@epoch-agent/cli 3.1.2 → 3.2.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/README.md CHANGED
@@ -49,7 +49,7 @@ epoch doctor # 装不上 / 跑不起来时第一个跑这个
49
49
  | `worktree.ts` | `--worktree` 的 git 那一侧:建 worktree + 新分支、收尾时**有改动就不删** |
50
50
  | `paths.ts` / `version.ts` | CLI 侧的路径与版本号;`--version` 那三行也在 `version.ts`,**第一行必须是裸版本号** |
51
51
 
52
- ## 带值的 flag 在**分流之前**落地,其中九个走环境变量
52
+ ## 带值的 flag 在**分流之前**落地,其中七个走环境变量
53
53
 
54
54
  「分流」= `commands/run.ts` 里那句「没有 prompt 就起 TUI」。所有带值 flag 的落地
55
55
  与校验都排在它**前面**,入口只有一个:`commands/run-overrides.ts` 的
@@ -83,13 +83,15 @@ epoch doctor # 装不上 / 跑不起来时第一个跑这个
83
83
  因为无参进 TUI 那条路**不经过 `runOnce`**——TUI 起的是另一个进程,选项对象过不去,
84
84
  只有环境变量带得过去。路径一律转**绝对**:子进程的 cwd 不保证一样。
85
85
 
86
- 前八个在 action 一开头就落进 env,`launchTui` 那边 `{ ...process.env }` 白拿;
86
+ 前六个在 action 一开头就落进 env,`launchTui` 那边 `{ ...process.env }` 白拿;
87
87
  只有 `EPOCH_RESUME` 要显式塞,因为它是**算出来的**(`-c` 要查库、`-r` 不带值
88
88
  要弹选择器)。加新 flag 时按这条分。
89
89
 
90
- 取值是**开放集合**的那两个(`-m` / `--fallback-model`,收 `@<id>`)没有可选值
91
- 清单可以对,所以判**字形**:模型 id 得是 ASCII 可见字符,base URL 得能被
92
- `new URL()` 解析且是 http(s)。卡得松是刻意的 —— 误伤一个合法模型名的代价是
90
+ 取值是**封闭集合**的那两个(`-m` / `--fallback-model`)判**字形**:必须是
91
+ `@<id>` 形状(`parseModelRef`),指向「我的模型」里的一条。
92
+ ⚠️ **「base URL 得能被 `new URL()` 解析」那句已经不适用了** —— 2.0.0 起模型名
93
+ 收窄成 `@<id>`,端点地址写在那一条模型自己身上,flag 不再收 base URL。
94
+ 卡得松是刻意的 —— 误伤一个合法模型名的代价是
93
95
  「那个模型压根用不了」,比放过一句话严重得多。
94
96
 
95
97
  反面例子是 `--worktree`:它**没有**对应的 `EPOCH_*`,因为它不是「传下去的一个设置」,
package/dist/index.js CHANGED
@@ -3939,6 +3939,7 @@ var STATUS_KEYS = {
3939
3939
  failed: "schedule.status.failed",
3940
3940
  denied: "schedule.status.denied",
3941
3941
  timeout: "schedule.status.timeout",
3942
+ cancelled: "schedule.status.cancelled",
3942
3943
  budget: "schedule.status.budget",
3943
3944
  "skipped-overlap": "schedule.status.skipped_overlap",
3944
3945
  "skipped-window": "schedule.status.skipped_window",
@@ -4329,8 +4330,19 @@ async function runDoctor(opts) {
4329
4330
  }
4330
4331
  }
4331
4332
  // src/schedule/manage.ts
4332
- import { removeRecordings } from "@epoch-agent/core";
4333
+ import { removeRecordings, requestScheduleCancel } from "@epoch-agent/core";
4333
4334
  import { automationLogsDir, t as t31 } from "@epoch-agent/infra";
4335
+ async function runStop(idOrPrefix) {
4336
+ const ctx = await openSchedule();
4337
+ try {
4338
+ const def = mustFind(ctx.store, idOrPrefix);
4339
+ const requested = requestScheduleCancel(ctx.store.connection, def.id);
4340
+ log10(requested ? t31("schedule.stop_requested", { name: def.name }) : t31("schedule.stop_no_run"));
4341
+ if (!requested) process.exitCode = 1;
4342
+ } finally {
4343
+ ctx.close();
4344
+ }
4345
+ }
4334
4346
  async function runSetEnabled(idOrPrefix, enabled) {
4335
4347
  const ctx = await openSchedule();
4336
4348
  try {
@@ -4565,6 +4577,7 @@ function registerScheduleCommand(program2) {
4565
4577
  cmd.command("disable").description(t34("cli.schedule.disable")).argument("<id>", t34("cli.schedule.arg_id")).action((id) => runSetEnabled(id, false));
4566
4578
  cmd.command("rm").alias("remove").description(t34("cli.schedule.rm")).argument("<id>", t34("cli.schedule.arg_id")).action((id) => runRemove(id));
4567
4579
  cmd.command("run").description(t34("cli.schedule.run")).argument("<id>", t34("cli.schedule.arg_id")).option("--fix", t34("cli.schedule.opt_fix")).action((id, opts) => runManual(id, opts));
4580
+ cmd.command("stop").description(t34("cli.schedule.stop")).argument("<id>", t34("cli.schedule.arg_id")).action((id) => runStop(id));
4568
4581
  cmd.command("logs").description(t34("cli.schedule.logs")).argument("<id>", t34("cli.schedule.arg_id")).option("-n, --limit <n>", t34("cli.schedule.opt_limit"), String(DEFAULT_LOG_LIMIT)).option("--tail", t34("cli.schedule.opt_tail")).action(
4569
4582
  (id, opts) => runLogs(id, Number(opts.limit ?? DEFAULT_LOG_LIMIT), opts.tail === true)
4570
4583
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epoch-agent/cli",
3
- "version": "3.1.2",
3
+ "version": "3.2.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/protocol": "3.1.2",
26
- "@epoch-agent/core": "3.1.2",
27
- "@epoch-agent/tui": "^3.1.2",
28
- "@epoch-agent/runtime": "3.1.2",
29
- "@epoch-agent/infra": "3.1.2",
30
- "@epoch-agent/server": "3.1.2"
25
+ "@epoch-agent/infra": "3.2.0",
26
+ "@epoch-agent/core": "3.2.0",
27
+ "@epoch-agent/protocol": "3.2.0",
28
+ "@epoch-agent/server": "3.2.0",
29
+ "@epoch-agent/tui": "^3.2.0",
30
+ "@epoch-agent/runtime": "3.2.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^22.20.1",