@vm0/cli 9.152.0 → 9.153.0

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/index.js CHANGED
@@ -68,7 +68,7 @@ import {
68
68
  source_default,
69
69
  volumeConfigSchema,
70
70
  withErrorHandler
71
- } from "./chunk-T32CMT7F.js";
71
+ } from "./chunk-7B5CZ4YO.js";
72
72
  import {
73
73
  __toESM,
74
74
  init_esm_shims
@@ -387,7 +387,7 @@ function getConfigPath() {
387
387
  return join(os.homedir(), ".vm0", "config.json");
388
388
  }
389
389
  var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
390
- console.log(source_default.bold(`VM0 CLI v${"9.152.0"}`));
390
+ console.log(source_default.bold(`VM0 CLI v${"9.153.0"}`));
391
391
  console.log();
392
392
  const config = await loadConfig();
393
393
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -4280,7 +4280,7 @@ var composeCommand = new Command().name("compose").description("Create or update
4280
4280
  options.autoUpdate = false;
4281
4281
  }
4282
4282
  if (options.autoUpdate !== false) {
4283
- await startSilentUpgrade("9.152.0");
4283
+ await startSilentUpgrade("9.153.0");
4284
4284
  }
4285
4285
  try {
4286
4286
  let result;
@@ -4372,7 +4372,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
4372
4372
  withErrorHandler(
4373
4373
  async (identifier, prompt, options) => {
4374
4374
  if (options.autoUpdate !== false) {
4375
- await startSilentUpgrade("9.152.0");
4375
+ await startSilentUpgrade("9.153.0");
4376
4376
  }
4377
4377
  const { name, version } = parseIdentifier(identifier);
4378
4378
  let composeId;
@@ -6165,13 +6165,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
6165
6165
  if (latestVersion === null) {
6166
6166
  throw new Error("Could not check for updates. Please try again later.");
6167
6167
  }
6168
- if (latestVersion === "9.152.0") {
6169
- console.log(source_default.green(`\u2713 Already up to date (${"9.152.0"})`));
6168
+ if (latestVersion === "9.153.0") {
6169
+ console.log(source_default.green(`\u2713 Already up to date (${"9.153.0"})`));
6170
6170
  return;
6171
6171
  }
6172
6172
  console.log(
6173
6173
  source_default.yellow(
6174
- `Current version: ${"9.152.0"} -> Latest version: ${latestVersion}`
6174
+ `Current version: ${"9.153.0"} -> Latest version: ${latestVersion}`
6175
6175
  )
6176
6176
  );
6177
6177
  console.log();
@@ -6198,7 +6198,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
6198
6198
  const success = await performUpgrade(packageManager);
6199
6199
  if (success) {
6200
6200
  console.log(
6201
- source_default.green(`\u2713 Upgraded from ${"9.152.0"} to ${latestVersion}`)
6201
+ source_default.green(`\u2713 Upgraded from ${"9.153.0"} to ${latestVersion}`)
6202
6202
  );
6203
6203
  return;
6204
6204
  }
@@ -6265,7 +6265,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
6265
6265
 
6266
6266
  // src/index.ts
6267
6267
  var program = new Command();
6268
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.152.0");
6268
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.153.0");
6269
6269
  program.addCommand(authCommand);
6270
6270
  program.addCommand(infoCommand);
6271
6271
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.152.0",
3
+ "version": "9.153.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  createZeroRun,
24
24
  decodeCliTokenPayload,
25
25
  decodeZeroTokenPayload,
26
+ deleteLocalBrowserHost,
26
27
  deleteSkill,
27
28
  deleteZeroAgent,
28
29
  deleteZeroOrg,
@@ -80,6 +81,8 @@ import {
80
81
  isInteractive,
81
82
  isUUID,
82
83
  leaveZeroOrg,
84
+ listLocalBrowserAuditEvents,
85
+ listLocalBrowserHosts,
83
86
  listSkills,
84
87
  listTelegramBots,
85
88
  listZeroAgents,
@@ -135,7 +138,7 @@ import {
135
138
  withErrorHandler,
136
139
  zeroAgentCustomSkillNameSchema,
137
140
  zeroRemoteAgentCommand
138
- } from "./chunk-T32CMT7F.js";
141
+ } from "./chunk-7B5CZ4YO.js";
139
142
  import {
140
143
  __toESM,
141
144
  init_esm_shims
@@ -2539,9 +2542,51 @@ init_esm_shims();
2539
2542
  var BUILT_IN_GENERATION_PROVIDERS = {
2540
2543
  image: [
2541
2544
  {
2542
- label: "Built-in",
2545
+ label: "Built-in OpenAI",
2543
2546
  model: "gpt-image-2",
2544
- command: "zero built-in generate image -h",
2547
+ command: "zero built-in generate image --model gpt-image-2 -h",
2548
+ reason: "available without connector setup"
2549
+ },
2550
+ {
2551
+ label: "Built-in OpenAI",
2552
+ model: "gpt-image-1.5",
2553
+ command: "zero built-in generate image --model gpt-image-1.5 -h",
2554
+ reason: "available without connector setup"
2555
+ },
2556
+ {
2557
+ label: "Built-in OpenAI",
2558
+ model: "gpt-image-1",
2559
+ command: "zero built-in generate image --model gpt-image-1 -h",
2560
+ reason: "available without connector setup"
2561
+ },
2562
+ {
2563
+ label: "Built-in OpenAI",
2564
+ model: "gpt-image-1-mini",
2565
+ command: "zero built-in generate image --model gpt-image-1-mini -h",
2566
+ reason: "available without connector setup"
2567
+ },
2568
+ {
2569
+ label: "Built-in fal.ai",
2570
+ model: "fal-ai/flux-pro/v1.1",
2571
+ command: "zero built-in generate image --model flux-pro-1.1 -h",
2572
+ reason: "available without connector setup"
2573
+ },
2574
+ {
2575
+ label: "Built-in fal.ai",
2576
+ model: "fal-ai/flux-pro/v1.1-ultra",
2577
+ command: "zero built-in generate image --model flux-pro-1.1-ultra -h",
2578
+ reason: "available without connector setup"
2579
+ },
2580
+ {
2581
+ label: "Built-in fal.ai",
2582
+ model: "fal-ai/qwen-image",
2583
+ command: "zero built-in generate image --model qwen-image -h",
2584
+ reason: "available without connector setup"
2585
+ },
2586
+ {
2587
+ label: "Built-in fal.ai",
2588
+ model: "fal-ai/bytedance/seedream/v4/text-to-image",
2589
+ command: "zero built-in generate image --model seedream4 -h",
2545
2590
  reason: "available without connector setup"
2546
2591
  }
2547
2592
  ],
@@ -2600,6 +2645,28 @@ var BUILT_IN_GENERATION_PROVIDERS = {
2600
2645
  }
2601
2646
  ]
2602
2647
  };
2648
+ var BUILT_IN_GENERATION_COMMANDS = {
2649
+ image: {
2650
+ label: "Built-in image generation",
2651
+ command: "zero built-in generate image -h",
2652
+ models: "OpenAI: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini; fal.ai: flux-pro-1.1, flux-pro-1.1-ultra, qwen-image, seedream4"
2653
+ },
2654
+ video: {
2655
+ label: "Built-in video generation",
2656
+ command: "zero built-in generate video -h",
2657
+ models: "veo3.1-fast, veo3.1, kling-o3-standard, kling-v3-4k, seedance2.0, seedance2.0-fast"
2658
+ },
2659
+ presentation: {
2660
+ label: "Built-in presentation generation",
2661
+ command: "zero built-in generate presentation -h",
2662
+ models: "gpt-5.5"
2663
+ },
2664
+ voice: {
2665
+ label: "Built-in voice generation",
2666
+ command: "zero built-in generate voice -h",
2667
+ models: "gpt-4o-mini-tts"
2668
+ }
2669
+ };
2603
2670
  var GENERATION_TYPE_ORDER = [
2604
2671
  "image",
2605
2672
  "video",
@@ -2631,6 +2698,9 @@ function getConnectorGenerationType(generationType) {
2631
2698
  function getBuiltInProviders(generationType) {
2632
2699
  return BUILT_IN_GENERATION_PROVIDERS[generationType] ?? [];
2633
2700
  }
2701
+ function getBuiltInCommand(generationType) {
2702
+ return BUILT_IN_GENERATION_COMMANDS[generationType] ?? null;
2703
+ }
2634
2704
  function getAvailableGenerationTypes() {
2635
2705
  const available = /* @__PURE__ */ new Set();
2636
2706
  for (const config of Object.values(CONNECTOR_TYPES)) {
@@ -2761,6 +2831,15 @@ function renderActions(candidates) {
2761
2831
  }
2762
2832
  }
2763
2833
  function renderBuiltInProvider(generationType) {
2834
+ const command = getBuiltInCommand(generationType);
2835
+ if (command) {
2836
+ console.log("");
2837
+ console.log("Built-in command:");
2838
+ console.log(` vm0 ${command.label}`);
2839
+ console.log(` Models: ${command.models}`);
2840
+ console.log(` Use: ${command.command}`);
2841
+ return;
2842
+ }
2764
2843
  const providers = getBuiltInProviders(generationType);
2765
2844
  if (providers.length === 0) return;
2766
2845
  console.log("");
@@ -7224,20 +7303,35 @@ function parseCompression(value) {
7224
7303
  }
7225
7304
  return compression;
7226
7305
  }
7306
+ function parseSeed(value) {
7307
+ const seed = Number(value);
7308
+ if (!Number.isInteger(seed) || seed < 0 || !Number.isSafeInteger(seed)) {
7309
+ throw new InvalidArgumentError("seed must be a non-negative safe integer");
7310
+ }
7311
+ return seed;
7312
+ }
7227
7313
  function createImageGenerateCommand(config) {
7228
7314
  return new Command().name(config.name).description("Generate a billed image file from a prompt").option("--prompt <text>", "Image prompt; can also be piped via stdin").option(
7315
+ "--model <model>",
7316
+ "Model: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini, flux-pro-1.1, flux-pro-1.1-ultra, qwen-image, or seedream4",
7317
+ "gpt-image-2"
7318
+ ).option(
7229
7319
  "--size <size>",
7230
- "Image size: auto or any valid WIDTHxHEIGHT for GPT Image 2",
7320
+ "Image size: auto or WIDTHxHEIGHT; support varies by model",
7231
7321
  "1024x1024"
7232
7322
  ).option(
7233
7323
  "--quality <quality>",
7234
7324
  "Image quality: low, medium, high, or auto",
7235
7325
  "medium"
7236
- ).option("--background <background>", "Background: auto or opaque", "auto").option("--format <format>", "Output format: png, webp, or jpeg", "png").option("--compression <0-100>", "Output compression for jpeg/webp only").option(
7326
+ ).option(
7327
+ "--background <background>",
7328
+ "Background: auto, opaque, or transparent when supported",
7329
+ "auto"
7330
+ ).option("--format <format>", "Output format: png, webp, or jpeg", "png").option("--compression <0-100>", "Output compression for jpeg/webp only").option(
7237
7331
  "--moderation <moderation>",
7238
7332
  "Moderation strictness: auto or low",
7239
7333
  "auto"
7240
- ).option("--json", "Print metadata as JSON").addHelpText(
7334
+ ).option("--seed <integer>", "Deterministic seed for fal models", parseSeed).option("--safety-tolerance <level>", "fal safety tolerance: 1-6", "4").option("--enhance-prompt", "Enable fal prompt enhancement when supported").option("--json", "Print metadata as JSON").addHelpText(
7241
7335
  "after",
7242
7336
  `
7243
7337
  Examples:
@@ -7249,23 +7343,34 @@ Output:
7249
7343
  Notes:
7250
7344
  - Authenticates via ZERO_TOKEN (requires file:write capability)
7251
7345
  - Charges org credits after successful image generation
7252
- - Uses OpenAI gpt-image-2 and bills returned usage tokens
7346
+ - Uses OpenAI for GPT Image models and fal.ai for non-OpenAI models
7347
+
7348
+ Models:
7349
+ - OpenAI: gpt-image-2 (default), gpt-image-1.5, gpt-image-1,
7350
+ gpt-image-1-mini. OpenAI generations bill returned text/image/output
7351
+ token usage.
7352
+ - fal.ai: flux-pro-1.1, flux-pro-1.1-ultra, qwen-image, seedream4.
7353
+ fal generations bill by output image or rounded-up output megapixel,
7354
+ depending on the model.
7253
7355
 
7254
- GPT Image 2 options:
7356
+ Options:
7255
7357
  - Prompt: required, up to 32,000 characters; stdin is supported.
7256
- - Size: use auto or WIDTHxHEIGHT. Popular sizes include 1024x1024,
7358
+ - Size: gpt-image-2 accepts auto or WIDTHxHEIGHT. Popular sizes include
7359
+ 1024x1024,
7257
7360
  1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160,
7258
7361
  and 2160x3840. Custom sizes must have edges <= 3840px, both
7259
7362
  edges divisible by 16, long:short ratio <= 3:1, and total pixels
7260
- between 655,360 and 8,294,400. Outputs larger than 2560x1440
7261
- total pixels are experimental.
7363
+ between 655,360 and 8,294,400. gpt-image-1.5, gpt-image-1, and
7364
+ gpt-image-1-mini use auto, 1024x1024, 1536x1024, or 1024x1536.
7262
7365
  - Quality: low, medium, high, or auto. Low is fastest for drafts.
7263
- - Background: auto or opaque. GPT Image 2 does not support transparent
7264
- backgrounds.
7265
- - Format: png, jpeg, or webp. Use --compression 0-100 only with jpeg
7266
- or webp; jpeg is usually lower latency than png.
7267
- - Moderation: auto or low.
7268
- - This command generates one text-to-image result. GPT Image 2 also
7366
+ - Background: auto, opaque, or transparent. gpt-image-2 and fal models do
7367
+ not support transparent backgrounds.
7368
+ - Format: png, jpeg, or webp for OpenAI; png or jpeg for fal. Use
7369
+ --compression 0-100 only with OpenAI jpeg or webp outputs.
7370
+ - Moderation: auto or low for OpenAI models.
7371
+ - fal-only controls: --seed, --safety-tolerance for Flux, and
7372
+ --enhance-prompt for flux-pro-1.1.
7373
+ - This command generates one text-to-image result. GPT Image also
7269
7374
  supports image edits, reference images, masks, partial-image streaming,
7270
7375
  and multiple images per request, but those are not exposed by this
7271
7376
  built-in Zero command yet.`
@@ -7275,12 +7380,16 @@ GPT Image 2 options:
7275
7380
  const compression = parseCompression(options.compression);
7276
7381
  const result = await generateWebImage({
7277
7382
  prompt,
7383
+ model: options.model,
7278
7384
  size: options.size,
7279
7385
  quality: options.quality,
7280
7386
  background: options.background,
7281
7387
  outputFormat: options.format,
7282
7388
  outputCompression: compression,
7283
- moderation: options.moderation
7389
+ moderation: options.moderation,
7390
+ seed: options.seed,
7391
+ safetyTolerance: options.safetyTolerance,
7392
+ enhancePrompt: options.enhancePrompt
7284
7393
  });
7285
7394
  if (options.json) {
7286
7395
  console.log(JSON.stringify(result));
@@ -7297,8 +7406,17 @@ GPT Image 2 options:
7297
7406
  if (result.moderation) {
7298
7407
  console.log(source_default.dim(` Moderation: ${result.moderation}`));
7299
7408
  }
7409
+ if (result.safetyTolerance) {
7410
+ console.log(
7411
+ source_default.dim(` Safety tolerance: ${result.safetyTolerance}`)
7412
+ );
7413
+ }
7414
+ if (result.seed !== void 0) {
7415
+ console.log(source_default.dim(` Seed: ${result.seed}`));
7416
+ }
7300
7417
  console.log(source_default.dim(` Credits charged: ${result.creditsCharged}`));
7301
7418
  console.log(source_default.dim(` Model: ${result.model}`));
7419
+ console.log(source_default.dim(` Provider: ${result.provider}`));
7302
7420
  })
7303
7421
  );
7304
7422
  }
@@ -7309,7 +7427,8 @@ var imageCommand = createImageGenerateCommand({
7309
7427
  usageCommand: "zero built-in generate image",
7310
7428
  examples: ` Generate image: zero built-in generate image --prompt "A watercolor fox"
7311
7429
  Pipe prompt: cat prompt.txt | zero built-in generate image
7312
- Pick size/quality: zero built-in generate image --prompt "A poster" --size 1024x1536 --quality high`
7430
+ OpenAI model: zero built-in generate image --model gpt-image-1.5 --prompt "A poster" --size 1024x1536 --quality high
7431
+ fal model: zero built-in generate image --model flux-pro-1.1 --prompt "A product hero shot" --seed 42`
7313
7432
  });
7314
7433
 
7315
7434
  // src/commands/zero/built-in/generate/presentation.ts
@@ -7422,7 +7541,7 @@ init_esm_shims();
7422
7541
  // src/commands/zero/shared/video-generate.ts
7423
7542
  init_esm_shims();
7424
7543
  import { readFileSync as readFileSync14 } from "fs";
7425
- function parseSeed(value) {
7544
+ function parseSeed2(value) {
7426
7545
  const seed = Number(value);
7427
7546
  if (!Number.isInteger(seed) || seed < 0 || !Number.isSafeInteger(seed)) {
7428
7547
  throw new InvalidArgumentError("seed must be a non-negative safe integer");
@@ -7456,7 +7575,7 @@ function createVideoGenerateCommand(config) {
7456
7575
  "--duration <duration>",
7457
7576
  "Duration: 3s-15s; Veo supports 4s/6s/8s",
7458
7577
  "8s"
7459
- ).option("--resolution <resolution>", "Resolution: 720p, 1080p, or 4k").option("--no-audio", "Generate a silent video").option("--negative-prompt <text>", "Negative prompt").option("--seed <integer>", "Deterministic seed", parseSeed).option("--no-auto-fix", "Disable fal prompt auto-fix").option("--safety-tolerance <level>", "Safety tolerance: 1-6", "4").option("--json", "Print metadata as JSON").addHelpText(
7578
+ ).option("--resolution <resolution>", "Resolution: 720p, 1080p, or 4k").option("--no-audio", "Generate a silent video").option("--negative-prompt <text>", "Negative prompt").option("--seed <integer>", "Deterministic seed", parseSeed2).option("--no-auto-fix", "Disable fal prompt auto-fix").option("--safety-tolerance <level>", "Safety tolerance: 1-6", "4").option("--json", "Print metadata as JSON").addHelpText(
7460
7579
  "after",
7461
7580
  `
7462
7581
  Examples:
@@ -7468,7 +7587,18 @@ Output:
7468
7587
  Notes:
7469
7588
  - Authenticates via ZERO_TOKEN (requires file:write capability)
7470
7589
  - Charges org credits after successful video generation
7471
- - Uses fal video models with configured usage pricing`
7590
+ - Uses fal video models with configured usage pricing
7591
+
7592
+ Models:
7593
+ - Veo: veo3.1-fast (default), veo3.1. Supports 4s/6s/8s,
7594
+ 16:9 or 9:16, 720p/1080p/4k, negative prompts, seed,
7595
+ auto-fix, safety tolerance, and optional audio.
7596
+ - Kling: kling-o3-standard, kling-v3-4k. Supports 3s-15s and
7597
+ 16:9 or 9:16. kling-v3-4k uses 4k output; kling-o3-standard
7598
+ uses 1080p output.
7599
+ - Seedance: seedance2.0, seedance2.0-fast. Supports 4s-15s,
7600
+ 480p/720p, seed, and aspect ratios 21:9, 16:9, 4:3, 1:1,
7601
+ 3:4, or 9:16.`
7472
7602
  ).action(
7473
7603
  withErrorHandler(async (options) => {
7474
7604
  const prompt = readPrompt3(options, config.usageCommand);
@@ -7719,6 +7849,16 @@ function parsePositiveInteger2(value, label) {
7719
7849
  }
7720
7850
  return parsed;
7721
7851
  }
7852
+ function parseLimit4(value) {
7853
+ if (value === void 0) {
7854
+ return 50;
7855
+ }
7856
+ const parsed = parsePositiveInteger2(value, "limit");
7857
+ if (parsed > 200) {
7858
+ throw new Error("limit must be 200 or less");
7859
+ }
7860
+ return parsed;
7861
+ }
7722
7862
  function resultText(command) {
7723
7863
  if (!command.result) {
7724
7864
  return "";
@@ -7815,6 +7955,96 @@ function readCommand(name, kind) {
7815
7955
  )
7816
7956
  );
7817
7957
  }
7958
+ function formatCapabilities(capabilities) {
7959
+ return capabilities.length > 0 ? capabilities.join(", ") : "none";
7960
+ }
7961
+ function formatHost(host) {
7962
+ const status = host.status === "online" ? source_default.green("online") : source_default.dim("offline");
7963
+ return [
7964
+ `${status} ${host.displayName}`,
7965
+ ` id: ${host.id}`,
7966
+ ` browser: ${host.browser}`,
7967
+ ` extension: ${host.extensionVersion}`,
7968
+ ` last seen: ${host.lastSeenAt}`,
7969
+ ` capabilities: ${formatCapabilities(host.supportedCapabilities)}`
7970
+ ].join("\n");
7971
+ }
7972
+ function formatAuditEvent(event) {
7973
+ const parts = [
7974
+ event.createdAt,
7975
+ event.event,
7976
+ event.kind,
7977
+ `command=${event.commandId}`
7978
+ ];
7979
+ if (event.hostId) {
7980
+ parts.push(`host=${event.hostId}`);
7981
+ }
7982
+ if (event.runId) {
7983
+ parts.push(`run=${event.runId}`);
7984
+ }
7985
+ if (event.tabId) {
7986
+ parts.push(`tab=${event.tabId}`);
7987
+ }
7988
+ if (event.targetUrl) {
7989
+ parts.push(`url=${event.targetUrl}`);
7990
+ }
7991
+ if (event.approvalOutcome) {
7992
+ parts.push(`approval=${event.approvalOutcome}`);
7993
+ }
7994
+ if (event.error) {
7995
+ parts.push(`error=${JSON.stringify(event.error)}`);
7996
+ }
7997
+ return parts.join(" ");
7998
+ }
7999
+ var hostsCommand = new Command().name("hosts").description("List and revoke linked local-browser hosts").addCommand(
8000
+ new Command().name("list").description("List linked local-browser hosts").option("--json", "Output hosts as JSON").action(
8001
+ withErrorHandler(async (options) => {
8002
+ const result = await listLocalBrowserHosts();
8003
+ if (options.json) {
8004
+ console.log(JSON.stringify(result));
8005
+ return;
8006
+ }
8007
+ if (result.hosts.length === 0) {
8008
+ console.log(source_default.dim("No linked local-browser hosts."));
8009
+ return;
8010
+ }
8011
+ console.log(result.hosts.map(formatHost).join("\n\n"));
8012
+ })
8013
+ )
8014
+ ).addCommand(
8015
+ new Command().name("revoke").description("Revoke a linked local-browser host").argument("<host-id>", "Local-browser host id").option("--json", "Output the revoke result as JSON").action(
8016
+ withErrorHandler(async (hostId, options) => {
8017
+ const result = await deleteLocalBrowserHost(hostId);
8018
+ if (options.json) {
8019
+ console.log(JSON.stringify(result));
8020
+ return;
8021
+ }
8022
+ console.log(source_default.green("Local-browser host revoked"));
8023
+ console.log(source_default.dim(` Host: ${hostId}`));
8024
+ })
8025
+ )
8026
+ );
8027
+ var auditCommand = new Command().name("audit").description("Inspect local-browser write command audit events").addCommand(
8028
+ new Command().name("list").description("List local-browser write command audit events").option("--limit <count>", "Maximum events to show", "50").option("--command-id <id>", "Filter by command id").option("--host-id <id>", "Filter by host id").option("--run-id <id>", "Filter by run id").option("--json", "Output audit events as JSON").action(
8029
+ withErrorHandler(async (options) => {
8030
+ const result = await listLocalBrowserAuditEvents({
8031
+ limit: parseLimit4(options.limit),
8032
+ ...options.commandId ? { commandId: options.commandId } : {},
8033
+ ...options.hostId ? { hostId: options.hostId } : {},
8034
+ ...options.runId ? { runId: options.runId } : {}
8035
+ });
8036
+ if (options.json) {
8037
+ console.log(JSON.stringify(result));
8038
+ return;
8039
+ }
8040
+ if (result.auditEvents.length === 0) {
8041
+ console.log(source_default.dim("No local-browser audit events found."));
8042
+ return;
8043
+ }
8044
+ console.log(result.auditEvents.map(formatAuditEvent).join("\n"));
8045
+ })
8046
+ )
8047
+ );
7818
8048
  var tabsCommand = new Command().name("tabs").description("Read and control browser tabs").addCommand(readCommand("list", "tabs.list")).addCommand(readCommand("current", "tabs.current")).addCommand(
7819
8049
  addWriteOptions(
7820
8050
  new Command().name("activate").description("Run tabs.activate").requiredOption("--tab-id <id>", "Tab to activate").action(
@@ -7894,15 +8124,18 @@ var pageCommand = new Command().name("page").description("Read and control the a
7894
8124
  )
7895
8125
  )
7896
8126
  );
7897
- var zeroLocalBrowserCommand = new Command().name("local-browser").description("Read authorized browser context").addHelpText(
8127
+ var zeroLocalBrowserCommand = new Command().name("local-browser").description("Read and manage authorized browser context").addHelpText(
7898
8128
  "after",
7899
8129
  `
7900
8130
  Examples:
8131
+ List hosts? zero local-browser hosts list
8132
+ Revoke host? zero local-browser hosts revoke <host-id>
7901
8133
  List tabs? zero local-browser tabs list
7902
8134
  Current tab? zero local-browser tabs current
7903
8135
  Click page? zero local-browser page click --selector button
7904
- Open tab? zero local-browser tabs open --url https://example.com`
7905
- ).addCommand(tabsCommand).addCommand(pageCommand);
8136
+ Open tab? zero local-browser tabs open --url https://example.com
8137
+ Audit actions? zero local-browser audit list`
8138
+ ).addCommand(hostsCommand).addCommand(auditCommand).addCommand(tabsCommand).addCommand(pageCommand);
7906
8139
 
7907
8140
  // src/commands/zero/host/index.ts
7908
8141
  init_esm_shims();
@@ -8298,7 +8531,7 @@ function registerZeroCommands(prog, commands) {
8298
8531
  var program = new Command();
8299
8532
  program.name("zero").description(
8300
8533
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
8301
- ).version("9.152.0").addHelpText("after", () => {
8534
+ ).version("9.153.0").addHelpText("after", () => {
8302
8535
  return buildZeroHelpText();
8303
8536
  });
8304
8537
  if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {