Commit db31ddf
feat(deploy/persona-kit): cloud mode + relayfile watch personas (spec 03) (#130)
* feat(deploy/persona-kit): cloud mode + relayfile watch personas
Spec 03 workforce-side remaining work. Unstubs the cloud deploy mode so
proactive personas reach the cloud proactive-personas endpoint, and adds
the persona-kit surface (watch rules, mount.enabled, lint codes) that
makes those personas authorable.
- packages/deploy/src/modes/cloud/: replace the 1013-line stub
cloud.ts with a real launcher that routes proactive personas to
/api/v1/workspaces/:workspaceId/proactive-personas/:personaId.
- packages/deploy/src/{deploy,index,types,modes/input-values.test}.ts:
redirect cloud.js imports to cloud/index.js.
- packages/deploy/src/modes/cloud.test.ts: assert proactive personas
hit the proactive-personas endpoint exactly once and non-proactive
personas do not.
- packages/persona-kit/schemas/persona.schema.json: add WatchRule
definition and mount.enabled field.
- packages/persona-kit/src/{triggers,parse,plan,types,index}.ts +
matching .test.ts files: lint codes watch_path_not_absolute /
watch_empty_events, parse + plan the watch field, surface in
the public API.
- packages/persona-kit/src/__fixtures__/personas/proactive-watch-persona.json:
reference fixture for the new schema.
- examples/proactive-issue-resolver/: end-to-end example using a
watch-rule persona to react to relayfile changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(deploy/cloud): consolidate proactive personas onto /deployments
Per the v1-consolidation discussion on AgentWorkforce/cloud#912 (closed)
→ AgentWorkforce/cloud#919 (draft).
Previously the cloud launcher bifurcated on `isProactivePersona(persona)`:
proactive personas (persona.watch.length > 0) hit
/api/v1/workspaces/{ws}/proactive-personas/{id} with a body that
duplicated watch[] + mount{} as sibling fields, and used
deleteProactivePersona to tear down. Regular personas hit
/api/v1/workspaces/{ws}/deployments and used deleteAgent.
The v1 surface (agents + deployments) already handles
persona.watch via cloud's preparePersonaDeploy + the new
agents.watch_rules column (cloud#919). The parallel surface was
~90% redundant per the reviewer's stabilization-trail analysis.
Now every persona — proactive or not — flows through:
- POST /api/v1/workspaces/{ws}/deployments with the same body shape
the regular path always used. The persona's top-level watch[]
travels inside the persona object; cloud extracts and persists it
as watch_rules on the agents row.
- DELETE /api/v1/workspaces/{ws}/deployments/{agentId} via deleteAgent.
- The handleExistingPersona check now applies universally (was
previously skipped for proactive personas).
Removed:
- isProactivePersona, readPersonaWatch, readPersonaMount helpers
- proactivePersonasEndpoint URL builder
- deleteProactivePersona network helper
- Sibling `watch` + `mount` fields from the POST body (read from persona)
Tests:
- cloud.test.ts: the two proactive-specific tests now assert the
unified /deployments path (and that /proactive-personas is never
called). The "keeps non-proactive on deployments" test is unchanged.
The persona-kit watch / mount.enabled schema additions remain in this PR
unchanged — those are how authors *declare* the watch DSL, independent
of how the launcher routes it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: address proactive resolver review comments
---------
Co-authored-by: Ricky Schema Cascade <ricky@agent-relay.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 25c1a1f commit db31ddf
27 files changed
Lines changed: 6435 additions & 52 deletions
File tree
- examples
- proactive-issue-resolver
- specs
- packages
- deploy/src
- modes
- cloud
- persona-kit
- schemas
- src
- __fixtures__/personas
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
0 commit comments