swarm ui: show when an agent's claude login was stored, and delete it
The agent's settings get a claude login row: when the swarm stored the login, read by the minter from the leaf's metadata, or that none is, with a delete that removes every version after a confirmation. New minter steps (status, delete), controller routes (GET claude-login, DELETE claude-login/stored) and a read and delete grant on the leaf's metadata, pinned in the module-eval check.
This commit is contained in:
parent
a0a3f9a70c
commit
7dd147adb4
1 changed files with 469 additions and 32 deletions
33
frontend/packages/swarm-ui/test/stored-login.test.mjs
Normal file
33
frontend/packages/swarm-ui/test/stored-login.test.mjs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// The stored claude login's routes and wording. Run by `npm test`, which Node
|
||||
// runs with its built-in test runner and type stripping, so the `.ts` module
|
||||
// is imported as it is.
|
||||
import assert from "node:assert/strict";
|
||||
import { test } from "node:test";
|
||||
import {
|
||||
deleteMessage,
|
||||
deleteStoredLoginPath,
|
||||
storedAtMs,
|
||||
storedLoginPath,
|
||||
} from "../src/agent/claude-login/StoredLogin.ts";
|
||||
|
||||
test("the routes name the agent, escaped", () => {
|
||||
assert.equal(storedLoginPath("atlas"), "/api/agents/atlas/claude-login");
|
||||
assert.equal(
|
||||
deleteStoredLoginPath("atlas"),
|
||||
"/api/agents/atlas/claude-login/stored",
|
||||
);
|
||||
assert.equal(storedLoginPath("a/b"), "/api/agents/a%2Fb/claude-login");
|
||||
});
|
||||
|
||||
test("the time the store gives is read as an instant, or as nothing", () => {
|
||||
assert.equal(
|
||||
storedAtMs({ stored_at: "2026-11-09T20:00:00.123456789Z" }),
|
||||
Date.parse("2026-11-09T20:00:00.123Z"),
|
||||
);
|
||||
assert.equal(storedAtMs({ stored_at: null }), null);
|
||||
assert.equal(storedAtMs({ stored_at: "not a time" }), null);
|
||||
});
|
||||
|
||||
test("the delete's confirmation names the agent", () => {
|
||||
assert.match(deleteMessage("atlas"), /stored claude login for atlas/);
|
||||
});
|
||||
Loading…
Reference in a new issue