byob-cli 0.2.11 → 0.2.12

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "byob-cli",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Codex connector for BYOB projects, backed by Agent MCP with project context, deployment helpers, and coding tools.",
5
5
  "skills": "./skills/byob_cli/",
6
6
  "mcpServers": "./.mcp.json"
package/README.md CHANGED
@@ -30,7 +30,7 @@ Refresh synced coding skills later without rerunning OAuth or changing MCP confi
30
30
  npx -y byob-cli codex sync-skills --project-id <project_id> --token <agent_access_token>
31
31
  ```
32
32
 
33
- For Local Codex billed project editing, the BYOB Agent MCP opens the project container as the active Codex workspace. It is powered by `codex ssh-proxy`:
33
+ For Local Codex billed project editing, the BYOB Agent MCP returns a workspace handle that the Codex host opens as the active Codex workspace. The host uses `codex ssh-proxy` behind that handle:
34
34
 
35
35
  ```bash
36
36
  npx -y byob-cli@latest codex ssh-proxy '{"ssh_endpoint":"wss://..."}'
@@ -206,8 +206,8 @@ npx -y byob-cli codex sync-skills --project-id <project_id> --token <agent_acces
206
206
  When a user chooses **Local Codex billed**, open the BYOB project as the active Codex workspace from the start of the edit session:
207
207
 
208
208
  1. Call `byob_codex_status` for the selected project.
209
- 2. If `Local Codex billed` is available, call `byob_codex_connection_create` with `connection_type: "ssh_gateway"`.
210
- 3. Hand the returned workspace metadata to the Codex host so `/home/workspace/app_data` becomes the active workspace.
209
+ 2. If `Local Codex billed` is available, call `byob_codex_connection_create` with `mode: "local_codex_billed"`.
210
+ 3. Hand the returned `workspace_handle` to the Codex host so `/home/workspace/app_data` becomes the active workspace.
211
211
  4. Keep tokens, private keys, and complete proxy commands out of chat.
212
212
  5. Use Codex's normal file, shell, and git workflow inside that active workspace.
213
213
 
package/bin/byob.js CHANGED
@@ -60,6 +60,25 @@ Options:
60
60
  `;
61
61
  }
62
62
 
63
+ function codexUsage() {
64
+ return `BYOB Codex Commands
65
+
66
+ Usage:
67
+ byob codex install
68
+ byob codex sync-skills
69
+ byob codex ssh-proxy [json_args]
70
+
71
+ Commands:
72
+ install Authorize BYOB, configure Codex MCP, and install BYOB skills.
73
+ sync-skills Refresh BYOB AIR coding skills for an approved project.
74
+ ssh-proxy Bridge OpenSSH stdio to a BYOB Local Codex billed workspace.
75
+
76
+ Local Codex billed workspaces are normally opened by the Codex host from the
77
+ workspace handle returned by BYOB Agent MCP. Agents should not print or manually
78
+ handle raw SSH tokens, private keys, or complete proxy commands.
79
+ `;
80
+ }
81
+
63
82
  function parseArgs(argv) {
64
83
  const opts = {
65
84
  airUrl: DEFAULT_AIR_URL,
@@ -200,15 +219,23 @@ function publicPreviewUrl(projectId) {
200
219
  return id ? `https://preview.${id}.api.byob.studio` : "";
201
220
  }
202
221
 
