agentflowctl 0.19.0 → 0.19.2
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 +3 -3
- package/dist/setup.js +54 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npx agentflowctl doctor
|
|
|
20
20
|
npx agentflowctl run --req "登入表單加入驗證與錯誤訊息"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
`agent setup` 會找出本機可用的 Claude Code、Codex、Gemini CLI,讓你選擇要加入哪些 agent
|
|
23
|
+
`agent setup` 會找出本機可用的 Claude Code、Codex、Gemini CLI,讓你選擇要加入哪些 agent,接著選模型模式(預設 `balanced`),最後寫入專案根目錄的 `flow.config.json`。`doctor` 會檢查設定與 CLI 是否可執行。agentflowctl 沒有預設 agent,因此第一次使用要先完成設定。
|
|
24
24
|
|
|
25
25
|
若要使用現成的需求文件,改用:
|
|
26
26
|
|
|
@@ -121,7 +121,7 @@ agentflowctl resume f-xxxx --max-attempts 8
|
|
|
121
121
|
|
|
122
122
|
### Agent 設定
|
|
123
123
|
|
|
124
|
-
`agent setup` 可互動選擇已安裝的 CLI
|
|
124
|
+
`agent setup` 可互動選擇已安裝的 CLI 與模型模式。也可以用指令新增或修改;這些指令會寫入 `flow.config.json`:
|
|
125
125
|
|
|
126
126
|
```bash
|
|
127
127
|
agentflowctl agent add claude --adapter claude
|
|
@@ -133,7 +133,7 @@ agentflowctl agent cycle claude,codex
|
|
|
133
133
|
|
|
134
134
|
`agent add` 的 `--adapter` 可填 `claude`、`codex`、`gemini` 或 `command`。`--model` 指定個別 agent 的模型;`--extra-arg=--參數` 可重複使用,傳給該 CLI。使用 `command` adapter 時,把指令寫在 `--` 後,例如 `agentflowctl agent add aider --adapter command -- aider --message {prompt}`。`agent remove <名稱>` 會移除設定與參與名單;`agent cycle` 不帶名單則顯示目前參與者。
|
|
135
135
|
|
|
136
|
-
`model add/set/remove` 只修改指定 agent 的模型清單;`model remove` 移除最後一個模型時,會檢查參與的 agent 是否仍有模型,不論目前使用哪種模型模式。同一 adapter 的 `agent set` 會保留清單;換 adapter 時會清掉舊 adapter 的模型設定。`agent setup` 遇到同名 agent
|
|
136
|
+
`model add/set/remove` 只修改指定 agent 的模型清單;`model remove` 移除最後一個模型時,會檢查參與的 agent 是否仍有模型,不論目前使用哪種模型模式。同一 adapter 的 `agent set` 會保留清單;換 adapter 時會清掉舊 adapter 的模型設定。`agent setup` 遇到同名 agent 會先詢問是否覆寫。`agent setup` 最後會問模型模式:預設 `balanced`(設定裡已是 adaptive 時預設沿用 adaptive);選 `adaptive` 時會逐一詢問缺 `models` 的參與 agent,輸入「名稱 強度」(強度省略為 medium,Enter 結束),任何一個 agent 沒登記模型就回到模式選擇。精靈只寫入設定、不送請求驗證,寫入後可執行 `model check`。若 adaptive 模式下參與的 agent 缺 `models`,`run` 會列出所有缺 `models` 的 agent,並附上 `model add` 與 `model mode balanced` 兩種修法。
|
|
137
137
|
|
|
138
138
|
### 依階段與任務難度選模型
|
|
139
139
|
|
package/dist/setup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addAgent, setAgent, setCycle } from "./agentConfig.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { addModel, setModelMode } from "./modelConfig.js";
|
|
3
|
+
import { ModelStrength } from "./schemas.js";
|
|
4
4
|
import { ADAPTERS } from "./agents/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* `agentflowctl agent setup` 的互動精靈。
|
|
@@ -20,6 +20,57 @@ export async function runSetup(initial, deps) {
|
|
|
20
20
|
const changes = [];
|
|
21
21
|
const chosen = [];
|
|
22
22
|
const existing = () => Object.keys((cfg.agents ?? {}));
|
|
23
|
+
const hasModels = (c, name) => !!c.agents[name]?.models?.length;
|
|
24
|
+
/** 問模型模式:balanced 不用登記模型;adaptive 逐一登記缺 models 的 agent,只寫設定、不送請求驗證 */
|
|
25
|
+
async function chooseModelMode(start, notes) {
|
|
26
|
+
let next = start;
|
|
27
|
+
const stored = (next.modelSelection ?? {}).mode;
|
|
28
|
+
for (;;) {
|
|
29
|
+
const mode = (await ask("模型模式(balanced=沿用各 agent 的 model,adaptive=依階段自動選模)", stored ?? "balanced")).toLowerCase();
|
|
30
|
+
if (mode !== "balanced" && mode !== "adaptive") {
|
|
31
|
+
log(" 請輸入 balanced 或 adaptive");
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (mode === "balanced") {
|
|
35
|
+
if (stored === "adaptive") {
|
|
36
|
+
next = setModelMode(next, "balanced");
|
|
37
|
+
notes.push("modelSelection.mode → balanced");
|
|
38
|
+
}
|
|
39
|
+
return next;
|
|
40
|
+
}
|
|
41
|
+
let tried = next;
|
|
42
|
+
const lacking = next.cycle.filter((n) => !hasModels(next, n));
|
|
43
|
+
const empty = [];
|
|
44
|
+
for (const name of lacking) {
|
|
45
|
+
log(`${name} 沒有登記模型,adaptive 只看 models,請登記可用的模型與強度`);
|
|
46
|
+
for (;;) {
|
|
47
|
+
const line = (await ask(` ${name} 模型(名稱 強度 low|medium|high,強度省略為 medium,Enter 結束)`)).trim();
|
|
48
|
+
if (!line)
|
|
49
|
+
break;
|
|
50
|
+
const [model, strength = "medium", ...extra] = line.split(/\s+/);
|
|
51
|
+
if (extra.length || !ModelStrength.safeParse(strength).success) {
|
|
52
|
+
log(" 格式是「名稱 強度」,強度只能是 low、medium 或 high");
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
tried = addModel(tried, name, model, strength);
|
|
57
|
+
notes.push(`${name} 模型 ${model}(${strength})`);
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
log(` ${e.message}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!hasModels(tried, name))
|
|
64
|
+
empty.push(name);
|
|
65
|
+
}
|
|
66
|
+
if (empty.length) {
|
|
67
|
+
log(`⚠️ ${empty.join("、")} 沒有登記任何模型,無法使用 adaptive;請重新選擇模式`);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
log("已寫入模型設定但未驗證;寫入後可執行 agentflowctl model check 確認帳號能否呼叫");
|
|
71
|
+
return setModelMode(tried, "adaptive");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
23
74
|
const configured = Object.entries(deps.configured ?? {});
|
|
24
75
|
if (configured.length) {
|
|
25
76
|
const defs = (cfg.agents ?? {});
|
|
@@ -76,16 +127,7 @@ export async function runSetup(initial, deps) {
|
|
|
76
127
|
log(` ${e.message}`);
|
|
77
128
|
}
|
|
78
129
|
}
|
|
79
|
-
|
|
80
|
-
const defs = (cfg.agents ?? {});
|
|
81
|
-
const lacking = cfg.cycle.filter((n) => !defs[n]?.models?.length);
|
|
82
|
-
if (lacking.length && (cfg.modelSelection ?? {}).mode === "adaptive") {
|
|
83
|
-
log(`\n⚠️ ${missingModelsMessage(lacking)}`);
|
|
84
|
-
if (await confirm("改回 balanced 模式?(選 n 則維持 adaptive,請之後自行登記 models)", true)) {
|
|
85
|
-
cfg = setModelMode(cfg, "balanced");
|
|
86
|
-
changes.push("modelSelection.mode → balanced");
|
|
87
|
-
}
|
|
88
|
-
}
|
|
130
|
+
cfg = await chooseModelMode(cfg, changes);
|
|
89
131
|
const agents = cfg.agents;
|
|
90
132
|
log("\n即將寫入:");
|
|
91
133
|
for (const name of chosen)
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentflowctl",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.19.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.19.2",
|
|
5
|
+
"description": "讓 Claude Code、Codex、Gemini CLI 等 agent 分工整理需求、規劃、寫測試與程式並交叉審查,最後建立 PR;由程式推進流程,以測試與檢查結果把關",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ai",
|
|
8
8
|
"agent",
|