aptly 0.1.14 → 0.1.15
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/policy-source.d.ts +2 -2
- package/dist/src/policy-source.js +4 -3
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/guide/en/configuration.md +2 -0
- package/docs/guide/ja/configuration.md +2 -0
- package/docs/guide/ko/configuration.md +2 -0
- package/docs/guide/zh-CN/configuration.md +2 -0
- 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] [--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 } },
|
|
@@ -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/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.15";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.15';
|
|
@@ -27,6 +27,8 @@ For manual MCP configuration, see [Advanced integration](advanced.md#guide-manua
|
|
|
27
27
|
| Codex | `$CODEX_HOME/config.toml`; `~/.codex/config.toml` when `CODEX_HOME` is unset |
|
|
28
28
|
| Claude Code | `mcpServers.aptly` in `~/.claude.json`; `.claude.json` inside `CLAUDE_CONFIG_DIR` when that directory is configured |
|
|
29
29
|
|
|
30
|
+
Starting with 0.1.15, the fix lets MCP using the `@codex-home` policy select `~/.codex` under the OS user home when `CODEX_HOME` is absent. An explicit absolute path takes precedence; explicitly empty, relative or control-character-containing values remain rejected. Published 0.1.14 still requires the variable to be forwarded even for the default home. Custom account homes are not discovered automatically, so account managers must forward the correct `CODEX_HOME`. If a custom host omits this value, the default home’s policy and transmission scope apply; forward it to preserve account-specific policy.
|
|
31
|
+
|
|
30
32
|
Claude Code stores Hooks in `~/.claude/settings.json` by default, or `$CLAUDE_CONFIG_DIR/settings.json` when `CLAUDE_CONFIG_DIR` is set. This is separate from MCP registration. If project `.mcp.json`, managed settings, or account-specific directories are in use, check the active entry in `/mcp` before editing or adding a registration.
|
|
31
33
|
|
|
32
34
|
<a id="guide-cli-configuration"></a>
|
|
@@ -27,6 +27,8 @@ MCP の手動設定は[高度な連携](advanced.md#guide-manual-mcp-setup)を
|
|
|
27
27
|
| Codex | `$CODEX_HOME/config.toml`。`CODEX_HOME` 未指定の場合は `~/.codex/config.toml` |
|
|
28
28
|
| Claude Code | `~/.claude.json` の `mcpServers.aptly`。`CLAUDE_CONFIG_DIR` 指定時は、そのディレクトリの `.claude.json` |
|
|
29
29
|
|
|
30
|
+
0.1.15 以降では、`@codex-home` ポリシーを使う MCP も `CODEX_HOME` が未指定の場合に OS ユーザーのホーム内の `~/.codex` を選択します。明示された絶対パスが優先され、空の値・相対パス・制御文字を含む値は引き続き拒否します。公開済みの 0.1.14 では、既定のホームでも環境変数の転送が必要です。カスタムのアカウントホームは自動探索しないため、アカウント管理ツールは正しい `CODEX_HOME` を転送してください。 カスタムホストがこの値を渡さない場合、既定ホームのポリシーと送信範囲が適用されるため、アカウント別ポリシーを維持するには必ず渡してください。
|
|
31
|
+
|
|
30
32
|
Claude Code の Hook ファイルは通常 `~/.claude/settings.json` ですが、`CLAUDE_CONFIG_DIR` を指定すると `$CLAUDE_CONFIG_DIR/settings.json` になります。MCP 登録とは別です。プロジェクトの `.mcp.json`、管理設定、アカウント別ディレクトリを使う場合は、編集・追加前に `/mcp` で有効な登録を確認してください。
|
|
31
33
|
|
|
32
34
|
<a id="guide-cli-configuration"></a>
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
| Codex | `$CODEX_HOME/config.toml`; `CODEX_HOME` 미지정 시 `~/.codex/config.toml` |
|
|
28
28
|
| Claude Code | `~/.claude.json`의 `mcpServers.aptly`; `CLAUDE_CONFIG_DIR` 지정 시 해당 디렉터리의 `.claude.json` |
|
|
29
29
|
|
|
30
|
+
0.1.15부터는 `@codex-home` 정책을 사용하는 MCP도 `CODEX_HOME`이 없으면 OS 사용자 홈의 `~/.codex`를 선택합니다. 명시한 절대 경로가 우선하며, 빈 값·상대 경로·제어 문자가 포함된 값은 계속 거절합니다. 게시된 0.1.14는 기본 홈도 환경변수 전달이 필요합니다. 사용자 지정 계정 홈은 자동 탐색하지 않으므로 계정 관리자는 올바른 `CODEX_HOME`을 전달해야 합니다. 사용자 지정 호스트가 이 값을 전달하지 않으면 기본 홈의 정책과 전송 범위가 적용되므로, 계정별 정책을 유지하려면 값을 반드시 전달하십시오.
|
|
31
|
+
|
|
30
32
|
Claude Code의 Hook 파일은 기본적으로 `~/.claude/settings.json`이며, `CLAUDE_CONFIG_DIR`을 지정하면 `$CLAUDE_CONFIG_DIR/settings.json`입니다. MCP 등록 파일과는 별개입니다. 프로젝트 `.mcp.json`·관리 설정·계정별 디렉터리를 사용한다면 수정하거나 등록하기 전에 `/mcp`에서 활성 항목을 확인하십시오.
|
|
31
33
|
|
|
32
34
|
<a id="guide-cli-configuration"></a>
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
| Codex | `$CODEX_HOME/config.toml`;未设置 `CODEX_HOME` 时为 `~/.codex/config.toml` |
|
|
28
28
|
| Claude Code | `~/.claude.json` 中的 `mcpServers.aptly`;设置 `CLAUDE_CONFIG_DIR` 时为该目录中的 `.claude.json` |
|
|
29
29
|
|
|
30
|
+
自 0.1.15 起,修复允许使用 `@codex-home` 策略的 MCP 在未设置 `CODEX_HOME` 时选择 OS 用户主目录下的 `~/.codex`。显式指定的绝对路径优先;显式空值、相对路径或含控制字符的值仍会被拒绝。已发布的 0.1.14 即使使用默认主目录,也仍需传递该变量。自定义账户目录不会被自动查找,因此账户管理工具必须传递正确的 `CODEX_HOME`。 若自定义宿主未传递此值,将应用默认主目录的策略与传输范围;请传递该值以保留账户专属策略。
|
|
31
|
+
|
|
30
32
|
Claude Code 默认将 Hook 存储在 `~/.claude/settings.json`;设置 `CLAUDE_CONFIG_DIR` 时则使用 `$CLAUDE_CONFIG_DIR/settings.json`。此文件与 MCP 注册分开。若使用项目 `.mcp.json`、托管设置或账户专用目录,请先通过 `/mcp` 确认当前注册,再编辑或添加。
|
|
31
33
|
|
|
32
34
|
<a id="guide-cli-configuration"></a>
|