@vm0/cli 9.204.4 → 9.206.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/zero.js CHANGED
@@ -175,7 +175,7 @@ import {
175
175
  uploadWebFile,
176
176
  upsertZeroOrgModelProvider,
177
177
  withErrorHandler
178
- } from "./chunk-JOO62BG4.js";
178
+ } from "./chunk-QMWTDWXH.js";
179
179
  import {
180
180
  CONNECTOR_TYPES,
181
181
  CONNECTOR_TYPE_KEYS,
@@ -188,7 +188,7 @@ import {
188
188
  getConnectorStoredSecretDisplayInfo,
189
189
  getDiagnosticConnectorTypeForRuntimeEnvName,
190
190
  hasRequiredConnectorAuthMethodScopes
191
- } from "./chunk-GTPY5BQJ.js";
191
+ } from "./chunk-A7UBSZER.js";
192
192
  import "./chunk-NR42YJMI.js";
193
193
  import {
194
194
  __toESM,
@@ -6061,7 +6061,7 @@ var GENERATED_RUNTIME_FIREWALL_LOADERS = {
6061
6061
  return (await import("./clearbit.generated-O6YEDZFY.js")).clearbitFirewall;
6062
6062
  },
6063
6063
  "clerk": async () => {
6064
- return (await import("./clerk.generated-VNZXBTJO.js")).clerkFirewall;
6064
+ return (await import("./clerk.generated-ZX6FS3MY.js")).clerkFirewall;
6065
6065
  },
6066
6066
  "clickup": async () => {
6067
6067
  return (await import("./clickup.generated-4U5NK3UA.js")).clickupFirewall;
@@ -6664,7 +6664,7 @@ var GENERATED_RUNTIME_FIREWALL_LOADERS = {
6664
6664
  return (await import("./v0.generated-VF33O3AD.js")).v0Firewall;
6665
6665
  },
6666
6666
  "vercel": async () => {
6667
- return (await import("./vercel.generated-VVYZQLAJ.js")).vercelFirewall;
6667
+ return (await import("./vercel.generated-NX2R7A4K.js")).vercelFirewall;
6668
6668
  },
6669
6669
  "wandb": async () => {
6670
6670
  return (await import("./wandb.generated-7RF2F2A3.js")).wandbFirewall;
@@ -6733,7 +6733,7 @@ function isRuntimeFirewallConnectorType(type) {
6733
6733
  async function loadExpandedConnectorFirewall(type) {
6734
6734
  const [firewall, { expandFirewallPlaceholders }] = await Promise.all([
6735
6735
  loadGeneratedRuntimeFirewall(type),
6736
- import("./firewall-placeholder-expansion-EZ5WNMSE.js")
6736
+ import("./firewall-placeholder-expansion-ZRRX27DR.js")
6737
6737
  ]);
6738
6738
  return expandFirewallPlaceholders(firewall, type);
6739
6739
  }
@@ -7448,9 +7448,8 @@ function printPermissionActionMessage(args) {
7448
7448
  );
7449
7449
  }
7450
7450
  }
7451
- async function outputPermissionChangeMessage(connectorRef, label, permission, action, duration) {
7451
+ async function outputPermissionChangeMessage(connectorRef, label, permission, action, duration, agentId) {
7452
7452
  const platformOrigin = await getPlatformOrigin();
7453
- const agentId = process.env.ZERO_AGENT_ID;
7454
7453
  const urlParams = new URLSearchParams({
7455
7454
  ref: connectorRef,
7456
7455
  permission,
@@ -7492,12 +7491,18 @@ var permissionChangeCommand = new Command().name("permission-change").descriptio
7492
7491
  ).choices([...PERMISSION_GRANT_DURATIONS])
7493
7492
  ).addOption(
7494
7493
  new Option("--reason <text>", "Brief reason for the permission change")
7494
+ ).addOption(
7495
+ new Option(
7496
+ "--agent <id>",
7497
+ "Agent ID whose permission page should be opened (defaults to ZERO_AGENT_ID)"
7498
+ )
7495
7499
  ).addHelpText(
7496
7500
  "after",
7497
7501
  `
7498
7502
  Examples:
7499
7503
  zero doctor permission-change github --permission contents:read --enable
7500
7504
  zero doctor permission-change github --permission contents:write --enable --duration 24h
7505
+ zero doctor permission-change gmail --permission messages.write --enable --agent <agent-id>
7501
7506
  zero doctor permission-change slack --permission chat:write --disable
7502
7507
  zero doctor permission-change cloudflare --permission __unknown__ --disable
7503
7508
  zero doctor permission-change computer-use --permission computer-use:write --enable
@@ -7505,6 +7510,7 @@ Examples:
7505
7510
  Notes:
7506
7511
  - Outputs a platform URL for the user to adjust the permission
7507
7512
  - Use --permission __unknown__ to change unknown endpoint policy
7513
+ - Use --agent to request a permission for another agent; defaults to ZERO_AGENT_ID
7508
7514
  - Enable requests default to --duration 1h; use 24h or 7d for longer user-approved work
7509
7515
  - Use --duration always only when the user explicitly asks for persistent access
7510
7516
  - Permission changes update the current user's connector grants`
@@ -7539,7 +7545,8 @@ Notes:
7539
7545
  metadata.label,
7540
7546
  opts.permission,
7541
7547
  action,
7542
- opts.duration
7548
+ opts.duration,
7549
+ opts.agent ?? process.env.ZERO_AGENT_ID
7543
7550
  );
7544
7551
  }
7545
7552
  )
@@ -10281,7 +10288,34 @@ var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
10281
10288
  var SCHEDULE_KINDS = ["cron", "once", "loop"];
10282
10289
  var EVENT_KINDS = ["gmail-new-message"];
10283
10290
  var TRIGGER_KINDS = [...SCHEDULE_KINDS, ...EVENT_KINDS];
10284
- var EXACTLY_ONE_FLAG_MESSAGE = "Provide exactly one of --expr (cron), --at (once), --every (loop)";
10291
+ var EXACTLY_ONE_FLAG_MESSAGE = "Provide exactly one of --expr (cron), --at (once), --every (loop), or provide Gmail match options";
10292
+ function addGmailTriggerOptions(command) {
10293
+ return command.option(
10294
+ "--config <path>",
10295
+ "Path to a Gmail new message trigger config JSON"
10296
+ ).option("--from-contains <text>", "Require the From header to contain text").option(
10297
+ "--from-not-contains <text>",
10298
+ "Require the From header not to contain text"
10299
+ ).option(
10300
+ "--subject-contains <text>",
10301
+ "Require the Subject header to contain text"
10302
+ ).option(
10303
+ "--subject-not-contains <text>",
10304
+ "Require the Subject header not to contain text"
10305
+ ).option(
10306
+ "--body-contains <text>",
10307
+ "Require the message body to contain text"
10308
+ ).option(
10309
+ "--body-not-contains <text>",
10310
+ "Require the message body not to contain text"
10311
+ ).option("--to-contains <text>", "Require the To header to contain text").option(
10312
+ "--to-not-contains <text>",
10313
+ "Require the To header not to contain text"
10314
+ ).option("--cc-contains <text>", "Require the Cc header to contain text").option(
10315
+ "--cc-not-contains <text>",
10316
+ "Require the Cc header not to contain text"
10317
+ );
10318
+ }
10285
10319
  function timezoneOrUtc(timezone) {
10286
10320
  return timezone ?? "UTC";
10287
10321
  }
@@ -10447,6 +10481,13 @@ function buildUpdate(options) {
10447
10481
  return value !== void 0;
10448
10482
  }
10449
10483
  ).length;
10484
+ const hasGmailOptions = hasGmailTriggerOptions(options);
10485
+ if (hasGmailOptions) {
10486
+ if (flagCount > 0 || options.timezone !== void 0) {
10487
+ throw new Error("Use either schedule flags or Gmail match options");
10488
+ }
10489
+ return { eventConfig: buildGmailNewMessageEventConfig(options) };
10490
+ }
10450
10491
  if (flagCount !== 1) {
10451
10492
  throw new Error(EXACTLY_ONE_FLAG_MESSAGE);
10452
10493
  }
@@ -10481,24 +10522,14 @@ async function resolveWorkflowId(ref, options) {
10481
10522
  }
10482
10523
  return matches[0].id;
10483
10524
  }
