ai-agentmanager 1.57.0 → 1.57.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.57.1 (2026-11-18)
4
+
5
+ - **Screen: zoom.** **−** and **+** in the bar draw the screen at 150% to 400%, and the button between them goes back to **Fit**. Zoomed in, **Move** lets a drag move around the screen; with it off, a tap clicks in the computer as before.
6
+ - **Screen: show the password.** The sign-in has a **Show the password** box: typed blind on a phone, a password goes wrong easily, and the Mac only says it was refused.
7
+ - **Screen: a Mac with Remote Management on.** Such a Mac lets in only the users on its own list and refuses anyone else as if the password were wrong. When this computer's user is not on it, the Screen dialog says so before you sign in, with where to add the user and the command that does it.
8
+ - **Tried:** Screen now works past a real Mac's sign-in, from a real phone. Zoom, Move and the password box are tried in desktop Chrome only; the Remote Management note is not tried in a browser.
9
+
3
10
  ## 1.57.0 (2026-11-17)
4
11
 
5
12
  - **Screen: this computer's desktop in the page, from the phone too.** A pop-up that waits for an answer, another program you want to watch: **Screen** in the top bar shows the computer's whole screen, and your clicks, taps and typing go back to it. It works on the computer itself and on any device signed in through remote access. On a phone the bar has a **Type here** field for the keyboard, and **Esc**, **Tab** and **⏎**.
package/README.md CHANGED
@@ -885,7 +885,9 @@ It does not capture the screen itself. The computer's own screen sharing does, a
885
885
  2. On the computer itself: **Screen → Turn on** (or `agentmgr screen --on`).
886
886
  3. From any signed-in device: **Screen → Connect**, and sign in with your Mac user name and password when the Mac asks. They go to the Mac's screen sharing and are not kept.
887
887
 
888
- On a phone, the bar has a **Type here** field for the keyboard, and **Esc**, **Tab** and **⏎**.
888
+ On a phone, the bar has a **Type here** field for the keyboard, and **Esc**, **Tab** and **⏎**. **−** and **+** zoom in up to 400% (the button between them goes back to **Fit**); zoomed in, **Move** lets a drag move around the screen instead of clicking in it. The sign-in has **Show the password**, for a password typed on a phone.
889
+
890
+ A Mac with **Remote Management** on (instead of plain Screen Sharing) lets in only the users listed under **Sharing → Remote Management → ⓘ**, and refuses anyone else as if the password were wrong. The Screen dialog says so when this computer's user is not listed, with the command that adds it.
889
891
 
890
892
  - **Whoever uses it controls the whole computer,** not only the agents. So it is off until you turn it on, it can be turned on only on the computer itself (not from a signed-in device), and the computer's screen sharing still asks for its own sign-in every time.
891
893
  - **Who is looking:** while another device views the screen, the **Screen** button shows a dot, and its tooltip and `agentmgr screen` name the device and its address. **Turn off** ends every view at once.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agentmanager",
3
- "version": "1.57.0",
3
+ "version": "1.57.1",
4
4
  "description": "Run background coding agents (Claude Code, Codex) per intent, and keep track of them from a web UI, your phone or the CLI",
