Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions examples/recipes/cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,44 @@ out of recipe files and dry-run evidence.

## Available recipes

### `codex-agent-smoke.json`

Runs a headless Data Machine agent inside a disposable WordPress Playground
sandbox using the Codex provider. This is the smallest end-to-end recipe for
proving that WP Codebox can mount the agent runtime stack, overlay a
`php-ai-client` branch with provider-supplied request auth, activate a Codex
provider plugin branch, and execute `agents/chat` through `wp-codebox.agent-sandbox-run`.

**Replace** these recipe paths before running:

- `/path/to/agents-api`
- `/path/to/data-machine`
- `/path/to/data-machine-code`
- `/path/to/php-ai-client-pr-238-or-newer`
- `/path/to/ai-provider-for-openai-pr-28-or-newer`

Export Codex OAuth credentials in the shell that runs WP Codebox. Keep token
values out of recipe files and artifacts:

```bash
export AI_PROVIDER_OPENAI_CODEX_ACCESS_TOKEN="..."
export AI_PROVIDER_OPENAI_CODEX_REFRESH_TOKEN="..."
export AI_PROVIDER_OPENAI_CODEX_EXPIRES_AT="..."
export AI_PROVIDER_OPENAI_CODEX_ACCOUNT_ID="..."
export AI_PROVIDER_OPENAI_CODEX_FEDRAMP="false"

npm run wp-codebox -- recipe-run \
--recipe ./examples/recipes/cookbook/codex-agent-smoke.json \
--json
```

The expected successful response is a JSON recipe run whose agent runtime
reports the Playground site title and active theme. Fleet runners such as
Homeboy should generate one recipe/run per task and own queueing,
concurrency, retry policy, durable run records, and PR/comment workflows above
WP Codebox. WP Codebox owns the sandbox, mounts, overlays, agent invocation,
and artifact bundle.

### `multisite-network.json`

Converts the Playground install to multisite with WP-CLI, mounts your plugin
Expand Down
78 changes: 78 additions & 0 deletions examples/recipes/cookbook/codex-agent-smoke.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"schema": "wp-codebox/workspace-recipe/v1",
"runtime": {
"backend": "wordpress-playground",
"name": "codex-agent-smoke",
"wp": "trunk",
"blueprint": {
"steps": []
},
"overlays": [
{
"kind": "bundled-library",
"library": "php-ai-client",
"source": "/path/to/php-ai-client-pr-238-or-newer",
"target": "/wordpress/wp-includes/php-ai-client",
"strategy": "wordpress-scoped-bundle",
"metadata": {
"component": "php-ai-client",
"purpose": "provider-supplied request authentication"
}
}
]
},
"inputs": {
"extraPlugins": [
{
"source": "/path/to/agents-api",
"slug": "agents-api",
"activate": true
},
{
"source": "/path/to/data-machine",
"slug": "data-machine",
"activate": true
},
{
"source": "/path/to/data-machine-code",
"slug": "data-machine-code",
"activate": true
},
{
"source": "/path/to/ai-provider-for-openai-pr-28-or-newer",
"slug": "ai-provider-for-openai",
"activate": false
}
],
"secretEnv": [
"AI_PROVIDER_OPENAI_CODEX_ACCESS_TOKEN",
"AI_PROVIDER_OPENAI_CODEX_REFRESH_TOKEN",
"AI_PROVIDER_OPENAI_CODEX_EXPIRES_AT",
"AI_PROVIDER_OPENAI_CODEX_ACCOUNT_ID",
"AI_PROVIDER_OPENAI_CODEX_FEDRAMP"
]
},
"workflow": {
"steps": [
{
"command": "wp-codebox.agent-sandbox-run",
"args": [
"task=Run a minimal headless WP Codebox smoke. Inspect the WordPress runtime, report the site title and active theme, and do not modify files.",
"agent=wp-codebox-sandbox",
"mode=default",
"provider=codex",
"model=gpt-5.5",
"provider-plugin-slugs=ai-provider-for-openai",
"max-turns=1",
"timeout-seconds=300"
]
}
]
},
"artifacts": {
"directory": "./artifacts/codex-agent-smoke",
"verify": {
"enabled": true
}
}
}