@hanskristoffer/agentpool 0.26.0 → 0.27.0

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 (2) hide show
  1. package/README.md +22 -17
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -39,15 +39,16 @@ Or from source: `bun install && bun run build` (binaries land in `dist/`), or ru
39
39
 
40
40
  ```sh
41
41
  agentgate init # names the node after the host; add --always-on on a server
42
+ agentgate service install # launchd (macOS) or systemd --user (Linux), and routes your coding tools
42
43
  agentgate login claude --label work # official login in a temp dir, imported, then deleted
43
44
  agentgate login codex --label personal
44
- agentgate setup # writes Claude Code / Codex config, prints the T3 settings
45
- agentgate service install # launchd (macOS) or systemd --user (Linux)
46
45
  ```
47
46
 
48
- You can do every setup step with the CLI. To use the native app, build it with `bun run build:desktop` and open **Agentgate.app**. It connects to `http://127.0.0.1:7878` by default. On a fresh machine, **Set up this machine** installs the bundled CLI in `~/.config/agentgate/bin`, initializes the store, and starts a launchd service. Add that folder to your shell PATH to use the CLI. Closing or removing the app leaves that service and its CLI running.
47
+ The first `service install` points the Claude Code, Codex and Cursor you already use at agentgate, so they use the pool with nothing to set in T3 Code (see [your own Claude Code and Codex](#your-own-claude-code-and-codex)). Add `--no-routing` to leave them as they are; undo it any time with `agentgate setup --primary off`. `agentgate status` shows which of them use agentgate.
49
48
 
50
- The app has Overview, Accounts, MCP servers, Skills, Projects, Machines, T3 Code, Activity, and Settings screens. Overview lists anything that needs you, such as an account or MCP server to sign in to again, and the sidebar marks the screen where you fix it. **Settings → Configure coding tools** generates the Claude/Codex folders and T3 settings. The app's service and coding-tool controls apply only to its configured local daemon; remote setup and services use the CLI on that machine. The one exception is routing: Machines shows whether each machine's own Claude Code and Codex go through agentgate, and its row menu turns that on or off there.
49
+ You can do every setup step with the CLI. To use the native app, build it with `bun run build:desktop` and open **Agentgate.app**. It connects to `http://127.0.0.1:7878` by default. On a fresh machine, **Set up this machine** installs the bundled CLI in `~/.config/agentgate/bin`, initializes the store, starts a launchd service, and routes your Claude Code, Codex and Cursor the same way. Add that folder to your shell PATH to use the CLI. Closing or removing the app leaves that service and its CLI running.
50
+
51
+ The app has Overview, Accounts, MCP servers, Skills, Projects, Machines, T3 Code, Activity, and Settings screens. Overview lists anything that needs you, such as an account or MCP server to sign in to again, and the sidebar marks the screen where you fix it. **Settings → Coding tools** routes your own Claude Code and Codex or undoes it, and can generate [separate folders for T3 Code](#or-separate-folders-for-t3-code) instead. The app's service and coding-tool controls apply only to its configured local daemon; remote setup and services use the CLI on that machine. The one exception is routing: Machines shows whether each machine's own Claude Code and Codex go through agentgate, and its row menu turns that on or off there.
51
52
 
52
53
  ## A second machine (e.g. an always-on server)
53
54
 
@@ -56,7 +57,7 @@ There are two ways to connect machines, and a machine can use both:
56
57
  - **Same network (Tailscale):** both machines are on your tailnet. Pairing uses a code that expires after 10 minutes.
57
58
  - **Relay:** works across any network, without Tailscale. Every record is encrypted before it leaves the machine; the relay stores only ciphertext and can't read your credentials.
58
59
 
59
- On the first machine, run `agentgate pair` or use **Pair a machine** in the app. In a terminal it asks which method to use and what to name the other machine; `--tailnet`, `--relay` and `--name` skip the questions, and an empty name uses the other machine's hostname. It prints one command to run on the server, which installs agentgate, joins, installs the service (on Linux this also runs `loginctl enable-linger` so it survives logout/reboot), and runs `agentgate setup --primary` so that machine's own Claude Code and Codex go through agentgate with no further setup (undo with `agentgate setup --primary off`):
60
+ On the first machine, run `agentgate pair` or use **Pair a machine** in the app. In a terminal it asks which method to use and what to name the other machine; `--tailnet`, `--relay` and `--name` skip the questions, and an empty name uses the other machine's hostname. It prints one command to run on the server, which installs agentgate, joins, and installs the service (on Linux this also runs `loginctl enable-linger` so it survives logout/reboot), which routes that machine's own Claude Code and Codex through agentgate with no further setup (undo with `agentgate setup --primary off`):
60
61
 
61
62
  ```sh
62
63
  curl -fsSL https://raw.githubusercontent.com/HansKristoffer/agentgate/main/install.sh | AGENTGATE_NAME=srv sh -s -- join agr1.…
@@ -68,7 +69,7 @@ The server now has every account, MCP instance and repo mapping, and takes over
68
69
 
69
70
  To sign every machine in to GitHub and Infisical as you, run `agentgate logins share` on the machine where you are signed in, or use **Share** under **Shared logins** on the Machines screen. It shares the `gh` login for github.com and the Infisical CLI login, skipping either one this machine doesn't use. Every paired machine, including servers that join later, then runs `gh auth login` and `gh auth setup-git` with that token (so `gh` must be installed there) and gets the same Infisical session. The machine that shared re-reads its logins every ten minutes, so if you log in again there, the others follow. Infisical must keep its login in a file: if it uses the system keychain, run `infisical vault set file` and `infisical login` first. `agentgate logins` and the Machines screen show whether this machine is signed in with each login, and `agentgate logins forget github|infisical` stops sharing; machines already signed in stay signed in.
70
71
 
71
- An Infisical login expires after a few days and can't be renewed, so you have to log in again. For tools that run on their own, such as servers, set an Infisical machine identity once instead: create one with Universal Auth in Infisical and give it access to your projects, then choose **Set** next to **Infisical machine identity** under **Shared logins**, or run `agentgate logins identity --client-id <id>` (it asks for the secret; `--site` defaults to the Infisical instance your CLI uses). agentgate checks it with Infisical and writes it to `~/.infisical/universal-auth.json` on every machine, including servers that join later. hanzio uses that file when a process has no `INFISICAL_CLIENT_ID` and `INFISICAL_CLIENT_SECRET`. `agentgate logins forget infisical-identity` removes it from every machine.
72
+ An Infisical login expires after a few days and can't be renewed, so you have to log in again. Every machine checks whether its shared logins still work, and the overview and `agentgate logins` name the machines where one doesn't, such as an expired Infisical session or a GitHub token that was revoked. Click **Sign in** on the overview to log in to Infisical again in your browser; agentgate then shares the new session with every machine. The browser login has to finish on the machine that runs it, so use the app on your laptop, or run `agentgate logins signin infisical` in a terminal on any machine, where the Infisical CLI also accepts the token its sign-in page shows when it can't reach a server. For tools that run on their own, such as servers, set an Infisical machine identity once instead: create one with Universal Auth in Infisical and give it access to your projects, then choose **Set** next to **Infisical machine identity** under **Shared logins**, or run `agentgate logins identity --client-id <id>` (it asks for the secret; `--site` defaults to the Infisical instance your CLI uses). agentgate checks it with Infisical and writes it to `~/.infisical/universal-auth.json` on every machine, including servers that join later. hanzio uses that file when a process has no `INFISICAL_CLIENT_ID` and `INFISICAL_CLIENT_SECRET`. `agentgate logins forget infisical-identity` removes it from every machine.
72
73
 
73
74
  **The relay invite never expires and is a master key.** Anyone who has it can read every account and MCP login, so share it privately. If it leaks, run `agentgate relay rotate` and have every relay machine join again with the new command. Removing a relay machine (`agentgate unpair <node>` or **Remove** in the app) rotates the same way. A rotation can't revoke Tailscale links, so also unpair the removed machine on every machine you keep. By default it uses the hosted relay at `https://agentgate-relay.hanskristoffer.dk`. To use your own instead, deploy `apps/relay` to your Cloudflare account (see [the relay](docs/operations/relay.md#deploying-and-self-hosting)) and pass `--relay-url`, or set `AGENTGATE_RELAY_URL`. `agentgate relay status` shows sync state and errors.
74
75
 
@@ -85,20 +86,22 @@ Each machine can show its own health: CPU, load, memory, disk, time spent waitin
85
86
 
86
87
  ## T3 Code
87
88
 
88
- `agentgate setup` writes a Claude config dir (whose `settings.json` points Claude Code at the daemon) and a Codex home. In T3 Code, add one provider instance per provider:
89
+ T3 Code's default Claude and Codex instances run your own Claude Code and Codex, which the first `agentgate service install` routes through agentgate, so there is nothing to set in T3 Code. One instance per provider covers every account; the daemon switches eligible accounts when quota is exhausted. Account-specific continuations require their original account; if it is unavailable, the client receives an explicit restart error. In the app's **Accounts** screen, click an account's pin to prefer it for its provider. The pin applies to the next request in every routed session and syncs to paired machines; while the pinned account has no room, the pool falls back to another one. Click the pin again to go back to automatic. The CLI equivalent is `agentgate accounts pin <id>` / `agentgate accounts unpin <id>`.
89
90
 
90
- | Provider | T3 setting |
91
- | -------- | ------------------------------------------------------- |
92
- | Claude | `CLAUDE_CONFIG_DIR path` = `~/.config/agentgate/claude` |
93
- | Codex | `CODEX_HOME path` = `~/.config/agentgate/codex` |
91
+ **Cursor** accounts can be added too (`agentgate login cursor`, or **Add account** in the app). Agentgate keeps their logins, shows each account's monthly plan usage, counts their tokens in the overview chart (read from Cursor's usage history every 15 minutes), and syncs the accounts to paired machines. Agent runs are pooled like Claude and Codex: set `CURSOR_API_BASE_URL` to `http://127.0.0.1:<port>/cursor` (the address `agentgate status` prints, with `/cursor` on the end). Other Cursor calls keep the CLI's own login. A machine on an older agentgate stops syncing once a Cursor account exists, until it is updated.
94
92
 
95
- One instance per provider covers every account; the daemon switches eligible accounts when quota is exhausted. Account-specific continuations require their original account; if it is unavailable, the client receives an explicit restart error. In the app's **Accounts** screen, click an account's pin to prefer it for its provider. The pin applies to the next request in every routed session and syncs to paired machines; while the pinned account has no room, the pool falls back to another one. Click the pin again to go back to automatic. The CLI equivalent is `agentgate accounts pin <id>` / `agentgate accounts unpin <id>`.
93
+ ### Your own Claude Code and Codex
96
94
 
97
- **Cursor** accounts can be added too (`agentgate login cursor`, or **Add account** in the app). Agentgate keeps their logins, shows each account's monthly plan usage, counts their tokens in the overview chart (read from Cursor's usage history every 15 minutes), and syncs the accounts to paired machines. Agent runs are pooled like Claude and Codex: set `CURSOR_API_BASE_URL` to `http://127.0.0.1:<port>/cursor` (the address `agentgate status` prints, with `/cursor` on the end). Other Cursor calls keep the CLI's own login. A machine on an older agentgate stops syncing once a Cursor account exists, until it is updated.
95
+ The first `agentgate service install` on a new machine routes them, and `agentgate setup --primary` does it any time. It adds `ANTHROPIC_BASE_URL` to `~/.claude/settings.json` and the agentgate MCP server to `~/.claude.json`, so the Claude Code you already use (and T3's default Claude instance) goes through agentgate while keeping its own login. Where Claude Code has never been signed in, such as on a new server, it also sets a placeholder `ANTHROPIC_AUTH_TOKEN`, because Claude Code won't start without a login; agentgate signs each request with a pooled account either way. Claude Desktop is not affected: it sets its own API address; see [Claude Desktop](docs/user/claude-desktop.md). For only the MCP servers, use `agentgate setup --mcp`. That, and `setup --primary`, also write `~/.cursor/mcp.json` where Cursor is installed, so Cursor and the Cursor CLI get the same servers. Claude Code sometimes saves `~/.claude.json` without the agentgate MCP server; while you have it on, the daemon puts it back within a minute, and `agentgate status` says when it did. Remove it with `agentgate setup --mcp off`, not `claude mcp remove`, which the daemon undoes. After agentgate's binary moves or its port changes, the daemon also updates these MCP entries. Start a new session to pick them up. Model requests use the pool; other requests keep your login, and your login is also the last resort when every pooled account is exhausted. Undo with `agentgate setup --primary off` (the previous base URL is restored, and later settings edits are preserved). It does the same for `~/.codex/config.toml` (or `$CODEX_HOME`): an `agentgate` model provider with `requires_openai_auth = true`, so Codex, the Codex app and T3's default Codex instance send their own ChatGPT login along as the last resort. Where Codex has never been signed in, it writes a placeholder API key to `~/.codex/auth.json`, so `codex login status` and T3 Code see Codex as signed in; undo removes it again. Add `--node <name>` to switch a paired machine from the one you are on. Keep the service installed: while the daemon is down, Claude Code and Codex can't reach their providers.
98
96
 
99
- ### Or: your normal Claude login
97
+ ### Or: separate folders for T3 Code
100
98
 
101
- `agentgate setup --primary` adds `ANTHROPIC_BASE_URL` to `~/.claude/settings.json` and the agentgate MCP server to `~/.claude.json`, so the Claude Code you already use (and T3's default Claude instance) goes through agentgate while keeping its own login. Where Claude Code has never been signed in, such as on a new server, it also sets a placeholder `ANTHROPIC_AUTH_TOKEN`, because Claude Code won't start without a login; agentgate signs each request with a pooled account either way. Claude Desktop is not affected: it sets its own API address; see [Claude Desktop](docs/user/claude-desktop.md). For only the MCP servers, use `agentgate setup --mcp`. That, and `setup --primary`, also write `~/.cursor/mcp.json`, so Cursor and the Cursor CLI get the same servers. Start a new session to pick them up. Model requests use the pool; other requests keep your login, and your login is also the last resort when every pooled account is exhausted. Undo with `agentgate setup --primary off` (the previous base URL is restored, and later settings edits are preserved). It does the same for `~/.codex/config.toml` (or `$CODEX_HOME`): an `agentgate` model provider with `requires_openai_auth = true`, so Codex, the Codex app and T3's default Codex instance send their own ChatGPT login along as the last resort. Where Codex has never been signed in, it writes a placeholder API key to `~/.codex/auth.json`, so `codex login status` and T3 Code see Codex as signed in; undo removes it again. Add `--node <name>` to switch a paired machine from the one you are on. Only do this with `agentgate service install`, or Claude Code and Codex can't reach their providers while the daemon is down.
99
+ To have only T3 Code use agentgate, turn routing off (`agentgate setup --primary off`) and run `agentgate setup`. It writes a Claude config dir (whose `settings.json` points Claude Code at the daemon) and a Codex home. In T3 Code, add one provider instance per provider:
100
+
101
+ | Provider | T3 setting |
102
+ | -------- | ------------------------------------------------------- |
103
+ | Claude | `CLAUDE_CONFIG_DIR path` = `~/.config/agentgate/claude` |
104
+ | Codex | `CODEX_HOME path` = `~/.config/agentgate/codex` |
102
105
 
103
106
  ### Hand threads between machines
104
107
 
@@ -155,7 +158,7 @@ agentgate project set Lullu-ai/lullu posthog=posthog-lullu # under a tool pref
155
158
  agentgate mcp test posthog-lullu
156
159
  ```
157
160
 
158
- A server can have any name, such as "PostHog Lullu"; its slug (`posthog-lullu`) becomes its id and the default tool prefix, and `agentgate mcp label <id> <name>` changes only the name shown in the app. The alias is the tool prefix: in every repo mapped to `posthog-lullu` under the alias `posthog`, the agent sees `posthog__…` tools that reach that repo's PostHog project. The repo is taken from `git remote get-url origin` in the session's working directory (override with `AGENTGATE_PROJECT=owner/repo`). Mapping changes reach running sessions without a restart.
161
+ A server can have any name, such as "PostHog Lullu"; its slug (`posthog-lullu`) becomes its id and the default tool prefix, and `agentgate mcp label <id> <name>` changes only the name shown in the app. The alias is the tool prefix: in every repo mapped to `posthog-lullu` under the alias `posthog`, the agent sees `posthog__…` tools that reach that repo's PostHog project. The repo is taken from `git remote get-url origin` in the session's working directory (override with `AGENTGATE_PROJECT=owner/repo`). Running Claude Code sessions pick up new servers and mapping changes without a restart. Codex reads the tool list only when a session starts, so start a new Codex session to see them.
159
162
 
160
163
  ## Skills per repo
161
164
 
@@ -184,7 +187,9 @@ Fetching needs Node (`npx`) or Bun (`bunx`) on the daemon's machine, and connect
184
187
  - **Every session**: the Claude and Codex folders `agentgate setup` writes (`~/.config/agentgate/{claude,codex}/skills`), plus `~/.claude/skills` and `~/.codex/skills` while `setup --primary` is on.
185
188
  - **One repo**: `.claude/skills/<name>` in the main checkout (Claude Code falls back to it from worktrees) and `.agents/skills/<name>` in the main checkout and every worktree (Codex). The entries are added to `.git/info/exclude`.
186
189
 
187
- Claude Code and Codex read skills before a session's MCP servers start, so repo links must exist ahead of time. A repo is known on a machine after its first agentgate session there, or after a scan under Projects → **Add project** → **Find on this machine**; from then on its worktrees are watched and new ones are linked with bounded retries and independent periodic repair. Register or scan a checkout before launching its first session; watcher timing cannot guarantee first-session readiness. Changes apply to new sessions. Agentgate never replaces a folder it did not create: a name clash is listed under Skills → Skills need attention. Skills run with your agent's permissions and are copied to every paired machine, so install only sources you trust; the app shows the skills.sh audit before installing.
190
+ Cursor also reads `~/.claude/skills`, `~/.codex/skills` and a repo's `.claude/skills` and `.agents/skills`, so it gets the same skills, except from the separate folders `agentgate setup` writes.
191
+
192
+ Claude Code and Codex read skills before a session's MCP servers start, so repo links must exist ahead of time. A repo is known on a machine once it is a project in that machine's T3 Code (with T3 Code connected; this includes clones from [project sync](#keep-projects-in-sync) and handoffs), after its first agentgate session there, or after a scan under Projects → **Add project** → **Find on this machine**; from then on its worktrees are watched and new ones are linked with bounded retries and independent periodic repair. Outside T3 Code, register or scan a checkout before launching its first session; watcher timing cannot guarantee first-session readiness. Changes apply to new sessions. Agentgate never replaces a folder it did not create on its own: a name clash is listed under Skills → Skills need attention, where **Use Agentgate's** moves the existing folder to `skill-backups` in agentgate's state folder and links agentgate's copy, and **Keep this one** leaves it and stops linking agentgate's copy there on that machine (`agentgate skills conflicts`, `agentgate skills resolve <path> agentgate|keep`). A folder the repository tracks is never moved. Skills run with your agent's permissions and are copied to every paired machine, so install only sources you trust; the app shows the skills.sh audit before installing.
188
193
 
189
194
  The app installs the exact files shown in a preview. Previews expire after ten minutes or cache eviction; preview again to continue. Skills installed from skills.sh, a source or a connected repository follow it and can't be edited; only hand-written skills can. Editing checks the saved revision and reports a conflict if another client or peer changed the skill. Skills → **Skills need attention** shows failed local materialization/link work, which the daemon retries automatically.
190
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanskristoffer/agentpool",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,9 +22,9 @@
22
22
  "agentgate": "bin/agentpool.js"
23
23
  },
24
24
  "optionalDependencies": {
25
- "agentpool-darwin-arm64": "0.26.0",
26
- "agentpool-darwin-x64": "0.26.0",
27
- "agentpool-linux-x64": "0.26.0",
28
- "agentpool-linux-arm64": "0.26.0"
25
+ "agentpool-darwin-arm64": "0.27.0",
26
+ "agentpool-darwin-x64": "0.27.0",
27
+ "agentpool-linux-x64": "0.27.0",
28
+ "agentpool-linux-arm64": "0.27.0"
29
29
  }
30
30
  }