diff --git a/CLAUDE.md b/CLAUDE.md index e8cba2a4..e90b8fd7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ # Claude Code Working Guide -_Last synced: v2.8.10 (2026-10-19) — an admin can switch a user to one pool account (account_pins); a Claude login goes into their home at once._ A change that makes any statement in this file, `AGENTS.md`, or a README wrong — a moved path, a new or changed extension point, a retired rule — updates that file in the same change-set and bumps this marker. **Bump = replace the version/date and a ≤ 1-line summary; never append a changelog here** — details belong in the commit message and `docs/`, because this whole file is loaded into every session. +_Last synced: v2.8.11 (2026-10-19) — an admin can switch a user to one pool account (account_pins); a Claude login goes into their home at once._ A change that makes any statement in this file, `AGENTS.md`, or a README wrong — a moved path, a new or changed extension point, a retired rule — updates that file in the same change-set and bumps this marker. **Bump = replace the version/date and a ≤ 1-line summary; never append a changelog here** — details belong in the commit message and `docs/`, because this whole file is loaded into every session. ## Project mission - Maintain a reliable local-first dashboard for Claude Code session monitoring. diff --git a/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap b/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap index e242e399..c06513e1 100644 --- a/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap +++ b/client/src/pages/__tests__/__snapshots__/screens.snapshot.test.tsx.snap @@ -7239,7 +7239,7 @@ exports[`screen snapshots > Settings — about 1`] = ` - UI build v2.8.10 (rebuild client to match) + UI build v2.8.11 (rebuild client to match)

diff --git a/openapi.yaml b/openapi.yaml index 5077b430..6c68899f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3,7 +3,7 @@ openapi: 3.0.3 info: title: Agent Dashboard for Claude Code API - version: 2.8.10 + version: 2.8.11 description: HTTP API for real-time Claude Code session monitoring, agent lifecycle tracking, analytics, pricing, hooks ingestion, and workflow intelligence. contact: name: Nguyễn Ngọc Trí Vĩ @@ -4785,6 +4785,22 @@ components: description: Events attributed to this run's inner agents, ordered by created_at then id. Capped at 5000 rows. items: $ref: '#/components/schemas/DashboardEvent' + AccountPin: + type: object + required: + - userId + - username + - account + properties: + userId: + type: integer + username: + type: string + account: + type: string + description: The pool account's name + pinnedAt: + type: string UserPrefs: type: object required: @@ -15141,6 +15157,18 @@ paths: nullable: true full: type: boolean + pins: + type: object + description: Per tool, the users an admin pinned to one account (empty in local mode) + properties: + claude: + type: array + items: + $ref: '#/components/schemas/AccountPin' + codex: + type: array + items: + $ref: '#/components/schemas/AccountPin' codex: type: array description: The Codex account pool (server/lib/codex-pool.js), same fields plus `kind`; no expiry @@ -15241,6 +15269,62 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + /api/accounts/pins: + put: + tags: + - Auth + operationId: pinPoolAccount + summary: 'Admin: switch one user''s sessions of a tool to one pool account (`account: null` = automatic), with their own password again. A Claude login is written into their home at once; running panes take it without a restart' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tool + - userId + - currentPassword + properties: + tool: + type: string + enum: + - claude + - codex + userId: + type: integer + account: + type: string + nullable: true + currentPassword: + type: string + responses: + '200': + description: '`{pin: {userId, username, account}, switched}` — `account` null when unpinned; `switched`: switched | kept | own-login | expired | next-session | null' + '400': + description: EBADTOOL + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: EREAUTH — wrong password; EADMIN — not an admin; ELOCALMODE + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: ENOUSER, ENOACCOUNT + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '429': + description: ETOOMANY — too many wrong passwords + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' /api/accounts/profiles: get: tags: @@ -15250,6 +15334,67 @@ paths: responses: '200': description: '`{profiles: [{name, label, email, subscriptionType, active}]}`' + /api/accounts/{name}/users: + put: + tags: + - Auth + operationId: setPoolAccountUsers + summary: 'Admin: exactly these users run on this pool account (a user on another account moves here; one left out goes back to the balancer), with their own password again. A Claude login is written into each added user''s home at once' + parameters: + - name: name + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tool + - userIds + - currentPassword + properties: + tool: + type: string + enum: + - claude + - codex + userIds: + type: array + items: + type: integer + currentPassword: + type: string + responses: + '200': + description: '`{added: [{userId, username, switched}], removed: [{userId, username}]}` — `switched`: switched | kept | own-login | expired | next-session' + '400': + description: EBADTOOL, EBADUSER + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: EREAUTH — wrong password; EADMIN — not an admin; ELOCALMODE + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: ENOUSER, ENOACCOUNT + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '429': + description: ETOOMANY — too many wrong passwords + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' /api/accounts/{name}: delete: tags: diff --git a/package-lock.json b/package-lock.json index bacd86f0..ff03a11c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "agenthub", - "version": "2.8.10", + "version": "2.8.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "agenthub", - "version": "2.8.10", + "version": "2.8.11", "hasInstallScript": true, "license": "UNLICENSED", "dependencies": { diff --git a/package.json b/package.json index b679d355..a12577c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agenthub", - "version": "2.8.10", + "version": "2.8.11", "bin": { "agenthub": "bin/agenthub.js" },