aptly 0.1.11 → 0.1.12
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/dist/src/cli-help.js +1 -1
- package/dist/src/setup.js +9 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/guide/en/troubleshooting.md +1 -1
- package/docs/guide/ja/troubleshooting.md +1 -1
- package/docs/guide/ko/troubleshooting.md +1 -1
- package/docs/guide/zh-CN/troubleshooting.md +1 -1
- package/package.json +1 -1
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] [--automatic]\n aptly setup --check [--client codex|claude|all]\n aptly setup --client codex|claude --migrate-launcher [--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. 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.
|
|
23
|
+
setup: { usage: 'aptly setup [--client codex|claude|all] [--mode defaults|advisory] [--transmission none|description|excerpt] [--automatic]\n aptly setup --check [--client codex|claude|all]\n aptly setup --client codex|claude --migrate-launcher [--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. 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 selects that account home and invalid overrides are rejected. MCP startup still requires a forwarded absolute CODEX_HOME, including the default home; missing values fail closed. 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, '--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 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
|
report: { usage: 'aptly report [--format md|json|both] [--output-dir DIR]', description: 'Write redacted local diagnostic attachments. Default format: both; directory: reports. No uploads or classification API probes. Review attachments before sharing.', options: { '--format': ['md', 'json', 'both'], '--output-dir': 'path' } },
|
package/dist/src/setup.js
CHANGED
|
@@ -322,17 +322,24 @@ function updateTomlForwarding(text, names) {
|
|
|
322
322
|
fail('unsupported_toml_layout');
|
|
323
323
|
return rendered;
|
|
324
324
|
}
|
|
325
|
+
/** CLI commands validate their explicitly selected config home, not a running host. */
|
|
326
|
+
function selectedCliPolicyPath(options) {
|
|
327
|
+
const env = options.env ?? process.env;
|
|
328
|
+
return resolvePolicySource(CODEX_HOME_POLICY_SOURCE, env.CODEX_HOME === undefined ? { ...env, CODEX_HOME: resolved(options, 'codex').dir } : env);
|
|
329
|
+
}
|
|
325
330
|
function policyReferenceMatches(entry, client, policyPath, options) {
|
|
326
331
|
const source = entry.env?.APTLY_HOOK_POLICY_PATH;
|
|
327
332
|
if (source !== CODEX_HOME_POLICY_SOURCE)
|
|
328
333
|
return source === policyPath;
|
|
329
|
-
return client === 'codex' && entry.env?.CODEX_HOME === undefined && Array.isArray(entry.env_vars) && entry.env_vars.every((x) => typeof x === 'string') && entry.env_vars.includes('CODEX_HOME') &&
|
|
334
|
+
return client === 'codex' && entry.env?.CODEX_HOME === undefined && Array.isArray(entry.env_vars) && entry.env_vars.every((x) => typeof x === 'string') && entry.env_vars.includes('CODEX_HOME') && selectedCliPolicyPath(options) === policyPath;
|
|
330
335
|
}
|
|
331
336
|
function resolved(options, client) {
|
|
332
337
|
const home = resolve(options.home ?? homedir()), env = options.env ?? process.env;
|
|
333
338
|
const override = client === 'codex' ? env.CODEX_HOME : env.CLAUDE_CONFIG_DIR;
|
|
334
339
|
if (override && !isAbsolute(override))
|
|
335
340
|
fail('relative_configuration_directory');
|
|
341
|
+
if (client === 'codex' && override !== undefined)
|
|
342
|
+
resolvePolicySource(CODEX_HOME_POLICY_SOURCE, env);
|
|
336
343
|
const dir = override || join(home, client === 'codex' ? '.codex' : '.claude');
|
|
337
344
|
const mcpPath = client === 'codex' ? join(dir, 'config.toml') : override ? join(dir, '.claude.json') : join(home, '.claude.json');
|
|
338
345
|
return { dir, mcpPath, hooksPath: join(dir, client === 'codex' ? 'hooks.json' : 'settings.json'), privateDir: join(dir, 'aptly') };
|
|
@@ -915,7 +922,7 @@ export function setPolicySource(options, dryRun = false) {
|
|
|
915
922
|
try {
|
|
916
923
|
const paths = resolved(options, client), policyPath = join(paths.privateDir, 'auto-policy.json');
|
|
917
924
|
// Validate the selector even when CODEX_HOME is present but empty.
|
|
918
|
-
if (
|
|
925
|
+
if (selectedCliPolicyPath(options) !== policyPath)
|
|
919
926
|
fail('policy_source_home_invalid');
|
|
920
927
|
const snap = (path) => { const file = read(path); return { path, before: file.text, after: file.text, mode: file.mode }; };
|
|
921
928
|
const mcp = snap(paths.mcpPath), hooks = snap(paths.hooksPath), policy = snap(policyPath), manifest = snap(join(paths.privateDir, 'setup-ownership.json'));
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.12";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.12';
|
|
@@ -42,7 +42,7 @@ CODEX_HOME="$HOME/.codex" aptly setup --check --client codex
|
|
|
42
42
|
CODEX_HOME="$HOME/.codex" aptly stats --client codex
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Migration registers `APTLY_HOOK_POLICY_PATH = "@codex-home"` and forwards `CODEX_HOME` through `env_vars`. At startup, the server selects that home's `aptly/auto-policy.json`. Missing, empty or relative values are rejected without selecting another home.
|
|
45
|
+
Migration registers `APTLY_HOOK_POLICY_PATH = "@codex-home"` and forwards `CODEX_HOME` through `env_vars`. At startup, the server selects that home's `aptly/auto-policy.json`. Missing, empty or relative values are rejected without selecting another home. MCP startup still requires an explicit forwarded home, including `CODEX_HOME="$HOME/.codex"` for the default home. If the 0.1.11 CLI reports `policy_source_home_invalid` in an ordinary terminal without the variable, use the explicit default home as above. The 0.1.12 CLI fix validates its already selected standard `~/.codex` when the variable is absent; explicit account selection and invalid-value rejection remain intact. The example uses the default home; substitute the intended absolute account home for account-specific commands. This is an operator-declared source selection, not complete host provenance. See [Codex MCP environment forwarding](https://learn.chatgpt.com/docs/extend/mcp#stdio-servers).
|
|
46
46
|
|
|
47
47
|
Migration does not move or reset policy contents, transmission consent, ledger paths, statistics history or Hook trust. Existing fixed/shared policies remain fixed unless explicitly migrated. Custom launchers, unrelated registration changes and ownership mismatches require local review; do not edit or copy receipts to bypass errors. Restart the server and check again in the intended account. A successful dry-run or file check does not prove the running MCP updated or a model was observed.
|
|
48
48
|
|
|
@@ -42,7 +42,7 @@ CODEX_HOME="$HOME/.codex" aptly setup --check --client codex
|
|
|
42
42
|
CODEX_HOME="$HOME/.codex" aptly stats --client codex
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
移行では `APTLY_HOOK_POLICY_PATH = "@codex-home"` と `env_vars` による `CODEX_HOME` の転送を登録します。起動時にそのホームの `aptly/auto-policy.json`
|
|
45
|
+
移行では `APTLY_HOOK_POLICY_PATH = "@codex-home"` と `env_vars` による `CODEX_HOME` の転送を登録します。起動時にそのホームの `aptly/auto-policy.json` を選びます。変数の欠落、空値、相対パスは別のホームに置き換えず拒否します。MCP 起動時には既定ホームでも `CODEX_HOME="$HOME/.codex"` を明示的に転送する必要があります。変数のない通常の端末で 0.1.11 CLI が `policy_source_home_invalid` を返す場合は、上の例のように既定ホームを明示してください。0.1.12 の CLI 修正では変数がない場合、すでに選択した標準の `~/.codex` を検証に使用します。明示的なアカウント選択と無効値の拒否は維持します。例は既定ホーム用です。各アカウントでは対象の絶対ホームパスに置き換えてください。これは運用者が指定した参照元の選択であり、ホスト全体の設定を証明するものではありません。[Codex MCP の環境変数転送](https://learn.chatgpt.com/docs/extend/mcp#stdio-servers)を参照してください。
|
|
46
46
|
|
|
47
47
|
移行はポリシー内容、送信同意、台帳パス、統計履歴、Hook の信頼を移動または初期化しません。既存の固定/共有ポリシーは明示的に移行しなければ維持されます。カスタムランチャー、無関係な登録変更、所有権の不一致はローカルで確認してください。エラーを回避するために記録を編集・コピーしないでください。サーバーを再起動して対象アカウントで再確認してください。プレビューやファイル検査の成功は、稼働中 MCP の更新やモデルの観測を証明しません。
|
|
48
48
|
|
|
@@ -42,7 +42,7 @@ CODEX_HOME="$HOME/.codex" aptly setup --check --client codex
|
|
|
42
42
|
CODEX_HOME="$HOME/.codex" aptly stats --client codex
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
전환은 `APTLY_HOOK_POLICY_PATH = "@codex-home"`과 `env_vars`의 `CODEX_HOME` 전달을 등록합니다. 서버 시작 시 전달된 홈의 `aptly/auto-policy.json`을 선택합니다. 변수가 없거나 비어 있거나 상대 경로이면 다른 홈으로 대체하지 않고 거부합니다.
|
|
45
|
+
전환은 `APTLY_HOOK_POLICY_PATH = "@codex-home"`과 `env_vars`의 `CODEX_HOME` 전달을 등록합니다. 서버 시작 시 전달된 홈의 `aptly/auto-policy.json`을 선택합니다. 변수가 없거나 비어 있거나 상대 경로이면 다른 홈으로 대체하지 않고 거부합니다. MCP 시작 시에는 기본 홈도 `CODEX_HOME="$HOME/.codex"`를 전달해야 합니다. 0.1.11 CLI에서 변수가 없는 일반 터미널의 setup이 `policy_source_home_invalid`로 실패하면 위 예시처럼 기본 홈을 명시하십시오. 0.1.12 CLI 수정에서는 변수가 없을 때 이미 선택한 표준 `~/.codex`를 검증에 사용합니다. 명시한 계정 홈과 잘못된 값의 거부는 유지합니다. 위 예시는 기본 홈용이며 각 계정에서는 해당 계정의 절대 홈 경로로 바꾸십시오. 이는 운영자가 지정한 경로 선택이며 호스트 전체 설정을 인증하는 증거가 아닙니다. [Codex MCP 환경변수 전달](https://learn.chatgpt.com/docs/extend/mcp#stdio-servers)을 참고하십시오.
|
|
46
46
|
|
|
47
47
|
전환은 정책 내용·전송 동의·원장 경로·통계 이력·Hook 신뢰를 이동하거나 초기화하지 않습니다. 기존 고정/공유 정책은 명시적으로 전환하지 않으면 유지됩니다. 사용자 정의 실행기, 다른 등록 변경, 소유권 불일치는 자동 복구하지 않습니다. 오류 시 기록을 편집하거나 복사하지 말고 등록을 검토하십시오. 서버를 다시 시작한 뒤 선택한 계정에서 다시 조회하십시오. 성공한 미리보기나 파일 검사는 실행 중 MCP의 갱신 또는 모델 관측을 증명하지 않습니다.
|
|
48
48
|
|
|
@@ -42,7 +42,7 @@ CODEX_HOME="$HOME/.codex" aptly setup --check --client codex
|
|
|
42
42
|
CODEX_HOME="$HOME/.codex" aptly stats --client codex
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
迁移注册 `APTLY_HOOK_POLICY_PATH = "@codex-home"`,并通过 `env_vars` 转发 `CODEX_HOME`。服务端启动时选择该目录下的 `aptly/auto-policy.json
|
|
45
|
+
迁移注册 `APTLY_HOOK_POLICY_PATH = "@codex-home"`,并通过 `env_vars` 转发 `CODEX_HOME`。服务端启动时选择该目录下的 `aptly/auto-policy.json`。变量缺失、为空或为相对路径时会被拒绝,不会选择其他主目录。MCP 启动时仍须显式转发主目录,默认目录也须传入 `CODEX_HOME="$HOME/.codex"`。如果 0.1.11 CLI 在未设置变量的普通终端中返回 `policy_source_home_invalid`,请像上述示例一样显式指定默认目录。0.1.12 CLI 修复会在变量缺失时验证其已选择的标准 `~/.codex`,同时保留显式账号选择及无效值拒绝。示例使用默认目录;针对账号执行时,请替换为目标账号的绝对主目录。这是操作者指定的来源选择,并非宿主完整配置的证明。请参阅 [Codex MCP 环境变量转发](https://learn.chatgpt.com/docs/extend/mcp#stdio-servers)。
|
|
46
46
|
|
|
47
47
|
迁移不会移动或重置策略内容、传输同意、账本路径、统计历史或 Hook 信任。现有固定/共享策略在未显式迁移时保持不变。自定义启动器、其他注册修改及所有权不匹配需要本地审查;请勿编辑或复制记录来绕过错误。重启服务端后,请在目标账号中再次检查。预演或文件检查成功并不证明运行中的 MCP 已更新,也不证明已观测到模型。
|
|
48
48
|
|