aptly 0.1.14 → 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/cli-help.js +1 -1
- package/dist/src/context-retry.js +2 -1
- package/dist/src/policy-source.d.ts +2 -2
- package/dist/src/policy-source.js +4 -3
- 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 +44 -57
- 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 +42 -55
- 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 +35 -48
- 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 +42 -55
- 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%;这不是整体任务成本或订阅实际账单的降幅。
|
package/dist/src/cli-help.js
CHANGED
|
@@ -20,7 +20,7 @@ const entries = {
|
|
|
20
20
|
'stats disable': { usage: 'aptly stats disable [--client codex|claude|all]', description: 'Disable Aptly collection and remove unchanged product-owned observer definitions. Preserve statistics/key/history, custom or modified observers and all routing settings. Retained modified definitions are reported for local review.', options: { '--client': client } },
|
|
21
21
|
budget: { usage: 'aptly budget status [--client codex|claude|all]', description: 'Inspect local per-ledger budget limits and reserved usage. No reset/refill command is provided.' },
|
|
22
22
|
'budget status': { usage: 'aptly budget status [--client codex|claude|all]', description: 'Read registered host budget settings and ledger metadata; defaults to both clients. No credentials, provider calls, configuration writes or ledger/gate initialization.\nLiteral 0 ceilings display Unlimited; reservations are not OpenAI billing. This is a registration/permitted-environment snapshot, not verification of running custom launchers. An existing gate is held briefly and can be busy.', options: { '--client': client } },
|
|
23
|
-
setup: { usage: 'aptly setup [--client codex|claude|all] [--mode defaults|advisory] [--transmission none|description|excerpt] [--launcher stable] [--automatic]\n aptly setup --check [--client codex|claude|all]\n aptly setup --client codex|claude --migrate-launcher [--launcher stable] [--include-existing] [--dry-run]\n aptly setup --client codex --policy-source codex-home [--dry-run]', description: 'Register MCP and PreToolUse Hooks while preserving unrelated settings and existing launchers. --launcher stable explicitly selects a POSIX-only private immutable runtime outside versioned Node installs; for existing direct registrations combine it with --migrate-launcher. The snapshot includes the package and production dependencies, not Node itself. A supported installed Node is still required. Existing stable registrations stay stable, including later migrations without the flag. Default/automatic installations keep direct Node registrations. Modified/custom launchers remain unchanged. Stable migration updates owned statistics observers in the same host transaction; direct-to-direct legacy migration retains its separate observer refresh contract and may report statistics_observer_migration_required; keys, history and collection/native-metadata choices remain unchanged. Old/shared snapshots are retained after remove. Windows stable mode is unsupported; the existing direct mode remains available. Omitted --mode preserves an existing mode; a new policy defaults to defaults. New transmission remains unselected unless explicitly chosen.\n--check snapshots the normal setup plan without writing; only --client may be combined with it. It does not verify a running host.\n--automatic skips CI, APTLY_SKIP_SETUP=1 and absent host directories.\n--migrate-launcher reviews a single owned standard launcher; --include-existing explicitly includes an eligible preserved registration. --dry-run validates migration without writing. Do not combine migration with --automatic, --mode or --transmission. --include-existing requires --migrate-launcher. --policy-source codex-home explicitly binds an existing owned Codex setup to the runtime CODEX_HOME using a reserved selector and forwarded CODEX_HOME; it preserves policy, ledger and statistics state. CLI commands select ~/.codex when CODEX_HOME is absent; an explicit override
|
|
23
|
+
setup: { usage: 'aptly setup [--client codex|claude|all] [--mode defaults|advisory] [--transmission none|description|excerpt] [--launcher stable] [--automatic]\n aptly setup --check [--client codex|claude|all]\n aptly setup --client codex|claude --migrate-launcher [--launcher stable] [--include-existing] [--dry-run]\n aptly setup --client codex --policy-source codex-home [--dry-run]', description: 'Register MCP and PreToolUse Hooks while preserving unrelated settings and existing launchers. --launcher stable explicitly selects a POSIX-only private immutable runtime outside versioned Node installs; for existing direct registrations combine it with --migrate-launcher. The snapshot includes the package and production dependencies, not Node itself. A supported installed Node is still required. Existing stable registrations stay stable, including later migrations without the flag. Default/automatic installations keep direct Node registrations. Modified/custom launchers remain unchanged. Stable migration updates owned statistics observers in the same host transaction; direct-to-direct legacy migration retains its separate observer refresh contract and may report statistics_observer_migration_required; keys, history and collection/native-metadata choices remain unchanged. Old/shared snapshots are retained after remove. Windows stable mode is unsupported; the existing direct mode remains available. Omitted --mode preserves an existing mode; a new policy defaults to defaults. New transmission remains unselected unless explicitly chosen.\n--check snapshots the normal setup plan without writing; only --client may be combined with it. It does not verify a running host.\n--automatic skips CI, APTLY_SKIP_SETUP=1 and absent host directories.\n--migrate-launcher reviews a single owned standard launcher; --include-existing explicitly includes an eligible preserved registration. --dry-run validates migration without writing. Do not combine migration with --automatic, --mode or --transmission. --include-existing requires --migrate-launcher. --policy-source codex-home explicitly binds an existing owned Codex setup to the runtime CODEX_HOME using a reserved selector and forwarded CODEX_HOME; it preserves policy, ledger and statistics state. CLI commands and MCP startup select ~/.codex under the OS user home when CODEX_HOME is absent; an explicit absolute override takes precedence. Explicitly empty, relative or control-character-containing overrides are rejected. A custom host that omits CODEX_HOME uses the default home policy and transmission scope. Custom account homes are not discovered automatically; account managers must forward the intended CODEX_HOME. This default-home MCP fallback is available starting with 0.1.15; published 0.1.14 requires explicit forwarding even for the default home. Use it in the canonical registration and intended account homes when a manager mirrors MCP tables. --dry-run validates either migration without writing. Policy-source migration requires --client codex and cannot combine with other setup actions. Upgrade all MCP backends first; restart MCP afterward.\nOrdinary interactive setup reviews unreviewed transmission choices, including existing registrations; Enter keeps configured scopes or selects none for unselected clients. --automatic, --check and launcher migration never prompt. Explicit --transmission records that choice without asking. No keys are stored. Restart the host/MCP; Codex requires native /hooks trust review.', options: { '--client': client, '--launcher': ['stable'], '--mode': ['defaults', 'advisory'], '--transmission': scope, '--automatic': true, '--check': true, '--migrate-launcher': true, '--policy-source': ['codex-home'], '--include-existing': true, '--dry-run': true } },
|
|
24
24
|
remove: { usage: 'aptly remove [--client codex|claude|all]', description: 'Remove only unchanged Aptly-owned registration for both clients by default. Preserve modified/user-owned entries, keys and ledger history. Restart host/MCP after removal.', options: { '--client': client } },
|
|
25
25
|
update: { usage: 'aptly update', description: 'Update this verified global npm installation within the same prefix. Stop other hosts/MCP/CLI writers first. Local/source/unverified installations are rejected. Lifecycle setup is not run: run aptly setup and restart hosts afterward. Existing stable registrations retain their selected snapshot until explicit per-client --migrate-launcher --launcher stable; plain setup reports stable_snapshot_outdated when versions differ. Existing launchers and keys are preserved. Update does not run setup or a new CLI process: next interactive setup/set default reviews pending transmission choices; use aptly set transmission --review for an explicit review. The first upgrade from older code requires a subsequent setup/default command to load this behavior.' },
|
|
26
26
|
doctor: { usage: 'aptly doctor [--client codex|claude|all]', description: 'Read local registration, policy, package version and bounded ledger metadata as JSON. No launcher execution, credential-store query, provider/network call, state creation or update notification. Complete (exit 0) means the query completed, not host readiness; partial (exit 1) means an observation failed. Runtime version, Hook trust/execution, restart need and retry ticket usage remain unknown. Ledgers above 4 MiB are not scanned. A missing first-use ledger has unknown history. Scan time includes validation/rechecks; write timing is not measured. Existing report exports are separate and unchanged.', options: { '--client': client } },
|
|
@@ -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');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const CODEX_HOME_POLICY_SOURCE = "@codex-home";
|
|
2
|
-
/** Resolve
|
|
3
|
-
export declare function resolvePolicySource(value: string | undefined, env: NodeJS.ProcessEnv,
|
|
2
|
+
/** Resolve an explicit override or the OS default; never discover custom account homes. */
|
|
3
|
+
export declare function resolvePolicySource(value: string | undefined, env: NodeJS.ProcessEnv, home?: string): string | undefined;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isAbsolute, join } from 'node:path';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
2
3
|
export const CODEX_HOME_POLICY_SOURCE = '@codex-home';
|
|
3
|
-
/** Resolve
|
|
4
|
-
export function resolvePolicySource(value, env,
|
|
4
|
+
/** Resolve an explicit override or the OS default; never discover custom account homes. */
|
|
5
|
+
export function resolvePolicySource(value, env, home) {
|
|
5
6
|
if (value !== CODEX_HOME_POLICY_SOURCE)
|
|
6
7
|
return value;
|
|
7
|
-
const codexHome = env.CODEX_HOME;
|
|
8
|
+
const codexHome = env.CODEX_HOME === undefined ? join(home ?? homedir(), '.codex') : env.CODEX_HOME;
|
|
8
9
|
if (codexHome === undefined || !codexHome.trim() || !isAbsolute(codexHome) || /[\x00-\x1f\x7f-\x9f]/.test(codexHome))
|
|
9
10
|
throw new Error('policy_source_home_invalid');
|
|
10
11
|
return join(codexHome, 'aptly', 'auto-policy.json');
|
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>
|