@kyo-so/cli 0.4.1 → 0.6.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/CHANGELOG.md +58 -0
- package/README.ja.md +55 -18
- package/README.md +59 -19
- package/README.zh-CN.md +55 -18
- package/dist/acp/FakeAgentManager.d.ts +13 -1
- package/dist/acp/prompts.d.ts +2 -1
- package/dist/aggregate/aggregateFindings.d.ts +5 -2
- package/dist/bin/kyoso.js +2112 -213
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/config/loadConfig.d.ts +8 -0
- package/dist/config/projectScope.d.ts +15 -0
- package/dist/config/schema.d.ts +9 -0
- package/dist/config/tomlConfigLoader.d.ts +1 -0
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/types.d.ts +21 -1
- package/dist/core/verification.d.ts +24 -0
- package/dist/index.js +1996 -130
- package/dist/judge/prompt.d.ts +7 -2
- package/dist/judge/provider.d.ts +7 -1
- package/examples/claude-only.toml +2 -0
- package/examples/codex-only.toml +2 -0
- package/examples/kyoso.toml +11 -0
- package/package.json +2 -1
- package/examples/claude-only.config.ts +0 -9
- package/examples/codex-only.config.ts +0 -9
- package/examples/kyoso.config.ts +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,64 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.6.0] - 2026-07-08
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- TOML config loading with XDG user-global layering:
|
|
15
|
+
`$XDG_CONFIG_HOME/kyoso/config.toml` or `~/.config/kyoso/config.toml`, then
|
|
16
|
+
project `kyoso.toml`.
|
|
17
|
+
- Unknown-key detection for user-global `config.toml`; security-sensitive
|
|
18
|
+
unknown settings fail closed by default, with `--allow-unknown-config` as an
|
|
19
|
+
explicit opt-out.
|
|
20
|
+
- Project TOML scope validation for repository-owned settings, including
|
|
21
|
+
additive `workspace.deny` and tightening-only security/network keys.
|
|
22
|
+
- `kyoso doctor` now reports global, project TOML, and legacy TypeScript config
|
|
23
|
+
layers.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- `kyoso init` now writes `kyoso.toml`.
|
|
28
|
+
- `--config` now fails when the specified file does not exist.
|
|
29
|
+
- Default Claude agent timeout raised from 240s to 300s; dogfooding traces
|
|
30
|
+
showed frequent reviews truncated at the previous limit.
|
|
31
|
+
- Repository dogfooding config and examples now use TOML.
|
|
32
|
+
|
|
33
|
+
### Deprecated
|
|
34
|
+
|
|
35
|
+
- `kyoso.config.ts` remains supported through the existing trust flow, but emits
|
|
36
|
+
a deprecation warning. When both `kyoso.toml` and `kyoso.config.ts` exist,
|
|
37
|
+
TOML takes precedence.
|
|
38
|
+
|
|
39
|
+
## [0.5.0] - 2026-07-08
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- Cross-validation classification on aggregated findings: findings backed by
|
|
44
|
+
both agents are marked `corroborated`, single-agent findings `single_source`.
|
|
45
|
+
- Fusion-style cross-model analysis from the advisory judge: blind spots,
|
|
46
|
+
semantic contradictions, and partial coverage are reported as advisory
|
|
47
|
+
metadata (`crossModelAnalysis`); the deterministic decision is unchanged.
|
|
48
|
+
- Optional adversarial verification round (`verification.enabled`, default
|
|
49
|
+
off): single-source high/critical findings are sent to the other agent with
|
|
50
|
+
a skeptical refute-first prompt. Annotate-only: verdicts adjust confidence
|
|
51
|
+
and notes, never severity or the decision.
|
|
52
|
+
- CI-ready MCP stdio and ACP subprocess integration tests now cover the real
|
|
53
|
+
protocol boundaries without live LLM credentials. `pack:verify` also starts
|
|
54
|
+
the packed CLI bin as an MCP server and checks its version and tool list.
|
|
55
|
+
- Nix development shell pinning Node.js and Bun for reproducible local setups.
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- Reviewer prompts now require concise English finding titles (evidence,
|
|
60
|
+
recommendations, and summaries may stay in the user's language) and clarify
|
|
61
|
+
that selected files show the pre-change base state during diff reviews.
|
|
62
|
+
- Same-category findings that reference overlapping line ranges in the same
|
|
63
|
+
file now merge regardless of title wording, so cross-model corroboration no
|
|
64
|
+
longer depends on title phrasing.
|
|
65
|
+
|
|
8
66
|
## [0.4.1] - 2026-07-07
|
|
9
67
|
|
|
10
68
|
### Changed
|
package/README.ja.md
CHANGED
|
@@ -10,6 +10,10 @@ Kyo-so (Kyoso / 協奏) は、AI coding workflow 向けの MCP-native、ACP-powe
|
|
|
10
10
|
|
|
11
11
|
「協奏」という名前には、複数の独立した奏者がそれぞれの役割を保ちながら、ひとつの成果をつくるという意味を込めています。
|
|
12
12
|
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="https://raw.githubusercontent.com/hokupod/kyoso/main/docs/assets/kyoso-ensemble.png" alt="指揮者がドラマー・バイオリニスト・ピアニストをまとめる様子" width="480">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
13
17
|
Kyo-so は Codex と Claude の reviewer を連携させ、次のレビューを行います。
|
|
14
18
|
|
|
15
19
|
- implementation plan review
|
|
@@ -24,7 +28,7 @@ Kyoso はコード変更を適用しません。
|
|
|
24
28
|
|
|
25
29
|
### Claude Only / Codex Only
|
|
26
30
|
|
|
27
|
-
Kyoso は Claude だけ、または Codex だけでも実行できます。利用できない backend は `kyoso.
|
|
31
|
+
Kyoso は Claude だけ、または Codex だけでも実行できます。利用できない backend は `kyoso.toml` で無効化してください。例は `examples/claude-only.toml` と `examples/codex-only.toml` にあります。
|
|
28
32
|
|
|
29
33
|
single-agent mode では、残った backend が `combined_reviewer` として 1 回だけ実行され、implementation と architecture/security の両方を確認します。JSON output には `reviewMode: "single_agent"` と `agentsUsed` が入り、Markdown output には cross-model verification が行われていないことと disagreements が N/A であることを表示します。
|
|
30
34
|
|
|
@@ -102,6 +106,7 @@ Naming note: npm パッケージは `@kyo-so/cli` (製品名 Kyo-so に対応)
|
|
|
102
106
|
ローカル開発:
|
|
103
107
|
|
|
104
108
|
```bash
|
|
109
|
+
nix develop
|
|
105
110
|
safe-chain bun install
|
|
106
111
|
safe-chain bun run typecheck
|
|
107
112
|
safe-chain bun test
|
|
@@ -110,6 +115,8 @@ safe-chain bun run build
|
|
|
110
115
|
|
|
111
116
|
パッケージ化された CLI を実行するには Node.js 20 以降が必要です。
|
|
112
117
|
|
|
118
|
+
Nix dev shell は Node.js 24 と nixpkgs が提供する Bun version を固定します。`.envrc` を確認してから `direnv allow` を一度実行すると、自動で shell を読み込めます。CI は Bun 1.3.14 に pin したままです。現在の nixpkgs Bun version は少し異なる場合がありますが、`flake.lock` により local shell の再現性を保ちます。
|
|
119
|
+
|
|
113
120
|
既知の配布リスク: `@modelcontextprotocol/server` にはまだ stable release がありません。Kyoso は現在 prerelease API を pin しているため、MCP SDK API の変更に追従する follow-up release が必要になる場合があります。
|
|
114
121
|
|
|
115
122
|
## CLI
|
|
@@ -200,6 +207,8 @@ Kyoso は provider credentials を保存しません。Child agent environment v
|
|
|
200
207
|
|
|
201
208
|
Repository content、plans、diffs、selected files は backend prompts 内で untrusted data として扱われます。Kyoso はそれらを `<untrusted-content>` tags で包み、その中にある instructions に従わないよう agents に指示します。最終判断は schema-constrained findings から導出されます。agents は files の書き込みや commands の実行ができず、judge は deterministic decision を変更できません。
|
|
202
209
|
|
|
210
|
+
Finding title は aggregation のため簡潔な英語に正規化されます。evidence、recommendations、summaries はユーザーの言語のままで構いません。
|
|
211
|
+
|
|
203
212
|
## Agent Auth
|
|
204
213
|
|
|
205
214
|
Codex は利用可能な場合、local `codex` login を使用します。既定の subscription-backed path では API key は不要です。
|
|
@@ -224,17 +233,14 @@ Kyoso は subprocesses の起動に必要な最小限の runtime env も forward
|
|
|
224
233
|
|
|
225
234
|
`agents.<name>.model` を省略すると、各 agent 独自の default を使用します。Codex は `~/.codex/config.toml` などの local Codex config を使用し、Claude は adapter default を使用します。
|
|
226
235
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
});
|
|
236
|
+
指定できる model 名は [Claude models overview](https://platform.claude.com/docs/en/about-claude/models/overview) と [Codex models](https://developers.openai.com/codex/models) を参照してください。
|
|
237
|
+
|
|
238
|
+
```toml
|
|
239
|
+
[agents.codex]
|
|
240
|
+
model = "gpt-5.5"
|
|
241
|
+
|
|
242
|
+
[agents.claude]
|
|
243
|
+
model = "claude-sonnet-5"
|
|
238
244
|
```
|
|
239
245
|
|
|
240
246
|
Kyoso は model pins を adapter-supported configuration に mapping します。
|
|
@@ -256,11 +262,42 @@ Raw agent output と raw file contents は既定で無効です。
|
|
|
256
262
|
|
|
257
263
|
## Config
|
|
258
264
|
|
|
259
|
-
|
|
265
|
+
Kyoso は次の順に config を load します。
|
|
266
|
+
|
|
267
|
+
- built-in defaults
|
|
268
|
+
- user global TOML: `$XDG_CONFIG_HOME/kyoso/config.toml`、または `~/.config/kyoso/config.toml`
|
|
269
|
+
- project TOML: `<cwd>/kyoso.toml`
|
|
270
|
+
- `--network` などの CLI flags
|
|
271
|
+
|
|
272
|
+
Project `kyoso.toml` は declarative で、trust approval は不要です。tools toggles、agent `enabled` / `model` / `role` / `timeoutMs`、workspace byte limits と additive `workspace.deny`、verification settings、advisory judge settings、tightening-only security/network settings を設定できます。
|
|
273
|
+
|
|
274
|
+
Global TOML は command 実行や env forwarding を含む user-owned settings 用です。
|
|
260
275
|
|
|
261
|
-
|
|
276
|
+
```toml
|
|
277
|
+
[agents.codex]
|
|
278
|
+
command = "bunx"
|
|
279
|
+
args = ["@agentclientprotocol/codex-acp"]
|
|
280
|
+
|
|
281
|
+
[agents.codex.env]
|
|
282
|
+
CODEX_CONFIG = '{"model":"gpt-5.5"}'
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`kyoso.config.ts` は deprecated ですが、互換性のため引き続き supported です。trust-on-first-use approval の後にのみ load され、trusted hashes は `~/.kyoso/trusted-configs.json` に保存されます。`kyoso.toml` と `kyoso.config.ts` が両方ある場合、Kyoso は TOML を使用し TypeScript config を無視します。
|
|
286
|
+
|
|
287
|
+
Default agent timeouts は Codex 120 秒、Claude 240 秒です。MCP clients は tool calls に少なくとも 360 秒を許可してください。`verification.enabled` が true の場合、Kyoso は追加の cross-agent verification round を実行することがあるため、少なくとも 480 秒を許可してください。
|
|
288
|
+
|
|
289
|
+
Optional finding verification は default で disabled です:
|
|
290
|
+
|
|
291
|
+
```toml
|
|
292
|
+
[verification]
|
|
293
|
+
enabled = false
|
|
294
|
+
maxFindings = 5
|
|
295
|
+
timeoutMs = 90000
|
|
296
|
+
# global config only; project kyoso.toml cannot set this
|
|
297
|
+
allowDemotion = false
|
|
298
|
+
```
|
|
262
299
|
|
|
263
|
-
|
|
300
|
+
Enabled の場合、Kyoso は high/critical かつ single-source の各 finding について、その finding を報告していない agent に反証を試みさせます。Phase 1 は annotate-only です。verification は finding confidence と notes を更新できますが、severity や final decision は変更しません。`allowDemotion` は future opt-in phase 用に予約されており、現時点では no-op です。
|
|
264
301
|
|
|
265
302
|
Judge LLMs は optional です。OpenAI judge を使うには `OPENAI_API_KEY` または `CODEX_API_KEY` を設定し、Anthropic judge を使うには `ANTHROPIC_API_KEY` を設定します。Optional overrides:
|
|
266
303
|
|
|
@@ -275,15 +312,15 @@ Subscription-only setup:
|
|
|
275
312
|
- Codex: local `codex` login を使用
|
|
276
313
|
- Claude: `claude setup-token` を実行し、`CLAUDE_CODE_OAUTH_TOKEN` を設定
|
|
277
314
|
- Judge: API keys を設定しないことで、Kyoso は `deterministic_fallback` を使用
|
|
278
|
-
- `OPENAI_API_KEY` が存在するときに OpenAI judge calls を避けるには、`
|
|
315
|
+
- `OPENAI_API_KEY` が存在するときに OpenAI judge calls を避けるには、`judge.provider = "none"` を設定
|
|
279
316
|
|
|
280
317
|
Team admins は organization Usage credits も確認してください。Credits が有効な場合、subscription limits を超える billing behavior は Kyoso の外側で制御されます。
|
|
281
318
|
|
|
282
319
|
## Troubleshooting
|
|
283
320
|
|
|
284
|
-
- MCP timeout: client tool timeouts を少なくとも 360 秒に設定してください。Kyoso defaults は Codex 120 秒、Claude 240 秒です。
|
|
321
|
+
- MCP timeout: client tool timeouts を少なくとも 360 秒、`verification.enabled` が true の場合は少なくとも 480 秒に設定してください。Kyoso defaults は Codex 120 秒、Claude 240 秒、verification 90 秒です。
|
|
285
322
|
- Fresh npm release: safe-chain などの minimum-package-age protection により、publish 直後は `npx @kyo-so/cli` の解決が一時的に block される場合があります。
|
|
286
|
-
-
|
|
323
|
+
- Deprecated TypeScript config: `--trust-config` を渡さない限り、untrusted `kyoso.config.ts` は skip されます。新規設定は `kyoso.toml` を使ってください。
|
|
287
324
|
|
|
288
325
|
## Development
|
|
289
326
|
|
package/README.md
CHANGED
|
@@ -8,6 +8,10 @@ Kyo-so (Kyoso / 協奏) is an MCP-native, ACP-powered multi-agent review gate fo
|
|
|
8
8
|
|
|
9
9
|
The Japanese word 協奏 translates to concerto in English: multiple independent players performing one coordinated piece.
|
|
10
10
|
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="https://raw.githubusercontent.com/hokupod/kyoso/main/docs/assets/kyoso-ensemble.png" alt="A conductor coordinating a drummer, a violinist, and a pianist" width="480">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
11
15
|
It coordinates Codex and Claude reviewers for:
|
|
12
16
|
|
|
13
17
|
- implementation plan review
|
|
@@ -22,7 +26,7 @@ No global install is required. Run Kyoso through `npx` or `bunx`.
|
|
|
22
26
|
|
|
23
27
|
### Claude Only / Codex Only
|
|
24
28
|
|
|
25
|
-
Kyoso can run when only Claude or only Codex is available. Disable the missing backend in `kyoso.
|
|
29
|
+
Kyoso can run when only Claude or only Codex is available. Disable the missing backend in `kyoso.toml` using `examples/claude-only.toml` or `examples/codex-only.toml`.
|
|
26
30
|
|
|
27
31
|
In single-agent mode, the remaining backend runs once as `combined_reviewer` and covers both implementation and architecture/security focus areas. JSON output includes `reviewMode: "single_agent"` and `agentsUsed`; Markdown output states that cross-model verification was not performed and marks disagreements as N/A.
|
|
28
32
|
|
|
@@ -100,15 +104,21 @@ Naming note: the npm package is `@kyo-so/cli` (matching the product name Kyo-so)
|
|
|
100
104
|
For local development:
|
|
101
105
|
|
|
102
106
|
```bash
|
|
107
|
+
nix develop
|
|
103
108
|
safe-chain bun install
|
|
104
109
|
safe-chain bun run typecheck
|
|
105
110
|
safe-chain bun test
|
|
106
111
|
safe-chain bun run build
|
|
112
|
+
safe-chain bun run pack:verify
|
|
107
113
|
```
|
|
108
114
|
|
|
109
115
|
Requires Node.js 20 or newer when running the packaged CLI.
|
|
110
116
|
|
|
111
|
-
|
|
117
|
+
The Nix dev shell pins Node.js 24 and the nixpkgs-provided Bun version. After reviewing `.envrc`, you can also run `direnv allow` once and let it load the shell automatically. CI remains pinned to Bun 1.3.14; the current nixpkgs Bun version may differ slightly, but `flake.lock` keeps local shells reproducible.
|
|
118
|
+
|
|
119
|
+
The test suite includes credential-free MCP stdio and ACP subprocess integration coverage. `pack:verify` additionally starts the packed `dist/bin/kyoso.js` MCP server and checks the published bundle's protocol handshake.
|
|
120
|
+
|
|
121
|
+
Known distribution risk: `@modelcontextprotocol/server` has no stable release yet; Kyoso currently pins a prerelease API, so MCP SDK API changes may require a follow-up release. Run manual real-agent dogfooding before releases that bump `@modelcontextprotocol/server`, `@agentclientprotocol/sdk`, or pinned ACP adapters.
|
|
112
122
|
|
|
113
123
|
## CLI
|
|
114
124
|
|
|
@@ -198,6 +208,8 @@ Kyoso does not store provider credentials. Child agent environment variables are
|
|
|
198
208
|
|
|
199
209
|
Repository content, plans, diffs, and selected files are treated as untrusted data in backend prompts. Kyoso wraps them in `<untrusted-content>` tags and tells agents not to follow instructions found inside. Final decisions are derived from schema-constrained findings; agents cannot write files or run commands, and the judge cannot change the deterministic decision.
|
|
200
210
|
|
|
211
|
+
Finding titles are normalized to concise English for aggregation; evidence, recommendations, and summaries can remain in the user's language.
|
|
212
|
+
|
|
201
213
|
## Agent Auth
|
|
202
214
|
|
|
203
215
|
Codex uses the local `codex` login when available. No API key is required for the default subscription-backed path.
|
|
@@ -222,17 +234,14 @@ Kyoso also forwards minimal runtime env needed to launch subprocesses: `PATH`, `
|
|
|
222
234
|
|
|
223
235
|
Omit `agents.<name>.model` to use each agent's own default. Codex uses the local Codex config, such as `~/.codex/config.toml`; Claude uses the adapter default.
|
|
224
236
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
});
|
|
237
|
+
For available model names, see the [Claude models overview](https://platform.claude.com/docs/en/about-claude/models/overview) and the [Codex models list](https://developers.openai.com/codex/models).
|
|
238
|
+
|
|
239
|
+
```toml
|
|
240
|
+
[agents.codex]
|
|
241
|
+
model = "gpt-5.5"
|
|
242
|
+
|
|
243
|
+
[agents.claude]
|
|
244
|
+
model = "claude-sonnet-5"
|
|
236
245
|
```
|
|
237
246
|
|
|
238
247
|
Kyoso maps model pins to adapter-supported configuration:
|
|
@@ -254,11 +263,42 @@ Keep `.kyoso/traces/` out of Git. `kyoso init` adds `.kyoso/` to `.gitignore`, a
|
|
|
254
263
|
|
|
255
264
|
## Config
|
|
256
265
|
|
|
257
|
-
|
|
266
|
+
Kyoso loads config in this order:
|
|
267
|
+
|
|
268
|
+
- built-in defaults
|
|
269
|
+
- user global TOML: `$XDG_CONFIG_HOME/kyoso/config.toml`, or `~/.config/kyoso/config.toml`
|
|
270
|
+
- project TOML: `<cwd>/kyoso.toml`
|
|
271
|
+
- CLI flags such as `--network`
|
|
272
|
+
|
|
273
|
+
Project `kyoso.toml` is declarative and does not require trust approval. It can set safe project-scoped keys such as tool toggles, agent `enabled` / `model` / `role` / `timeoutMs`, workspace byte limits and additive `workspace.deny`, verification settings, advisory judge settings, and tightening-only security/network settings.
|
|
274
|
+
|
|
275
|
+
Global TOML is for user-owned settings that can launch commands or forward environment variables:
|
|
258
276
|
|
|
259
|
-
|
|
277
|
+
```toml
|
|
278
|
+
[agents.codex]
|
|
279
|
+
command = "bunx"
|
|
280
|
+
args = ["@agentclientprotocol/codex-acp"]
|
|
281
|
+
|
|
282
|
+
[agents.codex.env]
|
|
283
|
+
CODEX_CONFIG = '{"model":"gpt-5.5"}'
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`kyoso.config.ts` is deprecated but still supported for compatibility. It is loaded only after trust-on-first-use approval; trusted hashes are stored in `~/.kyoso/trusted-configs.json`. If both `kyoso.toml` and `kyoso.config.ts` exist, Kyoso uses TOML and ignores the TypeScript config.
|
|
287
|
+
|
|
288
|
+
Default agent timeouts are Codex 120 seconds and Claude 240 seconds. MCP clients should allow at least 360 seconds for tool calls. If `verification.enabled` is true, allow at least 480 seconds because Kyoso may run an additional cross-agent verification round.
|
|
289
|
+
|
|
290
|
+
Optional finding verification is disabled by default:
|
|
291
|
+
|
|
292
|
+
```toml
|
|
293
|
+
[verification]
|
|
294
|
+
enabled = false
|
|
295
|
+
maxFindings = 5
|
|
296
|
+
timeoutMs = 90000
|
|
297
|
+
# global config only; project kyoso.toml cannot set this
|
|
298
|
+
allowDemotion = false
|
|
299
|
+
```
|
|
260
300
|
|
|
261
|
-
|
|
301
|
+
When enabled, Kyoso asks the agent that did not report each high/critical single-source finding to try to refute it. Phase 1 is annotate-only: verification can update finding confidence and notes, but it does not change severity or the final decision. `allowDemotion` is reserved for a future opt-in phase and is currently a no-op.
|
|
262
302
|
|
|
263
303
|
Judge LLMs are optional. Set `OPENAI_API_KEY` or `CODEX_API_KEY` to use the OpenAI judge, or `ANTHROPIC_API_KEY` to use the Anthropic judge. Optional overrides:
|
|
264
304
|
|
|
@@ -273,15 +313,15 @@ Subscription-only setup:
|
|
|
273
313
|
- Codex: use local `codex` login
|
|
274
314
|
- Claude: run `claude setup-token`, then set `CLAUDE_CODE_OAUTH_TOKEN`
|
|
275
315
|
- Judge: set no API keys, so Kyoso uses `deterministic_fallback`
|
|
276
|
-
- To avoid OpenAI judge calls when `OPENAI_API_KEY` is present, set `
|
|
316
|
+
- To avoid OpenAI judge calls when `OPENAI_API_KEY` is present, set `judge.provider = "none"`
|
|
277
317
|
|
|
278
318
|
Team admins should also check organization Usage credits. If credits are enabled, billing behavior beyond subscription limits is controlled outside Kyoso.
|
|
279
319
|
|
|
280
320
|
## Troubleshooting
|
|
281
321
|
|
|
282
|
-
- MCP timeout: set client tool timeouts to at least 360 seconds. Kyoso defaults are Codex 120 seconds
|
|
322
|
+
- MCP timeout: set client tool timeouts to at least 360 seconds, or at least 480 seconds when `verification.enabled` is true. Kyoso defaults are Codex 120 seconds, Claude 240 seconds, and verification 90 seconds.
|
|
283
323
|
- Fresh npm release: minimum-package-age protection in tools such as safe-chain may briefly block `npx @kyo-so/cli` resolution after publish.
|
|
284
|
-
-
|
|
324
|
+
- Deprecated TypeScript config: untrusted `kyoso.config.ts` is skipped unless you pass `--trust-config`; prefer `kyoso.toml`.
|
|
285
325
|
|
|
286
326
|
## Development
|
|
287
327
|
|
package/README.zh-CN.md
CHANGED
|
@@ -10,6 +10,10 @@ Kyo-so (Kyoso / 協奏) 是面向 AI coding workflows 的 MCP-native、ACP-power
|
|
|
10
10
|
|
|
11
11
|
日语词「協奏」在英语中可译为 concerto:多个独立演奏者各司其职,共同完成一部协调的作品。
|
|
12
12
|
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="https://raw.githubusercontent.com/hokupod/kyoso/main/docs/assets/kyoso-ensemble.png" alt="指挥家协调鼓手、小提琴手和钢琴家" width="480">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
13
17
|
它会协调 Codex 和 Claude reviewers,用于:
|
|
14
18
|
|
|
15
19
|
- implementation plan review
|
|
@@ -24,7 +28,7 @@ Kyoso 不会应用代码更改。
|
|
|
24
28
|
|
|
25
29
|
### Claude Only / Codex Only
|
|
26
30
|
|
|
27
|
-
Kyoso 可以在只有 Claude 或只有 Codex 可用时运行。请在 `kyoso.
|
|
31
|
+
Kyoso 可以在只有 Claude 或只有 Codex 可用时运行。请在 `kyoso.toml` 中禁用缺失的 backend;示例见 `examples/claude-only.toml` 和 `examples/codex-only.toml`。
|
|
28
32
|
|
|
29
33
|
在 single-agent mode 中,剩余 backend 会以 `combined_reviewer` 运行一次,同时覆盖 implementation 和 architecture/security 两类关注点。JSON output 会包含 `reviewMode: "single_agent"` 和 `agentsUsed`;Markdown output 会说明未执行 cross-model verification,并将 disagreements 标记为 N/A。
|
|
30
34
|
|
|
@@ -102,6 +106,7 @@ Naming note: npm package 是 `@kyo-so/cli` (对应产品名 Kyo-so),安装后
|
|
|
102
106
|
本地开发:
|
|
103
107
|
|
|
104
108
|
```bash
|
|
109
|
+
nix develop
|
|
105
110
|
safe-chain bun install
|
|
106
111
|
safe-chain bun run typecheck
|
|
107
112
|
safe-chain bun test
|
|
@@ -110,6 +115,8 @@ safe-chain bun run build
|
|
|
110
115
|
|
|
111
116
|
运行打包后的 CLI 需要 Node.js 20 或更高版本。
|
|
112
117
|
|
|
118
|
+
Nix dev shell 会 pin Node.js 24 和 nixpkgs 提供的 Bun version。确认 `.envrc` 后,也可以运行一次 `direnv allow`,让它自动加载 shell。CI 仍然 pin 到 Bun 1.3.14;当前 nixpkgs Bun version 可能略有不同,但 `flake.lock` 会保证 local shell 可复现。
|
|
119
|
+
|
|
113
120
|
已知分发风险:`@modelcontextprotocol/server` 目前还没有 stable release;Kyoso 当前 pin 了 prerelease API,因此 MCP SDK API 变更可能需要后续 release。
|
|
114
121
|
|
|
115
122
|
## CLI
|
|
@@ -200,6 +207,8 @@ Kyoso 不存储 provider credentials。Child agent environment variables 使用
|
|
|
200
207
|
|
|
201
208
|
Repository content、plans、diffs 和 selected files 在 backend prompts 中被视为 untrusted data。Kyoso 会用 `<untrusted-content>` tags 包裹它们,并告诉 agents 不要遵循其中的 instructions。最终 decisions 来自 schema-constrained findings;agents 不能写 files 或运行 commands,judge 不能改变 deterministic decision。
|
|
202
209
|
|
|
210
|
+
Finding title 会为 aggregation 规范化为简洁英文;evidence、recommendations 和 summaries 可以继续使用用户的语言。
|
|
211
|
+
|
|
203
212
|
## Agent Auth
|
|
204
213
|
|
|
205
214
|
可用时,Codex 使用 local `codex` login。默认 subscription-backed path 不需要 API key。
|
|
@@ -224,17 +233,14 @@ Kyoso 还会 forward 启动 subprocesses 所需的最小 runtime env:`PATH`, `
|
|
|
224
233
|
|
|
225
234
|
省略 `agents.<name>.model` 时,会使用各 agent 自身的 default。Codex 使用 local Codex config,例如 `~/.codex/config.toml`;Claude 使用 adapter default。
|
|
226
235
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
});
|
|
236
|
+
可指定的 model 名称请参阅 [Claude models overview](https://platform.claude.com/docs/en/about-claude/models/overview) 与 [Codex models](https://developers.openai.com/codex/models)。
|
|
237
|
+
|
|
238
|
+
```toml
|
|
239
|
+
[agents.codex]
|
|
240
|
+
model = "gpt-5.5"
|
|
241
|
+
|
|
242
|
+
[agents.claude]
|
|
243
|
+
model = "claude-sonnet-5"
|
|
238
244
|
```
|
|
239
245
|
|
|
240
246
|
Kyoso 会将 model pins 映射到 adapter-supported configuration:
|
|
@@ -256,11 +262,42 @@ Raw agent output 和 raw file contents 默认禁用。
|
|
|
256
262
|
|
|
257
263
|
## Config
|
|
258
264
|
|
|
259
|
-
|
|
265
|
+
Kyoso 按以下顺序 load config:
|
|
266
|
+
|
|
267
|
+
- built-in defaults
|
|
268
|
+
- user global TOML: `$XDG_CONFIG_HOME/kyoso/config.toml`,或 `~/.config/kyoso/config.toml`
|
|
269
|
+
- project TOML: `<cwd>/kyoso.toml`
|
|
270
|
+
- `--network` 等 CLI flags
|
|
271
|
+
|
|
272
|
+
Project `kyoso.toml` 是 declarative config,不需要 trust approval。它可以设置 tools toggles、agent `enabled` / `model` / `role` / `timeoutMs`、workspace byte limits 和 additive `workspace.deny`、verification settings、advisory judge settings,以及 tightening-only security/network settings。
|
|
273
|
+
|
|
274
|
+
Global TOML 用于 user-owned settings,包括 command 启动和 env forwarding。
|
|
260
275
|
|
|
261
|
-
|
|
276
|
+
```toml
|
|
277
|
+
[agents.codex]
|
|
278
|
+
command = "bunx"
|
|
279
|
+
args = ["@agentclientprotocol/codex-acp"]
|
|
280
|
+
|
|
281
|
+
[agents.codex.env]
|
|
282
|
+
CODEX_CONFIG = '{"model":"gpt-5.5"}'
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`kyoso.config.ts` 已 deprecated,但为了兼容仍然 supported。它只会在 trust-on-first-use approval 之后 load;trusted hashes 保存在 `~/.kyoso/trusted-configs.json`。如果 `kyoso.toml` 和 `kyoso.config.ts` 同时存在,Kyoso 使用 TOML 并忽略 TypeScript config。
|
|
286
|
+
|
|
287
|
+
Default agent timeouts 是 Codex 120 秒、Claude 240 秒。MCP clients 应允许 tool calls 至少运行 360 秒。如果 `verification.enabled` 为 true,Kyoso 可能会运行额外的 cross-agent verification round,因此建议至少允许 480 秒。
|
|
288
|
+
|
|
289
|
+
Optional finding verification 默认 disabled:
|
|
290
|
+
|
|
291
|
+
```toml
|
|
292
|
+
[verification]
|
|
293
|
+
enabled = false
|
|
294
|
+
maxFindings = 5
|
|
295
|
+
timeoutMs = 90000
|
|
296
|
+
# global config only; project kyoso.toml cannot set this
|
|
297
|
+
allowDemotion = false
|
|
298
|
+
```
|
|
262
299
|
|
|
263
|
-
|
|
300
|
+
启用后,Kyoso 会让没有报告该 finding 的 agent 对 high/critical 且 single-source 的 finding 尝试反驳。Phase 1 是 annotate-only:verification 可以更新 finding confidence 和 notes,但不会改变 severity 或 final decision。`allowDemotion` 为未来的 opt-in phase 保留,目前是 no-op。
|
|
264
301
|
|
|
265
302
|
Judge LLMs 是 optional。设置 `OPENAI_API_KEY` 或 `CODEX_API_KEY` 可使用 OpenAI judge,设置 `ANTHROPIC_API_KEY` 可使用 Anthropic judge。Optional overrides:
|
|
266
303
|
|
|
@@ -275,15 +312,15 @@ Subscription-only setup:
|
|
|
275
312
|
- Codex: 使用 local `codex` login
|
|
276
313
|
- Claude: 运行 `claude setup-token`,然后设置 `CLAUDE_CODE_OAUTH_TOKEN`
|
|
277
314
|
- Judge: 不设置 API keys,因此 Kyoso 使用 `deterministic_fallback`
|
|
278
|
-
- 当存在 `OPENAI_API_KEY` 时,如需避免 OpenAI judge calls,请设置 `
|
|
315
|
+
- 当存在 `OPENAI_API_KEY` 时,如需避免 OpenAI judge calls,请设置 `judge.provider = "none"`
|
|
279
316
|
|
|
280
317
|
Team admins 还应检查 organization Usage credits。如果启用了 credits,超出 subscription limits 的 billing behavior 由 Kyoso 外部控制。
|
|
281
318
|
|
|
282
319
|
## Troubleshooting
|
|
283
320
|
|
|
284
|
-
- MCP timeout: 将 client tool timeouts 设置为至少 360 秒。Kyoso defaults 是 Codex 120 秒、Claude 240 秒。
|
|
321
|
+
- MCP timeout: 将 client tool timeouts 设置为至少 360 秒;当 `verification.enabled` 为 true 时,设置为至少 480 秒。Kyoso defaults 是 Codex 120 秒、Claude 240 秒、verification 90 秒。
|
|
285
322
|
- Fresh npm release: safe-chain 等 minimum-package-age protection 可能会在 publish 后短时间内 block `npx @kyo-so/cli` resolution。
|
|
286
|
-
-
|
|
323
|
+
- Deprecated TypeScript config: 除非传入 `--trust-config`,否则 untrusted `kyoso.config.ts` 会被 skip;新配置请使用 `kyoso.toml`。
|
|
287
324
|
|
|
288
325
|
## Development
|
|
289
326
|
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import type { AgentRunInput, AgentRunResult } from "../core/types.js";
|
|
2
2
|
import { BaseAcpAgentManager } from "./AcpAgentManager.js";
|
|
3
3
|
export type FakeAgentScenario = "success" | "markdown_json" | "timeout" | "malformed" | "auth_failure" | "permission_request" | "write_attempt";
|
|
4
|
+
export type FakeVerifierVerdict = {
|
|
5
|
+
findingId: string;
|
|
6
|
+
verdict: "confirmed" | "refuted" | "uncertain";
|
|
7
|
+
reasoning?: string;
|
|
8
|
+
evidence?: string;
|
|
9
|
+
};
|
|
10
|
+
export type FakeVerifierScenario = "confirmed" | "refuted" | "uncertain" | "malformed" | "timeout" | {
|
|
11
|
+
rawText: string;
|
|
12
|
+
} | {
|
|
13
|
+
verdicts: FakeVerifierVerdict[];
|
|
14
|
+
};
|
|
4
15
|
export declare class FakeAgentManager extends BaseAcpAgentManager {
|
|
5
16
|
private readonly scenarios;
|
|
17
|
+
private readonly verifierScenarios;
|
|
6
18
|
readonly calls: AgentRunInput[];
|
|
7
|
-
constructor(scenarios?: Partial<Record<"codex" | "claude", FakeAgentScenario>>);
|
|
19
|
+
constructor(scenarios?: Partial<Record<"codex" | "claude", FakeAgentScenario>>, verifierScenarios?: Partial<Record<"codex" | "claude", FakeVerifierScenario>>);
|
|
8
20
|
runAgent(input: AgentRunInput): Promise<AgentRunResult>;
|
|
9
21
|
}
|
package/dist/acp/prompts.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { AgentName, AgentRole, KyosoReviewRequest, ReviewTool } from "../core/types.js";
|
|
1
|
+
import type { AgentName, AgentRole, KyosoFinding, KyosoReviewRequest, ReviewTool } from "../core/types.js";
|
|
2
2
|
export declare function buildAgentPrompt(tool: ReviewTool, request: KyosoReviewRequest, agent: AgentName, role: AgentRole): string;
|
|
3
|
+
export declare function buildFindingVerifierPrompt(tool: ReviewTool, request: KyosoReviewRequest, verifier: AgentName, findings: KyosoFinding[]): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentRunResult, KyosoFinding } from "../core/types.js";
|
|
1
|
+
import type { AgentRunResult, KyosoFinding, ReviewMode } from "../core/types.js";
|
|
2
2
|
export type AggregatedReview = {
|
|
3
3
|
findings: KyosoFinding[];
|
|
4
4
|
testsToAdd: string[];
|
|
@@ -12,4 +12,7 @@ export type AggregatedReview = {
|
|
|
12
12
|
judgeComment: string;
|
|
13
13
|
}>;
|
|
14
14
|
};
|
|
15
|
-
export declare function aggregateAgentResults(results: AgentRunResult[]
|
|
15
|
+
export declare function aggregateAgentResults(results: AgentRunResult[], options?: {
|
|
16
|
+
reviewMode?: ReviewMode;
|
|
17
|
+
}): AggregatedReview;
|
|
18
|
+
export declare function realSourceAgentCount(sourceAgents: KyosoFinding["sourceAgents"]): number;
|