Adopt users activate with --yes gate and --dry-run preview

seal-use users activate <userId> shipped in v0.4.0 as scaffolding for
the automated delegation flow but never made it onto the documented
surface, while sealUserActivate stayed reachable through the MCP write
gateway — an undocumented, ungated mutation. Adopt it:

- Document in the help registry (users area).
- Require --yes like its siblings delete/reset-password (CLI layer
  only; the MCP capability call path is unchanged).
- Wire the --dry-run preview already supported by the capability.
- Cover the gate and the preview in users.test.ts and
  dry-run-gates.test.ts.
This commit is contained in:
gitea committed 2026-10-25 00:56:23 +08:00
1 parent c05b0dc459
commit d5725e12d1
5 files changed
+50 -2

No files matched your search

+10 -2
View File
@@ -74,8 +74,16 @@ export async function handleUsersCommand(
if (action === "activate") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw usageError("Usage: seal-use users activate <userId>");
await runCapability("sealUserActivate", client, corp, { userId }, outputOptions(args.options));
if (!userId) throw usageError("Usage: seal-use users activate <userId> [--dry-run] --yes");
const confirmed = booleanOption(args.options.yes) === true || booleanOption(args.options.confirm) === true;
const dryRun = dryRunOption(args);
if (!confirmed && !dryRun) {
throw confirmationRequired(
`Refusing to activate user '${userId}' without --yes.`,
`seal-use users activate ${userId} --corp ${corp.id} --yes`
);
}
await runCapability("sealUserActivate", client, corp, { userId, dryRun }, outputOptions(args.options));
return;
}