aptly 0.1.15 → 0.1.16
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.en.md +9 -34
- package/README.ja.md +9 -34
- package/README.md +9 -34
- package/README.zh-CN.md +9 -34
- package/dist/src/context-retry.js +2 -1
- package/dist/src/server.js +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/SPAWN_CONTEXT.md +14 -0
- package/docs/guide/en/advanced.md +2 -0
- package/docs/guide/en/configuration.md +43 -58
- package/docs/guide/en/installation.md +30 -42
- package/docs/guide/en/transmission.md +31 -36
- package/docs/guide/en.md +17 -20
- package/docs/guide/ja/advanced.md +2 -0
- package/docs/guide/ja/configuration.md +41 -56
- package/docs/guide/ja/installation.md +25 -37
- package/docs/guide/ja/transmission.md +28 -33
- package/docs/guide/ja.md +17 -20
- package/docs/guide/ko/advanced.md +2 -0
- package/docs/guide/ko/configuration.md +34 -49
- package/docs/guide/ko/installation.md +23 -35
- package/docs/guide/ko/transmission.md +24 -29
- package/docs/guide/ko.md +17 -20
- package/docs/guide/zh-CN/advanced.md +2 -0
- package/docs/guide/zh-CN/configuration.md +41 -56
- package/docs/guide/zh-CN/installation.md +24 -36
- package/docs/guide/zh-CN/transmission.md +28 -33
- package/docs/guide/zh-CN.md +17 -20
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -10,61 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
[한국어](README.md) · **English** · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
|
|
12
12
|
|
|
13
|
-
**A local MCP server that selects Claude Code and Codex subagent models and reasoning effort to suit the task.**
|
|
14
|
-
|
|
15
13
|
</div>
|
|
16
14
|
|
|
17
|
-
Aptly
|
|
18
|
-
|
|
19
|
-
Our own tests showed **about 52–58% lower API-equivalent costs**. See the [test conditions and detailed results](docs/guide/en/benchmarks.md#guide-cost-benchmarks).
|
|
15
|
+
Aptly recommends models and reasoning effort for Claude Code and Codex subagents. It sends a task summary to the OpenAI Decisions API and preserves explicitly selected models, reasoning effort, and execution permissions.
|
|
20
16
|
|
|
21
17
|
## Quick start
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
You need Node.js **24 or later**, Claude Code or Codex, and an OpenAI API key.
|
|
24
20
|
|
|
25
21
|
```sh
|
|
26
22
|
npm install -g aptly@latest --allow-scripts=aptly
|
|
27
23
|
aptly set default
|
|
28
24
|
aptly set env OPENAI_API_KEY
|
|
29
|
-
aptly --version
|
|
30
25
|
```
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
During installation, `postinstall` registers the MCP server and a `PreToolUse` Hook in existing host configuration directories. Run `setup` explicitly if automatic registration was skipped or a host has no configuration directory yet. Other settings and Hooks, and any existing Aptly launch command and environment, are preserved.
|
|
35
|
-
|
|
36
|
-
Store the classification key, `OPENAI_API_KEY`, in the OS credential store using the hidden prompt in `aptly set env OPENAI_API_KEY`, or pass it to the MCP process through a secure execution environment. Do not put it in command arguments, requests, configuration JSON, or the repository. Restart the host or MCP server, then **review and trust the new Hook through `/hooks` in Codex**. See [installation, keys, and registration](docs/guide/en/installation.md#guide-installation).
|
|
27
|
+
Choose the transmission scope in `set default` and enter your API key through the hidden prompt. Restart the host, then **review and approve the new Hook in `/hooks` for Codex**. See [installation and key setup](docs/guide/en/installation.md) for npm compatibility and account-specific configuration.
|
|
37
28
|
|
|
38
29
|
## Update
|
|
39
30
|
|
|
40
|
-
|
|
31
|
+
Stop the relevant hosts, MCP servers, and CLI processes before running these commands.
|
|
41
32
|
|
|
42
33
|
```sh
|
|
43
34
|
aptly update
|
|
44
35
|
aptly setup --client all
|
|
45
36
|
```
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| Mode | Behavior |
|
|
50
|
-
|---|---|
|
|
51
|
-
| Automatic Hook | Checks constraints and recommends unspecified defaults for new calls |
|
|
52
|
-
| Direct recommendation | Returns a profile through `recommend_agent` or `aptly recommend`; review it and decide separately whether to run it in the host |
|
|
53
|
-
| fixture | Tests recommendations generated by local rules without a key or network access; these are not actual Decisions results |
|
|
54
|
-
|
|
55
|
-
From Aptly 0.1.4, inherited calls also reach recommendation. Application still requires explicit `fork_turns: "none"` in Codex or a general-purpose Claude Code call without history constraints; specified fields are preserved. Recommendation, Hook argument updates and child execution are separate facts. See the [guide](docs/guide/en/routing.md#guide-automatic-routing) for application conditions.
|
|
38
|
+
Restart the host. You do not need to re-enter the key. If migrating a stable launcher or an older version, see [updates](docs/guide/en/installation.md#guide-package-updates).
|
|
56
39
|
|
|
57
40
|
## Documentation
|
|
58
41
|
|
|
59
|
-
- [User guide](docs/guide/en.md):
|
|
60
|
-
- [
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
- [Cost benchmark](docs/guide/en/benchmarks.md#guide-cost-benchmarks): tokens, converted costs, and measurement scope for a README translation review
|
|
64
|
-
- [Diagnostics and development](docs/guide/en/advanced.md#guide-diagnostics-and-development): local reports and checks without paid API calls
|
|
65
|
-
|
|
66
|
-
Korean is the canonical documentation. The English, Simplified Chinese, and Japanese documents cover the same usage scope. Choosing a documentation language does not change the language of CLI or MCP output.
|
|
67
|
-
|
|
68
|
-
## License
|
|
69
|
-
|
|
70
|
-
[MIT](LICENSE).
|
|
42
|
+
- [User guide](docs/guide/en.md): configuration, automatic recommendations, budgets, statistics, and troubleshooting
|
|
43
|
+
- [Model candidates](docs/guide/en/configuration.md#guide-models-and-environment)
|
|
44
|
+
- [Transmission scope](docs/guide/en/transmission.md): information sent to the Decisions API
|
|
45
|
+
- [Measured costs](docs/guide/en/benchmarks.md): approximately 52–58% lower API-equivalent child review and classification costs in a small README review test. This is not a reduction in total task costs or subscription charges.
|
package/README.ja.md
CHANGED
|
@@ -10,61 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
[한국어](README.md) · [English](README.en.md) · [简体中文](README.zh-CN.md) · **日本語**
|
|
12
12
|
|
|
13
|
-
**タスクに適した Claude Code・Codex のサブエージェント用モデルと effort を選ぶローカル MCP です。**
|
|
14
|
-
|
|
15
13
|
</div>
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
独自テストでは、**API 換算コストが約 52~58% 減少しました**。[測定条件と詳細結果](docs/guide/ja/benchmarks.md#guide-cost-benchmarks)をご覧ください。
|
|
15
|
+
Claude Code・Codex のサブエージェントにモデルと推論強度を推薦します。タスクの要約を OpenAI Decisions API に送信し、明示されたモデル・推論強度・実行権限は保持します。
|
|
20
16
|
|
|
21
17
|
## クイックスタート
|
|
22
18
|
|
|
23
|
-
Node.js **24
|
|
19
|
+
Node.js **24 以上**、Claude Code または Codex、OpenAI API キーが必要です。
|
|
24
20
|
|
|
25
21
|
```sh
|
|
26
22
|
npm install -g aptly@latest --allow-scripts=aptly
|
|
27
23
|
aptly set default
|
|
28
24
|
aptly set env OPENAI_API_KEY
|
|
29
|
-
aptly --version
|
|
30
25
|
```
|
|
31
26
|
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
インストール時の `postinstall` は、既存のホスト設定ディレクトリに MCP と `PreToolUse` Hook を登録します。自動登録をスキップした場合や、ホストに設定ディレクトリがまだない場合も、`setup` を明示的に実行して登録できます。他の既存設定・Hook と、既存の Aptly の実行コマンド・環境は保持します。
|
|
35
|
-
|
|
36
|
-
分類用の `OPENAI_API_KEY` は、`aptly set env OPENAI_API_KEY` の非表示入力で OS の資格情報ストアに保存するか、安全な実行環境から MCP プロセスに渡してください。キーをコマンドライン・リクエスト・設定 JSON・リポジトリに記載しないでください。ホストまたは MCP を再起動した後、**Codex では `/hooks` で新しい Hook を確認し、信頼を承認**してください。[インストール・キー・登録の詳細](docs/guide/ja/installation.md#guide-installation)を確認してください。
|
|
27
|
+
`set default` で送信範囲を選び、API キーは非表示入力で登録します。ホストを再起動した後、**Codex では `/hooks` で新しい Hook を確認・承認**してください。[インストール・キー設定](docs/guide/ja/installation.md)で npm の互換オプションとアカウント別の設定を確認できます。
|
|
37
28
|
|
|
38
29
|
## 更新
|
|
39
30
|
|
|
40
|
-
|
|
31
|
+
実行前に、関連するホスト・MCP サーバー・CLI プロセスを停止してください。
|
|
41
32
|
|
|
42
33
|
```sh
|
|
43
34
|
aptly update
|
|
44
35
|
aptly setup --client all
|
|
45
36
|
```
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| 方法 | 動作 |
|
|
50
|
-
|---|---|
|
|
51
|
-
| 自動 Hook | 新しい呼び出しの制約を確認し、未指定のデフォルト値を推薦します |
|
|
52
|
-
| 直接推薦 | `recommend_agent` または `aptly recommend` でプロファイルを受け取り、実行するかどうかをホストで明示的に判断します |
|
|
53
|
-
| fixture | キーやネットワークを使わず、ローカルで生成した試験用の推薦を確認できます。実際の Decisions の結果ではありません |
|
|
54
|
-
|
|
55
|
-
Aptly 0.1.4 以降では継承呼び出しも推薦を評価します。適用には Codex の明示的な `fork_turns: "none"`、または履歴制約のない Claude Code の汎用呼び出しが必要で、指定済みフィールドは保持します。推薦・Hook 引数更新・実際の子の実行は別です。適用条件は[ガイド](docs/guide/ja/routing.md#guide-automatic-routing)を参照してください。
|
|
38
|
+
ホストを再起動してください。キーの再入力は不要です。stable ランチャーや以前のバージョンから移行する場合は、[更新案内](docs/guide/ja/installation.md#guide-package-updates)を確認してください。
|
|
56
39
|
|
|
57
40
|
## ドキュメント
|
|
58
41
|
|
|
59
|
-
- [使用ガイド](docs/guide/ja.md):
|
|
60
|
-
- [
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
- [費用実測](docs/guide/ja/benchmarks.md#guide-cost-benchmarks): README 翻訳レビューのトークン・換算費用と測定範囲
|
|
64
|
-
- [診断・開発](docs/guide/ja/advanced.md#guide-diagnostics-and-development): ローカル report と無料の検証コマンド
|
|
65
|
-
|
|
66
|
-
韓国語版が正本です。英語・簡体字中国語・日本語のドキュメントは同じ使用範囲を説明しており、ドキュメントの言語を選んでも CLI・MCP の出力言語は変わりません。
|
|
67
|
-
|
|
68
|
-
## ライセンス
|
|
69
|
-
|
|
70
|
-
[MIT](LICENSE)。
|
|
42
|
+
- [使用ガイド](docs/guide/ja.md): 設定・自動推薦・予算・統計・トラブルシューティング
|
|
43
|
+
- [候補モデルの設定](docs/guide/ja/configuration.md#guide-models-and-environment)
|
|
44
|
+
- [送信範囲](docs/guide/ja/transmission.md): Decisions API に送る情報
|
|
45
|
+
- [費用実測](docs/guide/ja/benchmarks.md): 小規模な README レビュー試験で子レビュー・分類費の API 換算額が約 52~58% 減少。タスク全体の費用やサブスクリプションの実請求額の削減率ではありません。
|
package/README.md
CHANGED
|
@@ -10,61 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
**한국어** · [English](README.en.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
|
|
12
12
|
|
|
13
|
-
**작업에 맞는 Claude Code·Codex 서브에이전트 모델과 effort를 선택하는 로컬 MCP입니다.**
|
|
14
|
-
|
|
15
13
|
</div>
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
자체 테스트에서 **API 환산 비용이 약 52~58% 감소했습니다**. [측정 조건과 상세 결과](docs/guide/ko/benchmarks.md#guide-cost-benchmarks)를 확인하세요.
|
|
15
|
+
Claude Code·Codex 서브에이전트의 모델과 추론 강도를 추천합니다. 작업 요약을 OpenAI Decisions API로 보내며, 명시한 모델·추론 강도·실행 권한은 보존합니다.
|
|
20
16
|
|
|
21
17
|
## 빠른 시작
|
|
22
18
|
|
|
23
|
-
Node.js **24
|
|
19
|
+
Node.js **24 이상**, Claude Code 또는 Codex, OpenAI API 키가 필요합니다.
|
|
24
20
|
|
|
25
21
|
```sh
|
|
26
22
|
npm install -g aptly@latest --allow-scripts=aptly
|
|
27
23
|
aptly set default
|
|
28
24
|
aptly set env OPENAI_API_KEY
|
|
29
|
-
aptly --version
|
|
30
25
|
```
|
|
31
26
|
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
설치 시 `postinstall`은 기존 호스트 설정 디렉터리에 MCP와 `PreToolUse` Hook을 등록합니다. 명시적인 `setup`은 자동 등록을 건너뛰었거나 아직 설정 디렉터리가 없는 호스트에도 사용할 수 있습니다. 기존 다른 설정·Hook과 기존 Aptly 실행 명령·환경은 보존합니다.
|
|
35
|
-
|
|
36
|
-
분류용 `OPENAI_API_KEY`는 `aptly set env OPENAI_API_KEY`의 숨김 입력으로 OS 자격 저장소에 보관하거나 안전한 실행 환경에서 MCP 프로세스에 전달하십시오. 키를 명령행·요청·설정 JSON·저장소에 기록하지 마십시오. 호스트 또는 MCP를 재시작한 뒤, **Codex에서는 `/hooks`에서 새 Hook을 검토하고 신뢰를 승인하십시오.** [설치·키·등록 상세](docs/guide/ko/installation.md#guide-installation)를 참고하십시오.
|
|
27
|
+
`set default`에서 전송 범위를 선택하고 API 키는 숨김 입력으로 등록합니다. 호스트를 재시작한 뒤 **Codex는 `/hooks`에서 새 Hook을 검토·승인**하십시오. [설치·키 설정](docs/guide/ko/installation.md)에서 npm 호환 옵션과 계정별 설정을 확인할 수 있습니다.
|
|
37
28
|
|
|
38
29
|
## 업데이트
|
|
39
30
|
|
|
40
|
-
|
|
31
|
+
관련 호스트·MCP 서버·CLI 프로세스를 중지한 뒤 실행하십시오.
|
|
41
32
|
|
|
42
33
|
```sh
|
|
43
34
|
aptly update
|
|
44
35
|
aptly setup --client all
|
|
45
36
|
```
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| 방식 | 동작 |
|
|
50
|
-
|---|---|
|
|
51
|
-
| 자동 Hook | 새 호출의 제약을 검사하고 미지정 기본값을 추천합니다 |
|
|
52
|
-
| 직접 추천 | `recommend_agent` 또는 `aptly recommend`로 프로필을 받고 호스트에서 명시적으로 실행합니다 |
|
|
53
|
-
| fixture | 키·네트워크 없이 시험용 추천을 확인합니다. 실제 Decisions 결과가 아닙니다 |
|
|
54
|
-
|
|
55
|
-
Aptly 0.1.4부터 상속 호출도 추천을 평가합니다. Codex의 적용은 명시적인 `fork_turns: "none"`, Claude Code는 이력 제약 없는 일반 호출로 제한하며 명시한 필드는 보존합니다. 추천·Hook 인자 변경·실제 자식 실행은 별개입니다. 적용 조건은 [가이드](docs/guide/ko/routing.md#guide-automatic-routing)에서 확인하십시오.
|
|
38
|
+
호스트를 재시작하십시오. 키를 다시 입력할 필요는 없습니다. stable 실행기나 이전 버전에서 전환하는 경우 [업데이트 안내](docs/guide/ko/installation.md#guide-package-updates)를 확인하십시오.
|
|
56
39
|
|
|
57
40
|
## 문서
|
|
58
41
|
|
|
59
|
-
- [사용 가이드](docs/guide/ko.md):
|
|
60
|
-
- [
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
- [비용 실측](docs/guide/ko/benchmarks.md#guide-cost-benchmarks): README 번역 검토의 토큰·환산 비용과 측정 범위
|
|
64
|
-
- [진단·개발](docs/guide/ko/advanced.md#guide-diagnostics-and-development): 로컬 진단 보고서와 무료 검증 명령
|
|
65
|
-
|
|
66
|
-
한국어가 정본입니다. 영어·중국어 간체·일본어 문서는 같은 사용 범위를 설명하며, 문서 언어가 CLI·MCP 출력 언어를 바꾸지는 않습니다.
|
|
67
|
-
|
|
68
|
-
## 라이선스
|
|
69
|
-
|
|
70
|
-
[MIT](LICENSE).
|
|
42
|
+
- [사용 가이드](docs/guide/ko.md): 설정·자동 추천·예산·통계·문제 해결
|
|
43
|
+
- [모델 후보 설정](docs/guide/ko/configuration.md#guide-models-and-environment)
|
|
44
|
+
- [전송 범위](docs/guide/ko/transmission.md): Decisions API에 보내는 정보
|
|
45
|
+
- [비용 실측](docs/guide/ko/benchmarks.md): 소규모 README 검토 시험에서 자식 검토·분류비의 API 환산액 약 52~58% 감소. 전체 작업 비용이나 구독 실청구 절감률은 아닙니다.
|
package/README.zh-CN.md
CHANGED
|
@@ -10,61 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
[한국어](README.md) · [English](README.en.md) · **简体中文** · [日本語](README.ja.md)
|
|
12
12
|
|
|
13
|
-
**用于为 Claude Code 和 Codex 子代理选择合适模型与推理强度(effort)的本地 MCP 服务器。**
|
|
14
|
-
|
|
15
13
|
</div>
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
在我们的测试中,**API 折算成本降低了约 52%~58%**。详见[测试条件与详细结果](docs/guide/zh-CN/benchmarks.md#guide-cost-benchmarks)。
|
|
15
|
+
为 Claude Code 和 Codex 子代理推荐模型与推理强度。Aptly 将任务摘要发送给 OpenAI Decisions API,并保留明确指定的模型、推理强度和执行权限。
|
|
20
16
|
|
|
21
17
|
## 快速开始
|
|
22
18
|
|
|
23
|
-
需要 Node.js **24
|
|
19
|
+
需要 Node.js **24 或更高版本**、Claude Code 或 Codex 以及 OpenAI API 密钥。
|
|
24
20
|
|
|
25
21
|
```sh
|
|
26
22
|
npm install -g aptly@latest --allow-scripts=aptly
|
|
27
23
|
aptly set default
|
|
28
24
|
aptly set env OPENAI_API_KEY
|
|
29
|
-
aptly --version
|
|
30
25
|
```
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
安装时的 `postinstall` 会在现有宿主配置目录中注册 MCP 和 `PreToolUse` Hook。如果跳过了自动注册,或宿主尚无配置目录,也可以显式运行 `setup`。其他现有配置与 Hook,以及 Aptly 原有的启动命令和环境均会保留。
|
|
35
|
-
|
|
36
|
-
请通过 `aptly set env OPENAI_API_KEY` 的隐藏输入,将分类用的 `OPENAI_API_KEY` 存入系统凭据存储,或通过安全的运行环境传递给 MCP 进程。不要将密钥写入命令行、请求、配置 JSON 或代码仓库。重启宿主或 MCP 后,**请在 Codex 的 `/hooks` 中审核新 Hook 并批准信任**。详见[安装、密钥与注册](docs/guide/zh-CN/installation.md#guide-installation)。
|
|
27
|
+
请在 `set default` 中选择传输范围,并通过隐藏输入注册 API 密钥。重启宿主后,**请在 Codex 的 `/hooks` 中审核并批准新 Hook**。有关 npm 兼容选项和各账户设置,请参阅[安装与密钥设置](docs/guide/zh-CN/installation.md)。
|
|
37
28
|
|
|
38
29
|
## 更新
|
|
39
30
|
|
|
40
|
-
|
|
31
|
+
执行前,请停止相关宿主、MCP 服务器和 CLI 进程。
|
|
41
32
|
|
|
42
33
|
```sh
|
|
43
34
|
aptly update
|
|
44
35
|
aptly setup --client all
|
|
45
36
|
```
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| 方式 | 行为 |
|
|
50
|
-
|---|---|
|
|
51
|
-
| 自动 Hook | 检查新调用的约束,并推荐未指定的默认值 |
|
|
52
|
-
| 直接推荐 | 通过 `recommend_agent` 或 `aptly recommend` 获取执行配置,再在宿主中明确选择并执行 |
|
|
53
|
-
| fixture | 无需密钥或网络即可测试本地模拟推荐;结果并非实际 Decisions 判断 |
|
|
54
|
-
|
|
55
|
-
Aptly 0.1.4 起也会为继承调用评估推荐。应用仍要求 Codex 显式指定 `fork_turns: "none"`,或 Claude Code 使用无历史约束的通用调用;已指定字段会保留。推荐、Hook 参数更新与实际子代理执行是不同事实。应用条件详见[指南](docs/guide/zh-CN/routing.md#guide-automatic-routing)。
|
|
38
|
+
请重启宿主,无需重新输入密钥。如果从 stable 启动器或旧版本迁移,请参阅[更新指南](docs/guide/zh-CN/installation.md#guide-package-updates)。
|
|
56
39
|
|
|
57
40
|
## 文档
|
|
58
41
|
|
|
59
|
-
- [使用指南](docs/guide/zh-CN.md)
|
|
60
|
-
- [
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
- [成本实测](docs/guide/zh-CN/benchmarks.md#guide-cost-benchmarks):README 翻译审阅的 token、换算成本与测量范围
|
|
64
|
-
- [诊断与开发](docs/guide/zh-CN/advanced.md#guide-diagnostics-and-development):本地诊断报告与免费验证命令
|
|
65
|
-
|
|
66
|
-
韩语文档为正本,英语、简体中文和日语文档与其保持相同的使用范围。选择文档语言不会改变 CLI 或 MCP 的输出语言。
|
|
67
|
-
|
|
68
|
-
## 许可证
|
|
69
|
-
|
|
70
|
-
[MIT](LICENSE)。
|
|
42
|
+
- [使用指南](docs/guide/zh-CN.md):设置、自动推荐、预算、统计与问题排查
|
|
43
|
+
- [候选模型设置](docs/guide/zh-CN/configuration.md#guide-models-and-environment)
|
|
44
|
+
- [传输范围](docs/guide/zh-CN/transmission.md):发送给 Decisions API 的信息
|
|
45
|
+
- [成本实测](docs/guide/zh-CN/benchmarks.md):在小规模 README 审阅测试中,子代理审阅与分类费用的 API 折算额降低约 52%~58%;这不是整体任务成本或订阅实际账单的降幅。
|
|
@@ -247,8 +247,9 @@ export class ContextRetries {
|
|
|
247
247
|
return reject(changed);
|
|
248
248
|
return { status: 'prepared', reason: 'caller_declared_independent', application: 'advisory_only', source_retry_id: retry_id, preparation_id,
|
|
249
249
|
profile_id: profile.id, profile: structuredClone(profile), intent_provenance: 'caller_declared_not_verified', original_invocation: 'deny_returned_execution_not_observed', execution: 'not_observed',
|
|
250
|
+
spawn_application: { status: 'caller_review_required', reason: 'explicit_profile_arguments_required', required_fields: ['model', 'reasoning_effort'], on_unavailable: 'stop_and_report' },
|
|
250
251
|
next_call: { tool: 'spawn_agent', arguments: { task_name, message: standalone_task, fork_turns: 'none', model: profile.model, reasoning_effort: profile.reasoning_effort } },
|
|
251
|
-
next_step: '
|
|
252
|
+
next_step: 'Caller review means checking the arguments, not requesting new user approval. Only after a host-reported blocked outcome, review and submit the separate next_call.arguments under existing delegation authorization and unchanged host permissions. Include every returned argument, especially the explicit model and reasoning_effort; do not omit them or submit a model/effort-omitted replacement, which may trigger context recovery again. If explicit user choices or higher-priority host instructions require parent-model inheritance or forbid either profile field, stop and report that the prepared profile cannot be applied. Do not use another recovery ticket to bypass that restriction. If it is unclear whether a user or host constraint permits applying either field, stop and report the uncertainty rather than guessing or dropping fields. Task prose is not permission to override those constraints. Original arguments were not rewritten; host execution is not observed by this server. Do not add history/role/resume overrides or reuse this preparation for another task. Preparation does not prove interception, permission approval, single execution or child execution.' };
|
|
252
253
|
}
|
|
253
254
|
catch {
|
|
254
255
|
return reject('fresh_delegation_unavailable');
|
package/dist/src/server.js
CHANGED
|
@@ -124,7 +124,7 @@ export function createServer({ env: inputEnv = process.env } = {}) {
|
|
|
124
124
|
return content(result);
|
|
125
125
|
});
|
|
126
126
|
server.registerTool('prepare_fresh_delegation', {
|
|
127
|
-
description: 'Prepare a SEPARATE intentional Codex fresh-child call from a completed inherited recommendation. No classification or spawn. Use the original Hook retry_id on this process within five minutes. Only when the caller can declare independent work, no user-required inherited history, and complete standalone instructions. Never use for required/unknown history or to bypass permissions. Explicit choices and the original blocked invocation remain intact. Same task is idempotent; changed task conflicts.',
|
|
127
|
+
description: 'Prepare a SEPARATE intentional Codex fresh-child call from a completed inherited recommendation. No classification or spawn. Use the original Hook retry_id on this process within five minutes. Only when the caller can declare independent work, no user-required inherited history, and complete standalone instructions. Submit all returned next_call.arguments, including model and reasoning_effort, after caller review. Caller review checks arguments, not new user approval. If explicit user choices or higher-priority host instructions forbid either field, require parent-model inheritance, or their applicability is unclear, stop and report; do not submit a profile-omitted call or create another recovery ticket to bypass it. Never use for required/unknown history or to bypass permissions. Explicit choices and the original blocked invocation remain intact. Same task is idempotent; changed task conflicts.',
|
|
128
128
|
annotations: { ...annotations, openWorldHint: false }, inputSchema: { retry_id: z.string().regex(/^[a-f0-9]{64}$/), task_name: z.string().min(1).max(128), standalone_task: z.string().min(1).max(12000),
|
|
129
129
|
declaration: z.object({ independent_task: z.boolean(), same_task: z.boolean(), original_call_outcome: z.enum(['blocked', 'executed', 'unknown']), history_requirement: z.enum(['not_required', 'required', 'unknown']), standalone_context_complete: z.boolean() }).strict() }
|
|
130
130
|
}, async ({ retry_id, task_name, standalone_task, declaration }, extra) => {
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.16";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.16';
|
package/docs/SPAWN_CONTEXT.md
CHANGED
|
@@ -365,6 +365,20 @@ new native call under unchanged host permissions and existing delegation
|
|
|
365
365
|
authorization. Neither preparation nor argument output proves dispatch/execution.
|
|
366
366
|
The process does not own native spawn or guarantee caller compliance.
|
|
367
367
|
|
|
368
|
+
Starting with 0.1.16, `spawn_application.required_fields` identifies the explicit `model` and
|
|
369
|
+
`reasoning_effort` that must accompany the separate call. Copy all returned
|
|
370
|
+
`next_call.arguments`; omitting the profile can trigger a new context-recovery
|
|
371
|
+
attempt when the native body is opaque. `caller_review_required` means argument
|
|
372
|
+
review, not a new user approval. If user choices or higher-priority host rules
|
|
373
|
+
forbid either field (including required parent-model inheritance), stop and
|
|
374
|
+
report that the profile cannot be applied. Do not use another recovery ticket
|
|
375
|
+
to bypass the restriction. If applicability of a user/host constraint is unclear,
|
|
376
|
+
stop and report the uncertainty instead of guessing or dropping fields. The Hook
|
|
377
|
+
preserves explicit fields; it does not verify that a new call matches a preparation.
|
|
378
|
+
Strict whole-response consumers must allow this additive object.
|
|
379
|
+
This metadata is caller guidance, not enforcement,
|
|
380
|
+
permission or native execution evidence; task prose grants no override authority.
|
|
381
|
+
|
|
368
382
|
The original five-minute lifetime and process/capacity boundaries apply. One
|
|
369
383
|
immutable preparation digest binds task, declaration, profile and original
|
|
370
384
|
reference; text/history are not persisted. Duplicate identical preparation is
|
|
@@ -153,6 +153,8 @@ After a defaults Hook blocks inherited application, the caller may use `prepare_
|
|
|
153
153
|
|
|
154
154
|
The original inherited invocation stays blocked. Review the separate `next_call.arguments` and submit it under existing delegation authorization and normal host permission checks. It includes `fork_turns: "none"` and preserves model/effort choices. This is caller-declared intent, not verified user intent or execution evidence. Do not use it for required/unknown history, fixed roles, resume or unverified additional execution arguments. A reference binds one task; five-minute expiry, cancellation, policy/catalog changes and changes to the original invocation block preparation. It is not offered for nonblocking advisory paths. See the [contract and limits](../../SPAWN_CONTEXT.md#intentional-fresh-delegation).
|
|
155
155
|
|
|
156
|
+
The required-argument guidance below is available starting with 0.1.16. Pass every returned `next_call.arguments` field, including `model` and `reasoning_effort`; omitting them can send an opaque new call back into context recovery. `spawn_application.required_fields` guides caller checks and grants no permission. If user choices or higher-priority host rules require parent-model inheritance or prohibit either field, stop and report that the profile cannot be applied. Do not bypass the restriction with a new recovery ID. If a constraint’s applicability is unclear, stop and report the uncertainty. The Hook preserves explicit fields but does not verify that a new call matches a preparation.
|
|
157
|
+
|
|
156
158
|
Use this only after the host reports the original call blocked. `original_call_outcome` values `executed` and `unknown` reject preparation. This is caller-declared, not server execution observation. Repeated identical preparation does not guarantee single child execution. The profile was selected from the original classification summary and must not be reused for a different task.
|
|
157
159
|
|
|
158
160
|
<a id="guide-model-info-cache"></a>
|
|
@@ -1,43 +1,33 @@
|
|
|
1
1
|
# Configuration and model candidates
|
|
2
2
|
|
|
3
|
-
[한국어](../ko/configuration.md) ·
|
|
3
|
+
[한국어](../ko/configuration.md) · **English** · [简体中文](../zh-CN/configuration.md) · [日本語](../ja/configuration.md)
|
|
4
4
|
|
|
5
|
-
[Guide
|
|
5
|
+
[Guide contents](../en.md)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
The default home may differ from the account home used by the host. Do not copy policies, ledgers, keys or trust records across homes. Preserve conflicting registrations and `existing_hook_not_owned` cases for review; see [Troubleshooting](troubleshooting.md).
|
|
10
|
-
|
|
11
|
-
For manual MCP configuration, see [Advanced integration](advanced.md#guide-manual-mcp-setup).
|
|
12
|
-
|
|
13
|
-
## On this page
|
|
7
|
+
## Contents
|
|
14
8
|
|
|
15
9
|
- [Configuration file locations](#guide-host-config-locations)
|
|
16
|
-
- [
|
|
10
|
+
- [CLI configuration](#guide-cli-configuration)
|
|
17
11
|
- [Keys and restarting](#guide-keys-and-restart)
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
12
|
+
- [Stable launcher](#guide-stable-launcher)
|
|
13
|
+
- [Model candidates](#guide-models-and-environment)
|
|
20
14
|
|
|
21
15
|
<a id="guide-host-config-locations"></a>
|
|
22
16
|
|
|
23
17
|
## Configuration file locations
|
|
24
18
|
|
|
25
|
-
| Host |
|
|
26
|
-
|
|
27
|
-
| Codex |
|
|
28
|
-
| Claude Code | `mcpServers.aptly` in `~/.claude.json
|
|
19
|
+
| Host | Default location | Alternate account home |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Codex | `~/.codex/config.toml` | `$CODEX_HOME/config.toml` |
|
|
22
|
+
| Claude Code | `mcpServers.aptly` in `~/.claude.json` | `$CLAUDE_CONFIG_DIR/.claude.json` |
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
Claude Hooks are in `~/.claude/settings.json` by default, or `$CLAUDE_CONFIG_DIR/settings.json` for another account. Pass the host's account environment to installation, setup, and statistics commands too. Do not copy policies, ledgers, keys, or trust records from another home.
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
Since 0.1.15, the Codex MCP `@codex-home` policy selects `~/.codex` when `CODEX_HOME` is absent. An explicit absolute path takes precedence; empty or relative paths and control characters are rejected. Custom homes are not discovered, so the default home's policy and transmission scope apply unless the administrator passes the value. See [advanced setup](advanced.md#guide-manual-mcp-setup) for manual, project, and managed registrations.
|
|
33
27
|
|
|
34
28
|
<a id="guide-cli-configuration"></a>
|
|
35
29
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
From 0.1.11, the first normal interactive `aptly set default` groups pending transmission reviews by client home. The recommendation is `excerpt`; Enter preserves an existing scope or selects `none` if unselected. See [transmission review](transmission.md#guide-transmission-scope). This review flow is not supported in 0.1.10, so update first.
|
|
39
|
-
|
|
40
|
-
The `set` commands require 0.1.1 or later. Commands do not automatically switch existing launch paths. API-key setup accepts only the current package’s standard Node/server registration with a verified OS-source-compatible runtime. Custom wrappers, older versions, and other installation prefixes are rejected with `credential_launcher_unverified`; explicitly switch the registration or upgrade it before trying again.
|
|
30
|
+
## CLI configuration
|
|
41
31
|
|
|
42
32
|
```sh
|
|
43
33
|
aptly set default
|
|
@@ -45,72 +35,71 @@ aptly set env APTLY_CODEX_MODELS
|
|
|
45
35
|
aptly set env OPENAI_API_KEY
|
|
46
36
|
```
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Both hosts are selected by default. Use `--client codex`, `--client claude`, or `--client all` to select targets. For example, enter a JSON string such as `["haiku","sonnet","opus"]` for Claude candidates.
|
|
38
|
+
`set default` adds missing registrations and defaults and reviews the [transmission scope](transmission.md). It preserves existing commands, environment, provider, candidates, and advisory policy. `set env` accepts hidden input and changes only the named variable. Both hosts are targeted by default; select with `--client codex|claude|all`.
|
|
51
39
|
|
|
52
40
|
```sh
|
|
53
41
|
aptly set env APTLY_CLAUDE_MODELS --client claude
|
|
54
42
|
```
|
|
55
43
|
|
|
56
|
-
|
|
44
|
+
Enter candidates as a JSON array string such as `["haiku","sonnet","opus"]`. For automation use `--stdin`. Do not put real keys in `printf` or shell history.
|
|
57
45
|
|
|
58
46
|
```sh
|
|
59
47
|
printf '%s\n' '["gpt-6.1-terra"]' | aptly set env APTLY_CODEX_MODELS --stdin
|
|
60
48
|
```
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
Generally allowed keys are `ROUTER_PROVIDER` (`fixture`/`decisions`), `APTLY_CLAUDE_MODELS`, `APTLY_CODEX_MODELS`, aliases `CLAUDE_MODELS` and `CODEX_MODELS`, and `APTLY_MODEL_INFO_PATH`. The model cache path must be absolute and inside a private directory. This command does not change administrative ledger or policy paths.
|
|
51
|
+
|
|
52
|
+
<a id="guide-keys-and-restart"></a>
|
|
53
|
+
|
|
54
|
+
## Keys and restarting
|
|
63
55
|
|
|
64
|
-
|
|
56
|
+
`aptly set env OPENAI_API_KEY` stores each host's key in macOS Keychain, Linux `secret-tool`, or Windows Credential Manager and registers only a store reference with MCP. An unavailable or locked store produces an error; Aptly does not fall back to a plaintext file or another environment key. See [credential store errors](troubleshooting.md).
|
|
65
57
|
|
|
66
|
-
|
|
58
|
+
Host subscription login and the API key are separate. Do not record keys in command arguments, configuration JSON, requests, or repositories. For direct delivery through a secure MCP execution environment, see [manual setup](advanced.md#guide-key-environment).
|
|
67
59
|
|
|
68
|
-
|
|
60
|
+
Key storage is allowed only for standard launchers verified as compatible. Custom wrappers are preserved but may be rejected with `credential_launcher_unverified`. For `partial`, check each host's error. On a storage failure Aptly attempts to restore the previous key; if `credential_rollback_failed` occurs, check the active key in the OS store before retrying. Changes across multiple hosts are not atomic.
|
|
69
61
|
|
|
70
|
-
Restart MCP
|
|
62
|
+
Restart MCP after changes and check candidates, provider, and `credential_status` with `get_routing_capabilities`. `os_store` means the key was read, not that its API validity was verified. Codex `/hooks` approval is also required.
|
|
71
63
|
|
|
72
64
|
<a id="guide-stable-launcher"></a>
|
|
73
65
|
|
|
74
|
-
## Node
|
|
66
|
+
## Launcher resilient to Node version changes
|
|
75
67
|
|
|
76
|
-
|
|
68
|
+
Default registrations use an absolute Node path. On macOS and Linux, `stable` is available for frequent Node version changes (since 0.1.14). It preserves Aptly and dependencies outside the Node directory and searches for another supported Node.js 24+. It does not include Node and does not support Windows.
|
|
77
69
|
|
|
78
|
-
|
|
70
|
+
For a new registration, use `aptly setup --client all --launcher stable`. For an existing one, review the dry run before migration. Pass the appropriate home environment for other accounts and use `--client claude` for Claude.
|
|
79
71
|
|
|
80
72
|
```sh
|
|
81
73
|
aptly setup --client codex --migrate-launcher --launcher stable --dry-run
|
|
82
74
|
aptly setup --client codex --migrate-launcher --launcher stable
|
|
83
75
|
```
|
|
84
76
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Resolution tries the installer Node, standard locations, numeric release directories in the default `~/.nvm/versions/node`, then safe absolute PATH entries. It does not promise the newest Node; symlink/shim-based managers may be rejected even with PATH; only qualified real executable paths are supported. No shell profile, npm or network download runs at startup. Stable mode deliberately removes `NODE_OPTIONS`, `NODE_PATH` and `NODE_REPL_EXTERNAL_MODULE` to avoid inheriting common Node startup overrides; use separate certificate settings such as `NODE_EXTRA_CA_CERTS` when needed. Runtime closures requiring native addons are refused. Missing runtime or failed integrity stops MCP with a fixed error; observers stay silent and best-effort.
|
|
88
|
-
|
|
89
|
-
Normal global npm installations are the primary supported source. Redirected/writable ancestors and dependencies hoisted outside a local package cannot be verified and are refused. Windows retains direct mode and rejects the stable option. Stable mode remains sticky across later setup/migration without the flag. Run `aptly update` from the actual global npm CLI; explicitly migrate to select a new Aptly snapshot. Remove retains old/shared snapshots because other homes or running processes may still use them. Doctor observes snapshot metadata, not full execution, authentication or reload readiness.
|
|
77
|
+
After updating global Aptly, run the same command to update the preserved copy. Ordinary `setup` does not replace it; an old copy reports `stable_snapshot_outdated`. Migration updates owned MCP and statistics observers together. Modified launchers and Hooks are not adopted. To target a preserved standard registration, review it and add `--include-existing`. Approve changed Codex Hooks again in `/hooks`.
|
|
90
78
|
|
|
91
|
-
|
|
79
|
+
<details>
|
|
80
|
+
<summary>Launcher limits and recovery</summary>
|
|
92
81
|
|
|
93
|
-
|
|
82
|
+
The search order is installation Node, standard paths, default `~/.nvm/versions/node`, then safe absolute PATH entries. Selection of the newest version and support for custom NVM_DIR, shims, or symlink-based managers are not guaranteed. Shell profiles, npm, and downloads are not executed. `NODE_OPTIONS`, `NODE_PATH`, and `NODE_REPL_EXTERNAL_MODULE` are removed; review `NODE_EXTRA_CA_CERTS` and similar settings for additional CAs.
|
|
94
83
|
|
|
95
|
-
|
|
84
|
+
Unverifiable sources such as writable ancestor paths, externally hoisted dependencies, and native add-ons are rejected. Integrity checks add I/O cost, and the search budget is not a hard timeout for all file I/O. This is not sandboxing or publisher signature verification. On failure MCP stops with an error and the statistics observer exits quietly.
|
|
96
85
|
|
|
97
|
-
|
|
86
|
+
If ownership matches, a missing, damaged, or older-format copy can be explicitly migrated from a new CLI source. Damaged same-generation copies and incomplete locks are not automatically overwritten or deleted. Old copies are not automatically deleted because other homes or processes may reference them. Check writers and references before reviewing the state. Migration between direct Node launchers may require a separate statistics update (`statistics_observer_migration_required`).
|
|
98
87
|
|
|
99
|
-
|
|
88
|
+
</details>
|
|
100
89
|
|
|
101
90
|
<a id="guide-models-and-environment"></a>
|
|
102
91
|
|
|
103
92
|
## Models and environment variables
|
|
104
93
|
|
|
105
|
-
|
|
94
|
+
Tiers are task presets and do not imply equivalent model performance across providers.
|
|
106
95
|
|
|
107
|
-
| Tier | Claude Code | Codex |
|
|
96
|
+
| Tier | Claude Code | Codex | Example tasks |
|
|
108
97
|
|---|---|---|---|
|
|
109
|
-
| simple | `haiku` | `gpt-6-luna` / `max` | Extraction, format conversion,
|
|
110
|
-
| routine | `sonnet` | `gpt-6.1-terra` / `high` | Context-aware writing
|
|
111
|
-
| deep | `opus` | `gpt-6.1-sol` / `medium` |
|
|
98
|
+
| simple | `haiku` | `gpt-6-luna` / `max` | Extraction, format conversion, small mechanical edits |
|
|
99
|
+
| routine | `sonnet` | `gpt-6.1-terra` / `high` | Context-aware writing, translation, scoped implementation |
|
|
100
|
+
| deep | `opus` | `gpt-6.1-sol` / `medium` | Complex debugging, design decisions, deep review |
|
|
112
101
|
|
|
113
|
-
MCP `env` values are strings, so candidate arrays
|
|
102
|
+
MCP `env` values are strings, so pass candidate arrays as JSON strings.
|
|
114
103
|
|
|
115
104
|
```json
|
|
116
105
|
{
|
|
@@ -121,12 +110,8 @@ MCP `env` values are strings, so candidate arrays must also be passed as JSON st
|
|
|
121
110
|
}
|
|
122
111
|
```
|
|
123
112
|
|
|
124
|
-
When
|
|
125
|
-
|
|
126
|
-
`aptly set default` preserves candidates and aliases already in MCP `env`, Codex `env_vars` declarations, and inherited candidates visible to the current CLI for Claude. It adds default candidates only for a model family with neither name configured. A Codex passthrough is preserved even when its value is unavailable in the current terminal; inherited values are not copied into configuration files. The CLI gives a static `env` value precedence over an inherited value with the same name when validating effective settings. Catalog validation remains in place, so conflicting aliases or malformed values reject the configuration change. Check the final candidates in the restarted MCP separately.
|
|
127
|
-
|
|
128
|
-
## Related topics
|
|
113
|
+
When omitted, the defaults above apply; `[]` disables recommendations for that host. Empty strings, duplicates, unsupported models, and invalid JSON are errors. `CLAUDE_MODELS` and `CODEX_MODELS` are aliases, but setting both the primary name and alias for one provider is an error. Candidate settings do not overwrite existing selections or verify account access to models.
|
|
129
114
|
|
|
130
|
-
|
|
115
|
+
`set default` preserves existing candidates, aliases, and pass-through declarations and adds defaults only for missing model families. It does not overwrite inherited Codex candidates even if the current CLI cannot see them. Check final candidates after restarting MCP.
|
|
131
116
|
|
|
132
|
-
[Guide
|
|
117
|
+
[Installation](installation.md) · [Troubleshooting](troubleshooting.md) · [Guide contents](../en.md)
|