@hanskristoffer/agentpool 0.1.2 → 0.3.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 +50 -11
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -6,7 +6,7 @@ One daemon per machine that:
6
6
  - hosts **MCP servers** and gives each GitHub repo its own set (e.g. a separate PostHog project per repo), plus general ones for every repo;
7
7
  - **shares** all of it between your machines over Tailscale, and keeps working when the other machines are offline.
8
8
 
9
- T3 Code (or plain Claude Code / Codex) runs the sessions; agentgate sits underneath. See [PLAN.md](PLAN.md) for the design and [STABILITY_PLAN.md](STABILITY_PLAN.md) for the code review, reliability fixes, and refactoring order.
9
+ T3 Code (or plain Claude Code / Codex) runs the sessions; agentgate sits underneath. The optional **Tauri macOS app** controls your local or remote setup. The daemon and CLI work independently, including on headless Linux servers. There is no web UI. See [PLAN.md](PLAN.md) for the design and [STABILITY_PLAN.md](STABILITY_PLAN.md) for the code review, reliability fixes, and refactoring order.
10
10
 
11
11
  ## Install
12
12
 
@@ -22,7 +22,7 @@ Without npm:
22
22
  curl -fsSL https://raw.githubusercontent.com/HansKristoffer/agentgate/main/install.sh | AGENTGATE_REPO=HansKristoffer/agentgate sh
23
23
  ```
24
24
 
25
- Or from source: `bun install && bun run build` (binaries land in `dist/`), or run `bun src/cli.ts …` directly.
25
+ Or from source: `bun install && bun run build` (binaries land in `dist/`), or run `bun run cli -- …` directly.
26
26
 
27
27
  ## First machine
28
28
 
@@ -34,7 +34,9 @@ agentgate setup # writes Claude Code / Codex config, prints
34
34
  agentgate service install # launchd (macOS) or systemd --user (Linux)
35
35
  ```
36
36
 
37
- Open http://127.0.0.1:7878 for the web UI. Everything below can also be done there.
37
+ 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.
38
+
39
+ The app has Accounts, MCP servers, Projects, Machines, and Settings screens. **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.
38
40
 
39
41
  ## A second machine (e.g. an always-on server)
40
42
 
@@ -47,7 +49,7 @@ agentgate setup
47
49
  agentgate service install # also runs `loginctl enable-linger` so it survives logout/reboot
48
50
  ```
49
51
 
50
- The server now has every account, MCP instance and repo mapping, and takes over token refreshes. The UI is reachable at `http://srv.<tailnet>.ts.net:7878` after logging in with `agentgate admin-token`.
52
+ The server now has every account, MCP instance and repo mapping, and takes over token refreshes. To control the server from the native app, open the connection settings at the bottom of the sidebar, enter `http://srv.<tailnet>.ts.net:7878`, and paste the token printed by `agentgate admin-token` on the server. Remote management uses bearer authentication over Tailscale.
51
53
 
52
54
  ## T3 Code
53
55
 
@@ -58,15 +60,15 @@ The server now has every account, MCP instance and repo mapping, and takes over
58
60
  | Claude | `CLAUDE_CONFIG_DIR path` = `~/.config/agentgate/claude` |
59
61
  | Codex | `CODEX_HOME path` = `~/.config/agentgate/codex` |
60
62
 
61
- One instance per provider covers every account; the daemon switches accounts, so a thread never breaks when an account runs out. To prefer one account, pin it (`agentgate accounts pin <id>` or the UI).
63
+ One instance per provider covers every account; the daemon switches accounts, so a thread never breaks when an account runs out. To prefer one account, pin it (`agentgate accounts pin <id>` or the app).
62
64
 
63
65
  ### Or: your normal Claude login
64
66
 
