Commit 220dfd2
feat: implement Rozenite as a built-in plugin (#29)
Closes #27
## Summary
Implements the Rozenite plugin on top of the generic plugin system from
#26. The plugin lets `agent-cdp` interoperate with Rozenite's React
Native agent tooling without leaking any Rozenite-specific details into
the core daemon or CLI.
### Rozenite plugin
- Lives entirely under `packages/agent-cdp/src/plugins/rozenite/*` —
core code is unaware of Fusebox globals, Rozenite domains, or tool
registry internals
- Activates only for React Native targets; fails cleanly on unsupported
targets
- On target selection, bootstraps a CDP bridge: calls `Runtime.enable`,
polls for `__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__`, reads the dynamic
`BINDING_NAME`, registers it via `Runtime.addBinding`, initialises the
`rozenite` domain, and sends `agent-session-ready`
- Tools are discovered dynamically from `register-tool` /
`unregister-tool` binding events and held in an in-memory registry
- Tool calls are dispatched by evaluating
`__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.sendMessage` and correlated with
`tool-result` binding events via a `callId`
- Exposes a fixed CLI surface: `rozenite status`, `rozenite tools`,
`rozenite tool-schema <name>`, `rozenite call <name> [--input JSON]`
### Playground integration
- Adds `@rozenite/metro` (dev) and `@rozenite/agent-bridge` to the
playground
- `metro.config.js` wraps the Expo Metro config with `withRozenite`
(opt-in via `WITH_ROZENITE=true`)
- `useRozeniteBridge` hook registers three test tools (`app.echo`,
`app.getTimestamp`, `app.getPlaygroundInfo`) for end-to-end testing
## Testing
```sh
# start Metro with Rozenite enabled
cd playground && WITH_ROZENITE=true pnpm start
# run the app, then:
node packages/agent-cdp/dist/bin.js start
node packages/agent-cdp/dist/bin.js target list
node packages/agent-cdp/dist/bin.js target select <id>
node packages/agent-cdp/dist/bin.js rozenite status # state: ready, toolCount: 3
node packages/agent-cdp/dist/bin.js rozenite tools
node packages/agent-cdp/dist/bin.js rozenite call app.echo --input '{"text":"hello"}'
```
---------
Co-authored-by: Szymon Chmal <szymon@chmal.it>1 parent 369c674 commit 220dfd2
18 files changed
Lines changed: 1528 additions & 7 deletions
File tree
- packages/agent-cdp
- skills
- src
- __tests__
- cli
- plugins/rozenite
- playground
- src
- app
- hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| |||
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
101 | 115 | | |
102 | 116 | | |
103 | 117 | | |
| |||
| 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 | + | |
0 commit comments