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
|
|
@ -50,6 +50,10 @@ pub enum Request {
|
|||
Code { agent: String, code: String },
|
||||
/// Stop the running login for `agent`, if any.
|
||||
Cancel { agent: String },
|
||||
/// Ask when `agent`'s stored login was written.
|
||||
Status { agent: String },
|
||||
/// Delete `agent`'s stored login, every version of it.
|
||||
Delete { agent: String },
|
||||
}
|
||||
|
||||
/// The minter's answer to one [`Request`].
|
||||
|
|
@ -64,6 +68,11 @@ pub enum Reply {
|
|||
Stored,
|
||||
/// The running login, if there was one, is stopped.
|
||||
Cancelled,
|
||||
/// When the agent's stored login was written, as the store spells the
|
||||
/// time (RFC 3339), or `None` when nothing is stored.
|
||||
Login { stored_at: Option<String> },
|
||||
/// The agent's stored login is gone, or was not there.
|
||||
Deleted,
|
||||
/// The step failed: why, with the last lines `claude` printed where it
|
||||
/// printed any.
|
||||
Failed { error: String },
|
||||
|
|
@ -98,6 +107,18 @@ mod tests {
|
|||
},
|
||||
json!({"step": "cancel", "agent": "atlas"}),
|
||||
),
|
||||
(
|
||||
Request::Status {
|
||||
agent: "atlas".to_owned(),
|
||||
},
|
||||
json!({"step": "status", "agent": "atlas"}),
|
||||
),
|
||||
(
|
||||
Request::Delete {
|
||||
agent: "atlas".to_owned(),
|
||||
},
|
||||
json!({"step": "delete", "agent": "atlas"}),
|
||||
),
|
||||
] {
|
||||
assert_eq!(serde_json::to_value(&req).expect("encodes"), wire);
|
||||
assert!(serde_json::from_value::<Request>(wire).expect("decodes") == req);
|
||||
|
|
@ -115,6 +136,17 @@ mod tests {
|
|||
),
|
||||
(Reply::Stored, json!({"state": "stored"})),
|
||||
(Reply::Cancelled, json!({"state": "cancelled"})),
|
||||
(
|
||||
Reply::Login {
|
||||
stored_at: Some("2026-11-09T20:00:00Z".to_owned()),
|
||||
},
|
||||
json!({"state": "login", "stored_at": "2026-11-09T20:00:00Z"}),
|
||||
),
|
||||
(
|
||||
Reply::Login { stored_at: None },
|
||||
json!({"state": "login", "stored_at": null}),
|
||||
),
|
||||
(Reply::Deleted, json!({"state": "deleted"})),
|
||||
(
|
||||
Reply::Failed {
|
||||
error: "e".to_owned(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue