maxc-cli 0.1.4__tar.gz → 0.1.6__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 (63) hide show
  1. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/PKG-INFO +43 -6
  2. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/README.md +39 -4
  3. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/setup.py +4 -2
  4. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/__init__.py +1 -1
  5. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/app.py +442 -188
  6. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/odps.py +23 -16
  7. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/query.py +24 -19
  8. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/cli.py +78 -42
  9. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/exceptions.py +35 -0
  10. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/helpers.py +19 -1
  11. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/models.py +160 -35
  12. maxc_cli-0.1.6/src/maxc_cli/output.py +296 -0
  13. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/SKILL.md +106 -14
  14. maxc_cli-0.1.6/src/maxc_cli/skills/nohup.out +0 -0
  15. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/references/command-patterns.md +8 -4
  16. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/references/maxcompute-sql-notes.md +44 -2
  17. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli.egg-info/PKG-INFO +43 -6
  18. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli.egg-info/SOURCES.txt +2 -0
  19. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_agent_hints_and_cli.py +10 -3
  20. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_cli_mock.py +3 -3
  21. maxc_cli-0.1.6/tests/test_phase1_improvements.py +568 -0
  22. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_query_auto_promote.py +10 -5
  23. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_setting_parser.py +17 -13
  24. maxc_cli-0.1.4/src/maxc_cli/output.py +0 -75
  25. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/MANIFEST.in +0 -0
  26. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/pyproject.toml +0 -0
  27. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/scripts/regression_test.py +0 -0
  28. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/setup.cfg +0 -0
  29. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/__main__.py +0 -0
  30. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/audit.py +0 -0
  31. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/auth_providers.py +0 -0
  32. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/__init__.py +0 -0
  33. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/auth.py +0 -0
  34. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/catalog.py +0 -0
  35. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/data.py +0 -0
  36. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/job.py +0 -0
  37. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/backend/meta.py +0 -0
  38. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/cache.py +0 -0
  39. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/config.py +0 -0
  40. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/masking.py +0 -0
  41. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/setting_parser.py +0 -0
  42. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/agents/openai.yaml +0 -0
  43. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/references/bootstrap-auth.md +0 -0
  44. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/references/migrate-from-odpscmd.md +0 -0
  45. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/references/partition-guide.md +0 -0
  46. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/skills/references/setup-install.md +0 -0
  47. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/store.py +0 -0
  48. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli/utils.py +0 -0
  49. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli.egg-info/dependency_links.txt +0 -0
  50. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli.egg-info/entry_points.txt +0 -0
  51. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli.egg-info/requires.txt +0 -0
  52. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/src/maxc_cli.egg-info/top_level.txt +0 -0
  53. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_agent_skill_commands_context.py +0 -0
  54. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_cache.py +0 -0
  55. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_catalog.py +0 -0
  56. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_compat.py +0 -0
  57. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_e2e_smoke.py +0 -0
  58. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_error_self_correction.py +0 -0
  59. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_external_auth.py +0 -0
  60. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_integration.py +0 -0
  61. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_integration_real.py +0 -0
  62. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_job_improvements.py +0 -0
  63. {maxc_cli-0.1.4 → maxc_cli-0.1.6}/tests/test_masking.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maxc-cli
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Agent-native MaxCompute CLI for external coding agents
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.8
@@ -8,7 +8,9 @@ Classifier: Programming Language :: Python :: 3.9
8
8
  Classifier: Programming Language :: Python :: 3.10
9
9
  Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Programming Language :: Python :: 3.12
11
- Requires-Python: >=3.8,<3.13
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Requires-Python: >=3.8
12
14
  Description-Content-Type: text/markdown
13
15
  Requires-Dist: PyYAML>=5.4
14
16
  Requires-Dist: pyodps
@@ -57,7 +59,7 @@ maxc query "SELECT * FROM schema.table WHERE ds='20260415'" --json
57
59
  | **cache** | `build`, `build-status`, `status`, `clear` | 元数据缓存管理 |
58
60
  | **agent** | `context`, `skill`, `install-skill` | Agent 集成与 SKILL 安装 |
59
61
 
60
- 所有命令支持 `--json` 输出 Envelope v2.0 结构化响应。
62
+ 所有命令支持 `--json` 输出 Envelope v2.0 结构化响应。支持 `--format json|markdown|brief`(全局标志)。
61
63
 
62
64
  ## Agent 集成
63
65
 
@@ -99,18 +101,53 @@ maxc agent skill --json # SKILL.md 路径与 min_cli_version
99
101
  "metadata": { ... },
100
102
  "error": null | { "code": "...", "message": "...", "recovery_steps": [...] },
101
103
  "agent_hints": {
102
- "next_actions": ["maxc meta search --json", ...],
103
- "action_ids": ["meta.search", ...],
104
+ "actions": [
105
+ {
106
+ "id": "meta.search",
107
+ "title": "Search tables",
108
+ "command": "maxc meta search <keyword> --json",
109
+ "executable": false,
110
+ "placeholders": {"keyword": "search keyword"},
111
+ "args_schema": {}
112
+ }
113
+ ],
114
+ "action_ids": ["meta.search"],
115
+ "next_actions": ["maxc meta search <keyword> --json"],
104
116
  "insights": [...],
105
117
  "warnings": [...]
106
118
  }
107
119
  }
