input-kanban 0.0.1 → 0.0.3
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/ENVIRONMENT.md +7 -1
- package/PROJECT_GUIDE.md +24 -0
- package/README.en.md +148 -0
- package/README.md +87 -96
- package/bin/input-kanban.js +12 -1
- package/package.json +3 -2
- package/public/index.html +85 -8
- package/src/orchestrator.js +126 -41
- package/src/runners/headlessRunner.js +51 -0
- package/src/runners/index.js +13 -0
- package/src/runners/tmuxRunner.js +170 -0
- package/src/runners/tmuxUtils.js +15 -0
- package/src/server.js +3 -3
- package/src/tmux.js +139 -0
- package/src/utils.js +9 -0
package/ENVIRONMENT.md
CHANGED
|
@@ -11,6 +11,7 @@ CLI options take precedence over environment variables. Environment variables ta
|
|
|
11
11
|
- `KANBAN_DEFAULT_REPO`: Default target repository path for new runs. Default: the current working directory when `input-kanban` is launched. CLI option: `--repo`.
|
|
12
12
|
- `KANBAN_RUNS_DIR`: Directory for run state, logs, and artifacts. Default: `.input-kanban/runs` under the user's home directory. CLI option: `--runs-dir`.
|
|
13
13
|
- `KANBAN_CODEX_BIN`: Codex CLI executable name or path. Default: `codex`. CLI option: `--codex-bin`.
|
|
14
|
+
- `KANBAN_RUNNER`: Runner mode. Supported values: `headless`, `tmux`. Default: `headless`. CLI option: `--runner`.
|
|
14
15
|
|
|
15
16
|
## Environment Example
|
|
16
17
|
|
|
@@ -19,6 +20,7 @@ PORT=8787 \
|
|
|
19
20
|
KANBAN_DEFAULT_REPO=/path/to/child-repo \
|
|
20
21
|
KANBAN_RUNS_DIR=/path/to/kanban-runs \
|
|
21
22
|
KANBAN_CODEX_BIN=codex \
|
|
23
|
+
KANBAN_RUNNER=headless \
|
|
22
24
|
input-kanban
|
|
23
25
|
```
|
|
24
26
|
|
|
@@ -29,11 +31,15 @@ input-kanban \
|
|
|
29
31
|
--port 8787 \
|
|
30
32
|
--repo /path/to/child-repo \
|
|
31
33
|
--runs-dir /path/to/kanban-runs \
|
|
32
|
-
--codex-bin codex
|
|
34
|
+
--codex-bin codex \
|
|
35
|
+
--runner headless
|
|
33
36
|
```
|
|
34
37
|
|
|
35
38
|
## Notes
|
|
36
39
|
|
|
37
40
|
- `KANBAN_DEFAULT_REPO` / `--repo` should point to the actual git repository where work should run.
|
|
41
|
+
- `KANBAN_RUNNER` / `--runner tmux` runs Codex tasks inside tmux windows while keeping scheduling and status tracking in the Node.js orchestrator.
|
|
42
|
+
- `KANBAN_RUNNER=tmux` is optional. Use it when you want live terminal visibility into planner, worker, and final judge sessions, or when you need to manually respond to Codex CLI approval prompts.
|
|
43
|
+
- tmux mode does not implement automatic approval. It does not bypass Codex CLI, repository, or system permission boundaries; any approval prompt must still be explicitly approved by the user in the relevant tmux window.
|
|
38
44
|
- The runtime runs directory contains task text, logs, model output, artifacts, and possible audit information. It should not be committed to git.
|
|
39
45
|
- Avoid writing machine-specific absolute paths into public or shared documentation.
|
package/PROJECT_GUIDE.md
CHANGED
|
@@ -322,6 +322,30 @@ npm run check
|
|
|
322
322
|
|
|
323
323
|
When editing `public/index.html`, also consider extracting the inline script and checking it with `node --check`.
|
|
324
324
|
|
|
325
|
+
## Manual Smoke Checklist
|
|
326
|
+
|
|
327
|
+
Use this checklist before an npm release when runner behavior or package contents
|
|
328
|
+
change. Record the exact commands, run ids, and artifact paths in the release
|
|
329
|
+
notes or handoff.
|
|
330
|
+
|
|
331
|
+
1. Headless runner:
|
|
332
|
+
- Start the app with `input-kanban --runner headless --runs-dir <tmp-runs-dir> --repo <target-repo> --port <free-port>`.
|
|
333
|
+
- Create a small run, plan it, dispatch at least one worker, and run the final judge if the plan requires it.
|
|
334
|
+
- Verify the run state reports `runner: headless`, no task exposes `tmux` metadata, and role directories contain the expected `prompt.md`, `events.jsonl`, `stderr.log`, `last_message.md`, and `exit_code` files.
|
|
335
|
+
- Stop the run and verify no unrelated local process is affected.
|
|
336
|
+
|
|
337
|
+
2. tmux runner, only when `tmux -V` succeeds:
|
|
338
|
+
- Start the app with `input-kanban --runner tmux --runs-dir <tmp-runs-dir> --repo <target-repo> --port <free-port>`.
|
|
339
|
+
- Create a small run and click Plan. Verify a session named `input-kanban-<runId>` exists and has a planner window.
|
|
340
|
+
- Dispatch workers. Verify each worker gets its own window and each role directory writes `run.sh` and `tmux.json` with the expected `sessionName`, `windowName`, `target`, `attachCommand`, and `selectWindowCommand`.
|
|
341
|
+
- Complete or stop the run. Verify stop removes only the exact `input-kanban-<runId>` tmux session and leaves any other tmux session running.
|
|
342
|
+
- Do not mark this smoke as passed when tmux is unavailable or when these tmux checks were not run.
|
|
343
|
+
|
|
344
|
+
3. Package dry run:
|
|
345
|
+
- Run `npm pack --dry-run`.
|
|
346
|
+
- Verify the package includes `bin/`, `src/`, `public/`, `README.md`, `README.en.md`, `PROJECT_GUIDE.md`, `ENVIRONMENT.md`, and `package.json`.
|
|
347
|
+
- Verify no runtime run directories, local logs, or unrelated temporary artifacts are included.
|
|
348
|
+
|
|
325
349
|
## Change Guidelines
|
|
326
350
|
|
|
327
351
|
- Do not add automatic worker retry unless there is a verified rollback or idempotency mechanism.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Input Kanban
|
|
2
|
+
|
|
3
|
+
[中文](README.md) | English
|
|
4
|
+
|
|
5
|
+
Input Kanban is a local Codex orchestration dashboard. The recommended path is to install it from npm, run `input-kanban` inside the target repository, and use the browser UI to manage planning, worker execution, and final judging.
|
|
6
|
+
|
|
7
|
+
## Recommended Usage
|
|
8
|
+
|
|
9
|
+
### 1. Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g input-kanban
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Verify the installation:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
input-kanban --help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Start in the Target Repository
|
|
22
|
+
|
|
23
|
+
Enter the repository you want Codex to modify or inspect:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cd /path/to/your/repo
|
|
27
|
+
input-kanban
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
By default, this starts a local server at:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
http://127.0.0.1:8787
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Open that URL in your browser to use the dashboard.
|
|
37
|
+
|
|
38
|
+
### 3. Start with an Explicit Repository
|
|
39
|
+
|
|
40
|
+
If you do not want to `cd` into the target repository first, pass it explicitly:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
input-kanban --repo /path/to/your/repo
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Common Startup Options
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
input-kanban --port 8787
|
|
50
|
+
input-kanban --host 127.0.0.1
|
|
51
|
+
input-kanban --runs-dir ~/.input-kanban/runs
|
|
52
|
+
input-kanban --codex-bin codex
|
|
53
|
+
input-kanban --runner headless
|
|
54
|
+
input-kanban --open
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Defaults:
|
|
58
|
+
|
|
59
|
+
- target repository: the current directory where `input-kanban` is launched
|
|
60
|
+
- host: `127.0.0.1`
|
|
61
|
+
- port: `8787`
|
|
62
|
+
- runs directory: `~/.input-kanban/runs`
|
|
63
|
+
- Codex command: `codex`
|
|
64
|
+
- runner: `headless`
|
|
65
|
+
|
|
66
|
+
`--runner` currently supports `headless` and `tmux`. The default behavior remains `headless`; `tmux` creates one `input-kanban-<runId>` session per run and one window for the planner, each worker, and the final judge.
|
|
67
|
+
|
|
68
|
+
tmux mode still leaves batch barriers, `maxParallel`, final judge sequencing, and `judge_input.json` generation in Node.js. Each role output directory gets `run.sh` and `tmux.json`; status continues to be driven by `events.jsonl`, `stderr.log`, `last_message.md`, `exit_code`, and existing artifact files.
|
|
69
|
+
|
|
70
|
+
tmux mode is optional. It is intended for live terminal viewing of each Codex role and for cases where the Codex CLI asks the user for manual approval. It does not implement automatic approval and does not bypass Codex CLI, repository, or system permission boundaries; any approval prompt still has to be explicitly approved by the user in the relevant tmux window.
|
|
71
|
+
|
|
72
|
+
## Using the Dashboard
|
|
73
|
+
|
|
74
|
+
1. Click `New Run`.
|
|
75
|
+
2. Enter a label, target repository, and task description.
|
|
76
|
+
3. Click `Create Run`.
|
|
77
|
+
4. Click `Plan` to let the Codex planner generate batches and workers.
|
|
78
|
+
5. Click `Dispatch` to run workers by batch barrier and concurrency limits.
|
|
79
|
+
6. Inspect execution logs, final messages, error logs, and artifacts.
|
|
80
|
+
7. After all batches complete, click `Final Judge`.
|
|
81
|
+
8. Stop or archive a run when needed, or manually mark a confirmed failed/unknown worker as completed.
|
|
82
|
+
|
|
83
|
+
## What It Is For
|
|
84
|
+
|
|
85
|
+
- Split a larger Codex programming task into multiple workers.
|
|
86
|
+
- Control execution order with batch barriers.
|
|
87
|
+
- Observe each worker's local status, logs, and final response.
|
|
88
|
+
- Run a final judge after all workers complete.
|
|
89
|
+
- Keep local run records for debugging and recovery.
|
|
90
|
+
|
|
91
|
+
## Runtime Data Location
|
|
92
|
+
|
|
93
|
+
Runtime data is stored in the configured runs directory. The CLI default is:
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
~/.input-kanban/runs
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Each run roughly looks like this:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
runs/<runId>/
|
|
103
|
+
├── task.md
|
|
104
|
+
├── plan.json
|
|
105
|
+
├── run_state.json
|
|
106
|
+
├── planner/
|
|
107
|
+
├── workers/<taskId>/
|
|
108
|
+
└── judge/
|
|
109
|
+
├── judge_input.json
|
|
110
|
+
└── verdict.json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
These files are local run records and do not need to be committed to your application repository.
|
|
114
|
+
|
|
115
|
+
## Requirements
|
|
116
|
+
|
|
117
|
+
- Node.js 20 or newer.
|
|
118
|
+
- Codex CLI installed and configured.
|
|
119
|
+
- The `codex` command works in your terminal, or `--codex-bin` points to the Codex executable.
|
|
120
|
+
|
|
121
|
+
## Maintainer Development
|
|
122
|
+
|
|
123
|
+
If you want to develop Input Kanban itself instead of using it as an end user:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git clone https://github.com/zhang3xing1/Input-Kanban.git
|
|
127
|
+
cd Input-Kanban
|
|
128
|
+
npm install
|
|
129
|
+
npm start
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
For local CLI development:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
npm link
|
|
136
|
+
input-kanban --help
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Run checks:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npm run check
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## More Documentation
|
|
146
|
+
|
|
147
|
+
- [Project guide](PROJECT_GUIDE.md)
|
|
148
|
+
- [Environment variables](ENVIRONMENT.md)
|
package/README.md
CHANGED
|
@@ -1,140 +1,102 @@
|
|
|
1
1
|
# Input Kanban
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
中文 | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Input Kanban 是一个本地 Codex 编排看板。推荐通过 npm 安装,然后在目标代码仓库里运行 `input-kanban`,用浏览器管理任务拆分、并发执行和最终验收。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
PROJECT_GUIDE.md
|
|
9
|
-
```
|
|
7
|
+
## 推荐使用方式
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
### 1. 安装
|
|
12
10
|
|
|
13
|
-
```
|
|
14
|
-
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g input-kanban
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
验证安装:
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
- start a `codex exec` planner and materialize `plan.json`;
|
|
23
|
-
- safely retry planner runs before any worker or judge starts;
|
|
24
|
-
- detect `plan_empty` when the planner returns zero tasks;
|
|
25
|
-
- schedule workers by strict batch barriers and `batch.maxParallel`;
|
|
26
|
-
- generate `judge_input.json` before the final judge pass;
|
|
27
|
-
- start an independent `codex exec` final judge;
|
|
28
|
-
- aggregate PID, exit code, events, stderr, last message, artifacts, and Codex session IDs;
|
|
29
|
-
- stop runs, soft-archive runs, and manually mark failed or unknown workers as completed.
|
|
17
|
+
```bash
|
|
18
|
+
input-kanban --help
|
|
19
|
+
```
|
|
30
20
|
|
|
31
|
-
|
|
21
|
+
### 2. 在目标仓库启动
|
|
32
22
|
|
|
33
|
-
|
|
23
|
+
进入你希望 Codex 修改或检查的代码仓库:
|
|
34
24
|
|
|
35
25
|
```bash
|
|
26
|
+
cd /path/to/your/repo
|
|
36
27
|
input-kanban
|
|
37
28
|
```
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
默认会启动本地服务:
|
|
40
31
|
|
|
41
|
-
```
|
|
42
|
-
|
|
32
|
+
```text
|
|
33
|
+
http://127.0.0.1:8787
|
|
43
34
|
```
|
|
44
35
|
|
|
45
|
-
|
|
36
|
+
打开浏览器访问这个地址即可使用看板。
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
### 3. 指定目标仓库启动
|
|
39
|
+
|
|
40
|
+
如果不想先 `cd` 到目标仓库,也可以显式指定:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
input-kanban --repo /path/to/your/repo
|
|
49
44
|
```
|
|
50
45
|
|
|
51
|
-
|
|
46
|
+
## 常用启动参数
|
|
52
47
|
|
|
53
48
|
```bash
|
|
54
49
|
input-kanban --port 8787
|
|
55
50
|
input-kanban --host 127.0.0.1
|
|
56
51
|
input-kanban --runs-dir ~/.input-kanban/runs
|
|
57
52
|
input-kanban --codex-bin codex
|
|
53
|
+
input-kanban --runner headless
|
|
58
54
|
input-kanban --open
|
|
59
55
|
```
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
默认值:
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
- 目标仓库:启动 `input-kanban` 时的当前目录
|
|
60
|
+
- host:`127.0.0.1`
|
|
61
|
+
- port:`8787`
|
|
62
|
+
- runs 目录:`~/.input-kanban/runs`
|
|
63
|
+
- Codex 命令:`codex`
|
|
64
|
+
- runner:`headless`
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
`--runner` 当前支持 `headless` 和 `tmux`。默认行为保持 `headless`;`tmux` 会为每个 run 创建一个 `input-kanban-<runId>` session,并为 planner、每个 worker、final judge 创建独立 window。
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
npm link
|
|
71
|
-
input-kanban
|
|
72
|
-
```
|
|
68
|
+
tmux 模式仍由 Node.js 负责 batch barrier、`maxParallel`、final judge 顺序和 `judge_input.json` 生成。每个角色输出目录会写入 `run.sh` 和 `tmux.json`,状态继续由 `events.jsonl`、`stderr.log`、`last_message.md`、`exit_code` 和既有 artifact 文件驱动。
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
1. Click `New Run`, then enter a label, target repo, max parallel value, and task text.
|
|
77
|
-
2. Click `Create Run`.
|
|
78
|
-
3. Click `Plan` to start the planner:
|
|
79
|
-
- planner uses `codex exec --json --sandbox read-only`;
|
|
80
|
-
- output is stored under `runs/<runId>/planner/`.
|
|
81
|
-
4. When planning succeeds, `plan.json` is created and the worker list is shown.
|
|
82
|
-
5. Click `Dispatch` to start workers according to batch barriers and `batch.maxParallel`.
|
|
83
|
-
6. The page polls status every 3 seconds.
|
|
84
|
-
7. After all batches complete, click `Final Judge` to run the final judge pass.
|
|
85
|
-
|
|
86
|
-
The current UI labels are localized, but the project documentation is written in English for easier agent consumption.
|
|
87
|
-
|
|
88
|
-
## Planner Output Format
|
|
89
|
-
|
|
90
|
-
The preferred planner response is a JSON object with `batches`. The older `tasks` shape is also supported.
|
|
91
|
-
|
|
92
|
-
```json
|
|
93
|
-
{
|
|
94
|
-
"batches": [
|
|
95
|
-
{
|
|
96
|
-
"id": "batch-1",
|
|
97
|
-
"name": "first batch name",
|
|
98
|
-
"maxParallel": 3,
|
|
99
|
-
"tasks": [
|
|
100
|
-
{
|
|
101
|
-
"id": "T-01",
|
|
102
|
-
"name": "short name",
|
|
103
|
-
"prompt": "complete worker prompt",
|
|
104
|
-
"sandbox": "workspace-write",
|
|
105
|
-
"expectedArtifacts": ["tmp/example-result.json"]
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
],
|
|
110
|
-
"finalJudgeRequired": true
|
|
111
|
-
}
|
|
112
|
-
```
|
|
70
|
+
tmux 模式是可选能力,主要用于在终端里实时查看每个 Codex 角色的执行过程,并在 Codex CLI 需要人工确认时让用户手动处理。它不会实现自动审批,也不会绕过 Codex CLI、仓库权限或系统权限的安全边界;所有需要确认的操作仍必须由用户在对应 tmux window 中明确批准。
|
|
113
71
|
|
|
114
|
-
|
|
72
|
+
## 在看板里如何使用
|
|
115
73
|
|
|
116
|
-
|
|
74
|
+
1. 点击 `新建任务批次`。
|
|
75
|
+
2. 输入批次名称、目标仓库和任务说明。
|
|
76
|
+
3. 点击 `创建批次`。
|
|
77
|
+
4. 点击 `拆分任务`,让 Codex planner 生成 batches 和 workers。
|
|
78
|
+
5. 点击 `派发执行`,按 batch barrier 和并发限制运行 workers。
|
|
79
|
+
6. 查看执行日志、最终回复、错误日志和产物。
|
|
80
|
+
7. 所有 batch 完成后,点击 `汇总验收`。
|
|
81
|
+
8. 必要时可以停止或归档 run,也可以手动标记已确认完成的失败/未知 worker。
|
|
117
82
|
|
|
118
|
-
|
|
83
|
+
## 它适合做什么
|
|
119
84
|
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
- expected artifacts
|
|
85
|
+
- 把一个较大的 Codex 编程任务拆成多个 worker。
|
|
86
|
+
- 按批次阻塞关系控制执行顺序。
|
|
87
|
+
- 在本地观察每个 worker 的状态、日志和最终回复。
|
|
88
|
+
- 在所有 worker 完成后,让 final judge 汇总验收。
|
|
89
|
+
- 保留本地运行记录,便于排查和恢复。
|
|
126
90
|
|
|
127
|
-
|
|
91
|
+
## 运行数据保存位置
|
|
128
92
|
|
|
129
|
-
|
|
130
|
-
- it calls `thread/list`;
|
|
131
|
-
- it matches sessions using prompt markers:
|
|
132
|
-
- `ORCHESTRATOR_RUN_ID`
|
|
133
|
-
- `ORCHESTRATOR_TASK_ID`
|
|
93
|
+
运行数据会保存到 runs 目录。CLI 默认位置是:
|
|
134
94
|
|
|
135
|
-
|
|
95
|
+
```text
|
|
96
|
+
~/.input-kanban/runs
|
|
97
|
+
```
|
|
136
98
|
|
|
137
|
-
|
|
99
|
+
每个 run 大致结构如下:
|
|
138
100
|
|
|
139
101
|
```text
|
|
140
102
|
runs/<runId>/
|
|
@@ -148,10 +110,39 @@ runs/<runId>/
|
|
|
148
110
|
└── verdict.json
|
|
149
111
|
```
|
|
150
112
|
|
|
151
|
-
|
|
113
|
+
这些文件是本地运行记录,不需要提交到你的业务仓库。
|
|
114
|
+
|
|
115
|
+
## 使用前提
|
|
152
116
|
|
|
153
|
-
|
|
117
|
+
- 已安装 Node.js 20 或更高版本。
|
|
118
|
+
- 已安装并配置可用的 Codex CLI。
|
|
119
|
+
- `codex` 命令能在终端中正常运行,或通过 `--codex-bin` 指定 Codex 可执行文件路径。
|
|
120
|
+
|
|
121
|
+
## 维护者开发
|
|
122
|
+
|
|
123
|
+
如果你要开发 Input Kanban 本身,而不是作为用户使用:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git clone https://github.com/zhang3xing1/Input-Kanban.git
|
|
127
|
+
cd Input-Kanban
|
|
128
|
+
npm install
|
|
129
|
+
npm start
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
本地 CLI 开发:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
npm link
|
|
136
|
+
input-kanban --help
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
检查:
|
|
154
140
|
|
|
155
141
|
```bash
|
|
156
142
|
npm run check
|
|
157
143
|
```
|
|
144
|
+
|
|
145
|
+
## 更多文档
|
|
146
|
+
|
|
147
|
+
- [项目实现说明](PROJECT_GUIDE.md)
|
|
148
|
+
- [环境变量](ENVIRONMENT.md)
|
package/bin/input-kanban.js
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
4
|
|
|
5
|
+
const VALID_RUNNERS = ['headless', 'tmux'];
|
|
6
|
+
|
|
7
|
+
function validateRunner(value, source) {
|
|
8
|
+
if (VALID_RUNNERS.includes(value)) return value;
|
|
9
|
+
throw new Error(`invalid ${source}: ${value}; expected one of: ${VALID_RUNNERS.join(', ')}`);
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
function parseArgs(argv) {
|
|
6
|
-
const args = { host: '127.0.0.1', port: undefined, repo: undefined, runsDir: undefined, codexBin: undefined, open: false, help: false };
|
|
13
|
+
const args = { host: '127.0.0.1', port: undefined, repo: undefined, runsDir: undefined, codexBin: undefined, runner: undefined, open: false, help: false };
|
|
7
14
|
for (let i = 0; i < argv.length; i++) {
|
|
8
15
|
const arg = argv[i];
|
|
9
16
|
const next = () => argv[++i];
|
|
@@ -15,6 +22,7 @@ function parseArgs(argv) {
|
|
|
15
22
|
else if (arg === '--repo' || arg === '-r') args.repo = next();
|
|
16
23
|
else if (arg === '--runs-dir') args.runsDir = next();
|
|
17
24
|
else if (arg === '--codex-bin') args.codexBin = next();
|
|
25
|
+
else if (arg === '--runner') args.runner = validateRunner(next(), '--runner');
|
|
18
26
|
else throw new Error(`unknown argument: ${arg}`);
|
|
19
27
|
}
|
|
20
28
|
return args;
|
|
@@ -32,6 +40,7 @@ Options:
|
|
|
32
40
|
-r, --repo <path> Default target repository, default current directory
|
|
33
41
|
--runs-dir <path> Runtime runs directory, default ~/.input-kanban/runs
|
|
34
42
|
--codex-bin <path> Codex CLI executable, default codex
|
|
43
|
+
--runner <mode> Runner mode: headless or tmux, default headless
|
|
35
44
|
--open Open browser after starting
|
|
36
45
|
--no-open Do not open browser, default
|
|
37
46
|
-h, --help Show help
|
|
@@ -54,6 +63,7 @@ try {
|
|
|
54
63
|
else if (!process.env.KANBAN_DEFAULT_REPO) process.env.KANBAN_DEFAULT_REPO = process.cwd();
|
|
55
64
|
if (args.runsDir) process.env.KANBAN_RUNS_DIR = path.resolve(args.runsDir);
|
|
56
65
|
if (args.codexBin) process.env.KANBAN_CODEX_BIN = args.codexBin;
|
|
66
|
+
if (args.runner) process.env.KANBAN_RUNNER = args.runner;
|
|
57
67
|
|
|
58
68
|
const { startServer } = await import('../src/server.js');
|
|
59
69
|
const instance = await startServer({ host: process.env.HOST, port: Number(process.env.PORT || 8787), log: false });
|
|
@@ -61,6 +71,7 @@ try {
|
|
|
61
71
|
console.log(`URL: ${instance.url}`);
|
|
62
72
|
console.log(`Repo: ${instance.defaultRepo}`);
|
|
63
73
|
console.log(`Runs: ${instance.runsDir}`);
|
|
74
|
+
console.log(`Runner: ${instance.runner}`);
|
|
64
75
|
if (args.open) openBrowser(instance.url);
|
|
65
76
|
const shutdown = () => { instance.stop().finally(() => process.exit(0)); };
|
|
66
77
|
process.on('SIGINT', shutdown);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "input-kanban",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"input-kanban": "bin/input-kanban.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"start": "node bin/input-kanban.js",
|
|
10
|
-
"check": "node --check bin/input-kanban.js && node --check src/server.js && node --check src/orchestrator.js && node --check src/appServerClient.js && node --check src/utils.js"
|
|
10
|
+
"check": "node --check bin/input-kanban.js && node --check src/server.js && node --check src/orchestrator.js && node --check src/appServerClient.js && node --check src/utils.js && node --check src/runners/index.js && node --check src/runners/headlessRunner.js && node --check src/runners/tmuxRunner.js && node --check src/runners/tmuxUtils.js && node --check src/tmux.js && node --test"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {},
|
|
13
13
|
"description": "A local Codex orchestration kanban dashboard",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"src",
|
|
17
17
|
"public",
|
|
18
18
|
"README.md",
|
|
19
|
+
"README.en.md",
|
|
19
20
|
"PROJECT_GUIDE.md",
|
|
20
21
|
"ENVIRONMENT.md"
|
|
21
22
|
],
|