@epoch-agent/cli 0.29.0 → 0.30.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/dist/index.js CHANGED
@@ -3783,6 +3783,7 @@ async function launchTui(resumeId) {
3783
3783
  import { t as t33 } from "@epoch-agent/infra";
3784
3784
  // src/schedule/add.ts
3785
3785
  import {
3786
+ isValidInterval,
3786
3787
  SCHEDULE_DEFAULTS,
3787
3788
  validateSchedule
3788
3789
  } from "@epoch-agent/core";
@@ -3792,12 +3793,14 @@ import {
3792
3793
  isPermissionLevel as isPermissionLevel3,
3793
3794
  OPERATION_TYPES as OPERATION_TYPES4,
3794
3795
  PERMISSION_LEVELS as PERMISSION_LEVELS4,
3795
- SCHEDULE_INTERVAL_MINUTES
3796
+ SCHEDULE_INTERVAL_MAX_MINUTES,
3797
+ SCHEDULE_INTERVAL_MIN_MINUTES
3796
3798
  } from "@epoch-agent/protocol";
3797
3799
  // src/schedule/labels.ts
3798
3800
  import { t as t26 } from "@epoch-agent/infra";
3799
3801
  import {
3800
- collectPendingApprovals
3802
+ collectPendingApprovals,
3803
+ cronTimes
3801
3804
  } from "@epoch-agent/protocol";
3802
3805
  var ISSUE_KEYS = {
3803
3806
  "name-empty": "schedule.issue.name_empty",
@@ -3808,6 +3811,7 @@ var ISSUE_KEYS = {
3808
3811
  "max-turns-invalid": "schedule.issue.max_turns_invalid",
3809
3812
  "timeout-invalid": "schedule.issue.timeout_invalid",
3810
3813
  "trigger-time-invalid": "schedule.issue.trigger_time_invalid",
3814
+ "trigger-times-too-many": "schedule.issue.trigger_times_too_many",
3811
3815
  "trigger-weekdays-empty": "schedule.issue.trigger_weekdays_empty",
3812
3816
  "trigger-days-invalid": "schedule.issue.trigger_days_invalid",
3813
3817
  "trigger-interval-invalid": "schedule.issue.trigger_interval_invalid",
@@ -3858,17 +3862,18 @@ function driftLabel(kind) {
3858
3862
  }
3859
3863
  function describeTrigger(trigger) {
3860
3864
  if (trigger.kind === "interval") {
3861
- return trigger.everyMinutes < 60 ? t26("schedule.trigger.every_minutes", { n: trigger.everyMinutes }) : t26("schedule.trigger.every_hours", { n: trigger.everyMinutes / 60 });
3865
+ return trigger.everyMinutes % 60 === 0 ? t26("schedule.trigger.every_hours", { n: trigger.everyMinutes / 60 }) : t26("schedule.trigger.every_minutes", { n: trigger.everyMinutes });
3862
3866
  }
3863
3867
  if (trigger.kind === "once") {
3864
3868
  return t26("schedule.trigger.once", { date: trigger.date, at: trigger.at });
3865
3869
  }
3866
- if (trigger.cycle === "daily") return t26("schedule.trigger.daily", { at: trigger.at });
3870
+ const at = cronTimes(trigger).join("/");
3871
+ if (trigger.cycle === "daily") return t26("schedule.trigger.daily", { at });
3867
3872
  if (trigger.cycle === "weekly") {
3868
3873
  const days = trigger.weekdays.map((d) => t26(WEEKDAY_KEYS[d])).join("/");
3869
- return t26("schedule.trigger.weekly", { days, at: trigger.at });
3874
+ return t26("schedule.trigger.weekly", { days, at });
3870
3875
  }
3871
- return t26("schedule.trigger.monthly", { days: trigger.days.join("/"), at: trigger.at });
3876
+ return t26("schedule.trigger.monthly", { days: trigger.days.join("/"), at });
3872
3877
  }
3873
3878
  function permissionLabel(level) {
3874
3879
  if (level === "plan") return t26("schedule.permission.plan");
@@ -4028,12 +4033,12 @@ function parseTrigger(opts) {
4028
4033
  );
4029
4034
  if (given.length === 0) throw new CliError(t28("schedule.err_no_trigger"), EXIT_CODES.FAILURE);
4030
4035
  if (given.length > 1) throw new CliError(t28("schedule.err_many_triggers"), EXIT_CODES.FAILURE);
4031
- if (opts.daily !== void 0) return { kind: "cron", cycle: "daily", at: opts.daily };
4036
+ if (opts.daily !== void 0) return { kind: "cron", cycle: "daily", ...cronAt(opts.daily) };
4032
4037
  if (opts.weekly !== void 0) {
4033
4038
  return {
4034
4039
  kind: "cron",
4035
4040
  cycle: "weekly",
4036
- at: requireAt(opts),
4041
+ ...cronAt(requireAt(opts)),
4037
4042
  weekdays: opts.weekly.split(",").map(parseWeekday)
4038
4043
  };
4039
4044
  }
@@ -4041,12 +4046,16 @@ function parseTrigger(opts) {
4041
4046
  return {
4042
4047
  kind: "cron",
4043
4048
  cycle: "monthly",
4044
- at: requireAt(opts),
4049
+ ...cronAt(requireAt(opts)),
4045
4050
  days: opts.monthly.split(",").map((d) => Number(d.trim()))
4046
4051
  };
4047
4052
  }
4048
4053
  if (opts.once !== void 0) {
4049
- return { kind: "once", date: opts.once, at: requireAt(opts) };
4054
+ const at = requireAt(opts);
4055
+ if (at.includes(",")) {
4056
+ throw new CliError(t28("schedule.err_once_single_at", { value: at }), EXIT_CODES.FAILURE);
4057
+ }
4058
+ return { kind: "once", date: opts.once, at };
4050
4059
  }
4051
4060
  return { kind: "interval", everyMinutes: parseEvery(opts.every) };
4052
4061
  }
@@ -4054,6 +4063,10 @@ function requireAt(opts) {
4054
4063
  if (!opts.at) throw new CliError(t28("schedule.err_at_required"), EXIT_CODES.FAILURE);
4055
4064
  return opts.at;
4056
4065
  }
4066
+ function cronAt(raw) {
4067
+ const [at = "", ...rest] = raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
4068
+ return rest.length > 0 ? { at, alsoAt: rest } : { at };
4069
+ }
4057
4070
  function parseWeekday(raw) {
4058
4071
  const idx = WEEKDAY_CODES.indexOf(raw.trim().toUpperCase());
4059
4072
  if (idx < 0) {
@@ -4068,12 +4081,13 @@ function parseWeekday(raw) {
4068
4081
  function parseEvery(raw) {
4069
4082
  const m = /^(\d+)\s*([mh])$/i.exec(raw.trim());
4070
4083
  const minutes = m ? Number(m[1]) * (m[2]?.toLowerCase() === "h" ? 60 : 1) : Number.NaN;
4071
- if (!SCHEDULE_INTERVAL_MINUTES.includes(minutes)) {
4084
+ if (!isValidInterval(minutes)) {
4072
4085
  throw new CliError(
4073
4086
  t28("schedule.err_every", { value: raw }),
4074
4087
  EXIT_CODES.FAILURE,
4075
4088
  t28("schedule.err_every_hint", {
4076
- values: SCHEDULE_INTERVAL_MINUTES.map((n) => n < 60 ? `${n}m` : `${n / 60}h`).join(" / ")
4089
+ min: `${SCHEDULE_INTERVAL_MIN_MINUTES}m`,
4090
+ max: `${SCHEDULE_INTERVAL_MAX_MINUTES / 60}h`
4077
4091
  })
4078
4092
  );
4079
4093
  }
@@ -4433,7 +4447,7 @@ function printRecording(run) {
4433
4447
  var DEFAULT_LOG_LIMIT = 10;
4434
4448
  function registerScheduleCommand(program2) {
4435
4449
  const cmd = program2.command("schedule").description(t33("cli.schedule.summary"));
4436
- cmd.command("add").description(t33("cli.schedule.add")).option("--name <name>", t33("cli.schedule.opt_name")).option("--prompt <text>", t33("cli.schedule.opt_prompt")).option("--daily <HH:mm>", t33("cli.schedule.opt_daily")).option("--weekly <days>", t33("cli.schedule.opt_weekly")).option("--monthly <days>", t33("cli.schedule.opt_monthly")).option("--every <interval>", t33("cli.schedule.opt_every")).option("--once <YYYY-MM-DD>", t33("cli.schedule.opt_once")).option("--at <HH:mm>", t33("cli.schedule.opt_at")).option("--start <YYYY-MM-DD>", t33("cli.schedule.opt_start")).option("--end <YYYY-MM-DD>", t33("cli.schedule.opt_end")).option("--workdir <dir>", t33("cli.schedule.opt_workdir")).option("--model <model>", t33("cli.schedule.opt_model")).option("--role <name>", t33("cli.schedule.opt_role")).option("--permission <level>", t33("cli.schedule.opt_permission")).option("--allow-tool <name>", t33("cli.schedule.opt_allow_tool"), collect3, []).option("--allow-operation <type>", t33("cli.schedule.opt_allow_operation"), collect3, []).option("--allow-rule <rule>", t33("cli.schedule.opt_allow_rule"), collect3, []).option("--max-turns <n>", t33("cli.schedule.opt_max_turns")).option("--budget <usd>", t33("cli.schedule.opt_budget")).option("--timeout <minutes>", t33("cli.schedule.opt_timeout")).option("--disabled", t33("cli.schedule.opt_disabled")).option("--i-understand-bypass", t33("cli.schedule.opt_bypass_ack")).action((opts) => runAdd(opts));
4450
+ cmd.command("add").description(t33("cli.schedule.add")).option("--name <name>", t33("cli.schedule.opt_name")).option("--prompt <text>", t33("cli.schedule.opt_prompt")).option("--daily <HH:mm[,HH:mm]>", t33("cli.schedule.opt_daily")).option("--weekly <days>", t33("cli.schedule.opt_weekly")).option("--monthly <days>", t33("cli.schedule.opt_monthly")).option("--every <interval>", t33("cli.schedule.opt_every")).option("--once <YYYY-MM-DD>", t33("cli.schedule.opt_once")).option("--at <HH:mm[,HH:mm]>", t33("cli.schedule.opt_at")).option("--start <YYYY-MM-DD>", t33("cli.schedule.opt_start")).option("--end <YYYY-MM-DD>", t33("cli.schedule.opt_end")).option("--workdir <dir>", t33("cli.schedule.opt_workdir")).option("--model <model>", t33("cli.schedule.opt_model")).option("--role <name>", t33("cli.schedule.opt_role")).option("--permission <level>", t33("cli.schedule.opt_permission")).option("--allow-tool <name>", t33("cli.schedule.opt_allow_tool"), collect3, []).option("--allow-operation <type>", t33("cli.schedule.opt_allow_operation"), collect3, []).option("--allow-rule <rule>", t33("cli.schedule.opt_allow_rule"), collect3, []).option("--max-turns <n>", t33("cli.schedule.opt_max_turns")).option("--budget <usd>", t33("cli.schedule.opt_budget")).option("--timeout <minutes>", t33("cli.schedule.opt_timeout")).option("--disabled", t33("cli.schedule.opt_disabled")).option("--i-understand-bypass", t33("cli.schedule.opt_bypass_ack")).action((opts) => runAdd(opts));
4437
4451
  cmd.command("list", { isDefault: true }).description(t33("cli.schedule.list")).action(() => runList());
4438
4452
  cmd.command("show").description(t33("cli.schedule.show")).argument("<id>", t33("cli.schedule.arg_id")).action((id) => runShow(id));
4439
4453
  cmd.command("enable").description(t33("cli.schedule.enable")).argument("<id>", t33("cli.schedule.arg_id")).action((id) => runSetEnabled(id, true));
package/dist/tui-entry.js CHANGED
@@ -420,7 +420,8 @@ function applyConfiguredCurrency() {
420
420
  // src/schedule/labels.ts
421
421
  import { t as t5 } from "@epoch-agent/infra";
422
422
  import {
423
- collectPendingApprovals
423
+ collectPendingApprovals,
424
+ cronTimes
424
425
  } from "@epoch-agent/protocol";
425
426
  function pendingNotice(defs, runs) {
426
427
  const items = collectPendingApprovals(defs, runs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epoch-agent/cli",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "private": false,
5
5
  "description": "epoch-agent CLI 入口",
6
6
  "repository": {
@@ -22,12 +22,12 @@
22
22
  "commander": "^15.0.0",
23
23
  "ink": "^7.1.1",
24
24
  "react": "^19.2.8",
25
- "@epoch-agent/core": "0.29.0",
26
- "@epoch-agent/runtime": "0.29.0",
27
- "@epoch-agent/infra": "0.29.0",
28
- "@epoch-agent/protocol": "0.29.0",
29
- "@epoch-agent/server": "0.29.0",
30
- "@epoch-agent/tui": "^0.29.0"
25
+ "@epoch-agent/core": "0.30.0",
26
+ "@epoch-agent/infra": "0.30.0",
27
+ "@epoch-agent/runtime": "0.30.0",
28
+ "@epoch-agent/server": "0.30.0",
29
+ "@epoch-agent/tui": "^0.30.0",
30
+ "@epoch-agent/protocol": "0.30.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^22.20.1",