@motionharness/cli 0.1.8 → 0.2.2

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
@@ -62,15 +62,26 @@ The npm command verifies the platform package and its version. On macOS and Linu
62
62
  experimental `process.execve()` to replace Node with Rust; unavailable API support
63
63
  produces an upgrade prompt. On Windows it starts and waits for `MotionHarness.exe`, preserving
64
64
  arguments, stdin/stdout/stderr and exit status.
65
- `mh open [directory]` returns a Studio URL and exits. Project commands default to
65
+ `mh open [directory]` returns `urls` (loopback first, then candidate network URLs) and exits.
66
+ It enables network access for the entire Studio service, not just the named project.
67
+ Use `mh open --local-only` to disable network access for all projects without restarting the daemon;
68
+ a later plain `mh open` enables it again. Other commands do not enable it implicitly.
69
+ Anyone who can reach the network port can use Studio; use it only on a trusted network.
70
+ If a firewall is configured, Standard preview also needs the returned `networkPreviewPort`.
71
+ The CLI's daemon management stays on loopback. Scripts that read `url` from `mh open` should switch to `urls[0]`.
72
+ When upgrading from an older version that returns `url`, close the projects and run `mh update` from
73
+ a terminal; that version's Studio update worker cannot reopen projects using the new receipt.
74
+ Project commands default to
66
75
  the current working directory (`--project` selects another) and start sessions
67
76
  on demand. Normal opening/editing commands automatically open or reuse Studio
68
- once per session, initially paused, without waiting for its connection. `preview`,
77
+ once per working round, initially paused, without waiting for its connection. A
78
+ round ends after 30 minutes without commands or Studio activity, and its first
79
+ command receipt includes the project's stable Studio link as `studio.url`. `preview`,
69
80
  `render` and `render plan` stay in the background even on first preparation; a
70
81
  later normal command can still open Studio once. Use `mh open` to present a new
71
82
  runnable project. The interactive Studio shows Quick Start once when the first
72
83
  project's preview is ready. Edits and exports keep the
73
- user's page open and do not reopen a closed tab. Set `MH_NO_BROWSER=1` for batch
84
+ user's page open and do not reopen a tab closed during the round. Set `MH_NO_BROWSER=1` for batch
74
85
  or server use. `mh open --browser` explicitly reopens or reuses Studio and waits
75
86
  for its connection, even with automatic opening disabled. If the browser fails
76
87
  to launch or connect, the explicit command exits nonzero and includes the Studio
@@ -79,7 +90,7 @@ failure does not fail project preparation. If local network permission is
79
90
  denied, `mh open` reports a command to open the same project from your terminal.
80
91
  `mh status` and `mh close` inspect or release the current project; `mh daemon
81
92
  status` lists all projects and `mh daemon stop` explicitly stops everything.
82
- A session closes after 30 idle minutes without connected Studios or running work.
93
+ `inspect`, `preview` and `render` release their session when they finish unless a Studio page is open, reconnecting or loading; other background sessions close after five idle minutes without connected Studios or running work. An interactive Studio session keeps its 30-minute reconnect grace.
83
94
  An empty daemon exits after 10 minutes. Busy projects and failed saves prevent
84
95
  normal close/reclamation. Node runs only for transient build/dependency tasks;
85
96
  Chrome automation uses Rust chromiumoxide.
