From 9440ceddbdbb090e2a609e018192640a26b9c8ff Mon Sep 17 00:00:00 2001 From: bordumb Date: Thu, 23 Jul 2026 13:27:50 +0100 Subject: [PATCH 01/37] feat(cli): implement single-command agent provisioning and autostash ergonomics Auths-Id: did:keri:EB5cPHY0t-ejNC_rUzPS1dclTvd6kG-R9mQzjozCuGgd Auths-Device: did:keri:EGXg8l62pI8_ig0JiIHMkKyGKbJHdWMpIhb0W0niK86y Auths-Anchor-Seq: 70 Auths-Scope: sign_commit --- Cargo.lock | 2 + crates/auths-cli/Cargo.toml | 1 + crates/auths-cli/src/commands/agent/mod.rs | 234 ++++++++++++++- crates/auths-cli/src/commands/sign.rs | 39 ++- .../auths-mcp-server/tests/cases/helpers.rs | 17 +- crates/auths-sdk/Cargo.toml | 1 + .../src/domains/agents/delegation.rs | 2 +- .../src/workflows/agent_provision.rs | 267 ++++++++++++++++++ crates/auths-sdk/src/workflows/mod.rs | 2 + 9 files changed, 540 insertions(+), 25 deletions(-) create mode 100644 crates/auths-sdk/src/workflows/agent_provision.rs diff --git a/Cargo.lock b/Cargo.lock index 6e53b6f49..2f88049e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -382,6 +382,7 @@ dependencies = [ "anyhow", "assert_cmd", "auths-anchor", + "auths-core", "auths-crypto", "auths-index", "auths-infra-git", @@ -1010,6 +1011,7 @@ dependencies = [ name = "auths-sdk" version = "0.1.16" dependencies = [ + "anyhow", "async-trait", "auths-anchor", "auths-core", diff --git a/crates/auths-cli/Cargo.toml b/crates/auths-cli/Cargo.toml index 139c5534b..e364b64dc 100644 --- a/crates/auths-cli/Cargo.toml +++ b/crates/auths-cli/Cargo.toml @@ -39,6 +39,7 @@ gethostname = "1.1.0" glob.workspace = true auths-policy.workspace = true auths-index.workspace = true +auths-core.workspace = true auths-crypto.workspace = true auths-sdk = { workspace = true, features = ["backend-git", "witness-server", "witness-client", "indexed-storage", "keychain-secure-enclave"] } auths-transparency = { workspace = true, features = ["native"] } diff --git a/crates/auths-cli/src/commands/agent/mod.rs b/crates/auths-cli/src/commands/agent/mod.rs index 91d23cd92..ddf4a6e1c 100644 --- a/crates/auths-cli/src/commands/agent/mod.rs +++ b/crates/auths-cli/src/commands/agent/mod.rs @@ -93,6 +93,68 @@ pub enum AgentSubcommand { /// Uninstall the system service UninstallService, + + /// Provision a new delegated headless agent in a single command + Provision { + /// Human-readable label / key alias for the new agent + #[arg(short, long, help = "Label / key alias for the new agent")] + label: String, + + /// Delegator signing key alias (defaults to "main") + #[arg(long, default_value = "main", help = "Your root identity's signing key name")] + key: String, + + /// Capability granted to the agent (repeatable) + #[arg(long = "scope", help = "Capability granted to the agent")] + scope: Vec, + + /// Expiration duration in seconds (e.g. 2592000 for 30 days) + #[arg(long = "expires-in", help = "Expiration duration in seconds")] + expires_in: Option, + + /// Destination directory for agent environment workspace (defaults to ~/.auths-agents/