@the-vibe-company/armada 0.1.11 → 0.1.12

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/README.md CHANGED
@@ -129,12 +129,12 @@ armada merge 34 # or the pull request URL; --ticket ABC-12 when the
129
129
 
130
130
  ## Watch the fleet (dashboard)
131
131
 
132
- `packages/dashboard` is a Next.js app with one page: the Fleet of every project registered in Turso.
132
+ `packages/dashboard` is a Next.js app whose main page is the Fleet of the projects registered in Turso. With accounts, each person sees the projects of their organization; under the shared password, every project.
133
133
 
134
134
  - **Waiting for you** comes first, across projects. It lists questions, blocked workers, plans to approve, hand-backs and silent workers, the most urgent first.
135
135
  - **At work** has one row per ticket in flight. A row shows the project, the runtime and session, the six-step phase pipeline, time in phase, the last report, the pull request with its CI, and the flags (red CI, conflict, double claim).
136
136
  - A filter shows one project. Each project shows whether its coordinator is active, from its last inbox read.
137
- - **Answer** a question from its line in Waiting for you (an option of the question fills the answer in). **Ready to launch** lists the frontier with a Launch button and a profile picker, the routed profile preselected. Neither reaches a worker: each becomes a request in that project's coordinator inbox, signed with the name the viewer gives (remembered in a cookie; default `ARMADA_DASHBOARD_AUTHOR`), and shows as pending until the coordinator carries it out. The dashboard holds no runtime credential.
137
+ - **Answer** a question from its line in Waiting for you (an option of the question fills the answer in). **Ready to launch** lists the frontier with a Launch button and a profile picker, the routed profile preselected. Neither reaches a worker: each becomes a request in that project's coordinator inbox, signed with the signed-in person's name and address (with accounts) or with the name the viewer gives (under the shared password; remembered in a cookie, default `ARMADA_DASHBOARD_AUTHOR`), and shows as pending until the coordinator carries it out. The dashboard holds no runtime credential.
138
138
  - It stays live without a reload. Linear and GitHub are read at most once a minute per project. Turso is read on every 5-second poll, so a worker's `armada report` shows within seconds.
139
139
  - When Turso is unreachable, a banner says so and the view falls back to Linear and GitHub.
140
140
  - The interface is in English or French (`ARMADA_DASHBOARD_LANGUAGE`, or the EN/FR switch).
@@ -148,18 +148,50 @@ ARMADA_DASHBOARD_PASSWORD=off ARMADA_DASHBOARD_DEMO=fleet ARMADA_TURSO_URL=file:
148
148
  bun run demo:report WID-12 shipping "Opened the pull request" # watch the row change
