agentlane 0.4.0-rc.1 → 0.4.0-rc.3

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
@@ -11,6 +11,8 @@ Newest first.
11
11
 
12
12
  ### Fixed
13
13
 
14
+ - Maestro starts with the JDK in `AGENTLANE_JAVA_HOME` when `JAVA_HOME` is another version. `up`, `doctor` and the Android build already read it first, but `look`, `screenshot` and the other driving commands read only `JAVA_HOME`, so they refused a Java 21 `JAVA_HOME` that `doctor` had passed.
15
+ - `up` and `doctor` no longer fail capture hygiene on a Mac where the simulator reads its pinned status-bar time back as `9:41`. They accepted only `09:41`, which is how some Macs print it.
14
16
  - `init` no longer lists 0.2.x's `.github/hooks/agent-env.json` as `unchanged` in a project that doesn't have it. It lists that file only when it changes or removes it.
15
17
  - Under `exec` and in the signin hook, `maestro` is the lane's own Maestro, or it prints why the lane has none and exits 2. A lane whose `agentlane.json` was invalid or had no `driver` block, or that held no running simulator or emulator, ran whatever `maestro` came first on PATH, unbound to the lane's device, after one warning that named only the file. The message now gives the config's problems, or what is missing and how to add it. A project that ran its own Maestro under `exec` without a `driver` block adds `"driver": {}` to `agentlane.json`.
16
18
  - The lane's `maestro` refuses `maestro mcp`, which takes its device from each tool call, so the lane can't bind it to its device. The lane's MCP server is `node_modules/.bin/agentlane mcp`.
@@ -49,8 +49,14 @@ export function sameCoordinate(a, b) {
49
49
  Math.abs(a.latitude - b.latitude) <= COORDINATE_TOLERANCE &&
50
50
  Math.abs(a.longitude - b.longitude) <= COORDINATE_TOLERANCE);
51
51
  }
52
+ /** simctl reads the pinned time back as `09:41` on some Macs and `9:41` on others. */
53
+ function sameField(key, got, wanted) {
54
+ if (key !== 'Time')
55
+ return got === wanted;
56
+ return got?.replace(/^0(?=\d:)/, '') === wanted.replace(/^0(?=\d:)/, '');
57
+ }
52
58
  export function statusBarPinned(fields) {
53
- return fields !== undefined && Object.entries(STATUS_BAR_PIN_FIELDS).every(([key, value]) => fields[key] === value);
59
+ return (fields !== undefined && Object.entries(STATUS_BAR_PIN_FIELDS).every(([key, value]) => sameField(key, fields[key], value)));
54
60
  }
55
61
  function formatStatusBar(fields) {
56
62
  const entries = Object.entries(fields ?? {});
@@ -4,6 +4,7 @@ import os from 'node:os';
4
4
  import path from 'node:path';
5
5
  import { Readable } from 'node:stream';
6
6
  import { pipeline } from 'node:stream/promises';
7
+ import { JAVA_HOME_ENV } from "../hooks/env.js";
7
8
  import { CLI, envName, TOOL } from "../name.js";
8
9
  import { identityOf, systemProcesses } from "../processes.js";
9
10
  import { DriverError } from "./errors.js";
@@ -12,7 +13,7 @@ import { tryLock, unlock } from "./lock.js";
12
13
  import { MAESTRO_RELEASE } from "./release.js";
13
14
  /** A Maestro binary to use instead of the pinned build, such as a local build of `maestro/`. */
14
15
  export const MAESTRO_OVERRIDE_ENV = envName('MAESTRO');
15
- const JDK_FIX = `install JDK 17 ('brew install openjdk@17'), or set JAVA_HOME to a JDK 17 home`;
16
+ const JDK_FIX = `install JDK 17 ('brew install openjdk@17'), or set ${JAVA_HOME_ENV} to a JDK 17 home`;
16
17
  const INSTALL_LOCK_WAIT_MS = 15 * 60_000;
17
18
  export function dataDir(env) {
18
19
  const xdg = env.XDG_DATA_HOME;
@@ -62,13 +63,14 @@ async function javaSettings(home) {
62
63
  javaHome: /^\s*java\.home = (.+)$/m.exec(text)?.[1]?.trim(),
63
64
  };
64
65
  }
65
- /** Finds JDK 17 the way maestro/build.sh does: JAVA_HOME, then java_home -v 17, then Homebrew's openjdk@17. */
66
+ /** Finds JDK 17: AGENTLANE_JAVA_HOME, then the way maestro/build.sh does, JAVA_HOME, java_home -v 17 and Homebrew's openjdk@17. */
66
67
  export async function findJdk17(env) {
67
68
  let candidate;
68
69
  let origin;
69
- if (env.JAVA_HOME) {
70
- candidate = env.JAVA_HOME;
71
- origin = `JAVA_HOME=${env.JAVA_HOME}`;
70
+ const named = env[JAVA_HOME_ENV] ? JAVA_HOME_ENV : env.JAVA_HOME ? 'JAVA_HOME' : undefined;
71
+ if (named) {
72
+ candidate = env[named];
73
+ origin = `${named}=${candidate ?? ''}`;
72
74
  }
73
75
  else {
74
76
  const javaHome = await runCommand('/usr/libexec/java_home', ['-v', '17'], { timeoutMs: 10_000 });
@@ -89,12 +91,13 @@ export async function findJdk17(env) {
89
91
  }
90
92
  if (!candidate)
91
93
  throw new DriverError('no JDK 17 found; Maestro runs on JDK 17', JDK_FIX);
94
+ const fix = named ? `${JDK_FIX}, or unset ${named} so ${TOOL} finds one` : JDK_FIX;
92
95
  const settings = await javaSettings(candidate);
93
96
  if (settings.spec === undefined) {
94
- throw new DriverError(`${origin} has no working bin/java`, `${JDK_FIX}, or unset JAVA_HOME so ${TOOL} finds one`);
97
+ throw new DriverError(`${origin} has no working bin/java`, fix);
95
98
  }
96
99
  if (settings.spec !== '17') {
97
- throw new DriverError(`${origin} is Java ${settings.spec}, and Maestro runs on JDK 17`, `${JDK_FIX}, or unset JAVA_HOME so ${TOOL} finds one`);
100
+ throw new DriverError(`${origin} is Java ${settings.spec}, and Maestro runs on JDK 17`, fix);
98
101
  }
99
102
  return { javaHome: settings.javaHome ?? candidate, origin };
100
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlane",
3
- "version": "0.4.0-rc.1",
3
+ "version": "0.4.0-rc.3",
4
4
  "description": "Gives each coding agent its own lane: a running copy of your app with its own ports, dev servers, database, and a simulator, emulator or browser to drive it.",
5
5
  "keywords": [
6
6
  "ai-agents",