Skip to content

Commit 2a1aa7c

Browse files
committed
feat: add native demo recorder workflow
1 parent 1db0e80 commit 2a1aa7c

8 files changed

Lines changed: 1566 additions & 0 deletions

bin/demo-recorder.mjs

Lines changed: 528 additions & 0 deletions
Large diffs are not rendered by default.

docs/atomic-demo.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ wp post create --post_type=page --post_status=publish --post_title='Support FAQ'
9898
7. Open openclaWP -> Chat and use one generated demo prompt as the customer scenario.
9999
8. Close with the production checklist: configure connectors, index KB sources, review approval policy, then register the generated agent/workflow.
100100

101+
## Recording The Demo
102+
103+
openclaWP can generate the storyboard and trigger a local recorder through:
104+
105+
- `openclawp/create-demo-recording-plan`
106+
- `openclawp/record-demo-video`
107+
- workflow `openclawp/record-agency-demo`
108+
109+
Run the recorder from your laptop or CI worker, not inside Atomic:
110+
111+
```bash
112+
node bin/demo-recorder.mjs --port=8765
113+
```
114+
115+
The plan includes captions and a narration script. On macOS, the recorder can
116+
use `say` for voice-over and `ffmpeg` to produce an MP4 with audio. See
117+
`docs/demo-recorder.md`.
118+
101119
## Good Demo Defaults
102120

103121
For a lead-generation agency demo:

docs/demo-recorder.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Demo Recorder
2+
3+
openclaWP can now generate a demo recording plan from inside WordPress and hand
4+
that plan to a local recorder service. The browser/video/audio work stays
5+
outside WordPress, which keeps Atomic installs safe.
6+
7+
## What It Demonstrates
8+
9+
- An existing WordPress site becomes the starting point.
10+
- openclaWP audits the site for agency automation opportunities.
11+
- The Agency page generates a client-specific automation package.
12+
- The Chat page proves live tool calling against WordPress.
13+
- The generated plan includes captions and a voice-over script.
14+
- A local Playwright recorder can synthesize voice-over with the macOS `say`
15+
command and mux it with `ffmpeg` when available.
16+
17+
## Abilities
18+
19+
- `openclawp/create-demo-recording-plan`
20+
- Builds the storyboard, browser steps, captions, narration, viewport, and
21+
output naming.
22+
- `openclawp/record-demo-video`
23+
- Sends a plan to a recorder endpoint such as
24+
`http://127.0.0.1:8765/record`.
25+
- This ability is tagged as `external`, so normal tool confirmation policy
26+
can gate it.
27+
28+
The bundled workflow is `openclawp/record-agency-demo`.
29+
30+
## Local Recorder
31+
32+
Start the local recorder from the repo:
33+
34+
```bash
35+
node bin/demo-recorder.mjs --port=8765
36+
```
37+
38+
Then run the WordPress ability or workflow with:
39+
40+
```php
41+
wp_get_ability( 'openclawp/record-demo-video' )->execute(
42+
array(
43+
'endpoint' => 'http://127.0.0.1:8765/record',
44+
'site_url' => 'http://localhost:8894/',
45+
'login_url' => 'http://localhost:8894/studio-auto-login?redirect_to=%2Fwp-admin%2F',
46+
'client_name' => 'Northstar Clinic',
47+
'industry' => 'clinic',
48+
'blueprint' => 'booking-agent',
49+
'voice' => array(
50+
'enabled' => true,
51+
'mode' => 'auto',
52+
),
53+
)
54+
);
55+
```
56+
57+
The recorder writes artifacts to `OPENCLAWP_DEMO_OUT_DIR` when set, otherwise
58+
to the OS temp directory under `openclawp-demo-artifacts`.
59+
60+
## Atomic Demo Shape
61+
62+
On Atomic, use openclaWP to create the plan. The video recorder should still
63+
run from your laptop or CI worker and browse the Atomic site remotely. Do not
64+
try to install Playwright, Chromium, `ffmpeg`, or a TTS stack inside the
65+
WordPress runtime.
66+
67+
If Atomic cannot reach your laptop recorder endpoint, run the local recorder
68+
with a saved plan instead:
69+
70+
```bash
71+
node bin/demo-recorder.mjs --plan=/path/to/openclawp-plan.json
72+
```
73+
74+
## Voice Behavior
75+
76+
Voice is best-effort:
77+
78+
- `voice.enabled=true` asks the recorder to create narration.
79+
- `voice.mode=script-only` writes only the narration script.
80+
- `voice.mode=auto` tries local TTS and falls back to script-only.
81+
- On macOS, `say` creates the audio file.
82+
- If `ffmpeg` exists, the recorder also creates an MP4 with audio.

includes/class-openclawp-agency-generator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,13 @@ private static function build_demo( array $workspace, array $blueprint, array $a
362362
'Show the internal summary and handoff plan.',
363363
'Show required connectors and approvals before production.',
364364
),
365+
'recording' => array(
366+
'workflow' => OpenclaWP_Demo_Recorder::WORKFLOW_ID,
367+
'plan_ability' => OpenclaWP_Demo_Recorder::CREATE_PLAN_ABILITY,
368+
'record_ability' => OpenclaWP_Demo_Recorder::RECORD_VIDEO_ABILITY,
369+
'voice_over_enabled' => true,
370+
'local_recorder_mode' => 'http-endpoint',
371+
),
365372
'success_criteria' => (array) ( $blueprint['success_metrics'] ?? array() ),
366373
'answers_used' => array_keys( $answers ),
367374
);

includes/class-openclawp-bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static function init(): void {
4545
OpenclaWP_Abilities::register();
4646
OpenclaWP_Content_Abilities::register();
4747
OpenclaWP_Agency_Abilities::register();
48+
OpenclaWP_Demo_Recorder::register();
4849
OpenclaWP_Mcp_Client_Bridge::register();
4950
OpenclaWP_Custom_Tools_Registrar::register();
5051
OpenclaWP_Knowledge_Base_Search::register();

0 commit comments

Comments
 (0)