10484
- var addCommand = new Command().name("add").description("Add a trigger to a workflow").argument("<workflow>", "Workflow ID or name").argument("<kind>", `Trigger type: ${TRIGGER_KINDS.join(" | ")}`).option("--expr <expression>", 'Cron expression for kind "cron"').option("--at <iso-time>", 'Fire time for kind "once"').option("--every <duration>", 'Interval for kind "loop" (e.g. 15m, 1h, 90s)').option("-z, --timezone <tz>", "IANA timezone for cron/once (default: UTC)").option("--config <path>", "Path to a Gmail new message trigger config JSON").option("--from-contains <text>", "Require the From header to contain text").option(
10485
- "--from-not-contains <text>",
10486
- "Require the From header not to contain text"
10487
- ).option(
10488
- "--subject-contains <text>",
10489
- "Require the Subject header to contain text"
10490
- ).option(
10491
- "--subject-not-contains <text>",
10492
- "Require the Subject header not to contain text"
10493
- ).option("--body-contains <text>", "Require the message body to contain text").option(
10494
- "--body-not-contains <text>",
10495
- "Require the message body not to contain text"
10496
- ).option("--to-contains <text>", "Require the To header to contain text").option(
10497
- "--to-not-contains <text>",
10498
- "Require the To header not to contain text"
10499
- ).option("--cc-contains <text>", "Require the Cc header to contain text").option(
10500
- "--cc-not-contains <text>",
10501
- "Require the Cc header not to contain text"
10525
+ var addCommand = addGmailTriggerOptions(
10526
+ new Command().name("add").description("Add a trigger to a workflow").argument("<workflow>", "Workflow ID or name").argument("<kind>", `Trigger type: ${TRIGGER_KINDS.join(" | ")}`).option("--expr <expression>", 'Cron expression for kind "cron"').option("--at <iso-time>", 'Fire time for kind "once"').option(
10527
+ "--every <duration>",
10528
+ 'Interval for kind "loop" (e.g. 15m, 1h, 90s)'
10529
+ ).option(
10530
+ "-z, --timezone <tz>",
10531
+ "IANA timezone for cron/once (default: UTC)"
10532
+ )
10502
10533
  ).option("--agent <id>", "Agent ID for resolving a workflow name").addHelpText(
10503
10534
  "after",
10504
10535
  `
@@ -10529,13 +10560,17 @@ Notes:
10529
10560
  }
10530
10561
  )
10531
10562
  );
10532
- var updateCommand3 = new Command().name("update").description("Replace a workflow trigger's schedule").argument("<trigger>", "Workflow trigger ID").option("--expr <expression>", 'New cron schedule (e.g. "0 9 * * *")').option("--at <iso-time>", 'New one-time fire (e.g. "2026-06-10T09:00")').option("--every <duration>", "New loop interval (e.g. 15m, 1h, 90s)").option("-z, --timezone <tz>", "IANA timezone for --expr / --at").addHelpText(
10563
+ var updateCommand3 = addGmailTriggerOptions(
10564
+ new Command().name("update").description("Replace a workflow trigger's schedule or Gmail match config").argument("<trigger>", "Workflow trigger ID").option("--expr <expression>", 'New cron schedule (e.g. "0 9 * * *")').option("--at <iso-time>", 'New one-time fire (e.g. "2026-06-10T09:00")').option("--every <duration>", "New loop interval (e.g. 15m, 1h, 90s)").option("-z, --timezone <tz>", "IANA timezone for --expr / --at")
10565
+ ).addHelpText(
10533
10566
  "after",
10534
10567
  `
10535
10568
  Examples:
10536
10569
  zero workflow trigger update 22222222-2222-4222-8222-222222222222 --expr "0 9 * * *" -z Asia/Shanghai
10537
10570
  zero workflow trigger update 22222222-2222-4222-8222-222222222222 --at "2026-06-10T09:00" -z UTC
10538
- zero workflow trigger update 22222222-2222-4222-8222-222222222222 --every 10m`
10571
+ zero workflow trigger update 22222222-2222-4222-8222-222222222222 --every 10m
10572
+ zero workflow trigger update 22222222-2222-4222-8222-222222222222 --from-contains "@example.com"
10573
+ zero workflow trigger update 22222222-2222-4222-8222-222222222222 --config ./gmail-trigger.json`
10539
10574
  ).action(
10540
10575
  withErrorHandler(async (id, options) => {
10541
10576
  const trigger = await updateWorkflowTrigger(id, buildUpdate(options));
@@ -15747,7 +15782,7 @@ function registerZeroCommands(prog, commands) {
15747
15782
  var program = new Command();
15748
15783
  program.name("zero").description(
15749
15784
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
15750
- ).version("9.204.4").addHelpText("after", () => {
15785
+ ).version("9.206.0").addHelpText("after", () => {
15751
15786
  return buildZeroHelpText();
15752
15787
  });
15753
15788
  if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {