proxyctl 0.3.2__tar.gz → 0.4.0__tar.gz

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.
Files changed (26) hide show
  1. {proxyctl-0.3.2 → proxyctl-0.4.0}/PKG-INFO +11 -2
  2. {proxyctl-0.3.2 → proxyctl-0.4.0}/README.md +10 -1
  3. {proxyctl-0.3.2 → proxyctl-0.4.0}/man/proxyctl.1 +12 -3
  4. {proxyctl-0.3.2 → proxyctl-0.4.0}/pyproject.toml +1 -1
  5. proxyctl-0.4.0/src/proxyctl/__init__.py +8 -0
  6. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/cli.py +243 -74
  7. proxyctl-0.4.0/src/proxyctl/completion.py +381 -0
  8. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/explain.py +183 -20
  9. proxyctl-0.3.2/src/proxyctl/__init__.py +0 -3
  10. proxyctl-0.3.2/src/proxyctl/completion.py +0 -223
  11. {proxyctl-0.3.2 → proxyctl-0.4.0}/.gitignore +0 -0
  12. {proxyctl-0.3.2 → proxyctl-0.4.0}/LICENSE +0 -0
  13. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/_io.py +0 -0
  14. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/audit.py +0 -0
  15. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/builtin_plugins/__init__.py +0 -0
  16. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/builtin_plugins/connectivity_basic.py +0 -0
  17. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/builtin_plugins/corp_network.py +0 -0
  18. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/check.py +0 -0
  19. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/core/__init__.py +0 -0
  20. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/core/plugin.py +0 -0
  21. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/engine/__init__.py +0 -0
  22. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/engine/base.py +0 -0
  23. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/engine/mihomo.py +0 -0
  24. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/engine/singbox.py +0 -0
  25. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/status.py +0 -0
  26. {proxyctl-0.3.2 → proxyctl-0.4.0}/src/proxyctl/trace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: proxyctl
3
- Version: 0.3.2
3
+ Version: 0.4.0
4
4
  Summary: Proxy configuration lifecycle management for macOS and Linux
5
5
  Project-URL: Homepage, https://github.com/crhan/proxyctl
6
6
  Project-URL: Issues, https://github.com/crhan/proxyctl/issues
@@ -63,7 +63,16 @@ PROXYCTL_AGENT=1 proxyctl <cmd> # 一键 --json + 关色 + 非交互
63
63
 
64
64
  - envelope schema v2:`schema_version / cmd / ok / data / error / code / hints[] / warnings[] / doc / meta{{ts,elapsed_ms,proxyctl_version,request_id}}`
65
65
  - 退出码分语义:`0 OK / 2 USAGE / 3 NOT_FOUND / 4 PERMISSION / 5 ENGINE_DOWN / 6 CONFIG_ERR / 7 NETWORK_ERR / 8 LOCKED / 9 TIMEOUT / 10 DEPENDENCY_MISSING`
66
- - 写命令支持 `--dry-run` 输出结构化 plan;`audit/check` 支持 `--plain` TSV
66
+ - 写命令支持 `--dry-run` 输出结构化 plan(`data.plan = [PlanStep, ...]`);自 0.4.0 起
67
+ `plan.target` 全部真实化,`action=="subprocess"` 的 target.split() 可直接当 argv 复读:
68
+ ```bash
69
+ proxyctl dns-unlock --dry-run --json | jq -r '.data.plan[] | select(.action=="subprocess").target'
70
+ # → launchctl bootout system/com.proxyctl.dns-lock
71
+ # → rm -f /Library/LaunchDaemons/com.proxyctl.dns-lock.plist
72
+ ```
73
+ PlanStep.action 枚举:`subprocess / system_op / fs_write / fs_copy / fs_write_atomic / fs_remove / edit_yaml / scan_log / http_put`。
74
+ CI 层 contract test(`tests/integration/test_plan_exec_contract.py`)保证 plan ↔ exec 永不漂移。
75
+ - `audit/check` 支持 `--plain` TSV
67
76
  - `proxyctl help <cmd>` 与 `<cmd> --help` 同源;错误带可执行 hints + explain topic
68
77
  - 非 TTY 自动关色;不读 stdin / 不 prompt;写操作 fcntl.flock 互斥
69
78
  - 从 0.2.x 升级见 [MIGRATION-0.3.md](MIGRATION-0.3.md)
@@ -34,7 +34,16 @@ PROXYCTL_AGENT=1 proxyctl <cmd> # 一键 --json + 关色 + 非交互
34
34
 
35
35
  - envelope schema v2:`schema_version / cmd / ok / data / error / code / hints[] / warnings[] / doc / meta{{ts,elapsed_ms,proxyctl_version,request_id}}`
36
36
  - 退出码分语义:`0 OK / 2 USAGE / 3 NOT_FOUND / 4 PERMISSION / 5 ENGINE_DOWN / 6 CONFIG_ERR / 7 NETWORK_ERR / 8 LOCKED / 9 TIMEOUT / 10 DEPENDENCY_MISSING`