203
- function sanitizePreviewUrls(value, projectIdHint = "", { sanitizeText = false } = {}) {
222
+ function sanitizePreviewUrls(
223
+ value,
224
+ projectIdHint = "",
225
+ { sanitizeText = false, redactPrivateMeta = false } = {},
226
+ ) {
204
227
  if (Array.isArray(value)) {
205
- return value.map((item) => sanitizePreviewUrls(item, projectIdHint, { sanitizeText }));
228
+ return value.map((item) => sanitizePreviewUrls(item, projectIdHint, { sanitizeText, redactPrivateMeta }));
206
229
  }
207
230
  if (!value || typeof value !== "object") {
208
231
  if (sanitizeText && typeof value === "string") {
209
232
  try {
210
233
  const parsed = JSON.parse(value);
211
- return JSON.stringify(sanitizePreviewUrls(parsed, projectIdHint, { sanitizeText }), null, 2);
234
+ return JSON.stringify(
235
+ sanitizePreviewUrls(parsed, projectIdHint, { sanitizeText, redactPrivateMeta }),
236
+ null,
237
+ 2,
238
+ );
212
239
  } catch {
213
240
  return value;
214
241
  }
@@ -219,19 +246,42 @@ function sanitizePreviewUrls(value, projectIdHint = "", { sanitizeText = false }
219
246
  const localProjectId = value.project_id || value.id || projectIdHint;
220
247
  const sanitized = {};
221
248
  for (const [key, item] of Object.entries(value)) {
249
+ if (
250
+ redactPrivateMeta &&
251
+ key === "_meta" &&
252
+ item &&
253
+ typeof item === "object" &&
254
+ item.byob_local_codex_workspace
255
+ ) {
256
+ sanitized[key] = {
257
+ ...item,
258
+ byob_local_codex_workspace: {
259
+ ...item.byob_local_codex_workspace,
260
+ ssh: {
261
+ redacted: true,
262
+ reason: "Use the workspace_handle with a Codex host; direct CLI display omits raw SSH material.",
263
+ },
264
+ },
265
+ };
266
+ continue;
267
+ }
222
268
  if (key === "preview_url") {
223
269
  sanitized[key] = publicPreviewUrl(localProjectId) || item;
224
270
  continue;
225
271
  }
226
272
  sanitized[key] = sanitizePreviewUrls(item, localProjectId, {
227
273
  sanitizeText: sanitizeText && key === "text",
274
+ redactPrivateMeta,
228
275
  });
229
276
  }
230
277
  return sanitized;
231
278
  }
232
279
 
233
280
  function printJson(payload, projectIdHint = "", sanitizeText = false) {
234
- const safePayload = sanitizePreviewUrls(payload, projectIdHint, { sanitizeText });
281
+ const safePayload = sanitizePreviewUrls(payload, projectIdHint, {
282
+ sanitizeText,
283
+ redactPrivateMeta: true,
284
+ });
235
285
  process.stdout.write(`${JSON.stringify(safePayload, null, 2)}\n`);
236
286
  }
237
287
 
@@ -922,9 +972,14 @@ async function main() {
922
972
  }
923
973
 
924
974
  if (command === "mcp") return serve(opts);
975
+ if (command === "codex" && (!first || first === "help")) {
976
+ process.stdout.write(codexUsage());
977
+ return;
978
+ }
925
979
  if (command === "codex" && first === "install") return codexInstall(opts);
926
980
  if (command === "codex" && first === "sync-skills") return codexSyncSkills(opts);
927
981
  if (command === "codex" && first === "ssh-proxy") return codexSshProxy(opts, second);
982
+ if (command === "codex") throw new Error(`Unknown codex command: ${first || ""}`);
928
983
  if (command === "config") return config(opts);
929
984
  if (command === "device-code") return deviceCode(opts);
930
985
  if (command === "token") return token(opts, first);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "byob-cli",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Codex connector for BYOB projects, backed by an Agent MCP stdio bridge.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -72,10 +72,10 @@ When the user selects **Local Codex billed**, open the BYOB project as the activ
72
72
  1. Establish active project context.
73
73
  2. Ensure the project is started and remote editing is available.
74
74
  3. Call `byob_codex_status`.
75
- 4. Create a Local Codex billed connection with `byob_codex_connection_create`.
76
- 5. Use the returned Local Codex billed workspace details through `byob-cli@latest`'s `codex ssh-proxy`.
75
+ 4. Create a Local Codex billed connection with `byob_codex_connection_create` using `mode: "local_codex_billed"`.
76
+ 5. Hand the returned Local Codex billed `workspace_handle` to the Codex host; the host uses `byob-cli@latest`'s `codex ssh-proxy` behind that handle.
77
77
 
78
- Local Codex billed should let Codex inspect and edit the remote project filesystem directly, including protected files such as `src/app.html` when the task requires reading them. Keep all returned tokens, private keys, and complete proxy commands out of chat and logs. Use user-facing language like "Local Codex billed"; avoid internal enum names unless debugging BYOB itself.
78
+ Local Codex billed should let Codex inspect and edit the remote project filesystem directly, including protected files such as `src/app.html` when the task requires reading them. Keep all tokens, private keys, and complete proxy commands out of chat and logs. Use user-facing language like "Local Codex billed"; avoid internal enum names unless debugging BYOB itself.
79
79
 
80
80
  After the workspace is open, use Codex's normal file, shell, git, and verification workflow inside the remote project.
81
81
 
@@ -57,8 +57,8 @@ For **Local Codex billed** project editing, open the BYOB project as the active
57
57
 
58
58
  1. Establish project context with `byob_current_project_context`.
59
59
  2. Call `byob_codex_status` and confirm the Local Codex billed option is available.
60
- 3. Call `byob_codex_connection_create` with the Local Codex billed connection type.
61
- 4. Use the returned Local Codex billed workspace metadata through `byob-cli@latest` so Codex edits the remote project container as its active workspace.
60
+ 3. Call `byob_codex_connection_create` with `mode: "local_codex_billed"`.
61
+ 4. Hand the returned Local Codex billed `workspace_handle` to the Codex host so Codex edits the remote project container as its active workspace.
62
62
  5. Do not print tokens, private keys, or full proxy commands in chat.
63
63
 
64
64
  After the workspace is open, use Codex's normal file, shell, git, and verification workflow inside the remote project.
@@ -290,8 +290,8 @@ Use this flow:
290
290
 
291
291
  1. Confirm the project is started and `connectivity.can_remote_edit` is true.
292
292
  2. Call `byob_codex_status`.
293
- 3. If Local Codex billed is available, call `byob_codex_connection_create` for that mode.
294
- 4. Use the returned Local Codex billed workspace details with `byob-cli@latest`'s `codex ssh-proxy`.
293
+ 3. If Local Codex billed is available, call `byob_codex_connection_create` with `mode: "local_codex_billed"`.
294
+ 4. Hand the returned Local Codex billed `workspace_handle` to the Codex host; the host uses `byob-cli@latest`'s `codex ssh-proxy` behind that handle.
295
295
  5. Keep credentials out of chat, logs, screenshots, and command transcripts.
296
296
 
297
297
  After the workspace is open, use Codex's normal file, shell, git, and verification workflow inside the remote project.