5
5
  "keywords": [
6
6
  "claude",
package/public/index.html CHANGED
@@ -1025,6 +1025,10 @@
1025
1025
  <button class="ghost small" data-screen-key="esc" title="Escape">Esc</button>
1026
1026
  <button class="ghost small" data-screen-key="tab" title="Tab">Tab</button>
1027
1027
  <button class="ghost small" data-screen-key="enter" title="Return">⏎</button>
1028
+ <button class="ghost small" data-screen-zoom="-1" title="Zoom out" aria-label="Zoom out">−</button>
1029
+ <button class="ghost small" id="screen-zoom-now" data-screen-zoom="0" title="Fit the whole screen">Fit</button>
1030
+ <button class="ghost small" data-screen-zoom="1" title="Zoom in" aria-label="Zoom in">+</button>
1031
+ <button class="ghost small" id="screen-move" data-screen="move" title="Drag to move around the zoomed screen instead of clicking in it" aria-pressed="false" hidden>Move</button>
1028
1032
  </span>
1029
1033
  <button id="screen-off" class="ghost small" data-screen="off" title="No device can reach this computer's screen until you turn it on again here" hidden>Turn off</button>
1030
1034
  <button class="ghost small" data-screen="close" title="Close (ends your connection to the screen)">Close</button>
package/public/screen.js CHANGED
@@ -100,6 +100,39 @@ export function initScreen({ api, esc, toast, $ }) {
100
100
  let ended = null; // why the last connection ended
101
101
 
102
102
  const remote = () => document.body.classList.contains('remote');
103
+
104
+ // Zoom: the screen is drawn larger than the dialog and scrolled. A finger on it clicks in the
105
+ // computer, so moving around is its own mode (Move), which puts a sheet over the screen.
106
+ const ZOOMS = [1, 1.5, 2, 3, 4];
107
+ let zoom = 1;
108
+ let moving = false;
109
+ let stage = null;
110
+ function layout(keep = true) {
111
+ if (!stage) return;
112
+ const cx = keep && view.scrollWidth ? (view.scrollLeft + view.clientWidth / 2) / view.scrollWidth : 0.5;
113
+ const cy = keep && view.scrollHeight ? (view.scrollTop + view.clientHeight / 2) / view.scrollHeight : 0.5;
114
+ if (zoom === 1) moving = false;
115
+ view.classList.toggle('zoomed', zoom > 1);
116
+ // The outer size: scrollbars that take room must not make the screen smaller than the zoom says.
117
+ const w = view.offsetWidth;
118
+ const h = view.offsetHeight;
119
+ stage.style.width = `${Math.round(w * zoom)}px`;
120
+ stage.style.height = `${Math.round(h * zoom)}px`;
121
+ view.scrollLeft = cx * w * zoom - w / 2;
122
+ view.scrollTop = cy * h * zoom - h / 2;
123
+ stage.querySelector('.screen-pan').hidden = !moving;
124
+ $('#screen-zoom-now').textContent = zoom === 1 ? 'Fit' : `${Math.round(zoom * 100)}%`;
125
+ const move = $('#screen-move');
126
+ move.hidden = zoom === 1;
127
+ move.setAttribute('aria-pressed', String(moving));
128
+ move.classList.toggle('on', moving);
129
+ }
130
+ function setZoom(step) {
131
+ const at = ZOOMS.indexOf(zoom);
132
+ zoom = step === 0 ? 1 : ZOOMS[Math.max(0, Math.min(ZOOMS.length - 1, at + step))];
133
+ layout();
134
+ }
135
+ new ResizeObserver(() => layout()).observe(view);
103
136
  const others = (v = status?.viewers ?? []) => v.filter((x) => x.who !== 'this computer');
104
137
 
105
138
  /** The dot on the button: someone on another device is looking at this computer's screen. */
@@ -111,6 +144,15 @@ export function initScreen({ api, esc, toast, $ }) {
111
144
  if (dialog.open && !rfb) render();
112
145
  }
113
146
 
147
+ /** A Mac with Remote Management on refuses a user it does not list, whatever the password. */
148
+ function notListed() {
149
+ const m = status?.mac;
150
+ if (!m || m.allowed) return '';
151
+ return `<div class="screen-note"><p><b>This Mac will refuse ${esc(m.user)}, even with the right password.</b> It has Remote Management on, which lets in only the users listed there, and ${esc(m.user)} is not one of them.</p>
152
+ <p>On the Mac: <b>System Settings → General → Sharing → Remote Management → ⓘ</b>, add your user with Observe and Control. Or in a terminal on it (the Terminal button here will do):</p>
153
+ <p><code>${esc(m.fix)}</code></p></div>`;
154
+ }
155
+
114
156
  function render() {
115
157
  const s = status;
116
158
  const connected = Boolean(rfb);
@@ -138,7 +180,7 @@ export function initScreen({ api, esc, toast, $ }) {
138
180
  return;
139
181
  }
140
182
  state.textContent = ended ? 'Ended' : 'Ready';
141
- body.innerHTML = `${ended ? `<p><b>Ended:</b> ${esc(ended)}</p>` : '<h3>Ready</h3>'}
183
+ body.innerHTML = `${ended ? `<p><b>Ended:</b> ${esc(ended)}</p>` : '<h3>Ready</h3>'}${notListed()}
142
184
  <p class="hint">${s.platform === 'darwin' ? 'The Mac asks for your Mac user name and password next. They go to the Mac and are not kept.' : 'The computer asks for its screen sharing password next. It is not kept.'}</p>
143
185
  <p><button class="primary" data-screen="connect">${ended ? 'Connect again' : 'Connect'}</button></p>${viewed}`;
144
186
  }
@@ -175,7 +217,7 @@ export function initScreen({ api, esc, toast, $ }) {
175
217
  body.innerHTML = `<form id="screen-login" class="screen-login" autocomplete="off">
176
218
  <h3>${mac ? 'Sign in to this Mac' : 'Screen sharing password'}</h3>
177
219
  ${types.includes('username') ? `<label>${mac ? 'Mac user name' : 'User name'} <input name="username" autocapitalize="none" autocorrect="off" spellcheck="false" required /></label>` : ''}
178
- ${types.includes('password') ? '<label>Password <input name="password" type="password" autocomplete="off" required /></label>' : ''}
220
+ ${types.includes('password') ? '<label>Password <input name="password" type="password" autocomplete="off" autocapitalize="none" autocorrect="off" spellcheck="false" required /></label><label class="screen-show"><input type="checkbox" data-screen-show /> Show the password</label>' : ''}
179
221
  <p class="hint">Sent to the computer's screen sharing and not kept anywhere.</p>
180
222
  <p><button class="primary" type="submit">Sign in</button> <button type="button" class="ghost" data-screen="cancel">Cancel</button></p>
181
223
  </form>`;
@@ -192,8 +234,12 @@ export function initScreen({ api, esc, toast, $ }) {
192
234
  } catch (err) {
193
235
  return drop(`The viewer could not be loaded (${err.message})`);
194
236
  }
195
- view.replaceChildren();
196
- const mine = new RFB(view, REMOTE ? new StreamChannel() : `ws://${location.host}/ws/screen`);
237
+ stage = document.createElement('div');
238
+ stage.className = 'screen-stage';
239
+ stage.innerHTML = '<div class="screen-pan" hidden></div>';
240
+ view.replaceChildren(stage);
241
+ zoom = 1;
242
+ const mine = new RFB(stage, REMOTE ? new StreamChannel() : `ws://${location.host}/ws/screen`);
197
243
  rfb = mine;
198
244
  mine.scaleViewport = true;
199
245
  mine.background = '#0f1117';
@@ -203,6 +249,7 @@ export function initScreen({ api, esc, toast, $ }) {
203
249
  if (rfb !== mine) return;
204
250
  state.textContent = 'Connected';
205
251
  render();
252
+ layout(false);
206
253
  mine.focus();
207
254
  });
208
255
  mine.addEventListener('disconnect', (e) => rfb === mine && drop(e.detail?.clean ? 'The connection was closed' : 'The connection was lost, or screen access is off'));
@@ -225,9 +272,16 @@ export function initScreen({ api, esc, toast, $ }) {
225
272
  rfb?.sendCredentials(creds);
226
273
  });
227
274
 
275
+ // Typed blind on a phone, a password goes wrong easily: let it be seen.
276
+ dialog.addEventListener('change', (e) => {
277
+ if (e.target.matches('[data-screen-show]')) e.target.form.password.type = e.target.checked ? 'text' : 'password';
278
+ });
279
+
228
280
  dialog.addEventListener('click', async (e) => {
229
281
  const key = e.target.closest('[data-screen-key]');
230
282
  if (key && rfb) return rfb.sendKey(KEYS[key.dataset.screenKey], null);
283
+ const z = e.target.closest('[data-screen-zoom]');
284
+ if (z) return setZoom(Number(z.dataset.screenZoom));
231
285
  const b = e.target.closest('[data-screen]');
232
286
  if (!b) return;
233
287
  const what = b.dataset.screen;
@@ -240,7 +294,10 @@ export function initScreen({ api, esc, toast, $ }) {
240
294
  render();
241
295
  } else if (what === 'check') await refresh();
242
296
  else if (what === 'connect') await connect();
243
- else if (what === 'cancel') drop('You cancelled the sign-in');
297
+ else if (what === 'move') {
298
+ moving = !moving;
299
+ layout();
300
+ } else if (what === 'cancel') drop('You cancelled the sign-in');
244
301
  else if (what === 'close') dialog.close();
245
302
  } catch (err) {
246
303
  toast(`Error: ${err.message}`, 6000);
package/public/style.css CHANGED
@@ -963,8 +963,13 @@ input.inline { display: inline-block; width: 80px; padding: 1px 4px; }
963
963
  .screen-dialog #screen-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 8px; }
964
964
  .screen-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px; max-width: 640px; line-height: 1.5; }
965
965
  .screen-body h3 { margin: 0 0 8px; }
966
- .screen-view { flex: 1; min-height: 0; display: flex; background: #0f1117; touch-action: none; }
967
- .screen-view > div { flex: 1; }
966
+ .screen-view { flex: 1; min-height: 0; overflow: hidden; background: #0f1117; }
967
+ .screen-view.zoomed { overflow: auto; }
968
+ .screen-stage { position: relative; width: 100%; height: 100%; }
969
+ .screen-stage > div:not(.screen-pan) { touch-action: none; }
970
+ .screen-pan { position: absolute; inset: 0; z-index: 2; cursor: grab; touch-action: pan-x pan-y; }
971
+ .screen-dialog .term-bar { flex-wrap: wrap; row-gap: 4px; }
972
+ .screen-keys button.on { background: var(--accent, #4c8dff); color: #fff; }
968
973
  .screen-keys { display: inline-flex; gap: 4px; align-items: center; }
969
974
  .screen-type { width: 110px; padding: 2px 6px; font-size: 16px; } /* 16px: iOS zooms the page for less */
970
975
  .screen-login label { display: block; margin: 8px 0; }
@@ -1810,3 +1815,6 @@ table.eval-items tr.eval-na td { color: var(--muted); }
1810
1815
  }
1811
1816
  .os-local td:first-child { white-space: normal; overflow-wrap: anywhere; }
1812
1817
  .os-local-no code { opacity: 0.6; }
1818
+ .screen-note { border-left: 3px solid var(--warn, #d9a441); padding: 2px 10px; margin: 10px 0; }
1819
+ .screen-note code { display: block; overflow-wrap: anywhere; user-select: all; }
1820
+ .screen-login .screen-show input { display: inline; width: auto; margin: 0 4px 0 0; }
package/src/screen.js CHANGED
@@ -7,7 +7,10 @@
7
7
  // Whoever uses it controls the whole computer, so it is off until turned on, and only from the
8
8
  // computer itself.
9
9
  import net from 'node:net';
10
+ import fs from 'node:fs';
11
+ import os from 'node:os';
10
12
  import crypto from 'node:crypto';
13
+ import { execFile } from 'node:child_process';
11
14
 
12
15
  export const SCREEN_DEFAULTS = { enabled: false, port: 5900 };
13
16
  const HOST = '127.0.0.1'; // never another computer: this is not a way into the network
@@ -36,9 +39,26 @@ export function listening(port, ms = 800) {
36
39
  });
37
40
  }
38
41
 
42
+ const out = (cmd, args) => new Promise((resolve) => execFile(cmd, args, { timeout: 3000 }, (err, stdout) => resolve(err ? null : String(stdout).trim())));
43
+ const KICKSTART = '/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart';
44
+
45
+ /**
46
+ * A Mac with Remote Management on (instead of plain Screen Sharing) lets in only the users listed
47
+ * there, and refuses everyone else as if the password were wrong. Whether this computer's user is
48
+ * let in: `{ user, allowed, fix }`, or null where that does not apply.
49
+ */
50
+ export async function macAccess() {
51
+ if (process.platform !== 'darwin' || !fs.existsSync('/Library/Application Support/Apple/Remote Desktop/RemoteManagement.launchd')) return null;
52
+ const user = os.userInfo().username;
53
+ const everyone = (await out('/usr/bin/defaults', ['read', '/Library/Preferences/com.apple.RemoteManagement', 'ARD_AllLocalUsers'])) === '1';
54
+ const listed = /naprivs:\s*-?\d/.test((await out('/usr/bin/dscl', ['.', '-read', `/Users/${user}`, 'naprivs'])) ?? '');
55
+ return { user, allowed: everyone || listed, fix: `sudo ${KICKSTART} -configure -users ${user} -access -on -privs -ControlObserve` };
56
+ }
57
+
39
58
  export class Screen {
40
- /** `onChange(viewers)` is called when someone connects or leaves. */
41
- constructor({ config, onChange = () => {}, log = () => {} }) {
59
+ /** `onChange(viewers)` is called when someone connects or leaves. `mac` stands in for macAccess in tests. */
60
+ constructor({ config, onChange = () => {}, log = () => {}, mac = macAccess }) {
61
+ this.mac = mac;
42
62
  this.config = config;
43
63
  this.onChange = onChange;
44
64
  this.log = log;
@@ -55,7 +75,8 @@ export class Screen {
55
75
 
56
76
  async status() {
57
77
  const s = this.settings;
58
- return { ...s, platform: process.platform, listening: await listening(s.port), viewers: this.viewers() };
78
+ const [on, mac] = await Promise.all([listening(s.port), s.enabled ? this.mac() : null]);
79
+ return { ...s, platform: process.platform, listening: on, mac, viewers: this.viewers() };
59
80
  }
60
81
 
61
82
  /** From the computer itself only (the route is local-only). Turning it off ends every viewer. */