feat(cli): deploy a persona by id, not just by path

Draft
WI
1mo ago
+134-7

agentworkforce deploy <persona-id> resolves through the registry cascade, so an agent kept in .agentworkforce/workforce/agents/<name>/ deploys by name from anywhere in the repo. Completes the loop opened by #316, which made those agents discoverable to list/show/agent but left deploy path-only.

$ agentworkforce deploy proposal-agent --dry-run        # in ../sales
workforce deploy → .../agents/proposal-agent/persona.json
persona proposal-agent: 1 integration(s), 1 schedule(s)
ok: proposal-agent (dry-run)

Which selectors are paths

Syntax decides, never the filesystem. A path separator, a leading .///~, or a persona-source extension means a path; anything else is an id. Probing disk instead would let a bare proposal-agent mean the persona in one directory and a same-named folder in another — the same command doing different things depending on where it ran.

Handler resolution is unaffected: onEvent resolves against the persona file's directory, and a compiled persona.json sits in the same agent directory as agent.ts, so an id-resolved deploy bundles exactly what a path-resolved one does.

Errors

A built-in id resolves but has no file to deploy, and says so:

deploy: persona "persona-maker" resolves to the built-in catalog, which has no
file to deploy. Pass a path to a persona.json or persona.ts instead.

An unknown id lists what is available, from the registry:

deploy: Unknown persona "no-such-agent". Known personas: customer-dev,
persona-improver, persona-maker, proposal-agent

Verification

Exercised against the real ../sales checkout: bare id, explicit persona.ts path (unchanged), unknown id, and built-in id. deploy-command and local-personas suites pass locally (74). cli.test.ts spawns subprocesses and is being OOM-killed on this machine, so it is left to CI.

Semver: minor — new selector form, no change to existing path behavior.

šŸ¤– Generated with Claude Code