65
- `agentgate setup --primary` adds only `ANTHROPIC_BASE_URL` to `~/.claude/settings.json`, so the Claude Code you already use (and T3's default Claude instance) goes through agentgate while keeping its own login. 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). Only do this with `agentgate service install`, or Claude Code can't reach Anthropic while the daemon is down.
67
+ `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. 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. Only do this with `agentgate service install`, or Claude Code and Codex can't reach their providers while the daemon is down.
66
68
 
67
69
  ## MCP servers per repo
68
70
 
69
- In the UI (MCP servers page), paste a server's URL and a name and click **Connect**. If the server uses MCP OAuth, you are sent to its login page and back; agentgate keeps the login, refreshes it, and syncs it to your other machines. One-click buttons cover common hosted servers (PostHog, Linear, Sentry, Notion, Supabase, Stripe, Vercel, Cloudflare, Neon, Railway, Context7) and a per-worktree filesystem server. Servers that take an API key instead get it under **Extra headers** (`Authorization: Bearer …`); the same field pins a server to one project (`x-posthog-project-id: 12345`).
71
+ In the native app (MCP servers), paste a server's URL and a name and click **Connect**. If the server uses MCP OAuth, click **Sign in** to open the browser; its callback completes in the daemon and the app updates automatically; agentgate keeps the login, refreshes it, and syncs it to your other machines. Presets cover common hosted servers (PostHog, Linear, Sentry, Notion, Supabase, Stripe, Vercel, Cloudflare, Neon, Railway, Context7) and a per-worktree filesystem server. Servers that take an API key instead get it under **Extra headers** (`Authorization: Bearer …`); the same field pins a server to one project (`x-posthog-project-id: 12345`).
70
72
 
71
73
  From the CLI:
72
74
 
@@ -98,16 +100,36 @@ Run `agentgate --help`. Useful ones: `status`, `accounts`, `accounts exhaust <id
98
100
 
99
101
  ```sh
100
102
  bun install
103
+ bun run cli -- init # initialize the daemon
104
+ bun start # foreground daemon, no app required
105
+ bun dev # Tauri app with Vite hot reload (Rust + Xcode tools required)
101
106
  bun test
102
107
  bun run typecheck
103
- AGENTGATE_HOME=/tmp/ag AGENTGATE_PORT=7979 bun src/cli.ts init # a throwaway node
108
+ AGENTGATE_HOME=/tmp/ag AGENTGATE_PORT=7979 bun run cli -- init # a throwaway node
104
109
  ```
105
110
 
106
- ## Reliability and upgrades
111
+ ## Monorepo
112
+
113
+ | Workspace | Role |
114
+ |---|---|
115
+ | `apps/agentgate` (`@agentgate/daemon`) | Bun daemon, standalone CLI, provider proxies, SQLite, sync, and MCP gateway |
116
+ | `apps/desktop` (`@agentgate/desktop`) | Tauri 2 shell with React/Vite, system appearance, translucent sidebar, and remembered window state |
117
+ | `apps/site` (`@agentgate/site`) | Static Astro landing page for Cloudflare Pages |
118
+ | `packages/protocol` (`@agentgate/protocol`) | Shared control API types and configuration schemas |
119
+
120
+ The app uses Tauri commands to send HTTP requests from Rust. It has no browser HTTP fallback, server-rendered pages, cookies, or CORS management access. The daemon's `/api/*` management endpoints reject browser Origin/Fetch Metadata headers; remote requests require the node's admin bearer token. Status omits credentials, header values, command environments, and URL credentials/query strings. `/oauth/callback` is a small text response for MCP sign-in, including CLI sign-in. Provider and MCP traffic remains loopback-only. Backup export/restore and login-directory import require a local connection.
121
+
122
+ `bun run build` builds the four standalone CLI binaries. `bun run build:desktop` builds a macOS `.app` and `.dmg` and bundles a compiled daemon for the requested Tauri target. Use `bun run --filter @agentgate/desktop tauri build --target universal-apple-darwin` for the universal build releases ship, after `rustup target add x86_64-apple-darwin aarch64-apple-darwin`. The service executable is copied outside the app bundle before installing it or generating coding-tool settings.
123
+
124
+ ## Landing page
125
+
126
+ `apps/site` is a static Astro page. It reads the latest GitHub release at build time to link the DMG, so rebuild it after a release. In Cloudflare Pages, keep the repository root as the root directory, set the build command to `bun run build:site` and the output directory to `apps/site/dist`. Set `GITHUB_TOKEN` in the build environment if the release lookup hits GitHub's rate limit. To upload from your machine instead: `bun run --filter @agentgate/site deploy`.
127
+
128
+ ## Reliability
107
129
 
108
130
  The reliability refactor is implemented; [STABILITY_PLAN.md](STABILITY_PLAN.md#implementation-and-verification--2026-09-30) records the changes, checks, and remaining live release gates. Account and MCP OAuth refreshes share holder coordination and a local cross-process lease. Running MCP shims reconnect after daemon restarts and update per-session mappings; tool calls with uncertain outcomes are never automatically replayed.
109
131
 
110
- Upgrade paired nodes together. This version uses **sync protocol 2**, and older peers are rejected. Existing MCP OAuth credentials migrate automatically into a separate record when the database opens. Deletion history is retained so offline machines cannot resurrect old configuration. Keep a full backup before upgrading.
132
+ Nodes use **sync protocol 2** and the app checks **management API version 1** when connecting. Deletion history is retained so offline machines cannot resurrect old configuration.
111
133
 
112
134
  `export --no-secrets` / **Without secrets** produces an inventory: it omits logins, OAuth client secrets, and arbitrary MCP URLs, headers, commands/arguments, environment, fields, and secrets. Restored inventory transports need configuration again. Full exports contain working credentials and transport configuration.
113
135
 
@@ -126,8 +148,25 @@ bun install --frozen-lockfile
126
148
  bun run typecheck
127
149
  bun test
128
150
  bun run build
151
+ bun run build:frontend
152
+ bun scripts/desktop-prepare.ts # prepares the bundled daemon for Rust checks
153
+ bun run check:native
154
+ cargo test --locked --manifest-path apps/desktop/src-tauri/Cargo.toml
155
+ bun run build:desktop
129
156
  bun scripts/smoke.ts dist/agentgate-darwin-arm64 # use your host target
130
157
  bun scripts/codex-smoke.ts # optional: installed Codex CLI, fake upstream
131
158
  ```
132
159
 
133
- Builds produce four macOS/Linux binaries and `dist/SHA256SUMS`. Releases use [release-please](https://github.com/googleapis/release-please): conventional commits on `main` (`feat:`, `fix:`) keep a release PR open with the next version and changelog, and merging it publishes the binaries to npm (`@hanskristoffer/agentpool` plus one `agentpool-<os>-<cpu>` package per binary, via `scripts/npm.ts`; needs the `NPM_TOKEN` secret) and to a GitHub release. The installer verifies the checksum from the same resolved release before replacing an installed binary. CI runs tests, typechecking, and compiled CLI checks on macOS and Linux.
160
+ Builds produce four macOS/Linux binaries and `dist/SHA256SUMS`. Releases use [release-please](https://github.com/googleapis/release-please): conventional commits on `main` (`feat:`, `fix:`) keep a release PR open with the next version and changelog, and merging it publishes the binaries to npm (`@hanskristoffer/agentpool` plus one `agentpool-<os>-<cpu>` package per binary, via `scripts/npm.ts`; needs the `NPM_TOKEN` secret) and to a GitHub release. The installer verifies the checksum from the same resolved release before replacing an installed binary. CI runs tests, typechecking, frontend builds, and compiled CLI checks on macOS and Linux, plus Rust checks and app packaging on macOS. Releases also attach a universal macOS DMG, signed with a Developer ID certificate and notarized (`.github/workflows/build-macos.yml`; run it by hand with a tag to rebuild one). It needs these repository secrets:
161
+
162
+ | Secret | Value |
163
+ |---|---|
164
+ | `APPLE_CERTIFICATE` | base64 of the Developer ID Application `.p12`, including the G2 intermediate |
165
+ | `APPLE_CERTIFICATE_PASSWORD` | its password |
166
+ | `APPLE_SIGNING_IDENTITY` | `Developer ID Application: Name (TEAMID)` |
167
+ | `APPLE_TEAM_ID` | ten-character team id |
168
+ | `APPLE_API_KEY` | App Store Connect API key id |
169
+ | `APPLE_API_ISSUER` | its issuer id |
170
+ | `APPLE_API_KEY_CONTENT` | contents of the `.p8` |
171
+
172
+ The bundled daemon is signed with the app's `Entitlements.plist`. It holds only `allow-jit`: under the hardened runtime, a compiled Bun binary without it falls back to the JavaScript interpreter and runs about 50 times slower. The standalone CLI binaries are not signed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanskristoffer/agentpool",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,9 +12,9 @@
12
12
  "agentgate": "bin/agentpool.js"
13
13
  },
14
14
  "optionalDependencies": {
15
- "agentpool-darwin-arm64": "0.1.2",
16
- "agentpool-darwin-x64": "0.1.2",
17
- "agentpool-linux-x64": "0.1.2",
18
- "agentpool-linux-arm64": "0.1.2"
15
+ "agentpool-darwin-arm64": "0.3.0",
16
+ "agentpool-darwin-x64": "0.3.0",
17
+ "agentpool-linux-x64": "0.3.0",
18
+ "agentpool-linux-arm64": "0.3.0"
19
19
  }
20
20
  }