agentlane 0.0.0 → 0.4.0-rc.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/CHANGELOG.md +118 -0
- package/LICENSE +27 -0
- package/README.md +167 -2
- package/dist/agents/claude-plugin.js +79 -0
- package/dist/agents/cli.js +258 -0
- package/dist/agents/detect.js +88 -0
- package/dist/agents/init.js +251 -0
- package/dist/agents/launcher.js +32 -0
- package/dist/agents/package.js +119 -0
- package/dist/agents/skills.js +59 -0
- package/dist/agents/toml.js +325 -0
- package/dist/agents/wiring-check.js +117 -0
- package/dist/agents/wiring.js +374 -0
- package/dist/bench/host.js +104 -0
- package/dist/bench/live.js +511 -0
- package/dist/bench/mcp-client.js +91 -0
- package/dist/bench/model.js +15 -0
- package/dist/bench/report.js +162 -0
- package/dist/bench/run.js +121 -0
- package/dist/bench/schedule.js +140 -0
- package/dist/bench/stats.js +59 -0
- package/dist/bench-cli.js +167 -0
- package/dist/browser/aria.js +184 -0
- package/dist/browser/control.js +203 -0
- package/dist/browser/env.js +118 -0
- package/dist/browser/evidence.js +44 -0
- package/dist/browser/install.js +361 -0
- package/dist/browser/kinds.js +10 -0
- package/dist/browser/lane-browser.js +224 -0
- package/dist/browser/libraries.js +56 -0
- package/dist/browser/paths.js +29 -0
- package/dist/browser/release.js +121 -0
- package/dist/browser/screen.js +19 -0
- package/dist/browser/signin.js +154 -0
- package/dist/browser/stop.js +163 -0
- package/dist/browser/tools.js +25 -0
- package/dist/cache/build.js +154 -0
- package/dist/cache/config.js +186 -0
- package/dist/cache/index.js +4 -0
- package/dist/cache/key.js +196 -0
- package/dist/cache/store.js +303 -0
- package/dist/cli.js +178 -0
- package/dist/clock.js +4 -0
- package/dist/devices/adb.js +160 -0
- package/dist/devices/android.js +214 -0
- package/dist/devices/backend.js +7 -0
- package/dist/devices/bundler.js +46 -0
- package/dist/devices/common.js +51 -0
- package/dist/devices/controls.js +65 -0
- package/dist/devices/dial.js +56 -0
- package/dist/devices/emulator.js +396 -0
- package/dist/devices/hygiene.js +202 -0
- package/dist/devices/index.js +5 -0
- package/dist/devices/launch.js +76 -0
- package/dist/devices/simctl.js +119 -0
- package/dist/devices/tools.js +1 -0
- package/dist/devices/variant.js +99 -0
- package/dist/devices/xcrun.js +265 -0
- package/dist/driver/absence.js +54 -0
- package/dist/driver/caller.js +51 -0
- package/dist/driver/client.js +312 -0
- package/dist/driver/diff.js +180 -0
- package/dist/driver/elements.js +70 -0
- package/dist/driver/engine-main.js +13 -0
- package/dist/driver/engine.js +499 -0
- package/dist/driver/errors.js +11 -0
- package/dist/driver/exec.js +66 -0
- package/dist/driver/failure.js +156 -0
- package/dist/driver/flow.js +94 -0
- package/dist/driver/idle.js +100 -0
- package/dist/driver/images.js +68 -0
- package/dist/driver/install.js +272 -0
- package/dist/driver/lock.js +101 -0
- package/dist/driver/look.js +223 -0
- package/dist/driver/maestro-child.js +194 -0
- package/dist/driver/maestro-runs.js +46 -0
- package/dist/driver/paths.js +105 -0
- package/dist/driver/pixels.js +144 -0
- package/dist/driver/plan.js +108 -0
- package/dist/driver/release.js +7 -0
- package/dist/driver/runner.js +42 -0
- package/dist/driver/selector.js +91 -0
- package/dist/driver/session.js +474 -0
- package/dist/driver/suggest.js +86 -0
- package/dist/driver/supervisor.js +251 -0
- package/dist/driver/tree.js +426 -0
- package/dist/driver-cli.js +865 -0
- package/dist/evidence/device.js +177 -0
- package/dist/evidence/evidence.js +304 -0
- package/dist/evidence/files.js +92 -0
- package/dist/hooks/env.js +81 -0
- package/dist/hooks/run.js +101 -0
- package/dist/mcp/server.js +69 -0
- package/dist/mcp/tools.js +246 -0
- package/dist/name.js +22 -0
- package/dist/plugin/aims.js +465 -0
- package/dist/plugin/conventions.js +73 -0
- package/dist/plugin/guard.js +163 -0
- package/dist/plugin/hook-cli.js +216 -0
- package/dist/plugin/session-name.js +28 -0
- package/dist/plugin/shell.js +254 -0
- package/dist/processes.js +77 -0
- package/dist/project/config.js +316 -0
- package/dist/project/schema.js +335 -0
- package/dist/project/validate.js +224 -0
- package/dist/registry/config.js +142 -0
- package/dist/registry/format.js +22 -0
- package/dist/registry/owner.js +265 -0
- package/dist/registry/paths.js +50 -0
- package/dist/registry/ports.js +26 -0
- package/dist/registry/prune.js +160 -0
- package/dist/registry/refusal.js +53 -0
- package/dist/registry/registry.js +1027 -0
- package/dist/registry/resources.js +117 -0
- package/dist/registry/rows.js +115 -0
- package/dist/registry/status.js +85 -0
- package/dist/registry/store.js +274 -0
- package/dist/registry/types.js +1 -0
- package/dist/registry-cli.js +544 -0
- package/dist/services/services.js +268 -0
- package/dist/services/system.js +189 -0
- package/dist/up/deps.js +1 -0
- package/dist/up/doctor.js +424 -0
- package/dist/up/exec.js +133 -0
- package/dist/up/lane-files.js +75 -0
- package/dist/up/lane-services.js +38 -0
- package/dist/up/maestro-env.js +172 -0
- package/dist/up/preflight.js +232 -0
- package/dist/up/release.js +148 -0
- package/dist/up/resources.js +178 -0
- package/dist/up/restart.js +87 -0
- package/dist/up/setup.js +28 -0
- package/dist/up/up.js +610 -0
- package/dist/up-cli.js +258 -0
- package/dist/usage.js +16 -0
- package/package.json +58 -3
- package/schema/agentlane.schema.json +675 -0
- package/skills/create-verification-skill/LICENSE +21 -0
- package/skills/create-verification-skill/SKILL.md +88 -0
- package/skills/dev-loop/LICENSE +21 -0
- package/skills/dev-loop/SKILL.md +61 -0
- package/skills/device/SKILL.md +8 -0
- package/skills/drive/SKILL.md +64 -0
- package/skills/maintain-verification-skill/LICENSE +21 -0
- package/skills/maintain-verification-skill/SKILL.md +42 -0
- package/skills/setup/SKILL.md +80 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Newest first.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### New
|
|
8
|
+
|
|
9
|
+
- **`npx agentlane init` with no flags.** init wires the agents whose files the project has (`CLAUDE.md`, `.codex/`, `.cursor/`, `.github/copilot-instructions.md`, `GEMINI.md`, `.agents/rules/` and others) or whose session runs it, and prints the reason for each. In a terminal it lists all six agents, checks the ones it found, and takes Enter, numbers or names. With no terminal and nothing found, it exits 2 and names `--agents` and `--all`, which work as before.
|
|
10
|
+
- **init installs the toolkit.** When the project's `package.json` doesn't list `agentlane`, init adds it as a dev dependency at its own version with the project's package manager (from the `packageManager` field or the lockfile: pnpm, yarn, bun or npm). A project with no `package.json` gets a private one. When the install fails, init keeps the files it wrote, exits 1 and prints the command to run. A project that already lists another version keeps it, and init says so. `--check` installs nothing.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `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.
|
|
15
|
+
- `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.
|
|
16
|
+
- 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`.
|
|
17
|
+
- 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`.
|
|
18
|
+
- `maestro test`'s output goes to the lane's evidence folder only when `test` is the subcommand. A flow file named `test`, given to another subcommand, got a `--debug-output` folder too.
|
|
19
|
+
- On macOS, `agentlane driver install --from <zip>` clears the `com.apple.quarantine` attribute from the Maestro it unpacks. macOS's `unzip` copied a browser-downloaded zip's quarantine onto every unpacked file. Install still checks the zip's sha256 before unpacking.
|
|
20
|
+
|
|
21
|
+
### The patched Maestro
|
|
22
|
+
|
|
23
|
+
The patched Maestro build is renamed `2.11.0-agentlane.1`, and the toolkit downloads it over https from this repository's release, so first use no longer needs a signed-in `gh`. Compared with `2.11.0-agentenv.3`:
|
|
24
|
+
|
|
25
|
+
- The MCP `run` tool's result lists only the `env` the call passed. It used to list every `MAESTRO_*` variable in the driver's own environment as well. Flows still get those variables.
|
|
26
|
+
- On Android, a `tapOn` with `retryTapIfNoChange: true` and `waitToSettleTimeoutMs: 0` taps a second time again when the first tap changed nothing. The quick tap, which sends `retryTapIfNoChange: false`, still reads no hierarchy after the tap.
|
|
27
|
+
- When an iOS runner never answers within the startup timeout, Maestro stops the `xcodebuild` it launched for it. Before, `maestro test` left that `xcodebuild` running after it exited.
|
|
28
|
+
- On iOS, `maestro record`, `maestro hierarchy` and `maestro query` take a runner port the OS assigns when you pass no `--driver-host-port`, as `maestro test` already did. They used the fixed port 22087, so two lanes running them at once collided, and the second failed with "The XCTest runner port 127.0.0.1:22087 is held by a Maestro runner that refuses this process's token". A `--driver-host-port` you pass still wins.
|
|
29
|
+
|
|
30
|
+
## 0.3.0
|
|
31
|
+
|
|
32
|
+
The toolkit is called agentlane now, and what each agent session holds is a lane. The package, the command, the config file, the environment variables, the plugin, the output and the JSON all say agentlane and lane. Besides the rename, 0.3.0 adds `prune`, browsers for Intel Macs and Linux, and the fixes listed under New and Fixed. You still claim and release a lane, so the `claim` and `release` commands keep their names. 0.3.0 runs beside 0.2.x on the same Mac, so projects can move one at a time.
|
|
33
|
+
|
|
34
|
+
### Moving from 0.2.x
|
|
35
|
+
|
|
36
|
+
1. **Release the project's lanes first.** In each worktree, while 0.2.x is still installed, run `node_modules/.bin/agent-env release`. A lane 0.2.x started keeps 0.2.x's variables in its services and driver.
|
|
37
|
+
2. **Replace the dependency.** The package is `agentlane`, at 0.3.0, and its bin is `node_modules/.bin/agentlane`.
|
|
38
|
+
3. **Rename the config.** `agent-env.json` becomes `agentlane.json`, and its `"$schema"` points at `agentlane.schema.json`. `up`, `doctor` and `restart` refuse a project that still has only `agent-env.json`, and their message names these renames.
|
|
39
|
+
4. **Rename the variables.** Every `AGENT_ENV_` variable is `AGENTLANE_` now, in the config's commands, hooks, scripts, Maestro flows and test configs. Two change more than the prefix: `AGENT_ENV_CLAIM` is `AGENTLANE_LANE`, and `AGENT_ENV_CLAIM_TOKEN` is `AGENTLANE_LANE_TOKEN`. The settings you set yourself follow the prefix: `AGENTLANE_STATE_DIR`, `AGENTLANE_OWNER_PID`, `AGENTLANE_JAVA_HOME`, `AGENTLANE_MAESTRO` and `AGENTLANE_PLAYWRIGHT_BROWSERS`.
|
|
40
|
+
5. **Run `init` once.** `node_modules/.bin/agentlane init --agents <list>` replaces what 0.2.x's `init` wrote instead of adding a second copy. MCP server entries named `agent-env` become `agentlane`, and `.codex/config.toml` loses `[mcp_servers.agent-env]`. Hooks that ran `node_modules/.bin/agent-env` run `node_modules/.bin/agentlane`, and `.github/hooks/agent-env.json` becomes `.github/hooks/agentlane.json`. The skill stubs run `agentlane skills get`, and `disabledMcpjsonServers` names `agentlane`. Until `init` has run, `doctor` warns that the wiring is stale.
|
|
41
|
+
6. **The Claude Code plugin is `agentlane@agentlane`.** Where `.claude/settings.json` enables `agent-env@agent-env`, `init` enables `agentlane@agentlane` instead and renames the marketplace entry `agent-env` to `agentlane`, keeping its source. Rename an `agent-env@…` entry in your local or user settings by hand. The setup skill is `/agentlane:setup`, and the MCP server is `plugin:agentlane:device`. The marketplace's repository is still `north-star-hq/agent-env`.
|
|
42
|
+
7. **Update scripts that read the CLI.** The renamed commands, flags and JSON fields are listed below.
|
|
43
|
+
8. **Expect one uncached build.** The build cache moves to `.git/agentlane/build-cache`. The pinned Maestro, Playwright and agent-browser download again into `~/.local/share/agentlane/`. Once no worktree of the project runs 0.2.x, you can delete `.git/agent-env/`, and once nothing on the Mac runs it, `~/.local/share/agent-env/`.
|
|
44
|
+
|
|
45
|
+
### Renamed
|
|
46
|
+
|
|
47
|
+
- `claims --json` is `lanes --json`. Its output is `version: 2`: `claims` is `lanes`, a pool device's `claimId` is `laneId`, and a pending teardown's `claim` is `lane`.
|
|
48
|
+
- `release --claim <id>` is `release --lane <id>`.
|
|
49
|
+
- In `claim --json` and `up --json`, `claim` is `lane`. In `release --json`, each teardown's `claim` is `lane`. `driver status --json` gives `laneId`. `doctor`'s `claim` check is the `lane` check, and the refusal `claim-gone` is `lane-gone`.
|
|
50
|
+
- The CLI's output, the MCP tools' descriptions, the schema and the skills say lane. `claim` prints `claimed lane <id>`, and `status` lists `lanes`.
|
|
51
|
+
- Each lane's folder is `<state dir>/lanes/<id>`, where `$AGENTLANE_LOGS` and `$AGENTLANE_EVIDENCE` point.
|
|
52
|
+
- New pool devices are `agentlane-pool-*` simulators and `agentlane-emu-*` emulators.
|
|
53
|
+
- The bench report's schema is `agentlane-bench/1`.
|
|
54
|
+
|
|
55
|
+
### Sharing a Mac with 0.2.x
|
|
56
|
+
|
|
57
|
+
- **One registry.** While `~/.local/state/agent-env/registry.sqlite` exists and `~/.local/state/agentlane/registry.sqlite` doesn't, 0.3.0 uses 0.2.x's state folder as it is. Both versions then see every lane, and neither hands out a port, simulator, emulator or browser profile the other holds. A Mac that never ran 0.2.x gets `~/.local/state/agentlane/`.
|
|
58
|
+
- **0.2.x's names in 0.2.x's folder.** There, 0.3.0 writes only what 0.2.x reads: the registry stays format 1, lane folders stay under `claims/`, and new pool devices are named `agent-env-pool-*` and `agent-env-emu-*`, because 0.2.x boots only emulators with its own prefix. So either version can reap the other's lane once its owner is gone: stop its services, driver and browser, and run its resources' teardowns.
|
|
59
|
+
- **0.2.x's pool devices stay in the pool.** A free one goes to the next lane of either version, and 0.3.0 boots, stops and deletes `agent-env-emu-*` emulators as its own. `agentlane prune --yes` deletes the free ones along with 0.3.0's, and never one a 0.2.x lane holds.
|
|
60
|
+
- **Moving the folder.** Once no project on the Mac runs 0.2.x and `status` lists no lanes, run `mv ~/.local/state/agent-env ~/.local/state/agentlane && mv ~/.local/state/agentlane/claims ~/.local/state/agentlane/lanes`. 0.3.0 then uses the folder under its own name. Don't run 0.2.x on that Mac afterwards, because it would start a second registry.
|
|
61
|
+
|
|
62
|
+
### New
|
|
63
|
+
|
|
64
|
+
- `agentlane prune` lists the pool simulators and emulators that no lane holds, and `agentlane prune --yes` deletes them to free their disk. It works from the registry, so it covers the `agent-env-pool-*` and `agent-env-emu-*` devices 0.2.x made. Each deletion locks the registry and checks again that no lane of either version holds the device, so a lane claimed meanwhile keeps it. A device the registry has no record of is never deleted, even one with a pool name; the listing shows those apart, because a registry in another state folder may hold them. `--json` prints the listing and each result for tools.
|
|
65
|
+
- **Browsers for Intel Macs and Linux.** The pinned Chrome for Testing, its headless shell and ffmpeg now cover Intel Macs and Linux on x64 and arm64, so `up --platform web` installs its browser there without `AGENTLANE_PLAYWRIGHT_BROWSERS`. Linux runs the web half of a project; iOS needs a Mac, and Android on Linux isn't supported yet.
|
|
66
|
+
- **Chrome's system libraries on Linux.** `doctor` has a `browser libraries` check that names each library Chrome for Testing needs and the machine lacks, such as `libnss3.so`, and gives Playwright's `install-deps chromium` command as the fix. `up` stops with the same message before it opens the browser.
|
|
67
|
+
- Capture hygiene on a simulator has a new `keyboard-intro` step. It marks the keyboard's slide-to-type intro as shown (`com.apple.keyboard.preferences` `DidShowContinuousPathIntroduction` = true) and reads it back, so a fresh simulator's first keyboard no longer opens on an intro that covers the app. `doctor` lists the step with the others.
|
|
68
|
+
- The `create-verification-skill` skill tells a project to clear its app's own first-run sheets (onboarding, what's-new, permission prompts) before capturing, and to name them in its run skill.
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- On Android, the build hook runs with `JAVA_HOME` set to the JDK the build cache key names: `AGENTLANE_JAVA_HOME`, else `JAVA_HOME`, else the JDK 17 agentlane finds. Before, with `JAVA_HOME` unset, Gradle could run a different JDK from the one the cached build was keyed to.
|
|
73
|
+
- On Linux, hooks run with `LANG` and `LC_ALL` set to `C.UTF-8`, which glibc always has, instead of `en_US.UTF-8`, which many images don't generate. `up` refused a web app on such a machine, citing CocoaPods. macOS keeps `en_US.UTF-8`.
|
|
74
|
+
- On Linux without `lsof` or `ss`, as in the `node:24` image, `up` reads a port's listeners from `/proc`. Before this, it never found a service's listener and timed out on a server that answered.
|
|
75
|
+
|
|
76
|
+
## 0.2.1
|
|
77
|
+
|
|
78
|
+
Fixes from running `setup` from scratch on a production app and on the example app, after 0.2.0 reached them. A project that vendors 0.2.0 should move to this one.
|
|
79
|
+
|
|
80
|
+
- `maestro test` under a claim keeps a passing run's folder, its `takeScreenshot` files included, and links every run into Maestro's own folder. 0.2.0 deleted a passing run's folder, so a flow's screenshots were lost and scripts reading `~/.maestro/tests` found nothing.
|
|
81
|
+
- A second `up --platform web` on a claim whose browser is open works. 0.2.0 failed with "Tracing has already been started".
|
|
82
|
+
- A web service started through a package manager (`pnpm exec next dev …`) passes `up`'s check that the server on the port is this worktree's, because a listener anywhere below the started process now counts.
|
|
83
|
+
- `init` wires Claude Code once wherever the plugin loads from, and removes the copies an earlier `init` wrote; `doctor` warns when both wire it.
|
|
84
|
+
- Every command the CLI and the skills tell you to run is `node_modules/.bin/agent-env …`, which works in every agent's shell.
|
|
85
|
+
- Simulator hygiene sets the location again, up to 3 times, when a set doesn't read back.
|
|
86
|
+
- Claude Code's SessionEnd hook declares a 10 s timeout, so the release isn't cut off by Claude Code's shared 1.5 s budget.
|
|
87
|
+
- The skills: `setup` runs every committed flow and test suite before and after its changes and lists each one; `create-verification-skill` pins the device when flows tap by point, writes a precondition per tool, seeds a page per feature the repo's docs list, and treats a wait that never matches in a sign-in flow as a defect.
|
|
88
|
+
|
|
89
|
+
## 0.2.0
|
|
90
|
+
|
|
91
|
+
0.2.0 adds web apps beside mobile apps, per-claim resources, the setup skill and wiring for six agents. A project moving from 0.1.x needs to know the items under "Moving from 0.1.x" first.
|
|
92
|
+
|
|
93
|
+
### Moving from 0.1.x
|
|
94
|
+
|
|
95
|
+
- **Run `init` again after you upgrade.** The skill stubs' text changed, so `doctor` warns that a project's stubs are stale until `node_modules/.bin/agent-env init --agents <list>` rewrites them. Warnings don't fail `doctor`.
|
|
96
|
+
- **Each claim has an evidence folder.** `$AGENT_ENV_EVIDENCE` (`<state dir>/claims/<id>/evidence`) is set in every hook and under `exec`. It survives `release` and goes when the claim's files are pruned, seven days after the claim ends. `node_modules/.bin/agent-env evidence screenshot | video start|stop | trace start|stop | logs | list` writes there, and a failed `run`, or a failed command under `exec` on a browser claim, keeps its own bundle there.
|
|
97
|
+
- **`maestro test` under a claim writes into the evidence folder.** In 0.1.x, Maestro wrote each run to its own folder, `~/.maestro/tests/<run>`. The claim's `maestro` now passes `--debug-output`, and each test's output, its `takeScreenshot` files included, lands in `$AGENT_ENV_EVIDENCE/<stamp>-maestro-test-<pid>/.maestro/tests/<run>/<flow>/`. The folder name ends in `-failed` when the test failed, which is also the path Maestro prints on a failure.
|
|
98
|
+
- Each run is also linked into Maestro's own folder (`~/.maestro/tests/<run>`, or `$XDG_STATE_HOME/maestro/tests/<run>`), so a script that reads it keeps working. Maestro's folder holds the runs of every claim on the Mac, so a script that runs under a claim should read `$AGENT_ENV_EVIDENCE` instead.
|
|
99
|
+
- A `--debug-output` or `--test-output-dir` you pass yourself goes to Maestro unchanged.
|
|
100
|
+
- **Printed commands are `node_modules/.bin/agent-env …`.** Every fix line the CLI prints, and every command in the skills and stubs, is written that way, run from the project root, because a bare `agent-env` is on the PATH only in Claude Code with the toolkit's plugin. A run skill that says bare `agent-env` works only there; write the full path.
|
|
101
|
+
- **The `device` skill is now `drive`.** It drives browsers too. A `device` skill remains and points to `drive`, so a run skill that names `device` still works.
|
|
102
|
+
- **`init` and the Claude Code plugin.** Wherever Claude Code loads the plugin (the project's settings, your local or user settings, or the session running `init`, as `--plugin-dir` does), `init` writes none of the plugin's skills, MCP server or hooks for Claude Code, and says where it found the plugin. It removes the copies an earlier `init` wrote, backing each file up first in `<state dir>/init-backups/`. An agent-env server in `.mcp.json` stays for other agents and is turned off for Claude Code with `disabledMcpjsonServers`. A project whose only agent is Claude Code through the plugin gets no toolkit stubs in `.agents/skills/`. `doctor` warns when the plugin and the project's own files both wire Claude Code.
|
|
103
|
+
- **The registry format is unchanged.** 0.1.3 and 0.2.0 worktrees share a Mac's registry: 0.2.0 adds tables that 0.1.3 doesn't read and keeps the format version 0.1.3 checks.
|
|
104
|
+
|
|
105
|
+
### New
|
|
106
|
+
|
|
107
|
+
- **Web apps.** `web` in `agent-env.json` names the service that serves the web app and the page to open. `node_modules/.bin/agent-env up --platform web` gives the claim its own browser (a profile, a debugging port and a driver session), opens the app, and signs it in through the `signin` hook, which writes Playwright storage state to `$AGENT_ENV_STORAGE_STATE`. The driver is Playwright (`playwright-cli`) by default, or agent-browser. The toolkit installs Playwright 1.64.0 and agent-browser 0.39.0 with their browsers in its own data folder, so a project's `@playwright/test` must be 1.64.x for its tests to find a browser under `exec`. Browser archives are pinned for Apple silicon Macs only; elsewhere, set `AGENT_ENV_PLAYWRIGHT_BROWSERS`. One claim can hold a device and a browser.
|
|
108
|
+
- **Service `platforms`.** A service can be limited to the apps that need it, so a web `up` doesn't start Metro.
|
|
109
|
+
- **Resources.** `resources` declares data each claim gets its own copy of, such as a database: a `create` command that exports values to every service, hook and `exec`, and a `teardown` that runs when the claim ends, after a crash too.
|
|
110
|
+
- **Six agents.** `node_modules/.bin/agent-env init --agents claude,codex,cursor,copilot,gemini,antigravity` (or `--all`) writes each agent's skill stubs, MCP server and hooks from one source. `--check` exits 1 when a file would change.
|
|
111
|
+
- **The setup skill.** It takes a project from no toolkit wiring to `doctor` ready on every platform. `up` and `doctor` name it when `agent-env.json` is missing or invalid, or no agent is wired.
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
|
|
115
|
+
- A service started through a package manager, such as `pnpm exec next dev`, is the service's. `pnpm exec` starts its command in a process group of its own, and `up` refused the server as a process the toolkit did not start. A listener below the service's process now counts, and stopping the service stops it too, even when the wrapper passes on no signal.
|
|
116
|
+
- `up --platform web` runs again on a claim whose browser is open. The second run failed at sign-in with "Tracing has already been started"; it now ends the running trace and starts a new one.
|
|
117
|
+
- A browser driver error during `up` or `exec` is reported with exit code 1 and a fix that works when `doctor` says ready (close the browser with `node_modules/.bin/agent-env exec -- playwright-cli close`, then `up` opens a new one), instead of escaping with a stack trace.
|
|
118
|
+
- `up` sets the simulator's location again, up to three times, when it doesn't read back, as happens on a freshly booted simulator under heavy load.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 North Star
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
The files under maestro/ patch Maestro, which is licensed under the Apache
|
|
24
|
+
License, Version 2.0; see maestro/LICENSE-maestro and maestro/NOTICE. The
|
|
25
|
+
skills under skills/create-verification-skill, skills/dev-loop and
|
|
26
|
+
skills/maintain-verification-skill adapt parts of cursor/plugins (pstack) under
|
|
27
|
+
the MIT License; each of those folders holds its LICENSE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,168 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="brand/lockup-dark.svg">
|
|
4
|
+
<img src="brand/lockup-light.svg" width="300" alt="agentlane">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
<p align="center"><strong>A running copy of your app for every AI coding agent.</strong></p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://www.npmjs.com/package/agentlane"><img src="https://img.shields.io/npm/v/agentlane" alt="npm"></a>
|
|
12
|
+
<a href="https://github.com/north-star-hq/agentlane/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License: MIT"></a>
|
|
13
|
+
<a href="https://github.com/north-star-hq/agentlane/actions/workflows/ci.yml"><img src="https://github.com/north-star-hq/agentlane/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
agentlane gives each agent session a lane: its own ports, dev servers and database, and its own iOS simulator, Android emulator or browser, with fast tools to see the app and drive it. Agents use it through the `agentlane` CLI, an MCP server (`look`, `run`, `screenshot`), and skills and hooks that teach them the loop. It works with Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and Antigravity, on web apps, iOS and Android.
|
|
17
|
+
|
|
18
|
+
**1. In your project's root:**
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npx agentlane init
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**2. Then tell your agent:**
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
Set this project up with agentlane.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
<sub>`init` wires the agents it finds and adds agentlane to your dev dependencies. Setup then learns how your project runs and brings each app up in its own lane. [Getting started](https://north-star-hq.github.io/agentlane/docs/getting-started.html) walks through both steps.</sub>
|
|
31
|
+
|
|
32
|
+
<picture>
|
|
33
|
+
<source media="(prefers-color-scheme: dark)" srcset="media/hero-dark.svg">
|
|
34
|
+
<img src="media/hero-light.svg" width="960" alt="Claude Code, Codex and Cursor, each shown with its mark, get their own lane from agentlane up: ports, dev server, database and a browser, iOS simulator or Android emulator. Each types an item into its own copy of the Basket app, ticks items off and takes screenshots, then Codex finishes and its lane is released.">
|
|
35
|
+
</picture>
|
|
36
|
+
|
|
37
|
+
## Why agentlane
|
|
38
|
+
|
|
39
|
+
- **Every agent, one install.** [Six agents](https://north-star-hq.github.io/agentlane/docs/install.html) get the same CLI, MCP server, skills and hooks from one `init`.
|
|
40
|
+
- **Web, iOS and Android in one tool.** [`look`, `run` and `screenshot`](https://north-star-hq.github.io/agentlane/docs/drive.html) work the same on a simulator, an emulator or a browser.
|
|
41
|
+
- **The whole environment, per agent.** [Ports, dev servers, a database, sign-in](https://north-star-hq.github.io/agentlane/docs/lanes.html), and a device or browser that no other agent touches.
|
|
42
|
+
- **Fast.** A warm lane reads the screen in about 0.15 s. See [Speed](#speed).
|
|
43
|
+
- **It checks the app before your agent trusts it.** [`doctor`](https://north-star-hq.github.io/agentlane/docs/doctor.html) confirms that every server runs this worktree's code, and names the fix when one doesn't.
|
|
44
|
+
- **Evidence you can open.** [Videos, traces, logs and screenshots](https://north-star-hq.github.io/agentlane/docs/evidence.html), plus the Maestro flows and Playwright tests your agent commits.
|
|
45
|
+
- **It cleans up.** When a session ends, [its lane is released](https://north-star-hq.github.io/agentlane/docs/guard.html): services stop, databases are torn down, and devices go back to the pool.
|
|
46
|
+
- **Local.** No account, no hosted service, [no telemetry of its own](#security-and-telemetry).
|
|
47
|
+
|
|
48
|
+
## Speed
|
|
49
|
+
|
|
50
|
+
| On a warm lane, median of 16 calls | iOS simulator | Browser |
|
|
51
|
+
| ---------------------------------- | ------------- | ------- |
|
|
52
|
+
| Read the screen with `look` | 0.15 s | 0.16 s |
|
|
53
|
+
| Take a screenshot | 0.16 s | 0.18 s |
|
|
54
|
+
| Click through `playwright-cli` | | 0.81 s |
|
|
55
|
+
|
|
56
|
+
What makes it fast:
|
|
57
|
+
|
|
58
|
+
- **A warm Maestro session.** `look`, `run` and `screenshot` talk to a Maestro session that stays up between calls, so only the first call pays to start it.
|
|
59
|
+
- **A runner port per session.** Stock Maestro gives every iOS simulator's runner the same port, 22087, so with two simulators the second one started cold on every call: 6.5 s per screen read, against 0.12 s with our patch.
|
|
60
|
+
- **Quick taps.** On Android, `run --quick` skips Maestro's fixed 750 ms window settle and the screen reads after the tap.
|
|
61
|
+
- **A build cache your worktrees share.** The example app's iOS build took 91.5 s. A fresh worktree got its build from the cache in 6.5 s and reached the running app in 38.6 s.
|
|
62
|
+
- **A device pool.** Lanes reuse simulators and emulators instead of creating new ones, and emulators boot from their Quick Boot snapshot in 1.6 to 1.8 s, against 14.6 s for a cold boot.
|
|
63
|
+
|
|
64
|
+
[Speed](https://north-star-hq.github.io/agentlane/docs/speed.html) on the docs site explains each one.
|
|
65
|
+
|
|
66
|
+
<details>
|
|
67
|
+
<summary>How these were measured</summary>
|
|
68
|
+
|
|
69
|
+
All on an Apple M4 Max with 48 GB of memory.
|
|
70
|
+
|
|
71
|
+
- iOS column: `agentlane bench` on the [example app](examples/expo-app/), two iPhone 17 simulators alternating, release 0.1.3 with the Maestro build agentlane installs (`2.11.0-agentenv.3`). The Mac was under memory pressure, so these are upper bounds.
|
|
72
|
+
- Browser column: the same bench on the example's web app, Playwright 1.64.0 with Chrome for Testing, a 0.2.0 development build.
|
|
73
|
+
- Port comparison: 16 reads per simulator on another app, stock Maestro 2.8.0 against an early build with the port patch.
|
|
74
|
+
- Build cache: single runs of 0.2.0 on the example app. Boot times: two boots each of a Pixel 8 emulator on Android 36.
|
|
75
|
+
|
|
76
|
+
[`bench/README.md`](bench/README.md) has the method, and `agentlane bench` runs it on your machine.
|
|
77
|
+
|
|
78
|
+
</details>
|
|
79
|
+
|
|
80
|
+
## What a lane gives your agent
|
|
81
|
+
|
|
82
|
+
**Its own environment**
|
|
83
|
+
|
|
84
|
+
- [Ports](https://north-star-hq.github.io/agentlane/docs/services.html) from a registry on the machine, with your dev servers started on them and checked ready before `up` returns.
|
|
85
|
+
- [A database](https://north-star-hq.github.io/agentlane/docs/resources.html), or any resource you declare, created for the lane and torn down when it ends, after a crash too.
|
|
86
|
+
- Sign-in through your project's hook, so the app opens signed in.
|
|
87
|
+
- A [simulator, emulator](https://north-star-hq.github.io/agentlane/docs/devices.html) or [browser](https://north-star-hq.github.io/agentlane/docs/browsers.html) from a pool. When the pool is full, the request waits for a free device.
|
|
88
|
+
- `restart` changes one service's environment, such as a feature flag, without tearing the lane down.
|
|
89
|
+
|
|
90
|
+
**Eyes and hands**
|
|
91
|
+
|
|
92
|
+
- `look` reads the screen or page, one line per element, and `--interactive` keeps only what can be tapped or typed into. On iOS, our Maestro patch puts each element's type in the hierarchy to make that possible.
|
|
93
|
+
- `run` runs Maestro steps and prints what changed.
|
|
94
|
+
- In the browser, Playwright's `playwright-cli` (the default) or agent-browser, run through `agentlane exec`.
|
|
95
|
+
- [`record save`](https://north-star-hq.github.io/agentlane/docs/drive.html) turns the session's passing steps into a Maestro flow you can commit.
|
|
96
|
+
- `device` sets location, permissions, appearance, push notifications, the clipboard and links to open.
|
|
97
|
+
- Before launch, `up` sets the device's location, status bar and keyboard, so captures match from run to run.
|
|
98
|
+
|
|
99
|
+
**Evidence and housekeeping**
|
|
100
|
+
|
|
101
|
+
- [`evidence`](https://north-star-hq.github.io/agentlane/docs/evidence.html) keeps videos, Playwright traces, logs and screenshots in a folder that outlives the lane. A failed `run` or `exec` command keeps its own.
|
|
102
|
+
- [A hook](https://north-star-hq.github.io/agentlane/docs/guard.html) denies `simctl`, `adb`, `emulator`, `avdmanager`, `playwright-cli` and `agent-browser` commands aimed at another lane's device or browser.
|
|
103
|
+
- The next lane taken on the machine cleans up any lane whose session died, and `prune` deletes pool devices no lane holds.
|
|
104
|
+
|
|
105
|
+
## The skills
|
|
106
|
+
|
|
107
|
+
[The skills](https://north-star-hq.github.io/agentlane/docs/skills.html) teach an agent the whole loop in your project, from setup to proof. Each stub `init` writes prints its skill from the installed version, so the skills update with the package.
|
|
108
|
+
|
|
109
|
+
- **setup** finds how your project runs its apps, servers, data and sign-in, wires your agents, writes `agentlane.json`, and brings each app up until `doctor` reports ready. It asks you only what it can't find out.
|
|
110
|
+
- **dev-loop** is what an agent follows whenever it runs the app: one lane per session, `up`, `doctor` before trusting an instance, `release` when done, and what counts as proof.
|
|
111
|
+
- **drive** covers driving the lane's device or browser, turning what worked into a committed flow or test, and keeping evidence.
|
|
112
|
+
- **create-verification-skill** writes your project's run skill, with how to launch, check, drive and capture the app and a page per user-facing feature, and runs it end to end once before it is done.
|
|
113
|
+
- **maintain-verification-skill** keeps the run skill and its feature pages true as the app changes. It checks each page against the code, drives each feature, and opens at most one PR of corrections.
|
|
114
|
+
|
|
115
|
+
Claude Code can load the skills, the MCP server and the hooks as the agentlane plugin, and Codex, Cursor and Gemini CLI have plugins with the skills and the MCP server.
|
|
116
|
+
|
|
117
|
+
Once setup reports ready, any agent in the project can take work like this:
|
|
118
|
+
|
|
119
|
+
> Add a "clear completed" button to the list. Bring the app up on iOS and on the web, prove the button works with a Maestro flow and a Playwright test, and record a video of it.
|
|
120
|
+
|
|
121
|
+
## Where it runs
|
|
122
|
+
|
|
123
|
+
| Host | Web apps | iOS | Android |
|
|
124
|
+
| -------------------- | -------- | -------- | -------- |
|
|
125
|
+
| Mac, Apple silicon | yes | yes | yes |
|
|
126
|
+
| Mac, Intel | untested | untested | untested |
|
|
127
|
+
| Linux, x64 and arm64 | yes | no | not yet |
|
|
128
|
+
|
|
129
|
+
agentlane needs Node 24 or newer, and Xcode or the Android SDK for mobile apps. It drives simulators, emulators and browsers, not physical devices. On Linux, Chrome needs system libraries that agentlane can't pin; `agentlane doctor` names any that are missing and gives the command that installs them. [Where it runs](https://north-star-hq.github.io/agentlane/docs/requirements.html) on the docs site lists what each platform needs.
|
|
130
|
+
|
|
131
|
+
## Security and telemetry
|
|
132
|
+
|
|
133
|
+
agentlane runs on your machine. It has no account, no hosted service and no telemetry of its own.
|
|
134
|
+
|
|
135
|
+
- On first use it downloads its pinned tools: the patched Maestro from this repository's releases, Playwright and agent-browser from npm, and Chrome for Testing. It checks each against a hash pinned in the package.
|
|
136
|
+
- The patched Maestro has its update check, error reporter, screen report and PostHog analytics removed. A check in `maestro/test/` calls every local Maestro tool and sees no connection leave the machine. Maestro's `cheat_sheet` and cloud tools still call Maestro's servers, as they are built to.
|
|
137
|
+
- Each lane's iOS runner answers only requests that carry the lane's token, so another process can't drive your simulator through it.
|
|
138
|
+
- Playwright and agent-browser run as their maintainers publish them; agentlane doesn't change what they send.
|
|
139
|
+
- What your agent reads through `look` and `screenshot` goes to the model it runs on, like any tool output.
|
|
140
|
+
|
|
141
|
+
To report a vulnerability, see [`SECURITY.md`](SECURITY.md).
|
|
142
|
+
|
|
143
|
+
## Acknowledgements
|
|
144
|
+
|
|
145
|
+
agentlane is built on these projects, and we're grateful to their authors:
|
|
146
|
+
|
|
147
|
+
- [Maestro](https://github.com/mobile-dev-inc/Maestro) drives every simulator and emulator. agentlane ships it with the patches in [`maestro/`](maestro/).
|
|
148
|
+
- [Playwright](https://github.com/microsoft/playwright) drives the browser by default, on [Chrome for Testing](https://googlechromelabs.github.io/chrome-for-testing/).
|
|
149
|
+
- [agent-browser](https://github.com/vercel-labs/agent-browser) is the other browser driver a lane can run.
|
|
150
|
+
- [pstack](https://github.com/cursor/plugins/tree/main/pstack), Lauren Tan's skills for Cursor, is where dev-loop and the two verification skills began. Parts of them are adapted from it under the MIT licence.
|
|
151
|
+
|
|
152
|
+
Other projects worth knowing, from people working on the same problem:
|
|
153
|
+
|
|
154
|
+
- [agent-device](https://github.com/callstack/agent-device) by Callstack: mobile automation for agents through a CLI, an MCP server and a Node.js API, on more platforms than agentlane covers.
|
|
155
|
+
- [MobileBuildMCP](https://github.com/getsentry/MobileBuildMCP) by Sentry, formerly XcodeBuildMCP: an MCP server and CLI with tools for agents working on iOS and macOS projects.
|
|
156
|
+
- The simulator and browser panes in Claude Code Desktop, and the built-in browser Codex uses in the ChatGPT desktop app, which put the running app next to the conversation.
|
|
157
|
+
|
|
158
|
+
The Android robot in the animation is Google's, used under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
|
|
159
|
+
|
|
160
|
+
## Documentation
|
|
161
|
+
|
|
162
|
+
The [docs site](https://north-star-hq.github.io/agentlane/) has per-agent setup, the config and CLI reference, platform requirements and troubleshooting, with an `llms.txt` for agents. [`examples/expo-app/`](examples/expo-app/) is the app agentlane is tested on, and [`CHANGELOG.md`](CHANGELOG.md) lists every release.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
[MIT](LICENSE). The patched Maestro is Apache-2.0; [`maestro/`](maestro/) holds its patches and notice.
|
|
167
|
+
|
|
168
|
+
Made by North Star.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { FORMER, TOOL } from "../name.js";
|
|
4
|
+
import { claudeConfigDir } from "../plugin/session-name.js";
|
|
5
|
+
export const CLAUDE_SETTINGS = '.claude/settings.json';
|
|
6
|
+
export const CLAUDE_LOCAL_SETTINGS = '.claude/settings.local.json';
|
|
7
|
+
export function jsonObjectAt(file) {
|
|
8
|
+
try {
|
|
9
|
+
const value = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
10
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : null;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function toolkitEntries(settings, names) {
|
|
17
|
+
const enabled = settings?.enabledPlugins;
|
|
18
|
+
if (typeof enabled !== 'object' || enabled === null)
|
|
19
|
+
return [];
|
|
20
|
+
return Object.entries(enabled).flatMap(([key, on]) => names.some(name => key.startsWith(`${name}@`)) && typeof on === 'boolean' ? [[key, on]] : []);
|
|
21
|
+
}
|
|
22
|
+
/** Claude Code puts each loaded plugin's `bin/` on its Bash tool's PATH and sets CLAUDECODE there. */
|
|
23
|
+
function sessionPluginDir(env) {
|
|
24
|
+
if (!env.CLAUDECODE)
|
|
25
|
+
return null;
|
|
26
|
+
for (const entry of (env.PATH ?? '').split(path.delimiter)) {
|
|
27
|
+
if (path.basename(entry) !== 'bin')
|
|
28
|
+
continue;
|
|
29
|
+
const dir = path.dirname(entry);
|
|
30
|
+
if (jsonObjectAt(path.join(dir, '.claude-plugin', 'plugin.json'))?.name === TOOL)
|
|
31
|
+
return dir;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Where Claude Code loads the toolkit's plugin from for this project, the most lasting first. Claude Code reads
|
|
37
|
+
* `enabledPlugins` from the local project settings over the shared ones over the user's, key by key. The project's
|
|
38
|
+
* settings count under 0.2.x's plugin name too, because init renames it there.
|
|
39
|
+
*/
|
|
40
|
+
export function claudePluginSources(root, env) {
|
|
41
|
+
const scopes = [
|
|
42
|
+
{ source: { kind: 'local', file: CLAUDE_LOCAL_SETTINGS }, at: path.join(root, CLAUDE_LOCAL_SETTINGS), names: [TOOL] },
|
|
43
|
+
{ source: { kind: 'project', file: CLAUDE_SETTINGS }, at: path.join(root, CLAUDE_SETTINGS), names: [TOOL, FORMER.tool] },
|
|
44
|
+
];
|
|
45
|
+
const user = path.join(claudeConfigDir(env), 'settings.json');
|
|
46
|
+
scopes.push({ source: { kind: 'user', file: user }, at: user, names: [TOOL] });
|
|
47
|
+
const decided = new Set();
|
|
48
|
+
const enabledBy = new Set();
|
|
49
|
+
for (const { source, at, names } of scopes) {
|
|
50
|
+
for (const [key, on] of toolkitEntries(jsonObjectAt(at), names)) {
|
|
51
|
+
if (decided.has(key))
|
|
52
|
+
continue;
|
|
53
|
+
decided.add(key);
|
|
54
|
+
if (on)
|
|
55
|
+
enabledBy.add(source);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const order = ['project', 'local', 'user'];
|
|
59
|
+
const sources = [...enabledBy].sort((a, b) => order.indexOf(a.kind) - order.indexOf(b.kind));
|
|
60
|
+
const dir = sessionPluginDir(env);
|
|
61
|
+
if (dir !== null)
|
|
62
|
+
sources.push({ kind: 'session', dir });
|
|
63
|
+
return sources;
|
|
64
|
+
}
|
|
65
|
+
export function claudePluginSource(root, env) {
|
|
66
|
+
return claudePluginSources(root, env)[0] ?? null;
|
|
67
|
+
}
|
|
68
|
+
export function describePluginSource(source) {
|
|
69
|
+
switch (source.kind) {
|
|
70
|
+
case 'project':
|
|
71
|
+
return `the project enables the ${TOOL} plugin in ${source.file}`;
|
|
72
|
+
case 'local':
|
|
73
|
+
return `your local settings for this project (${source.file}) enable the ${TOOL} plugin`;
|
|
74
|
+
case 'user':
|
|
75
|
+
return `your user settings (${source.file}) enable the ${TOOL} plugin in every project`;
|
|
76
|
+
case 'session':
|
|
77
|
+
return `this Claude Code session loads the ${TOOL} plugin from ${source.dir}`;
|
|
78
|
+
}
|
|
79
|
+
}
|