149
149
  ```
150
150
 
151
+ The same with accounts (email and password work in development only; confirmation links are printed in the server log):
152
+
153
+ ```sh
154
+ ARMADA_DASHBOARD_DEMO=fleet ARMADA_TURSO_URL=file:.demo/armada.db \
155
+ ARMADA_AUTH_DATABASE_URL=file:.demo/auth.db ARMADA_AUTH_SECRET="$(openssl rand -base64 32)" \
156
+ ARMADA_AUTH_URL=http://localhost:4822 ARMADA_AUTH_OWNER_EMAILS=you@example.com bun run dev
157
+ ```
158
+
151
159
  **Deploy on Vercel.** Create a project from this repository and set these options:
152
160
 
153
161
  - Root Directory: `packages/dashboard`, with files outside the root directory included (the default). The framework preset is Next.js, and Bun installs the workspace from `bun.lock`.
154
- - Environment variables: `ARMADA_DASHBOARD_PASSWORD`, `LINEAR_API_KEY`, `GITHUB_TOKEN`, `ARMADA_TURSO_URL` and `ARMADA_TURSO_TOKEN`. Optional: `ARMADA_REPOSITORIES` (the `owner/name` list shown while Turso is unreachable on a fresh server), `ARMADA_DASHBOARD_LANGUAGE` (`en` or `fr`), `ARMADA_DASHBOARD_SNAPSHOT_SECONDS` (Linear and GitHub read period, default 60) and `ARMADA_DASHBOARD_AUTHOR` (the name requests are signed with until a viewer gives theirs). Never add a runtime token (Conductor or other): the coordinator carries out every request.
162
+ - Environment variables: the accounts variables below (or, until they are set, `ARMADA_DASHBOARD_PASSWORD`), `LINEAR_API_KEY`, `GITHUB_TOKEN`, `ARMADA_TURSO_URL` and `ARMADA_TURSO_TOKEN`. Optional: `ARMADA_REPOSITORIES` (the `owner/name` list shown while Turso is unreachable on a fresh server), `ARMADA_DASHBOARD_LANGUAGE` (`en` or `fr`), `ARMADA_DASHBOARD_SNAPSHOT_SECONDS` (Linear and GitHub read period, default 60) and `ARMADA_DASHBOARD_AUTHOR` (the name requests are signed with until a viewer gives theirs). Never add a runtime token (Conductor or other): the coordinator carries out every request.
155
163
  - The keys stay on the server; the browser only receives the fleet reading.
156
164
 
157
- **Password.** The dashboard asks for `ARMADA_DASHBOARD_PASSWORD` before it shows anything, on every host, a custom domain included. Every page, the polling route and every server action answer 401 or send the viewer to the login page until then; only the build's static files are public.
165
+ **Accounts.** People sign in with GitHub (or email and password where enabled) and belong to organizations, with the roles owner, admin and member. Accounts, sessions, organizations and invitations live in a libSQL database of their own, separate from the fleet's Turso database; its schema is applied on first use. Accounts turn on only when every required variable below is set. With none of them set, the shared password applies, unchanged; with some but not all, the dashboard fails closed (503, naming the missing ones) rather than fall back to a password that shows every organization's projects.
166
+
167
+ | Variable | What |
168
+ | --- | --- |
169
+ | `ARMADA_AUTH_DATABASE_URL` | The accounts database, `libsql://...` (a new Turso database, not the fleet's), or `file:` locally |
170
+ | `ARMADA_AUTH_DATABASE_TOKEN` | Its token (not needed for `file:`) |
171
+ | `ARMADA_AUTH_SECRET` | Signs sessions: 32 characters at least, for example `openssl rand -base64 32`. Changing it signs everyone out |
172
+ | `ARMADA_AUTH_URL` | The dashboard's public address, for example `https://armada.example.com`: GitHub's callback and the links in emails |
173
+ | `ARMADA_AUTH_GITHUB_CLIENT_ID`, `ARMADA_AUTH_GITHUB_CLIENT_SECRET` | A GitHub OAuth app (GitHub > Settings > Developer settings > OAuth Apps) whose callback URL is `<ARMADA_AUTH_URL>/api/auth/callback/github` |
174
+ | `ARMADA_AUTH_OWNER_EMAILS` | Comma-separated addresses that may create an account without an invitation and create organizations |
175
+ | `ARMADA_AUTH_EMAIL_PASSWORD` | Optional, `on` or `off`: email and password sign-in, with address confirmation. Development only for now (default on): production ignores it until an email provider is plugged in, since confirmation links would sit in the server log |
176
+
177
+ - Accounts are by invitation: an account is created only for an owner address or an address with a pending invitation. The first owner to sign in creates the organization; the projects already registered, and those the CLI registers until it signs in, join the deployment's first organization. Organizations cannot be deleted.
178
+ - An owner or admin invites by email from the Organization page (the name in the top bar). No email provider is plugged in yet: messages (invitations, address confirmations) go to the server log, and the Organization page shows each pending invitation's link to copy and send. The invited person signs in with that address and accepts.
179
+ - Sessions are HttpOnly, SameSite=Lax cookies (Secure over https) valid 30 days; a revoked session can last up to five minutes (signed cookie cache). Without its accounts database the dashboard fails closed (503).
180
+
181
+ **Switch from the shared password to accounts** (a deployment that runs on `ARMADA_DASHBOARD_PASSWORD` keeps working until the redeploy of step 4; set every variable before it, since a partial set locks the dashboard):
182
+
183
+ 1. Create the accounts database (`turso db create armada-accounts`, then `turso db show armada-accounts --url` and `turso db tokens create armada-accounts`) and set `ARMADA_AUTH_DATABASE_URL` and `ARMADA_AUTH_DATABASE_TOKEN`.
184
+ 2. Create a GitHub OAuth app with the callback URL `https://<your dashboard>/api/auth/callback/github`, and set `ARMADA_AUTH_GITHUB_CLIENT_ID` and `ARMADA_AUTH_GITHUB_CLIENT_SECRET`.
185
+ 3. Set `ARMADA_AUTH_SECRET`, `ARMADA_AUTH_URL` and `ARMADA_AUTH_OWNER_EMAILS` (at least the address of your GitHub account), for Production and Preview.
186
+ 4. Redeploy. The dashboard now asks for an account; sign in with GitHub, create the organization (the registered projects join it) and invite the others.
187
+ 5. Remove `ARMADA_DASHBOARD_PASSWORD` and `ARMADA_DASHBOARD_AUTHOR`: with accounts they are no longer read.
188
+
189
+ **Password (until accounts are configured).** The dashboard asks for `ARMADA_DASHBOARD_PASSWORD` before it shows anything, on every host, a custom domain included. Every page, the polling route and every server action answer 401 or send the viewer to the login page until then; only the build's static files are public.
158
190
 
