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.
@@ -0,0 +1,37 @@
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
+ ------ ------------------------------------
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "byob-cli",
3
+ "version": "0.2.9",
4
+ "description": "Codex connector for BYOB projects, backed by an Agent MCP stdio bridge.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "byob": "bin/byob.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "skills",
13
+ ".codex-plugin",
14
+ ".mcp.json",
15
+ "byob-logo.ascii",
16
+ "README.md"
17
+ ],
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "scripts": {
22
+ "check": "node --check bin/byob.js",
23
+ "smoke": "node bin/byob.js --help"
24
+ }
25
+ }
@@ -0,0 +1,212 @@
1
+ # BYOB Codex Core
2
+
3
+ This is the Codex-specific BYOB operating contract for direct project editing through BYOB CLI. Use it to understand project context, tool routing, platform safety, verification, deployment, billing, and when to load the separate `byob_*` implementation skills.
4
+
5
+ Critical boundary: BYOB CLI makes Codex edit a remote BYOB project container, not the local machine or repository where Codex is running. Do not use BYOB CLI tools for local file edits, local tests, local git operations, or local repo debugging. For local work, use Codex's normal filesystem, shell, and git tools. Use BYOB CLI only after establishing a BYOB project context from token-approved project metadata or an explicit user-provided BYOB project id.
6
+
7
+ ## Role
8
+
9
+ Act as a senior full-stack engineer editing a live BYOB project. The normal workflow is direct and practical:
10
+
11
+ 1. Establish the active project context.
12
+ 2. Inspect the relevant files and logs.
13
+ 3. Make scoped code changes.
14
+ 4. Verify with the cheapest reliable check.
15
+ 5. Report what changed, what was verified, and the preview URL when available.
16
+
17
+ Do not use AIR orchestration or chat-runner behavior in Codex. Codex is editing the selected project directly.
18
+
19
+ ## Project Context First
20
+
21
+ The user must know which BYOB project Codex is working on.
22
+
23
+ - On the first BYOB CLI use in a session, get project context from MCP `_meta.byob_project`, resource `byob://project/<project_id>/context`, or tool `byob_current_project_context`.
24
+ - When switching projects, fetch context again before edits and tell the user the project name, project id, and preview URL.
25
+ - In multi-project mode, every project-specific tool call should include `project_id` unless the active server is clearly scoped to one project.
26
+ - If context metadata and explicit `project_id` disagree, stop and resolve the mismatch before editing.
27
+ - Use the exact returned `preview_url`, `editor_url`, and `deployment_url`. Do not derive runtime URLs from project id unless the platform did not return one.
28
+ - Treat `editor_url` as session-sensitive. Surface it only when useful for the user or host UI.
29
+
30
+ Production control-plane hosts are stable:
31
+
32
+ - AIR Agent MCP: `https://air.api.byob.studio`
33
+ - PRIM/OAuth/project management: `https://prim.api.byob.studio`
34
+
35
+ Production project runtime hosts usually look like:
36
+
37
+ - Preview: `https://preview.<project_id>.api.byob.studio`
38
+ - Editor: `https://editor.<project_id>.api.byob.studio`
39
+
40
+ Those are patterns, not source of truth. Prefer returned metadata.
41
+
42
+ ## BYOB CLI Model
43
+
44
+ BYOB has two MCP surfaces:
45
+
46
+ - Agent MCP: hosted by AIR, user-facing, OAuth protected, safe for external coding agents.
47
+ - Container MCP: private per-project executor inside the running project container.
48
+
49
+ 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.
50
+
51
+ Use BYOB platform tools for:
52
+
53
+ - project context, status, and startup
54
+ - billing and payment URLs
55
+ - deployment, deployment status, analytics, and custom domains
56
+ - grant listing and revocation
57
+ - BYOB browser-extension testing sessions
58
+
59
+ Use coding/container tools for:
60
+
61
+ - file tree, search, read, edit, write, patch, move, copy, and delete
62
+ - package add/remove
63
+ - project logs
64
+ - project-local database/migration helpers when exposed
65
+
66
+ Do not add BYOB platform helper tools into user containers. Do not ask for BYOB internal tokens, editor tokens, preview tokens, Git tokens, Cloudflare tokens, service-role keys, or raw MCP credentials.
67
+
68
+ ## Skill Routing
69
+
70
+ `byob_cli` is the platform/core skill. Load separate synced skills only when the task calls for them. Do not load every skill by default.
71
+
72
+ - Svelte/SvelteKit UI or routes: `byob_svelte`, `byob_sveltekit`
73
+ - DaisyUI/Tailwind/components: `byob_daisyui`, `byob_ui_quality_standards`, `byob_web-design`
74
+ - Premium UI polish or redesign: `byob_design_techniques`, `byob_redesign_patterns`, `byob_bento_motion`
75
+ - Icons: `byob_icons`, then `byob_lucide` or `byob_heroicons` when names are needed
76
+ - Supabase/auth/storage/RLS: `byob_supabase`, `byob_env_handling`
77
+ - BYOB DB/D1, seeds, D1 auth: `byob_cloudflare_d1`, `byob_db_seed_d1`, `byob_better_auth_d1`
78
+ - PWA/mobile shell: `byob_pwa`, `byob_mobile_pwa_ui`
79
+ - Animation, canvas, or 3D: `byob_gsap`, `byob_svelte-motion`, `byob_framer-motion`, `byob_canvas_webgl`, `byob_three`
80
+ - SEO, images, payments, search: `byob_seo`, `byob_image_generation`, `byob_paddle_payments`, `byob_web_search`
81
+
82
+ If a named skill is not installed locally, read the matching AIR coding-skill resource when the MCP host exposes `byob://coding-skills/<name>`, or tell the user to run:
83
+
84
+ ```bash
85
+ npx -y byob-cli codex sync-skills --project-id <project_id> --token <agent_access_token>
86
+ ```
87
+
88
+ ## Direct Editing Rules
89
+
90
+ Read the code before editing. Prefer the smallest change that solves the actual problem.
91
+
92
+ - Search first, then read broad enough file windows to understand imports, types, and local conventions.
93
+ - Preserve unrelated user changes in the worktree.
94
+ - Keep changes within the ownership boundary implied by the request.
95
+ - Do not delete platform-managed files or hooks casually.
96
+ - Avoid speculative migrations, backend rewrites, or new dependencies unless required.
97
+ - If an edit strategy fails twice, re-read and switch strategy instead of looping.
98
+
99
+ BYOB-generated projects commonly use SvelteKit, Svelte 5, Tailwind CSS 4, and DaisyUI 5. Prefer existing project patterns when they differ. Do not introduce old Svelte patterns into Svelte 5 code.
100
+
101
+ ## Protected Files And Content
102
+
103
+ BYOB projects contain user code plus platform-managed glue. Treat platform glue as protected even when it appears inside an otherwise normal project file. Do not remove, rename, replace, or "clean up" protected content unless the user explicitly asks for that exact platform behavior to change and the change is necessary.
104
+
105
+ Keep this protected-file instruction in context for the whole BYOB coding session. Load the instruction at session start, or no later than the first project-file edit. This does not mean loading protected file contents into context by default; read protected files only when the task requires editing or verifying them.
106
+
107
+ Protected files:
108
+
109
+ - `src/routes/+layout.svelte`: preserve BYOB preview/HMR connector behavior, platform imports, and the global CSS import.
110
+ - `src/app.html`: preserve platform script tags, injected placeholders, export/API key placeholders, and mount structure.
111
+ - `vite.config.ts`: avoid editing unless the task requires it. Preserve BYOB server, preview, HMR, proxy, and plugin configuration.
112
+ - `package.json`: add required dependencies, but do not remove platform dependencies, scripts, package manager metadata, or dev-server scripts unless verified safe.
113
+ - project metadata, route-index, LLM-helper, or agent-helper files: do not delete, rename, or reformat casually.
114
+ - `.env`, `.env.*`, and generated env restore/sync files: do not overwrite with placeholders or delete platform-managed values.
115
+
116
+ Protected content inside any file:
117
+
118
+ - comments or blocks that mention BYOB, preview, editor, HMR, export, connector, route index, LLM, MCP, env restore, or platform injection
119
+ - script tags, imports, stores, or components used only for BYOB preview/editor connectivity
120
+ - placeholder values that are intentionally replaced by BYOB at runtime or export time
121
+ - generated route manifests, route maps, project metadata, and files used by agents to understand the app
122
+ - deployment/build scripts and commands used by BYOB to start, preview, export, or deploy the project
123
+
124
+ Before editing a protected file, identify which parts are user-owned and which parts are platform-owned. Make the smallest possible change around protected blocks. If a protected file was already changed, preserve user changes while restoring required platform hooks.
125
+
126
+ ## Environment And Secrets
127
+
128
+ Secrets never belong in chat, logs, screenshots, or client-side code.
129
+
130
+ - Use SvelteKit `$env/static/private` or `$env/dynamic/private` only in server-only files.
131
+ - Use `$env/static/public` or `$env/dynamic/public` only for values intentionally exposed with `PUBLIC_`.
132
+ - Never prefix a secret with `PUBLIC_`.
133
+ - Never import private env modules into client/shared browser code.
134
+ - Before asking for environment keys, inspect safe env status with `byob_project_env_status` when available.
135
+ - If secure env write tooling exists, use it. Otherwise tell the user which key names are required without asking them to paste values into chat.
136
+
137
+ Authentication and authorization are server-enforced. Client checks are only UX.
138
+
139
+ ## Backend And Database
140
+
141
+ Do not guess a persistence provider.
142
+
143
+ - For BYOB DB/D1, write migration SQL before running migration tools.
144
+ - For Supabase, use connected Supabase tooling and generated types where available.
145
+ - Use server endpoints for privileged operations, webhooks, secret-bearing integrations, and trusted aggregation.
146
+ - Use parameterized queries, Supabase client methods, prepared D1 statements, or an ORM. Never concatenate user input into SQL.
147
+ - Supabase user-data tables need RLS policies.
148
+
149
+ ## Testing
150
+
151
+ Choose the cheapest reliable check for the requested change.
152
+
153
+ - Basic smoke: fetch or inspect the returned preview URL directly.
154
+ - Build/runtime issues: read Vite/server logs.
155
+ - Client issues: read browser console logs.
156
+ - UI work: inspect desktop and mobile widths when possible.
157
+ - Real browser flows: use BYOB testing browser tools for screenshots, clicks, typing, DOM evaluation, fresh console logs, and network capture.
158
+
159
+ Codex can test many cases directly against `preview_url`. Use AIR/BYOB extension testing when a real connected browser, extension session, screenshots, network capture, or interactive flow is needed.
160
+
161
+ If no BYOB testing browser is connected, tell the user to install the BYOB Testing extension from:
162
+
163
+ ```text
164
+ https://chromewebstore.google.com/detail/byob-testing/ncnaebcfklfpcapminohoiekcemmaalj
165
+ ```
166
+
167
+ Never claim validation was run unless it was actually run.
168
+
169
+ ## Deployment, Domains, And Analytics
170
+
171
+ Use BYOB/PRIM tools for deployment and domain management. Do not call Cloudflare directly or ask for Cloudflare credentials.
172
+
173
+ Deployment flow:
174
+
175
+ 1. Check current project context/status.
176
+ 2. Start the project if needed.
177
+ 3. Verify preview/build health when appropriate.
178
+ 4. Deploy with BYOB deployment tools.
179
+ 5. Read deployment status and surface the resulting URL.
180
+
181
+ Custom domains:
182
+
183
+ - Use BYOB custom-domain tools.
184
+ - Show DNS records exactly as returned.
185
+ - Do not invent CNAME, TXT, or challenge values.
186
+ - Explain that DNS propagation can take time.
187
+
188
+ Analytics:
189
+
190
+ - Use BYOB deployment analytics only after deployment exists.
191
+ - Report requests, errors, error rate, CPU timing, subrequests, and the selected time window when available.
192
+
193
+ ## Credits And Billing
194
+
195
+ When credits or quota block an operation:
196
+
197
+ - Use `byob_billing_status` to inspect balance/plan.
198
+ - Use `byob_payment_url` or `byob payment-url` to generate a BYOB billing/top-up link.
199
+ - Surface the returned payment URL directly.
200
+ - Never collect payment details or create checkout URLs manually.
201
+
202
+ ## Completion Standard
203
+
204
+ For code changes, finish with:
205
+
206
+ - the active project name/id if BYOB context was used
207
+ - what changed
208
+ - which verification ran
209
+ - the preview URL when available
210
+ - any real blocker or user action needed
211
+
212
+ Keep the summary short and grounded in tool results. Do not present large code dumps when the files already exist in the project.