deploy: print the app-trigger URL after a cloud deploy

Merged
KH
2mo ago
+99-0

An agent can be woken from outside by POSTing to its deployment trigger endpoint — that is how a customer's own product hands it work. But the URL is advertised nowhere the deploying user looks, so wiring an app to an agent has been starting with someone being told the shape by hand.

Deploy is the moment someone is actually wiring the agent up, so it is the moment the URL is worth knowing.

launched: cloud/b3aea7ae-2425-4d32-b51b-3a1c1ba15360
trigger from your app: POST https://…/api/v1/workspaces/<ws>/deployments/app-signal/trigger
  auth: Bearer <deployment API token>  (dashboard → Workspace → Deployment API tokens)
  body: any JSON object; it reaches the handler as the event payload

Uses the persona id (the deployed name) rather than handle.id. Names are unique per workspace among live agents and survive a destroy/redeploy, while the uuid does not — so the name is what an app should hard-code. Anyone who guesses and uses the uuid gets something that works right up until the next redeploy.

Cloud mode only, and only when the cloud URL and workspace are both known — otherwise the line is skipped rather than printed half-formed.

Typecheck clean; packages/deploy tests 250/250.

Related

  • cloud#3025 — makes the endpoint accept a JSON payload and the agent's name (passing a name previously returned a 500, because agents.id is a uuid column). It also adds the same URL to the agent's dashboard page, so the two surfaces agree.

This PR stands alone: the printed URL is correct today for uuid-addressed callers and becomes correct for name-addressed ones when cloud#3025 ships. Worth merging cloud first so the printed line works verbatim on arrival.

🤖 Generated with Claude Code