159
191
  - Use a long random value, for example `openssl rand -base64 24`, and set it for the Production and Preview environments. It stays on the server: never prefix it with `NEXT_PUBLIC_`.
160
192
  - A correct password sets a signed session cookie (HttpOnly, Secure, SameSite=Lax) for 30 days. The signature is derived from the password, so changing it and redeploying logs every browser out. "Log out" in the top bar ends one session.
161
193
  - Five wrong passwords from one address block it for 15 minutes, counted per server instance.
162
- - Without the variable, the dashboard fails closed: every route answers 503 and names the variable. `ARMADA_DASHBOARD_PASSWORD=off` turns the password off for local development only; a production server refuses it the same way.
194
+ - Without the variable and without accounts, the dashboard fails closed: every route answers 503 and names the variable. `ARMADA_DASHBOARD_PASSWORD=off` turns the password off for local development only; a production server refuses it the same way.
163
195
  - Vercel Authentication (Settings > Deployment Protection) is a useful second layer, but its standard protection leaves the production custom domain open (covering it takes a paid option), so it cannot replace the password.
164
196
 
165
197
  One deployment covers one Linear workspace and one GitHub organization: its keys must read every registered project.
package/dist/armada.js CHANGED
@@ -2114,6 +2114,16 @@ var MIGRATIONS = [
2114
2114
  )`,
2115
2115
  "CREATE INDEX IF NOT EXISTS inbox_requests_by_question ON inbox_requests (project, question)"
2116
2116
  ]
2117
+ },
2118
+ {
2119
+ version: 5,
2120
+ statements: [
2121
+ `CREATE TABLE IF NOT EXISTS project_organizations (
2122
+ project TEXT PRIMARY KEY,
2123
+ organization TEXT NOT NULL,
2124
+ assigned_at TEXT NOT NULL
2125
+ )`
2126
+ ]
2117
2127
  }
2118
2128
  ];
2119
2129
  var SCHEMA_VERSION = MIGRATIONS.at(-1)?.version ?? 0;
@@ -2182,12 +2192,14 @@ async function ensureProject(db, p, now = new Date) {
2182
2192
  });
2183
2193
  }
2184
2194
  async function listProjects(db) {
2185
- const rs = await db.execute("SELECT slug, name, repository, program_root, created_at, updated_at FROM projects ORDER BY slug");
2195
+ const rs = await db.execute(`SELECT p.slug, p.name, p.repository, p.program_root, o.organization, p.created_at, p.updated_at
2196
+ FROM projects p LEFT JOIN project_organizations o ON o.project = p.slug ORDER BY p.slug`);
2186
2197
  return rs.rows.map((r) => ({
2187
2198
  slug: String(r.slug),
2188
2199
  name: String(r.name),
2189
2200
  repository: String(r.repository),
2190
2201
  programRoot: String(r.program_root),
2202
+ organization: r.organization === null ? null : String(r.organization),
2191
2203
  createdAt: String(r.created_at),
2192
2204
  updatedAt: String(r.updated_at)
2193
2205
  }));
@@ -5052,7 +5064,7 @@ async function loadStatus(config, opts) {
5052
5064
  });
5053
5065
  }
5054
5066
  // package.json
5055
- var version = "0.1.11";
5067
+ var version = "0.1.12";
5056
5068
 
5057
5069
  // src/io.ts
5058
5070
  class UsageError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-vibe-company/armada",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "description": "Run a fleet of coding agents on one project: the armada command line.",
6
6
  "license": "MIT",