37
- - 写命令支持 `--dry-run` 输出结构化 plan;`audit/check` 支持 `--plain` TSV
37
+ - 写命令支持 `--dry-run` 输出结构化 plan(`data.plan = [PlanStep, ...]`);自 0.4.0 起
38
+ `plan.target` 全部真实化,`action=="subprocess"` 的 target.split() 可直接当 argv 复读:
39
+ ```bash
40
+ proxyctl dns-unlock --dry-run --json | jq -r '.data.plan[] | select(.action=="subprocess").target'
41
+ # → launchctl bootout system/com.proxyctl.dns-lock
42
+ # → rm -f /Library/LaunchDaemons/com.proxyctl.dns-lock.plist
43
+ ```
44
+ PlanStep.action 枚举:`subprocess / system_op / fs_write / fs_copy / fs_write_atomic / fs_remove / edit_yaml / scan_log / http_put`。
45
+ CI 层 contract test(`tests/integration/test_plan_exec_contract.py`)保证 plan ↔ exec 永不漂移。
46
+ - `audit/check` 支持 `--plain` TSV
38
47
  - `proxyctl help <cmd>` 与 `<cmd> --help` 同源;错误带可执行 hints + explain topic
39
48
  - 非 TTY 自动关色;不读 stdin / 不 prompt;写操作 fcntl.flock 互斥
40
49
  - 从 0.2.x 升级见 [MIGRATION-0.3.md](MIGRATION-0.3.md)
@@ -1,4 +1,4 @@
1
- .TH PROXYCTL 1 "2026-05" "proxyctl 0.3.0" "User Commands"
1
+ .TH PROXYCTL 1 "2026-05" "proxyctl 0.4.0" "User Commands"
2
2
  .SH NAME
3
3
  proxyctl \- Proxy configuration lifecycle management for macOS / Linux
4
4
  .SH SYNOPSIS
@@ -35,6 +35,12 @@ PlanStep 字段:step / action / target / reversible / requires_sudo /
35
35
  side_effects / summary。
36
36
  适用:mode / engine / fix / audit apply / config set / daemon /
37
37
  dns-lock / dns-unlock。
38
+ .IP
39
+ \fB自 0.4.0\fR:plan.target 全部真实化(无 \fI<...>\fR 占位符);
40
+ action=\fBsubprocess\fR 的 target.split() 可直接当 argv(run 时
41
+ prepend sudo)。action 枚举:subprocess / system_op / fs_write /
42
+ fs_copy / fs_write_atomic / fs_remove / edit_yaml / scan_log /
43
+ http_put。CI 层 contract test 保证 plan ↔ exec 永不漂移。
38
44
  .TP
39
45
  .BR --no-color
40
46
  关闭 ANSI 颜色(默认按 isatty / NO_COLOR / TERM=dumb / PROXYCTL_NO_COLOR 自动判断)。
@@ -53,8 +59,10 @@ dns-lock / dns-unlock。
53
59
  .SH COMMANDS
54
60
  .SS 自描述(Agent 入口)
55
61
  .TP
56
- .B proxyctl agent-guide
62
+ \fBproxyctl agent-guide\fR [\fB--list-sections\fR | \fB--section\fR \fINAME\fR]
57
63
  输出给 LLM 的运行时入门 markdown(能力地图 / 引导路径 / 决策树 / envelope 字段表 / 锁文件位置 / footgun)。
64
+ v0.3.3 新增:\fB--list-sections\fR 列出所有 ASCII slug 形式的 section 名;
65
+ \fB--section <name>\fR 只输出该 section(模糊匹配 + did-you-mean),agent 按需取小块。
58
66
  .TP
59
67
  \fBproxyctl explain\fR [\fITOPIC\fR]
60
68
  无参输出"想改 X 去哪?"速查表;带 topic 输出卡片。
@@ -74,7 +82,8 @@ supports_dry_run / needs_sudo / interactive / exit_codes / examples。
74
82
  .B proxyctl doctor [--json]
75
83
  极简 5 项健康打分:engine_up / port_listen / dns_ok / system_proxy_ok /
76
84
  connectivity_ok。\fB--json\fR 额外含 informational 字段:
77
- engine / mode / port / config_path / engine_config_path / lock_held / lock_path
85
+ engine / mode / port / config_path / engine_config_path / lock_held / lock_path /
86
+ \fBhealthy\fR (v0.3.3 新增 bool,agent 不必再算 score==max)。
78
87
  .TP
79
88
  .B proxyctl help [\fICOMMAND\fR]
80
89
  顶层帮助 / 单命令完整说明。等价 \fBproxyctl --help\fR / \fBproxyctl <cmd> --help\fR。
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "proxyctl"
3
- version = "0.3.2"
3
+ version = "0.4.0"
4
4
  description = "Proxy configuration lifecycle management for macOS and Linux"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -0,0 +1,8 @@
1
+ """proxyctl — Proxy configuration lifecycle management."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version as _v
4
+
5
+ try:
6
+ __version__ = _v("proxyctl")
7
+ except PackageNotFoundError: # editable / source tree without metadata
8
+ __version__ = "unknown"