@@ -100,6 +111,17 @@ and daemon state use separate `auth` and `daemon` directories under `%LOCALAPPDA
100
111
  These directories require current-user ownership and private ACLs, with no reparse
101
112
  points. `MH_CACHE_DIR` can select an
102
113
  absolute private writable base; `mh doctor` reports the resource location.
114
+ When an agent sandbox denies writes to the default cache or daemon directory and no
115
+ override is set, MotionHarness uses a private `mh-<uid>` directory (`%TEMP%\mh` on
116
+ Windows) under the process temporary directory for that run and says so on stderr.
117
+ Settings, credentials and telemetry choices never move. On Windows the daemon leaves the
118
+ caller's Job when the Job allows it, so it survives the command that started it.
119
+
120
+ `mh doctor` checks state directories, loopback networking, an actual Chrome page load,
121
+ encoders and internet reachability. Its `status` is `ready` (exit 0), `install-broken`
122
+ (exit 1) or `environment-blocked` (exit 3, usually an agent sandbox); `capabilities`
123
+ names what each check blocks; when not ready, `next` tells an agent in one sentence what
124
+ is wrong and what to do, including how to allow it.
103
125
  The new Windows default leaves the old `%LOCALAPPDATA%\mh\cache` in place, so a
104
126
  cache created with the wrong owner by an earlier CLI does not block startup.
105
127
  A damaged cache is an error: stop processes using the affected hash, remove only
@@ -5,7 +5,9 @@ import { existsSync } from 'node:fs';
5
5
  import { join, dirname } from 'node:path';
6
6
  import { createRequire } from 'node:module';
7
7
  const request=JSON.parse(await readFile(process.argv[2],'utf8'));
8
- const {prefix,root,packageJson,latest,summary,json,timeoutSeconds}=request;
8
+ const {prefix,root,packageJson,latest,summary,json,timeoutSeconds,channel}=request;
9
+ const registryArgs=typeof channel?.registry==='string'&&channel.registry.length>0?['--registry',channel.registry]:[];
10
+ const isPrerelease=value=>value.split('+')[0].includes('-');
9
11
  let lock, installedStarted=false, interrupted=false, activeChild;
10
12
  const deadline=Date.now()+timeoutSeconds*1000;
11
13
  const env={...process.env};delete env.MH_WINDOWS_UPDATE_REQUEST;
@@ -62,7 +64,8 @@ try {
62
64
  await acquire();
63
65
  const manifest=JSON.parse(await readFile(packageJson,'utf8'));
64
66
  if(manifest.name!=='@motionharness/cli')throw new Error('Invalid npm entry package');
65
- summary.currentVersion=manifest.version;summary.updateAvailable=newer(latest,manifest.version);
67
+ summary.currentVersion=manifest.version;
68
+ summary.updateAvailable=latest!==manifest.version&&(channel?.custom?true:!isPrerelease(latest)&&(newer(latest,manifest.version)||isPrerelease(manifest.version)));
66
69
  if(!summary.updateAvailable) {
67
70
  console.log(json?JSON.stringify(summary):`MotionHarness is up to date (${manifest.version})`);
68
71
  } else {
@@ -76,7 +79,7 @@ try {
76
79
  catch(error) {if(!['EBUSY','EPERM','EACCES'].includes(error.code))throw error;if(Date.now()>=deadline)throw new Error('Close other MotionHarness commands before updating; the executable is still in use');await pause();}
77
80
  }
78
81
  installedStarted=true;
79
- await npm(['install','--global','--prefix',prefix,`@motionharness/cli@${latest}`,'--include=optional','--ignore-scripts','--no-audit','--no-fund']);
82
+ await npm(['install','--global','--prefix',prefix,`@motionharness/cli@${latest}`,'--include=optional','--ignore-scripts','--no-audit','--no-fund',...registryArgs]);
80
83
  const installed=JSON.parse(await readFile(packageJson,'utf8'));
81
84
  const platformJson=platformManifest();
82
85
  const platform=JSON.parse(await readFile(platformJson,'utf8'));
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.8",
2
+ "version": "0.2.2",
3
3
  "license": "GPL-3.0-only",
4
4
  "type": "module",
5
5
  "engines": {
@@ -32,11 +32,11 @@
32
32
  "x64"
33
33
  ],
34
34
  "optionalDependencies": {
35
- "@motionharness/cli-darwin-arm64": "0.1.8",
36
- "@motionharness/cli-darwin-x64": "0.1.8",
37
- "@motionharness/cli-win32-x64": "0.1.8",
38
- "@motionharness/cli-linux-x64": "0.1.8",
39
- "@motionharness/cli-linux-arm64": "0.1.8"
35
+ "@motionharness/cli-darwin-arm64": "0.2.2",
36
+ "@motionharness/cli-darwin-x64": "0.2.2",
37
+ "@motionharness/cli-win32-x64": "0.2.2",
38
+ "@motionharness/cli-linux-x64": "0.2.2",
39
+ "@motionharness/cli-linux-arm64": "0.2.2"
40
40
  },
41
41
  "files": [
42
42
  "bin/mh",