maxc-cli 0.4.6__tar.gz → 0.4.7__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.
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/PKG-INFO +4 -6
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/README.md +3 -5
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/setup.py +1 -1
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/__init__.py +1 -1
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/output.py +50 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/SKILL.md +4 -5
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/command-patterns.md +1 -1
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli.egg-info/PKG-INFO +4 -6
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_phase1_improvements.py +40 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/MANIFEST.in +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/pyproject.toml +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/scripts/pyinstaller_entry.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/scripts/regression_test.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/setup.cfg +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/__main__.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/_samples.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/agent_platforms.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/app.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/audit.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/auth_providers.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/__init__.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/auth.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/catalog.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/data.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/job.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/meta.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/odps.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/backend/query.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/cache.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/catalog_bootstrap.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/cli.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/config.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/exceptions.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/help_format.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/helpers.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/masking.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/models.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/setting_parser.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/agents/openai.yaml +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/bootstrap-auth.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/bootstrap-flow.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/json-output-format.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/maxcompute-select-guide.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/maxcompute-sql-notes.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/partition-guide.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/red-lines.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/setup-install.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/sql-common-errors.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/sql-query-patterns.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/skills/references/text2sql-principles.md +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/store.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli/utils.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli.egg-info/SOURCES.txt +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli.egg-info/dependency_links.txt +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli.egg-info/entry_points.txt +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli.egg-info/requires.txt +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/src/maxc_cli.egg-info/top_level.txt +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_agent_hints_and_cli.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_agent_platforms.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_agent_skill_commands.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_agent_skill_commands_context.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_backend_data.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_backend_data_serialization.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_backend_meta.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_build_release_script.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_cache.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_catalog.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_catalog_bootstrap.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_cli_arg_validation.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_cli_mock.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_cli_query_parse_and_sanitize.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_compat.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_e2e_smoke.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_envelope_shape.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_error_self_correction.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_error_translation.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_exit_codes.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_external_auth.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_flag_hoist.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_help_format.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_help_version_e2e.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_helpers.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_helpers_csv.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_integration.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_integration_real.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_job_improvements.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_masking.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_meta_schema_and_partition_cols.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_pyinstaller_bundle.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_query_auto_promote.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_query_result_csv_fallback.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_setting_parser.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_skill_cli_consistency.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_skill_eval.py +0 -0
- {maxc_cli-0.4.6 → maxc_cli-0.4.7}/tests/test_skill_renderer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maxc-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
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.9
|
|
@@ -61,7 +61,7 @@ maxc query "SELECT * FROM schema.table WHERE ds='20260415'" --json
|
|
|
61
61
|
| **cache** | `build`, `build-status`, `status`, `clear` | 元数据缓存管理 |
|
|
62
62
|
| **agent** | `context`, `skill install`, `skill list` | Agent 集成与 SKILL 安装 |
|
|
63
63
|
|
|
64
|
-
所有命令支持 `--json` 输出 Envelope v2.0
|
|
64
|
+
所有命令支持 `--json` 输出 Envelope v2.0 结构化响应。对 Agent 而言,应始终使用 `--json`。
|
|
65
65
|
|
|
66
66
|
## Agent 集成
|
|
67
67
|
|
|
@@ -128,12 +128,10 @@ maxc agent skill --json # SKILL.md 路径与 min_cli_version
|
|
|
128
128
|
|
|
129
129
|
### 输出格式
|
|
130
130
|
|
|
131
|
-
`--
|
|
131
|
+
对 Agent,统一使用 `--json`:
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
|
-
maxc
|
|
135
|
-
maxc --format markdown meta describe my_table # 人类可读 markdown
|
|
136
|
-
maxc --format brief meta describe my_table # 最小化单行输出(低 token 场景)
|
|
134
|
+
maxc meta describe my_table --json
|
|
137
135
|
```
|
|
138
136
|
|
|
139
137
|
### safety 块
|
|
@@ -39,7 +39,7 @@ maxc query "SELECT * FROM schema.table WHERE ds='20260415'" --json
|
|
|
39
39
|
| **cache** | `build`, `build-status`, `status`, `clear` | 元数据缓存管理 |
|
|
40
40
|
| **agent** | `context`, `skill install`, `skill list` | Agent 集成与 SKILL 安装 |
|
|
41
41
|
|
|
42
|
-
所有命令支持 `--json` 输出 Envelope v2.0
|
|
42
|
+
所有命令支持 `--json` 输出 Envelope v2.0 结构化响应。对 Agent 而言,应始终使用 `--json`。
|
|
43
43
|
|
|
44
44
|
## Agent 集成
|
|
45
45
|
|
|
@@ -106,12 +106,10 @@ maxc agent skill --json # SKILL.md 路径与 min_cli_version
|
|
|
106
106
|
|
|
107
107
|
### 输出格式
|
|
108
108
|
|
|
109
|
-
`--
|
|
109
|
+
对 Agent,统一使用 `--json`:
|
|
110
110
|
|
|
111
111
|
```bash
|
|
112
|
-
maxc
|
|
113
|
-
maxc --format markdown meta describe my_table # 人类可读 markdown
|
|
114
|
-
maxc --format brief meta describe my_table # 最小化单行输出(低 token 场景)
|
|
112
|
+
maxc meta describe my_table --json
|
|
115
113
|
```
|
|
116
114
|
|
|
117
115
|
### safety 块
|
|
@@ -9,7 +9,7 @@ README = ROOT / "README.md"
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name="maxc-cli",
|
|
12
|
-
version="0.4.
|
|
12
|
+
version="0.4.7",
|
|
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",
|
|
@@ -84,6 +84,42 @@ def _stringify(value: Any) -> str:
|
|
|
84
84
|
# ---------------------------------------------------------------------------
|
|
85
85
|
|
|
86
86
|
|
|
87
|
+
def _render_pending_md(envelope: Envelope) -> str:
|
|
88
|
+
"""Render a pending/async envelope so the user sees status and how to wait."""
|
|
89
|
+
parts: list[str] = ["## Pending", ""]
|
|
90
|
+
parts.append("The query has not finished yet — it is still running asynchronously.")
|
|
91
|
+
parts.append("")
|
|
92
|
+
|
|
93
|
+
data = envelope.data or {}
|
|
94
|
+
metadata = envelope.metadata or {}
|
|
95
|
+
kv: dict[str, Any] = {}
|
|
96
|
+
job_id = data.get("job_id") or metadata.get("job_id")
|
|
97
|
+
if job_id:
|
|
98
|
+
kv["Job ID"] = job_id
|
|
99
|
+
if metadata.get("project"):
|
|
100
|
+
kv["Project"] = metadata["project"]
|
|
101
|
+
if metadata.get("wait_seconds") is not None:
|
|
102
|
+
kv["Waited"] = f"{metadata['wait_seconds']}s"
|
|
103
|
+
if metadata.get("logview"):
|
|
104
|
+
kv["Logview"] = metadata["logview"]
|
|
105
|
+
if kv:
|
|
106
|
+
parts.append(render_key_values(kv))
|
|
107
|
+
parts.append("")
|
|
108
|
+
|
|
109
|
+
parts.append("Wait for it to complete with:")
|
|
110
|
+
parts.append("")
|
|
111
|
+
hints = envelope.agent_hints
|
|
112
|
+
if hints is None or not hints.actions:
|
|
113
|
+
if job_id:
|
|
114
|
+
parts.append(f"- `maxc job wait {job_id} --json`")
|
|
115
|
+
parts.append(f"- `maxc job status {job_id} --json`")
|
|
116
|
+
else:
|
|
117
|
+
parts.append("- `maxc job wait <job_id> --json`")
|
|
118
|
+
parts.append("")
|
|
119
|
+
return "\n".join(parts)
|
|
120
|
+
return _append_agent_hints_md(parts, envelope)
|
|
121
|
+
|
|
122
|
+
|
|
87
123
|
def render_markdown(envelope: Envelope) -> str:
|
|
88
124
|
"""Render an Envelope as human-readable markdown."""
|
|
89
125
|
parts: list[str] = []
|
|
@@ -100,6 +136,10 @@ def render_markdown(envelope: Envelope) -> str:
|
|
|
100
136
|
parts.append("")
|
|
101
137
|
return _append_agent_hints_md(parts, envelope)
|
|
102
138
|
|
|
139
|
+
# --- Pending / async envelopes --------------------------------------
|
|
140
|
+
if envelope.status == "pending":
|
|
141
|
+
return _render_pending_md(envelope)
|
|
142
|
+
|
|
103
143
|
command = envelope.command
|
|
104
144
|
data = envelope.data
|
|
105
145
|
metadata = envelope.metadata or {}
|
|
@@ -249,6 +289,16 @@ def render_brief(envelope: Envelope) -> str:
|
|
|
249
289
|
|
|
250
290
|
data = envelope.data
|
|
251
291
|
|
|
292
|
+
# --- pending / async ------------------------------------------------
|
|
293
|
+
if envelope.status == "pending":
|
|
294
|
+
job_id = data.get("job_id") or (envelope.metadata or {}).get("job_id") or "?"
|
|
295
|
+
line = f"{command} | pending | job {job_id}"
|
|
296
|
+
if next_cmd:
|
|
297
|
+
line += f" | next: {next_cmd}"
|
|
298
|
+
elif job_id != "?":
|
|
299
|
+
line += f" | next: maxc job wait {job_id} --json"
|
|
300
|
+
return line
|
|
301
|
+
|
|
252
302
|
# --- query ----------------------------------------------------------
|
|
253
303
|
if envelope.command in {"query", "job.wait", "job.result"}:
|
|
254
304
|
total = data.get("total_rows", "?")
|
|
@@ -40,7 +40,7 @@ in SKILL.md alone.
|
|
|
40
40
|
|
|
41
41
|
These are non-negotiable. See [references/red-lines.md](references/red-lines.md) for the full list including common mistakes, anti-patterns, and error recovery.
|
|
42
42
|
|
|
43
|
-
1. **Always use `--json
|
|
43
|
+
1. **Always use `--json`**. Agents should use JSON output consistently.
|
|
44
44
|
2. **Never invent names** — table, schema, project, or endpoint. Verify with `meta` commands and `auth whoami`.
|
|
45
45
|
3. **Default to `--project` for the user's target project.** The configured project (in `~/.maxc/config.yaml`) is the user's **dev project** — the data they actually want to query usually lives in a *different* project (often the corresponding production one). When the user mentions a table/project without specifying which environment, **ask first**, then pass `--project <name>` on every meta/data command and use `project.table` in SQL.
|
|
46
46
|
4. **Project naming convention is a fixed pair:** `<name>_dev` is the dev project; the same `<name>` **without** the `_dev` suffix is its corresponding **production** project. Together they form one DataWorks workspace. They share metadata structure but hold different data and different permissions. See Dev vs Production Projects below.
|
|
@@ -125,11 +125,10 @@ Use `--project` to read metadata from the production project without switching s
|
|
|
125
125
|
{{cli}} data sample my_table --project my_project --json
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
When
|
|
128
|
+
When querying production data from a dev project, use a fully qualified table name in SQL and pass the dev project explicitly:
|
|
129
129
|
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
SELECT * FROM my_project.my_table WHERE ds = '20260418' LIMIT 100
|
|
130
|
+
```bash
|
|
131
|
+
{{cli}} query "SELECT * FROM my_production_project.my_table WHERE ds = '20260418' LIMIT 100" --project my_dev_project
|
|
133
132
|
```
|
|
134
133
|
|
|
135
134
|
Do NOT use bare table names (`FROM my_table`) when the target table lives in a different project — the query will fail with `TABLE_NOT_FOUND`.
|
|
@@ -140,7 +140,7 @@ Async pattern for long queries:
|
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
142
|
# Step 1: submit
|
|
143
|
-
{{cli}} query "SELECT * FROM
|
|
143
|
+
{{cli}} query "SELECT * FROM my_production_project.my_table WHERE ds = '20260418'" --project my_dev_project --wait 0 --json
|
|
144
144
|
# Returns: { "status": "pending", "metadata": { "job_id": "<job_id>" } }
|
|
145
145
|
|
|
146
146
|
# Step 2: extract metadata.job_id (e.g. 2026042011_abc123) and wait
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maxc-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
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.9
|
|
@@ -61,7 +61,7 @@ maxc query "SELECT * FROM schema.table WHERE ds='20260415'" --json
|
|
|
61
61
|
| **cache** | `build`, `build-status`, `status`, `clear` | 元数据缓存管理 |
|
|
62
62
|
| **agent** | `context`, `skill install`, `skill list` | Agent 集成与 SKILL 安装 |
|
|
63
63
|
|
|
64
|
-
所有命令支持 `--json` 输出 Envelope v2.0
|
|
64
|
+
所有命令支持 `--json` 输出 Envelope v2.0 结构化响应。对 Agent 而言,应始终使用 `--json`。
|
|
65
65
|
|
|
66
66
|
## Agent 集成
|
|
67
67
|
|
|
@@ -128,12 +128,10 @@ maxc agent skill --json # SKILL.md 路径与 min_cli_version
|
|
|
128
128
|
|
|
129
129
|
### 输出格式
|
|
130
130
|
|
|
131
|
-
`--
|
|
131
|
+
对 Agent,统一使用 `--json`:
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
|
-
maxc
|
|
135
|
-
maxc --format markdown meta describe my_table # 人类可读 markdown
|
|
136
|
-
maxc --format brief meta describe my_table # 最小化单行输出(低 token 场景)
|
|
134
|
+
maxc meta describe my_table --json
|
|
137
135
|
```
|
|
138
136
|
|
|
139
137
|
### safety 块
|
|
@@ -270,6 +270,34 @@ class TestRenderMarkdown:
|
|
|
270
270
|
md = render_markdown(envelope)
|
|
271
271
|
assert "maxc meta describe" in md
|
|
272
272
|
|
|
273
|
+
def test_query_pending_with_actions(self):
|
|
274
|
+
envelope = Envelope(
|
|
275
|
+
command="query",
|
|
276
|
+
status="pending",
|
|
277
|
+
data={"job_id": "job-42"},
|
|
278
|
+
metadata={"job_id": "job-42", "project": "demo", "wait_seconds": 10},
|
|
279
|
+
agent_hints=AgentHints(actions=[
|
|
280
|
+
SuggestedAction(id="job.wait", title="Wait for job", command="maxc job wait job-42 --json"),
|
|
281
|
+
SuggestedAction(id="job.status", title="Check status", command="maxc job status job-42 --json"),
|
|
282
|
+
]),
|
|
283
|
+
)
|
|
284
|
+
md = render_markdown(envelope)
|
|
285
|
+
assert "Pending" in md
|
|
286
|
+
assert "(no rows)" not in md
|
|
287
|
+
assert "job-42" in md
|
|
288
|
+
assert "maxc job wait job-42 --json" in md
|
|
289
|
+
|
|
290
|
+
def test_query_pending_without_actions_falls_back(self):
|
|
291
|
+
envelope = Envelope(
|
|
292
|
+
command="query",
|
|
293
|
+
status="pending",
|
|
294
|
+
data={"job_id": "job-99"},
|
|
295
|
+
metadata={"job_id": "job-99"},
|
|
296
|
+
)
|
|
297
|
+
md = render_markdown(envelope)
|
|
298
|
+
assert "Pending" in md
|
|
299
|
+
assert "maxc job wait job-99 --json" in md
|
|
300
|
+
|
|
273
301
|
|
|
274
302
|
class TestRenderBrief:
|
|
275
303
|
def test_query_result(self):
|
|
@@ -286,6 +314,18 @@ class TestRenderBrief:
|
|
|
286
314
|
assert "42" in brief
|
|
287
315
|
assert len(brief) < 300
|
|
288
316
|
|
|
317
|
+
def test_query_pending_brief(self):
|
|
318
|
+
envelope = Envelope(
|
|
319
|
+
command="query",
|
|
320
|
+
status="pending",
|
|
321
|
+
data={"job_id": "job-7"},
|
|
322
|
+
metadata={"job_id": "job-7"},
|
|
323
|
+
)
|
|
324
|
+
brief = render_brief(envelope)
|
|
325
|
+
assert "pending" in brief
|
|
326
|
+
assert "job-7" in brief
|
|
327
|
+
assert "maxc job wait job-7 --json" in brief
|
|
328
|
+
|
|
289
329
|
def test_meta_describe_brief(self):
|
|
290
330
|
envelope = Envelope(
|
|
291
331
|
command="meta.describe",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|