byob-cli 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +7 -0
- package/.mcp.json +14 -0
- package/README.md +426 -0
- package/bin/byob.js +752 -0
- package/byob-logo.ascii +37 -0
- package/package.json +25 -0
- package/skills/byob_cli/CODEX_CORE.md +212 -0
- package/skills/byob_cli/SKILL.md +423 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byob_cli
|
|
3
|
+
description: Use BYOB CLI as the Codex connector for deployed/production BYOB projects, including OAuth approval, scoped project access, coding tools, deployment, billing, and safe remote editing.
|
|
4
|
+
aliases:
|
|
5
|
+
- byob
|
|
6
|
+
- byob mcp
|
|
7
|
+
- byob deployed mcp
|
|
8
|
+
- production byob_cli
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# BYOB CLI Skill
|
|
12
|
+
|
|
13
|
+
Use this when Codex connects to a BYOB-hosted project through BYOB CLI. Other MCP-capable coding agents can use the same bridge, but Codex is the first-class workflow. This skill is for production-like hosted BYOB projects, not local developer stack debugging or local repository editing.
|
|
14
|
+
|
|
15
|
+
Critical boundary: BYOB CLI tools operate on a remote BYOB project container selected by the approved BYOB agent token. They must not be used to inspect, edit, test, commit, or deploy the local filesystem/repository where Codex itself is running. For local files such as the current checkout, use Codex's normal local file and shell tools instead. Use BYOB CLI only when the user explicitly wants Codex to work inside a BYOB platform project, or when the active task clearly references a BYOB project id/context.
|
|
16
|
+
|
|
17
|
+
For substantial BYOB project coding work, also read `CODEX_CORE.md` from this skill directory. It is the Codex-specific platform contract for direct project editing: project context, tool routing, protected BYOB files, testing expectations, deployment/domain/analytics behavior, billing URL handling, and security boundaries. It is not the reusable UI/style guide.
|
|
18
|
+
|
|
19
|
+
BYOB projects include platform-managed content mixed into normal app files. Keep this protected-file instruction in context at session start or before the first project-file edit. This does not mean loading protected file contents by default. Preserve BYOB preview/editor/HMR connectors, platform script tags, injected placeholders, route indexes, LLM/agent helper files, env restore/sync glue, deployment scripts, and package/dev-server metadata unless the user explicitly asks to modify that platform behavior. When editing a protected file, change only the user-owned section needed for the task.
|
|
20
|
+
|
|
21
|
+
At the start of a BYOB coding session, and whenever switching projects, establish context with `_meta.byob_project`, resource `byob://project/<project_id>/context`, `byob_current_project_context`, or `byob context`. Tell the user the project name, project id, and preview URL before project-specific edits when the active project was not already clear.
|
|
22
|
+
|
|
23
|
+
After authentication, the installer downloads BYOB AIR coding skills into local Codex skill folders named with `byob_` prefixes. Use those synced `byob_*` skills for SvelteKit, Supabase, BYOB DB, UI quality, testing, SEO, PWA, payments, animations, image generation, and related implementation patterns. Pass `--no-air-skills` only if the user wants the MCP server and core platform skill without reusable coding skills.
|
|
24
|
+
|
|
25
|
+
Do not load `CODEX_CORE.md` for a simple account/status/payment-link lookup.
|
|
26
|
+
|
|
27
|
+
## Core Model
|
|
28
|
+
|
|
29
|
+
BYOB has two MCP surfaces:
|
|
30
|
+
|
|
31
|
+
- **Agent MCP**: hosted by AIR, user-facing, OAuth protected, safe for external coding agents.
|
|
32
|
+
- **Container MCP**: private per-project executor inside the running project container.
|
|
33
|
+
|
|
34
|
+
External agents connect only to **Agent MCP**. AIR validates the agent token, checks project scope, starts projects when needed, and proxies coding tools into the private container MCP.
|
|
35
|
+
|
|
36
|
+
Never ask users for raw `mcp_token`, `mcp_env_sec_token`, editor tokens, preview tokens, Git tokens, or service-role keys.
|
|
37
|
+
|
|
38
|
+
## Deployed OAuth Device Flow
|
|
39
|
+
|
|
40
|
+
Prefer the packaged helper when running from a user machine:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx -y byob-cli codex install --client-name "Codex"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This starts the device flow, waits for browser approval, and configures Codex MCP in one command.
|
|
47
|
+
It also installs this skill into `~/.agents/skills/byob_cli`; restart Codex or start a new session if the skill list was already open.
|
|
48
|
+
After authentication, the installer downloads BYOB AIR coding skills into local Codex skill folders named with `byob_` prefixes.
|
|
49
|
+
|
|
50
|
+
Refresh downloaded coding skills later without rerunning OAuth or changing MCP config:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx -y byob-cli codex sync-skills --project-id <project_id> --token <agent_access_token>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Equivalent raw PRIM flow:
|
|
57
|
+
|
|
58
|
+
1. Request a device code from PRIM:
|
|
59
|
+
|
|
60
|
+
```http
|
|
61
|
+
POST /oauth/device/code
|
|
62
|
+
Content-Type: application/json
|
|
63
|
+
|
|
64
|
+
{
|
|
65
|
+
"client_name": "Your agent name"
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
2. Show the user:
|
|
70
|
+
|
|
71
|
+
- `user_code`
|
|
72
|
+
- `verification_uri_complete`
|
|
73
|
+
|
|
74
|
+
3. User signs in through BYOB and approves selected projects.
|
|
75
|
+
|
|
76
|
+
4. Poll PRIM:
|
|
77
|
+
|
|
78
|
+
```http
|
|
79
|
+
POST /oauth/token
|
|
80
|
+
Content-Type: application/json
|
|
81
|
+
|
|
82
|
+
{
|
|
83
|
+
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
|
|
84
|
+
"device_code": "<device_code>"
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Handle:
|
|
89
|
+
|
|
90
|
+
- `authorization_pending`: poll again using the returned interval.
|
|
91
|
+
- `access_denied`: stop; user rejected the connection.
|
|
92
|
+
- `expired_token`: restart device flow.
|
|
93
|
+
- success: store `access_token` and `refresh_token` securely.
|
|
94
|
+
|
|
95
|
+
The grant can include multiple project ids. If the agent needs another project later, restart device flow and ask the user to approve that project too.
|
|
96
|
+
|
|
97
|
+
## Token Lifetime And Refresh
|
|
98
|
+
|
|
99
|
+
Access tokens are intentionally long enough for normal coding sessions. Refresh tokens are long lived and rotate on use.
|
|
100
|
+
|
|
101
|
+
When an MCP call returns token expiration, refresh:
|
|
102
|
+
|
|
103
|
+
```http
|
|
104
|
+
POST /oauth/token
|
|
105
|
+
Content-Type: application/json
|
|
106
|
+
|
|
107
|
+
{
|
|
108
|
+
"grant_type": "refresh_token",
|
|
109
|
+
"refresh_token": "<refresh_token>"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Replace both stored tokens from the response. Never print tokens in chat, logs, telemetry, errors, or screenshots.
|
|
114
|
+
|
|
115
|
+
## Agent MCP Endpoint
|
|
116
|
+
|
|
117
|
+
Connect to the deployed AIR broker:
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
/mcp/projects/<project_id>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Send:
|
|
124
|
+
|
|
125
|
+
```http
|
|
126
|
+
Authorization: Bearer <agent_access_token>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use JSON-RPC MCP methods:
|
|
130
|
+
|
|
131
|
+
- `initialize`
|
|
132
|
+
- `tools/list`
|
|
133
|
+
- `tools/call`
|
|
134
|
+
- `ping`
|
|
135
|
+
|
|
136
|
+
## Production URL Rules
|
|
137
|
+
|
|
138
|
+
In deployed BYOB, configure control-plane hosts explicitly:
|
|
139
|
+
|
|
140
|
+
- `BYOB_AIR_URL`: deployed AIR Agent MCP broker, always `https://air.api.byob.studio` in production.
|
|
141
|
+
- `--prim-url` / `BYOB_PRIM_URL`: deployed PRIM OAuth/token API, always `https://prim.api.byob.studio` in production.
|
|
142
|
+
|
|
143
|
+
The packaged helper defaults to those production hosts. Pass URL overrides only for local development or staging.
|
|
144
|
+
|
|
145
|
+
Never infer preview, editor, or deployment URLs from local ports or hostnames. Standard production project runtime URLs normally use these host patterns:
|
|
146
|
+
|
|
147
|
+
- Editor: `https://editor.<project_id>.api.byob.studio`
|
|
148
|
+
- Preview: `https://preview.<project_id>.api.byob.studio`
|
|
149
|
+
|
|
150
|
+
Use those patterns only as production shape guidance. Production project URLs are platform-generated and may differ by deployment, gateway, or custom-domain state. Read the actual URL from:
|
|
151
|
+
|
|
152
|
+
- `byob_current_project_context`
|
|
153
|
+
- `byob context`
|
|
154
|
+
- `_meta.byob_project`
|
|
155
|
+
- `byob_deployment_status` for deployment/canonical URLs
|
|
156
|
+
|
|
157
|
+
Treat `editor_url` as a session-sensitive link. Surface it only when the user or host UI needs it.
|
|
158
|
+
|
|
159
|
+
For local scripts, CI smoke checks, or agents that do not have a native MCP client yet, use the packaged helper instead of constructing JSON-RPC by hand:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
BYOB_AGENT_TOKEN=<agent_access_token> BYOB_PROJECT_ID=<project_id> \
|
|
163
|
+
byob tools
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Shortcut commands include `status`, `start`, `deploy`, `env-status`, `grants`, and `dns`.
|
|
167
|
+
|
|
168
|
+
Use `byob context` or MCP tool `byob_current_project_context` when Codex needs project name/id/status/preview/editor/deployment metadata. Host UIs can also render resource `byob://project/<project_id>/context` or `_meta.byob_project` outside model-visible text.
|
|
169
|
+
|
|
170
|
+
For MCP clients that use local stdio servers, configure the npm package in the standard `mcpServers` shape:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"mcpServers": {
|
|
175
|
+
"byob": {
|
|
176
|
+
"command": "npx",
|
|
177
|
+
"args": ["-y", "byob-cli", "mcp"],
|
|
178
|
+
"env": {
|
|
179
|
+
"BYOB_PROJECT_ID": "<project_id>",
|
|
180
|
+
"BYOB_AGENT_TOKEN": "<agent_access_token>"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
For multiple approved projects, prefer one named MCP server per project when the client UI supports multiple servers. This makes tool use less ambiguous and avoids relying on the model to pass `project_id` correctly:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"mcpServers": {
|
|
192
|
+
"byob-web": {
|
|
193
|
+
"command": "npx",
|
|
194
|
+
"args": ["-y", "byob-cli", "mcp"],
|
|
195
|
+
"env": {
|
|
196
|
+
"BYOB_PROJECT_ID": "<web_project_id>",
|
|
197
|
+
"BYOB_AGENT_TOKEN": "<agent_access_token>"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"byob-admin": {
|
|
201
|
+
"command": "npx",
|
|
202
|
+
"args": ["-y", "byob-cli", "mcp"],
|
|
203
|
+
"env": {
|
|
204
|
+
"BYOB_PROJECT_ID": "<admin_project_id>",
|
|
205
|
+
"BYOB_AGENT_TOKEN": "<agent_access_token>"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
If the client needs a single MCP entry, run `byob mcp --multi-project` with `BYOB_PROJECT_IDS`:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"mcpServers": {
|
|
217
|
+
"byob": {
|
|
218
|
+
"command": "npx",
|
|
219
|
+
"args": ["-y", "byob-cli", "mcp", "--multi-project"],
|
|
220
|
+
"env": {
|
|
221
|
+
"BYOB_PROJECT_IDS": "<project_id_1>,<project_id_2>",
|
|
222
|
+
"BYOB_CLI_MULTI_PROJECT": "1",
|
|
223
|
+
"BYOB_AGENT_TOKEN": "<agent_access_token>"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
In multi-project mode, every project-specific tool call should include `project_id` in `arguments`; otherwise the first configured project is the default. Project switching is explicit; the helper does not persist a mutable current project.
|
|
231
|
+
|
|
232
|
+
For project context in multi-project mode, call:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
byob context '{"project_id":"<project_id>"}'
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
or read resource URI `byob://project/<project_id>/context`.
|
|
239
|
+
|
|
240
|
+
## Tool Routing
|
|
241
|
+
|
|
242
|
+
BYOB helper tools are exposed through Agent MCP. AIR handles token/project-scope validation; PRIM owns project-management behavior such as start, deploy, analytics, and custom domains.
|
|
243
|
+
|
|
244
|
+
- `byob_list_projects`
|
|
245
|
+
- `byob_current_project_context`
|
|
246
|
+
- `byob_project_status`
|
|
247
|
+
- `byob_start_project`
|
|
248
|
+
- `byob_billing_status`
|
|
249
|
+
- `byob_payment_url`
|
|
250
|
+
- `byob_project_env_status`
|
|
251
|
+
- `byob_list_agent_grants`
|
|
252
|
+
- `byob_revoke_agent_grant`
|
|
253
|
+
- `byob_deploy_project`
|
|
254
|
+
- `byob_deployment_status`
|
|
255
|
+
- `byob_deployment_analytics`
|
|
256
|
+
- `byob_get_custom_domain`
|
|
257
|
+
- `byob_custom_domain_dns_instructions`
|
|
258
|
+
- `byob_set_custom_domain`
|
|
259
|
+
- `byob_delete_custom_domain`
|
|
260
|
+
- `byob_testing_browsers`
|
|
261
|
+
- `byob_browser_session_start`
|
|
262
|
+
- `byob_browser_action`
|
|
263
|
+
- `byob_browser_session_close`
|
|
264
|
+
|
|
265
|
+
Coding tools are proxied by AIR into the private project container MCP:
|
|
266
|
+
|
|
267
|
+
- file tree, read, search, edit, write, move, copy, delete
|
|
268
|
+
- Git status/diff operations exposed by the coding tool surface
|
|
269
|
+
- package add/remove
|
|
270
|
+
- preview, browser, and MCP logs
|
|
271
|
+
- database/environment helpers that BYOB exposes for that project
|
|
272
|
+
|
|
273
|
+
Do not assume `byob_*` tools exist inside the user container. They are platform tools and belong to Agent MCP only.
|
|
274
|
+
|
|
275
|
+
## Project Scope
|
|
276
|
+
|
|
277
|
+
The user approves specific projects during browser approval. The agent token can only access those project ids.
|
|
278
|
+
|
|
279
|
+
If a project was not selected:
|
|
280
|
+
|
|
281
|
+
1. Call `byob_list_projects`.
|
|
282
|
+
2. If the needed project is absent, ask the user to reconnect and approve it.
|
|
283
|
+
|
|
284
|
+
AIR rechecks BYOB access on every call. If access is revoked, stop using that project and ask the user to reconnect or update sharing.
|
|
285
|
+
|
|
286
|
+
For multiple projects:
|
|
287
|
+
|
|
288
|
+
- Use `byob_list_projects` or `byob projects` to discover approved ids.
|
|
289
|
+
- Prefer one MCP server entry per project for coding tasks.
|
|
290
|
+
- In multi-project mode, include `project_id` for `byob_*` project tools and coding tools.
|
|
291
|
+
- If a tool acts on the wrong project, stop and retry with explicit `project_id`.
|
|
292
|
+
|
|
293
|
+
## Project Context Display
|
|
294
|
+
|
|
295
|
+
Expose the current project context in host UI rather than chat text:
|
|
296
|
+
|
|
297
|
+
- Tool: `byob_current_project_context`.
|
|
298
|
+
- Resource: `byob://project/<project_id>/context`.
|
|
299
|
+
- CLI: `byob context`.
|
|
300
|
+
- Metadata: `_meta.byob_project` on initialize/tools/resource responses.
|
|
301
|
+
|
|
302
|
+
Codex reliably sees the tool and receives BYOB CLI MCP server instructions telling it to use the tool when context is needed. Resources and `_meta` are best for clients/hosts that render them out of band.
|
|
303
|
+
|
|
304
|
+
The payload includes project name, id, status, preview URL, editor URL, deployment URL, publish slug, and timestamps. Treat editor URLs as user/session-sensitive and do not log them casually.
|
|
305
|
+
|
|
306
|
+
## Startup And Readiness
|
|
307
|
+
|
|
308
|
+
If a project is stopped, AIR may auto-start it before running coding tools. Startup can be slow.
|
|
309
|
+
|
|
310
|
+
Recommended flow:
|
|
311
|
+
|
|
312
|
+
1. Call `byob_project_status`.
|
|
313
|
+
2. If stopped, call `byob_start_project` or let the first coding tool auto-start.
|
|
314
|
+
3. Retry coding tools only for transient startup/readiness errors.
|
|
315
|
+
4. Do not loop indefinitely. Surface persistent startup failures with the BYOB error message and payment URL if provided.
|
|
316
|
+
|
|
317
|
+
## Credits And Payment URLs
|
|
318
|
+
|
|
319
|
+
If credits block project startup or usage, Agent MCP returns a structured billing error and may include a `payment_url`.
|
|
320
|
+
|
|
321
|
+
Expected billing/startup errors:
|
|
322
|
+
|
|
323
|
+
- `INSUFFICIENT_CREDITS`
|
|
324
|
+
- `PROJECT_START_FAILED`
|
|
325
|
+
- `QUOTA_EXCEEDED`
|
|
326
|
+
|
|
327
|
+
Use:
|
|
328
|
+
|
|
329
|
+
- `byob_billing_status` to inspect balance/plan.
|
|
330
|
+
- `byob_payment_url` to generate a clickable BYOB billing link.
|
|
331
|
+
- CLI aliases: `byob billing` and `byob payment-url '{"topup":500}'`.
|
|
332
|
+
|
|
333
|
+
Surface BYOB payment URLs directly to the user. Do not create checkout links yourself, collect payment details, or ask for card data.
|
|
334
|
+
|
|
335
|
+
## Deployment
|
|
336
|
+
|
|
337
|
+
Use PRIM-owned deployment helpers through Agent MCP:
|
|
338
|
+
|
|
339
|
+
1. Call `byob_deployment_status`.
|
|
340
|
+
2. If the project is stopped, call `byob_start_project` or let `byob_deploy_project` start it if supported.
|
|
341
|
+
3. Verify coding tools and preview logs if deployment needs a fresh build.
|
|
342
|
+
4. Call `byob_deploy_project`.
|
|
343
|
+
5. Call `byob_deployment_status` again and surface `deployment_url` or `byob_url`.
|
|
344
|
+
|
|
345
|
+
Deployment failures may come from credits/quota, project startup, preview build export, Cloudflare Worker deploy, D1 bindings, or env bindings. Report the failing layer and the returned PRIM message.
|
|
346
|
+
|
|
347
|
+
Do not ask users for Cloudflare tokens or call Cloudflare directly. BYOB deployment credentials stay in PRIM/platform infrastructure.
|
|
348
|
+
|
|
349
|
+
## Custom Domains And Analytics
|
|
350
|
+
|
|
351
|
+
Custom-domain tools are PRIM-owned and feature-gated:
|
|
352
|
+
|
|
353
|
+
- `byob_get_custom_domain`: inspect current domain, SSL status, and DNS verification payload.
|
|
354
|
+
- `byob_set_custom_domain`: attach a hostname after the project is deployed.
|
|
355
|
+
- `byob_custom_domain_dns_instructions`: return exact DNS records and HTTP challenges to show the user.
|
|
356
|
+
- `byob_delete_custom_domain`: remove the current hostname.
|
|
357
|
+
|
|
358
|
+
If `byob_set_custom_domain` or `byob_custom_domain_dns_instructions` returns DNS records, show them exactly as returned. Do not invent CNAME/TXT values.
|
|
359
|
+
|
|
360
|
+
Use `byob_deployment_analytics` only after the project is deployed. If there is no publish slug yet, deploy first.
|
|
361
|
+
|
|
362
|
+
## Env And Grant Helpers
|
|
363
|
+
|
|
364
|
+
Use `byob_project_env_status` before deploy troubleshooting. It returns key names, value presence, public/client-only flags, and Worker binding eligibility without exposing secret values.
|
|
365
|
+
|
|
366
|
+
Use `byob_list_agent_grants` and `byob_revoke_agent_grant` for user-visible connection management. Revoking the current grant will invalidate the active agent session; after that, restart OAuth device flow.
|
|
367
|
+
|
|
368
|
+
## Codex-Driven Browser Testing
|
|
369
|
+
|
|
370
|
+
BYOB has two testing modes:
|
|
371
|
+
|
|
372
|
+
- BYOB app testing modal: internally driven by BYOB AIR's testing agent.
|
|
373
|
+
- Direct Codex checks: Codex can fetch or inspect the project preview URL directly when HTTP/page content checks are enough.
|
|
374
|
+
- Agent MCP browser tools: driven directly by Codex through the connected BYOB browser extension when real browser interaction is needed.
|
|
375
|
+
|
|
376
|
+
Prefer the cheapest sufficient testing path:
|
|
377
|
+
|
|
378
|
+
1. For basic smoke checks, fetch/read the `preview_url` directly with the available fetch/browser tools in the Codex environment.
|
|
379
|
+
2. Use project log tools such as `read_vite_preview_server_logs` and `read_browser_console_logs` for runtime errors already captured by BYOB.
|
|
380
|
+
3. Use BYOB browser-extension tools only when Codex needs live browser state: screenshots, clicks, typing, viewport checks, DOM evaluation in the real page, console logs from a fresh session, or network capture.
|
|
381
|
+
|
|
382
|
+
For Codex-driven testing, do not call `delegate_testing`; that is a BYOB chat UI tool and is not exposed through Agent MCP. Use:
|
|
383
|
+
|
|
384
|
+
1. `byob_testing_browsers` to find connected browser extension devices scoped to the approved user/project.
|
|
385
|
+
2. `byob_browser_session_start` to claim one browser and open the preview URL.
|
|
386
|
+
3. `byob_browser_action` for `navigate`, `screenshot`, `click`, `type`, `evaluate`, `wait_for_selector`, `resize_viewport`, `get_console_logs`, `start_network_capture`, `get_network_log`, and `clear_network_log`.
|
|
387
|
+
4. `byob_browser_session_close` when finished.
|
|
388
|
+
|
|
389
|
+
If no browser is connected, tell the user to install or open the BYOB Testing extension:
|
|
390
|
+
|
|
391
|
+
```text
|
|
392
|
+
https://chromewebstore.google.com/detail/byob-testing/ncnaebcfklfpcapminohoiekcemmaalj
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
When a task will need visual/browser testing and another long-running step is underway, such as image generation, package install, build, or deploy, tell the user early that installing the extension during that wait will let Codex test the preview afterward.
|
|
396
|
+
|
|
397
|
+
When testing UI changes, take screenshots for important states, inspect console logs, and report the preview URL with pass/fail findings.
|
|
398
|
+
|
|
399
|
+
## Editing And Verification
|
|
400
|
+
|
|
401
|
+
For code edits:
|
|
402
|
+
|
|
403
|
+
1. Read the file first.
|
|
404
|
+
2. Use `edit_file` for targeted changes or `write_file` for complete small-file rewrites.
|
|
405
|
+
3. Read the file back.
|
|
406
|
+
4. Verify with available tools, commonly:
|
|
407
|
+
- `execute_git_command ["diff", "--", "<path>"]`
|
|
408
|
+
- `execute_git_command ["status", "--short"]`
|
|
409
|
+
- preview/server log tools
|
|
410
|
+
- live preview fetch when the URL is available
|
|
411
|
+
5. After successful code changes, show the current preview URL to the user. Prefer the `preview_url` returned by the mutating tool response metadata or call `byob_current_project_context` if needed.
|
|
412
|
+
|
|
413
|
+
If no general shell tool is exposed, do not invent one. Use the tools returned by `tools/list`.
|
|
414
|
+
|
|
415
|
+
## Safety
|
|
416
|
+
|
|
417
|
+
- Never request or expose internal BYOB/container secrets.
|
|
418
|
+
- Never log bearer tokens.
|
|
419
|
+
- Never add BYOB platform helper tools to user containers.
|
|
420
|
+
- Keep user project changes scoped to the approved project.
|
|
421
|
+
- Use `byob_*` tools only for account/project/billing/deployment operations.
|
|
422
|
+
- Use coding tools only for project-local filesystem/runtime operations.
|
|
423
|
+
- On repeated connection/start failures, report the concrete failing layer: OAuth, AIR, PRIM, Conman/startup, Git/repo, runner MCP readiness, or coding tool execution.
|