agent-lyceum 0.4.14 → 0.5.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 +17 -20
- package/README.zh-TW.md +17 -20
- package/dist/assert.d.ts +2 -0
- package/dist/assert.js +6 -0
- package/dist/cli.js +7 -2
- package/dist/config.d.ts +17 -16
- package/dist/config.js +14 -6
- package/dist/dispatcher.d.ts +3 -34
- package/dist/dispatcher.js +4 -464
- package/dist/format.js +7 -5
- package/dist/fs-util.d.ts +2 -0
- package/dist/fs-util.js +15 -0
- package/dist/guard.d.ts +8 -0
- package/dist/guard.js +24 -3
- package/dist/mailbox.d.ts +2 -0
- package/dist/mailbox.js +10 -5
- package/dist/policy.js +3 -3
- package/dist/process-runner.js +1 -2
- package/dist/project-lock.d.ts +10 -1
- package/dist/project-lock.js +39 -4
- package/dist/prompt.js +1 -1
- package/dist/run-cleanup.js +4 -3
- package/dist/run-log.d.ts +5 -0
- package/dist/run-log.js +18 -0
- package/dist/run-outcome.d.ts +22 -0
- package/dist/run-outcome.js +26 -0
- package/dist/run-session.d.ts +82 -0
- package/dist/run-session.js +505 -0
- package/dist/run-store.js +3 -3
- package/dist/scaffold.js +1 -0
- package/dist/schema.d.ts +67 -237
- package/dist/schema.js +4 -2
- package/dist/status.js +19 -13
- package/dist/validate.js +12 -8
- package/dist/worktree.js +7 -6
- package/package.json +14 -8
package/README.md
CHANGED
|
@@ -24,23 +24,19 @@ Requires Node 20+, plus `claude` and/or `codex` on your `PATH` (already logged i
|
|
|
24
24
|
|
|
25
25
|
| Command | What it does |
|
|
26
26
|
|---|---|
|
|
27
|
-
| `init [-y]` | Create the home and
|
|
28
|
-
| `project add <name> --dir <repo>` | Register a project
|
|
29
|
-
| `project list` / `project remove <name> [--purge]` | List
|
|
30
|
-
| `validate [-p name] [--task-file f]` | Validate the merged config and
|
|
31
|
-
| `run ["task"] [--task-file f] [-p name]` | Give the task to the lead and run
|
|
32
|
-
| `resume [run-id] [-p name]` | Continue an interrupted or failed run
|
|
33
|
-
| `status [-p name] [--monitor]` |
|
|
34
|
-
| `clear <run-id> [-p name] [--dry-run] [--keep-worktrees]` | Delete a
|
|
35
|
-
| `config show --resolved [-p name] [--json]` | Print every effective setting
|
|
36
|
-
| `doctor [-p name] [--json]` | Check
|
|
37
|
-
| `unlock [-p name] --force` | Remove the project
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
**Exit codes of `run` / `resume`:** `0` only when the lead reported `outcome: completed`; `2` for `partial` or `blocked` (also when the run went idle or hit `max_rounds` without a done); `1` for `failed` (also when the lead itself failed); `130` for `cancelled`. *Upgrading:* before this version an `idle` run exited `0` and a failed lead exited `2`; scripts that treated `0` as "the run ended" must now check for `0` as "the work was completed". Runs that ended before outcomes were recorded show as unverified (`partial`) and are not reported as a success.
|
|
42
|
-
|
|
43
|
-
Without `--project`, the project is the registered one whose `dir` is the longest prefix of the current directory; if none matches the command lists the registered projects and stops.
|
|
27
|
+
| `init [-y]` | Create the home and the global agent library. [details](docs/commands.md#init) |
|
|
28
|
+
| `project add <name> --dir <repo>` | Register a project. [details](docs/commands.md#project-add) |
|
|
29
|
+
| `project list` / `project remove <name> [--purge]` | List or unregister projects. [details](docs/commands.md#project-list-and-remove) |
|
|
30
|
+
| `validate [-p name] [--task-file f]` | Validate the merged config and show each agent's enforcement level. [details](docs/commands.md#validate) |
|
|
31
|
+
| `run ["task"] [--task-file f] [-p name]` | Give the task to the lead and run until done. [details](docs/commands.md#run) |
|
|
32
|
+
| `resume [run-id] [-p name]` | Continue an interrupted or failed run. [details](docs/commands.md#resume) |
|
|
33
|
+
| `status [-p name] [--monitor]` | Show agents, mail, the current wake-up and past runs (`--json`, `--monitor`). [details](docs/commands.md#status) |
|
|
34
|
+
| `clear <run-id> [-p name] [--dry-run] [--keep-worktrees]` | Delete a run with its task memory and worktrees. [details](docs/commands.md#clear) |
|
|
35
|
+
| `config show --resolved [-p name] [--json]` | Print every effective setting and where it came from. [details](docs/commands.md#config-show) |
|
|
36
|
+
| `doctor [-p name] [--json]` | Check config, git, the lock and runtime CLIs without running agents. [details](docs/commands.md#doctor) |
|
|
37
|
+
| `unlock [-p name] --force` | Remove the project lock a crashed run left behind. [details](docs/commands.md#unlock) |
|
|
38
|
+
|
|
39
|
+
Ctrl-C cancels a run cleanly and it can be continued with `resume` ([Stopping a run](docs/commands.md#stopping-a-run)). `run` and `resume` exit `0` only when the lead reported `completed`, `2` for partial or blocked, `1` for failed, `130` for cancelled ([Exit codes](docs/commands.md#exit-codes)). Without `-p`, the project is inferred from the current directory ([Choosing the project](docs/commands.md#choosing-the-project)).
|
|
44
40
|
|
|
45
41
|
## Monitor mod (Claude Code)
|
|
46
42
|
|
|
@@ -57,7 +53,7 @@ claude --plugin-dir /path/to/agent-lyceum/plugins/status-monitor
|
|
|
57
53
|
**Use it.**
|
|
58
54
|
- **Status line:** always on once loaded (`team 讀取中…` until the first poll, `team 無法取得狀態:…` when the CLI cannot run); shows the run state, round `n/max`, output tokens, the current step and unread mail. With several projects it shows one overview line (`team 1/3 running · a ... | b ...`).
|
|
59
55
|
- **Toasts:** a message pops up when a run finishes, is interrupted, or an agent's wake fails (prefixed `[project]` when several are watched). Nothing to do.
|
|
60
|
-
- **`/status-monitor`:** the pane
|
|
56
|
+
- **`/status-monitor`:** type it to open (or, if already open, close) the pane. It is off at session start unless `autoOpen` is set. In the **fullscreen layout** (`"tui": "fullscreen"` in `~/.claude/settings.json`, restart the session to apply; `/tui fullscreen` does the same) from 110 terminal columns it docks on the right at half the terminal width, and tabs and **關閉** (Close) can be clicked. Otherwise it shows above the prompt; the layout is fixed when the session starts, so a session started on the main screen stays that way. Keyboard (works in both): `x` closes, `1`-`9` or Tab/Enter switch task, Esc returns to the prompt, running the command again also closes. It shows, per project: the run id and state, task, progress and checklist, the agents working now and the queued mail, blocked integrations, notes and result summary, output tokens per runtime, per-agent wake statistics, the last 8 wakes. Each task (a project's current run and its last 3 past runs) is a tab. It refreshes with the polling interval while open.
|
|
61
57
|
|
|
62
58
|
**Configure it.** In `~/.claude/settings.json` under `pluginConfigs."status-monitor@inline"` (`options`):
|
|
63
59
|
|
|
@@ -66,6 +62,7 @@ claude --plugin-dir /path/to/agent-lyceum/plugins/status-monitor
|
|
|
66
62
|
| `command` | CLI to run, split on spaces, e.g. `node /path/to/agent-lyceum/dist/cli.js` | `agent-lyceum` |
|
|
67
63
|
| `project` | Registered project name(s) (`-p`); comma-separate to watch several; empty infers from the session's directory | empty |
|
|
68
64
|
| `intervalSeconds` | How often status is polled | `1` |
|
|
65
|
+
| `autoOpen` | Open the pane when a session starts (it seats only from 144 columns when opened unasked) | `false` |
|
|
69
66
|
|
|
70
67
|
Changes take effect on the next session start. If the pane shows `無法取得狀態:...`, the `command` could not run (usually `dist/cli.js` was not built) or the project name is not registered.
|
|
71
68
|
|
|
@@ -89,7 +86,7 @@ Changes take effect on the next session start. If the pane shows `無法取得
|
|
|
89
86
|
# project.yaml
|
|
90
87
|
dir: ~/code/web-app
|
|
91
88
|
team: { lead: lead }
|
|
92
|
-
dispatcher: { max_rounds: 30, max_parallel: 1, wake_timeout_sec: 600, retry: 1, strict: false, workspace_mode: auto }
|
|
89
|
+
dispatcher: { max_rounds: 30, max_parallel: 1, wake_timeout_sec: 600, retry: 1, strict: false, workspace_mode: auto, log_max_bytes: 8388608 }
|
|
93
90
|
agents:
|
|
94
91
|
lead: { resume: true, can_message: all, can_edit_agent_md: true }
|
|
95
92
|
fe-member: { runtime: codex, can_message: [lead], owns: ["src/web/**"] }
|
|
@@ -125,7 +122,7 @@ Enforcement is layered because no single mechanism is complete:
|
|
|
125
122
|
|
|
126
123
|
- **Claude Code**: per-run `--settings` with `Edit(...)` rules **plus** the OS sandbox (`allowWrite`/`denyWrite`, `allowUnsandboxedCommands: false`). Without the sandbox, `python -c` and similar bypass Edit rules, so the sandbox is required for the `os` level.
|
|
127
124
|
- **Codex**: `-s workspace-write` with `-c sandbox_workspace_write.writable_roots=[...]` (OS-enforced). Codex cannot forbid a single file inside the repo, so repo `CLAUDE.md`/`AGENTS.md` are protected by **post-hoc detection** only.
|
|
128
|
-
- **All runtimes**: protected files are hashed before the run; after each wake-up unauthorized changes are reverted, logged, and reported to the lead.
|
|
125
|
+
- **All runtimes**: protected files are hashed before the run; after each wake-up unauthorized changes are reverted, logged, and reported to the lead; what was written is kept in `runs/<run-id>/violations/` first.
|
|
129
126
|
|
|
130
127
|
`validate` and `run` print every agent's level per category (`os`, `tool-rules`, `post-hoc`, `prompt-only`) and the paths it can write outside the repo. With `dispatcher.strict: true`, a run is refused unless memory, `AGENT.md` and other agents' context are OS-enforced.
|
|
131
128
|
|
package/README.zh-TW.md
CHANGED
|
@@ -24,23 +24,19 @@ npx agent-lyceum status
|
|
|
24
24
|
|
|
25
25
|
| 指令 | 功能 |
|
|
26
26
|
|---|---|
|
|
27
|
-
| `init [-y]` | 建立 home 與全域 agent
|
|
28
|
-
| `project add <name> --dir <repo>` |
|
|
29
|
-
| `project list` / `project remove <name> [--purge]` |
|
|
30
|
-
| `validate [-p name] [--task-file f]` |
|
|
31
|
-
| `run ["task"] [--task-file f] [-p name]` | 把任務交給 lead
|
|
32
|
-
| `resume [run-id] [-p name]` | 接續被中斷或失敗的 run
|
|
33
|
-
| `status [-p name] [--monitor]` | 顯示 agent
|
|
34
|
-
| `clear <run-id> [-p name] [--dry-run] [--keep-worktrees]` |
|
|
35
|
-
| `config show --resolved [-p name] [--json]` |
|
|
36
|
-
| `doctor [-p name] [--json]` |
|
|
37
|
-
| `unlock [-p name] --force` |
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
**`run`/`resume` 的 exit code:** `0` 只代表 lead 回報 `outcome: completed`;`2` 代表 `partial` 或 `blocked`(run 閒置或達到 `max_rounds` 而沒有 done 也算);`1` 代表 `failed`(lead 本身失敗也算);`130` 代表 `cancelled`。*升級注意:* 舊版 `idle` 結束會回傳 `0`、lead 失敗回傳 `2`;原本把 `0` 當成「run 結束了」的腳本,現在 `0` 的意思是「工作確實完成」。在記錄結果狀態之前就結束的舊 run 會顯示為「未驗證」(`partial`),不會被當成成功。
|
|
42
|
-
|
|
43
|
-
未指定 `--project` 時,會選用 `dir` 為目前目錄最長前綴的已註冊專案;若沒有符合的專案,指令會列出已註冊專案後停止。
|
|
27
|
+
| `init [-y]` | 建立 home 與全域 agent 庫。 [詳細](docs/commands.zh-TW.md#init) |
|
|
28
|
+
| `project add <name> --dir <repo>` | 註冊專案。 [詳細](docs/commands.zh-TW.md#project-add) |
|
|
29
|
+
| `project list` / `project remove <name> [--purge]` | 列出或取消註冊專案。 [詳細](docs/commands.zh-TW.md#project-list-and-remove) |
|
|
30
|
+
| `validate [-p name] [--task-file f]` | 驗證設定並顯示每個 agent 的防護等級。 [詳細](docs/commands.zh-TW.md#validate) |
|
|
31
|
+
| `run ["task"] [--task-file f] [-p name]` | 把任務交給 lead 並執行到結束。 [詳細](docs/commands.zh-TW.md#run) |
|
|
32
|
+
| `resume [run-id] [-p name]` | 接續被中斷或失敗的 run。 [詳細](docs/commands.zh-TW.md#resume) |
|
|
33
|
+
| `status [-p name] [--monitor]` | 顯示 agent、信件、目前執行與歷次 run(支援 `--json`、`--monitor`)。 [詳細](docs/commands.zh-TW.md#status) |
|
|
34
|
+
| `clear <run-id> [-p name] [--dry-run] [--keep-worktrees]` | 刪除 run 與其任務記憶、worktree。 [詳細](docs/commands.zh-TW.md#clear) |
|
|
35
|
+
| `config show --resolved [-p name] [--json]` | 印出每項生效設定與其來源。 [詳細](docs/commands.zh-TW.md#config-show) |
|
|
36
|
+
| `doctor [-p name] [--json]` | 不執行 agent,檢查設定、git、鎖與 runtime CLI。 [詳細](docs/commands.zh-TW.md#doctor) |
|
|
37
|
+
| `unlock [-p name] --force` | 移除當機 run 留下的專案鎖。 [詳細](docs/commands.zh-TW.md#unlock) |
|
|
38
|
+
|
|
39
|
+
Ctrl-C 會乾淨地取消 run,之後可用 `resume` 接續([中止 run](docs/commands.zh-TW.md#中止-run))。`run`/`resume` 只有在 lead 回報 `completed` 時才 exit `0`;`partial`/`blocked` 為 `2`,`failed` 為 `1`,取消為 `130`([退出碼](docs/commands.zh-TW.md#退出碼))。未指定 `-p` 時,專案由目前目錄推斷([選擇專案](docs/commands.zh-TW.md#選擇專案))。
|
|
44
40
|
|
|
45
41
|
## 監控 mod(Claude Code)
|
|
46
42
|
|
|
@@ -57,7 +53,7 @@ claude --plugin-dir /path/to/agent-lyceum/plugins/status-monitor
|
|
|
57
53
|
**操作。**
|
|
58
54
|
- **狀態列:** 載入後常駐(第一次輪詢前顯示 `team 讀取中…`,CLI 跑不起來時顯示 `team 無法取得狀態:…`),顯示執行狀態、輪數 `n/max`、output tokens、目前步驟與未讀信件。監看多個專案時顯示一行總覽(`team 1/3 執行中 · a ... | b ...`)。
|
|
59
55
|
- **通知:** 執行完成、被中斷或某個 agent 喚醒失敗時會跳出訊息(監看多個專案時前面加 `[專案名]`),不需要任何操作。
|
|
60
|
-
- **`/status-monitor`:** session
|
|
56
|
+
- **`/status-monitor`:** 輸入即開啟面板(已開著則關閉)。session 啟動時預設不開,除非設定 `autoOpen`。在 **fullscreen 版面**(`~/.claude/settings.json` 設 `"tui": "fullscreen"` 後重開 session;`/tui fullscreen` 效果相同)且終端寬度 110 欄以上時,面板會靠右 dock 在終端寬度的一半,分頁與 **關閉** 都可以用滑鼠點。否則顯示在輸入框上方;版面在 session 啟動時就固定,從主畫面啟動的 session 不會變。鍵盤操作兩種版面都能用:`x` 關閉,`1`-`9` 或 Tab/Enter 切換任務,Esc 回到輸入框,再執行一次指令也會關閉。每個專案顯示:執行 id 與狀態、任務、進度與清單、正在工作的 agent 與排隊中的信件、受阻的整合、備註與結果摘要、各 runtime 的 output tokens、各 agent 的喚醒統計、最近 8 次喚醒。每個任務(專案目前的執行與最近 3 次過往執行)是一個分頁。面板開著時會依輪詢間隔自動更新。
|
|
61
57
|
|
|
62
58
|
**設定。** 在 `~/.claude/settings.json` 的 `pluginConfigs."status-monitor@inline"`(`options`):
|
|
63
59
|
|
|
@@ -66,6 +62,7 @@ claude --plugin-dir /path/to/agent-lyceum/plugins/status-monitor
|
|
|
66
62
|
| `command` | 要執行的 CLI,以空白分隔,例如 `node /path/to/agent-lyceum/dist/cli.js` | `agent-lyceum` |
|
|
67
63
|
| `project` | 已註冊的專案名稱(`-p`);用逗號分隔可同時監看多個;留空則依 session 所在目錄推斷 | 空 |
|
|
68
64
|
| `intervalSeconds` | 輪詢狀態的間隔(秒) | `1` |
|
|
65
|
+
| `autoOpen` | session 啟動時自動開啟面板(未經操作開啟時,終端需 144 欄以上才會顯示) | `false` |
|
|
69
66
|
|
|
70
67
|
設定變更要等下次啟動 session 才生效。面板若顯示 `無法取得狀態:...`,通常是 `command` 跑不起來(多半是還沒 build `dist/cli.js`),或專案名稱沒有註冊。
|
|
71
68
|
|
|
@@ -90,7 +87,7 @@ claude --plugin-dir /path/to/agent-lyceum/plugins/status-monitor
|
|
|
90
87
|
# project.yaml
|
|
91
88
|
dir: ~/code/web-app
|
|
92
89
|
team: { lead: lead }
|
|
93
|
-
dispatcher: { max_rounds: 30, max_parallel: 1, wake_timeout_sec: 600, retry: 1, strict: false, workspace_mode: auto }
|
|
90
|
+
dispatcher: { max_rounds: 30, max_parallel: 1, wake_timeout_sec: 600, retry: 1, strict: false, workspace_mode: auto, log_max_bytes: 8388608 }
|
|
94
91
|
agents:
|
|
95
92
|
lead: { resume: true, can_message: all, can_edit_agent_md: true }
|
|
96
93
|
fe-member: { runtime: codex, can_message: [lead], owns: ["src/web/**"] }
|
|
@@ -126,7 +123,7 @@ Agent 欄位:`runtime`(`claude-code`|`codex`;若 `model` 可辨識則可
|
|
|
126
123
|
|
|
127
124
|
- **Claude Code**:每次執行帶入 `--settings`,內含 `Edit(...)` 規則,**加上** OS 沙箱(`allowWrite`/`denyWrite`、`allowUnsandboxedCommands: false`)。沒有沙箱時,`python -c` 之類的做法能繞過 Edit 規則,因此 `os` 等級必須啟用沙箱。
|
|
128
125
|
- **Codex**:`-s workspace-write` 搭配 `-c sandbox_workspace_write.writable_roots=[...]`(由 OS 強制)。Codex 無法禁止 repo 內的單一檔案,所以 repo 的 `CLAUDE.md`/`AGENTS.md` 只能靠**事後偵測**保護。
|
|
129
|
-
- **所有 runtime**:執行前會對受保護檔案做雜湊;每次喚醒後,未經授權的變更會被還原、記錄,並通報 lead
|
|
126
|
+
- **所有 runtime**:執行前會對受保護檔案做雜湊;每次喚醒後,未經授權的變更會被還原、記錄,並通報 lead;被寫入的內容會先留存在 `runs/<run-id>/violations/`。
|
|
130
127
|
|
|
131
128
|
`validate` 與 `run` 會依類別(`os`、`tool-rules`、`post-hoc`、`prompt-only`)印出每個 agent 的防護等級,以及它能寫入 repo 之外的哪些路徑。設定 `dispatcher.strict: true` 時,除非記憶、`AGENT.md` 與其他 agent 的 context 都由 OS 強制保護,否則拒絕執行。
|
|
132
129
|
|
package/dist/assert.d.ts
ADDED
package/dist/assert.js
ADDED
package/dist/cli.js
CHANGED
|
@@ -15,6 +15,7 @@ import { addProject, initHome, removeProject } from "./scaffold.js";
|
|
|
15
15
|
import { buildStatusReport, buildTaskListReport, formatMonitor, formatRunDetail, formatStatusWithLog, formatTaskList, latestUnfinishedRun, runIsAlive } from "./status.js";
|
|
16
16
|
import { prepareTask, readTaskFile } from "./task.js";
|
|
17
17
|
import { formatEnforcement, validateProject } from "./validate.js";
|
|
18
|
+
import { must } from "./assert.js";
|
|
18
19
|
const program = new Command();
|
|
19
20
|
program
|
|
20
21
|
.name("agent-lyceum")
|
|
@@ -170,7 +171,11 @@ function cancelOnSignals() {
|
|
|
170
171
|
const onTerm = handler("Terminated");
|
|
171
172
|
process.on("SIGINT", onInt);
|
|
172
173
|
process.on("SIGTERM", onTerm);
|
|
173
|
-
return { signal: ac.signal, dispose: () =>
|
|
174
|
+
return { signal: ac.signal, dispose: () => {
|
|
175
|
+
process.off("SIGINT", onInt);
|
|
176
|
+
process.off("SIGTERM", onTerm);
|
|
177
|
+
},
|
|
178
|
+
};
|
|
174
179
|
}
|
|
175
180
|
function reportRun(summary, runDir) {
|
|
176
181
|
console.log(`\nRun ${summary.runId} ended: ${summary.endReason}, outcome: ${summary.outcome}, after ${summary.rounds} round(s). Logs: ${path.join(runDir, "log.jsonl")}`);
|
|
@@ -354,7 +359,7 @@ configCmd
|
|
|
354
359
|
const keys = Object.keys(sources).filter((k) => values[k] !== undefined);
|
|
355
360
|
const w = Math.max(...keys.map((k) => `${k} = ${show(values[k])}`.length));
|
|
356
361
|
for (const k of keys)
|
|
357
|
-
console.log(`${`${k} = ${show(values[k])}`.padEnd(w)} ${where(sources[k])}`);
|
|
362
|
+
console.log(`${`${k} = ${show(values[k])}`.padEnd(w)} ${where(must(sources[k], `source of ${k}`))}`);
|
|
358
363
|
}
|
|
359
364
|
catch (e) {
|
|
360
365
|
fail(e instanceof ConfigError ? e.message : e.message);
|
package/dist/config.d.ts
CHANGED
|
@@ -44,45 +44,46 @@ export declare function loadGlobal(home: string): {
|
|
|
44
44
|
agents: Record<string, {
|
|
45
45
|
runtime?: "claude-code" | "codex" | undefined;
|
|
46
46
|
model?: string | undefined;
|
|
47
|
-
effort?: "
|
|
47
|
+
effort?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
|
|
48
48
|
agent_md?: string | undefined;
|
|
49
49
|
memory?: {
|
|
50
50
|
global?: string | undefined;
|
|
51
51
|
project?: string | undefined;
|
|
52
52
|
} | undefined;
|
|
53
53
|
resume?: boolean | undefined;
|
|
54
|
-
can_message?: string[] |
|
|
54
|
+
can_message?: "all" | string[] | undefined;
|
|
55
55
|
can_edit_agent_md?: boolean | undefined;
|
|
56
56
|
owns?: string[] | undefined;
|
|
57
57
|
}>;
|
|
58
58
|
};
|
|
59
59
|
export declare function loadProjectRaw(home: string, name: string): {
|
|
60
|
+
dir: string;
|
|
61
|
+
team: {
|
|
62
|
+
lead: string;
|
|
63
|
+
};
|
|
64
|
+
dispatcher: {
|
|
65
|
+
max_rounds?: number | undefined;
|
|
66
|
+
max_parallel?: number | undefined;
|
|
67
|
+
wake_timeout_sec?: number | undefined;
|
|
68
|
+
retry?: number | undefined;
|
|
69
|
+
strict?: boolean | undefined;
|
|
70
|
+
workspace_mode?: "auto" | "shared" | "worktree" | undefined;
|
|
71
|
+
log_max_bytes?: number | undefined;
|
|
72
|
+
};
|
|
60
73
|
agents: Record<string, {
|
|
61
74
|
runtime?: "claude-code" | "codex" | undefined;
|
|
62
75
|
model?: string | undefined;
|
|
63
|
-
effort?: "
|
|
76
|
+
effort?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh" | undefined;
|
|
64
77
|
agent_md?: string | undefined;
|
|
65
78
|
memory?: {
|
|
66
79
|
global?: string | undefined;
|
|
67
80
|
project?: string | undefined;
|
|
68
81
|
} | undefined;
|
|
69
82
|
resume?: boolean | undefined;
|
|
70
|
-
can_message?: string[] |
|
|
83
|
+
can_message?: "all" | string[] | undefined;
|
|
71
84
|
can_edit_agent_md?: boolean | undefined;
|
|
72
85
|
owns?: string[] | undefined;
|
|
73
86
|
}>;
|
|
74
|
-
dir: string;
|
|
75
|
-
team: {
|
|
76
|
-
lead: string;
|
|
77
|
-
};
|
|
78
|
-
dispatcher: {
|
|
79
|
-
strict?: boolean | undefined;
|
|
80
|
-
max_rounds?: number | undefined;
|
|
81
|
-
max_parallel?: number | undefined;
|
|
82
|
-
wake_timeout_sec?: number | undefined;
|
|
83
|
-
retry?: number | undefined;
|
|
84
|
-
workspace_mode?: "shared" | "auto" | "worktree" | undefined;
|
|
85
|
-
};
|
|
86
87
|
};
|
|
87
88
|
export declare function resolveProject(home: string, name: string): ResolvedProject;
|
|
88
89
|
/** Registered projects: name -> repo dir (best effort; skips broken configs). */
|
package/dist/config.js
CHANGED
|
@@ -112,12 +112,20 @@ export function resolveProject(home, name) {
|
|
|
112
112
|
let runtime = pl.runtime;
|
|
113
113
|
if (runtime !== undefined)
|
|
114
114
|
sources.runtime = "project";
|
|
115
|
-
else
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
else {
|
|
116
|
+
const candidates = [
|
|
117
|
+
[inferRuntime(pl.model), "model"],
|
|
118
|
+
[gl.runtime, "global"],
|
|
119
|
+
[inferRuntime(gl.model), "model"],
|
|
120
|
+
];
|
|
121
|
+
for (const [r, from] of candidates) {
|
|
122
|
+
if (!r)
|
|
123
|
+
continue;
|
|
124
|
+
runtime = r;
|
|
125
|
+
sources.runtime = from;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
121
129
|
const isLead = agentName === lead;
|
|
122
130
|
const resume = pick("resume");
|
|
123
131
|
const canMessage = pick("can_message");
|
package/dist/dispatcher.d.ts
CHANGED
|
@@ -1,37 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import
|
|
3
|
-
import type { RunOutcome } from "./schema.js";
|
|
4
|
-
import { newRunId, type EndReason, type RunState } from "./run-store.js";
|
|
5
|
-
import { type PreparedTask } from "./task.js";
|
|
1
|
+
import { type RunOptions, type RunSummary } from "./run-session.js";
|
|
2
|
+
import { newRunId } from "./run-store.js";
|
|
6
3
|
export { newRunId };
|
|
7
4
|
export type { ActiveWake, EndReason, RunState, SentTopic, WakeRecord, WakeTopic } from "./run-store.js";
|
|
8
|
-
export
|
|
9
|
-
/** How many times a non-conforming `done` goes back to the lead before it is accepted as `partial`. */
|
|
10
|
-
export declare const MAX_DONE_REJECTIONS = 2;
|
|
11
|
-
export interface RunSummary {
|
|
12
|
-
runId: string;
|
|
13
|
-
runDir: string;
|
|
14
|
-
rounds: number;
|
|
15
|
-
endReason: EndReason;
|
|
16
|
-
/** How the work turned out; only "completed" means success. */
|
|
17
|
-
outcome: RunOutcome;
|
|
18
|
-
outcomeNote?: string;
|
|
19
|
-
verification?: string;
|
|
20
|
-
doneMessage?: {
|
|
21
|
-
subject: string;
|
|
22
|
-
body: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export interface RunOptions {
|
|
26
|
-
project: ResolvedProject;
|
|
27
|
-
/** The task for a new run; omit when resuming. */
|
|
28
|
-
task?: PreparedTask;
|
|
29
|
-
/** Continue this earlier run (same run dir, sessions and counters) instead of starting a new one. */
|
|
30
|
-
resume?: RunState;
|
|
31
|
-
runDir: string;
|
|
32
|
-
invoker?: Invoker;
|
|
33
|
-
/** Stop the run when this fires: running agents are killed, unread mail is kept, the run ends `cancelled` and can be resumed. */
|
|
34
|
-
signal?: AbortSignal;
|
|
35
|
-
log?: (line: string) => void;
|
|
36
|
-
}
|
|
5
|
+
export { MAX_DONE_REJECTIONS, RESULT_FILE, type RunOptions, type RunSummary } from "./run-session.js";
|
|
37
6
|
export declare function runTeam(opts: RunOptions): Promise<RunSummary>;
|