108
120
  ```
109
121
 
122
+ - `agent_hints.actions[]`: 结构化 `SuggestedAction` 对象数组(Phase 1 新增)
110
123
  - `action_ids`:稳定 dot-notation,用于程序化路由(`meta.describe`、`job.wait`)
111
- - `next_actions`:可直接 copy-paste 的 CLI 命令
124
+ - `next_actions`:可直接 copy-paste 的 CLI 命令(从 `actions[]` 派生)
112
125
  - `error.recovery_steps`:错误码对应的恢复步骤
113
126
 
127
+ ### 输出格式
128
+
129
+ `--format` 是全局标志,适用于所有命令:
130
+
131
+ ```bash
132
+ maxc --format json meta describe my_table # 结构化 JSON(默认,等价于 --json)
133
+ maxc --format markdown meta describe my_table # 人类可读 markdown
134
+ maxc --format brief meta describe my_table # 最小化单行输出(低 token 场景)
135
+ ```
136
+
137
+ ### safety 块
138
+
139
+ `query` 和 `job` 命令的 `data` 中包含 `safety` 字段,描述安全策略决策:
140
+
141
+ ```json
142
+ "safety": {
143
+ "mode": "read_only",
144
+ "force": false,
145
+ "allowed_operations": ["SELECT"],
146
+ "effective_hints": {"odps.sql.read.only": "true"},
147
+ "policy_decision": "allowed"
148
+ }
149
+ ```
150
+
114
151
  详见 [`docs/ENVELOPE_SPEC.md`](docs/ENVELOPE_SPEC.md)。
115
152
 
116
153
  ## 项目结构
@@ -36,7 +36,7 @@ maxc query "SELECT * FROM schema.table WHERE ds='20260415'" --json
36
36
  | **cache** | `build`, `build-status`, `status`, `clear` | 元数据缓存管理 |
37
37
  | **agent** | `context`, `skill`, `install-skill` | Agent 集成与 SKILL 安装 |
38
38
 
39
- 所有命令支持 `--json` 输出 Envelope v2.0 结构化响应。
39
+ 所有命令支持 `--json` 输出 Envelope v2.0 结构化响应。支持 `--format json|markdown|brief`(全局标志)。
40
40
 
41
41
  ## Agent 集成
42
42
 
@@ -78,18 +78,53 @@ maxc agent skill --json # SKILL.md 路径与 min_cli_version
78
78
  "metadata": { ... },
79
79
  "error": null | { "code": "...", "message": "...", "recovery_steps": [...] },
80
80
  "agent_hints": {
81
- "next_actions": ["maxc meta search --json", ...],
82
- "action_ids": ["meta.search", ...],
81
+ "actions": [
82
+ {
83
+ "id": "meta.search",
84
+ "title": "Search tables",
85
+ "command": "maxc meta search <keyword> --json",
86
+ "executable": false,
87
+ "placeholders": {"keyword": "search keyword"},
88
+ "args_schema": {}
89
+ }
90
+ ],
91
+ "action_ids": ["meta.search"],
92
+ "next_actions": ["maxc meta search <keyword> --json"],
83
93
  "insights": [...],
84
94
  "warnings": [...]
85
95
  }
86
96
  }
87
97
  ```
88
98
 
99
+ - `agent_hints.actions[]`: 结构化 `SuggestedAction` 对象数组(Phase 1 新增)
89
100
  - `action_ids`:稳定 dot-notation,用于程序化路由(`meta.describe`、`job.wait`)
90
- - `next_actions`:可直接 copy-paste 的 CLI 命令
101
+ - `next_actions`:可直接 copy-paste 的 CLI 命令(从 `actions[]` 派生)
91
102
  - `error.recovery_steps`:错误码对应的恢复步骤
92
103
 
104
+ ### 输出格式
105
+
106
+ `--format` 是全局标志,适用于所有命令:
107
+
108
+ ```bash
109
+ maxc --format json meta describe my_table # 结构化 JSON(默认,等价于 --json)
110
+ maxc --format markdown meta describe my_table # 人类可读 markdown
111
+ maxc --format brief meta describe my_table # 最小化单行输出(低 token 场景)
112
+ ```
113
+
114
+ ### safety 块
115
+
116
+ `query` 和 `job` 命令的 `data` 中包含 `safety` 字段,描述安全策略决策:
117
+
118
+ ```json
119
+ "safety": {
120
+ "mode": "read_only",
121
+ "force": false,
122
+ "allowed_operations": ["SELECT"],
123
+ "effective_hints": {"odps.sql.read.only": "true"},
124
+ "policy_decision": "allowed"
125
+ }
126
+ ```
127
+
93
128
  详见 [`docs/ENVELOPE_SPEC.md`](docs/ENVELOPE_SPEC.md)。
94
129
 
95
130
  ## 项目结构
@@ -9,11 +9,11 @@ README = ROOT / "README.md"
9
9
 
10
10
  setup(
11
11
  name="maxc-cli",
12
- version="0.1.4",
12
+ version="0.1.6",
13
13
  description="Agent-native MaxCompute CLI for external coding agents",
14
14
  long_description=README.read_text(encoding="utf-8"),
15
15
  long_description_content_type="text/markdown",
16
- python_requires=">=3.8,<3.13",
16
+ python_requires=">=3.8",
17
17
  package_dir={"": "src"},
18
18
  packages=find_packages(where="src"),
19
19
  include_package_data=True,
@@ -31,6 +31,8 @@ setup(
31
31
  "Programming Language :: Python :: 3.10",
32
32
  "Programming Language :: Python :: 3.11",
33
33
  "Programming Language :: Python :: 3.12",
34
+ "Programming Language :: Python :: 3.13",
35
+ "Programming Language :: Python :: 3.14",
34
36
  ],
35
37
  install_requires=[
36
38
  "PyYAML>=5.4",
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.1.4"
5
+ __version__ = "0.1.6"