compshare-cli 0.5.3__tar.gz → 0.5.4__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.
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/CHANGELOG.md +8 -0
- {compshare_cli-0.5.3/src/compshare_cli.egg-info → compshare_cli-0.5.4}/PKG-INFO +1 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/connector-meta.json +1 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/mcp.json +1 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/skills/compshare/SKILL.md +1 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/__init__.py +1 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/output.py +4 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4/src/compshare_cli.egg-info}/PKG-INFO +1 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_config.py +4 -2
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_output.py +13 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_remote_jobs.py +4 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_ssh.py +5 -1
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_ssh_cache.py +12 -4
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/LICENSE +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/MANIFEST.in +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/README.md +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/RELEASING.md +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/icon.svg +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/token-schema.json +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/pyproject.toml +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/setup.cfg +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/skills/compshare-cli/SKILL.md +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/skills/compshare-cli/agents/openai.yaml +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/__main__.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/actions.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/api.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/cli.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/__init__.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/bandwidth.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/common.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/doctor.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/feedback.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/image.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/instance.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/minimax.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/storage.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/team.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/config.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/errors.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/i18n.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/insights.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/instance_templates.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/location.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/mcp_server.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/parsing.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/remote_jobs.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/runtime.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/sdk.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/ssh.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/ssh_cache.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/SOURCES.txt +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/dependency_links.txt +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/entry_points.txt +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/requires.txt +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/top_level.txt +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_actions.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_api.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_bandwidth.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_cli.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_feedback.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_instance_templates.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_location.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_mcp_server.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_minimax.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_minimax_media.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_parsing.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_release_version.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_sdk.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_ssh_integration.py +0 -0
- {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_workbuddy_connector.py +0 -0
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.5.4
|
|
6
|
+
|
|
7
|
+
- 修复 Windows 下 PowerShell 5.1/7 使用 GBK 代码页时中文 JSON 乱码或无法解析的问题,保持 UTF-8
|
|
8
|
+
输出和原有 JSON 数据结构。
|
|
9
|
+
- 适配 Windows 测试的平台条件,验证 DPAPI 凭证缓存加密,并完成监控、SSH、中文路径传输
|
|
10
|
+
和持久化远程任务的真实 PowerShell 回归。
|
|
11
|
+
- Windows 经 SSH 会话嵌套调用 OpenSSH 仍可能挂起,独立 PowerShell 实测通过。
|
|
12
|
+
|
|
5
13
|
## 0.5.3
|
|
6
14
|
|
|
7
15
|
- 恢复 `instance monitor`:自动定位实例地域并按最多 10 台分批查询,终端显示各设备最新
|
|
@@ -3,7 +3,7 @@ name: compshare
|
|
|
3
3
|
description: Manage CompShare GPU cloud resources and MiniMax H3 media tasks through the controlled CompShare MCP bridge.
|
|
4
4
|
description_zh: 通过受控 CompShare MCP 桥接查询和管理优云智算 GPU 云资源及 MiniMax H3 视频、图片和语音任务。
|
|
5
5
|
description_en: Manage CompShare GPU cloud resources and MiniMax H3 media tasks through the controlled CompShare MCP bridge.
|
|
6
|
-
version: "0.5.
|
|
6
|
+
version: "0.5.4"
|
|
7
7
|
author: "CompShare"
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -150,7 +150,10 @@ def _project_rows(
|
|
|
150
150
|
|
|
151
151
|
def _write_json(payload: Dict[str, Any]) -> None:
|
|
152
152
|
"""Write one UTF-8 JSON document independently of the console code page."""
|
|
153
|
-
|
|
153
|
+
# PowerShell can decode native pipes using a legacy Windows console code page.
|
|
154
|
+
document = (
|
|
155
|
+
json.dumps(payload, ensure_ascii=sys.platform == "win32", separators=(",", ":")) + "\n"
|
|
156
|
+
)
|
|
154
157
|
stream = sys.stdout
|
|
155
158
|
binary = getattr(stream, "buffer", None)
|
|
156
159
|
if binary is not None:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import os
|
|
2
3
|
import stat
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
|
|
@@ -21,8 +22,9 @@ def test_profile_round_trip_and_file_permissions(monkeypatch, tmp_path) -> None:
|
|
|
21
22
|
expected = Profile("public", "private")
|
|
22
23
|
store.save_profile("testing", expected)
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
if os.name != "nt":
|
|
26
|
+
assert stat.S_IMODE(path.stat().st_mode) == 0o600
|
|
27
|
+
assert stat.S_IMODE(path.parent.stat().st_mode) == 0o700
|
|
26
28
|
assert store.load_profile("testing") == expected
|
|
27
29
|
saved = json.loads(path.read_text(encoding="utf-8"))["profiles"]["testing"]
|
|
28
30
|
assert set(saved) == {"public_key", "private_key"}
|
|
@@ -53,6 +53,19 @@ def test_json_renderer_writes_utf8_bytes_under_a_gbk_stdout(monkeypatch) -> None
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
def test_windows_json_survives_legacy_powershell_pipe_decoding(monkeypatch) -> None:
|
|
57
|
+
raw = BytesIO()
|
|
58
|
+
monkeypatch.setattr(output.sys, "platform", "win32")
|
|
59
|
+
monkeypatch.setattr(output.sys, "stdout", TextIOWrapper(raw, encoding="gbk"))
|
|
60
|
+
|
|
61
|
+
Renderer(True).data({"value": "中文 😀"})
|
|
62
|
+
|
|
63
|
+
document = raw.getvalue()
|
|
64
|
+
assert document.isascii()
|
|
65
|
+
assert document.count(b"\n") == 1
|
|
66
|
+
assert json.loads(document.decode("gbk"))["data"]["value"] == "中文 😀"
|
|
67
|
+
|
|
68
|
+
|
|
56
69
|
def test_json_renderer_reports_redacted_field_paths(capsys) -> None:
|
|
57
70
|
Renderer(True).data({"Password": "secret", "IPSet": [{"IP": "203.0.113.1"}]})
|
|
58
71
|
|
|
@@ -91,6 +91,7 @@ def test_protocol_parser_and_normalizer() -> None:
|
|
|
91
91
|
parse_records("COMPSHARE_JOB_UNSUPPORTED\n")
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
@pytest.mark.skipif(os.name == "nt", reason="requires a local POSIX shell")
|
|
94
95
|
def test_relative_xdg_state_home_falls_back_to_home(tmp_path) -> None:
|
|
95
96
|
environment = os.environ.copy()
|
|
96
97
|
environment.update({"HOME": str(tmp_path), "XDG_STATE_HOME": "relative/state"})
|
|
@@ -106,6 +107,7 @@ def test_relative_xdg_state_home_falls_back_to_home(tmp_path) -> None:
|
|
|
106
107
|
assert (tmp_path / ".local" / "state" / "compshare" / "jobs").is_dir()
|
|
107
108
|
|
|
108
109
|
|
|
110
|
+
@pytest.mark.skipif(os.name == "nt", reason="requires a local POSIX shell")
|
|
109
111
|
def test_submit_show_and_read_logs_with_xdg_state_directory(tmp_path) -> None:
|
|
110
112
|
bin_directory = tmp_path / "bin"
|
|
111
113
|
bin_directory.mkdir()
|
|
@@ -166,6 +168,7 @@ def test_submit_show_and_read_logs_with_xdg_state_directory(tmp_path) -> None:
|
|
|
166
168
|
assert [record["JobId"] for record in parse_records(listed.stdout)] == ["job-test"]
|
|
167
169
|
|
|
168
170
|
|
|
171
|
+
@pytest.mark.skipif(os.name == "nt", reason="requires a local POSIX shell")
|
|
169
172
|
def test_submit_is_idempotent_for_the_same_job_id(tmp_path) -> None:
|
|
170
173
|
job_directory = tmp_path / "state" / "compshare" / "jobs" / "job-existing"
|
|
171
174
|
job_directory.mkdir(parents=True)
|
|
@@ -206,6 +209,7 @@ def test_submit_is_idempotent_for_the_same_job_id(tmp_path) -> None:
|
|
|
206
209
|
parse_records(cwd_conflict.stdout)
|
|
207
210
|
|
|
208
211
|
|
|
212
|
+
@pytest.mark.skipif(os.name == "nt", reason="requires a local POSIX shell")
|
|
209
213
|
def test_prune_removes_only_old_terminal_jobs(tmp_path) -> None:
|
|
210
214
|
jobs_root = tmp_path / "state" / "compshare" / "jobs"
|
|
211
215
|
old_job = jobs_root / "job-old"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from pathlib import Path
|
|
2
3
|
from types import SimpleNamespace
|
|
3
4
|
|
|
@@ -7,6 +8,7 @@ from compshare_cli import ssh
|
|
|
7
8
|
from compshare_cli.errors import CLIError, UsageError
|
|
8
9
|
|
|
9
10
|
|
|
11
|
+
@pytest.mark.skipif(os.name == "nt", reason="pexpect requires POSIX")
|
|
10
12
|
def test_connect_with_password_answers_split_prompt_once(monkeypatch) -> None:
|
|
11
13
|
calls = []
|
|
12
14
|
sent = []
|
|
@@ -68,6 +70,7 @@ def test_connect_with_password_answers_split_prompt_once(monkeypatch) -> None:
|
|
|
68
70
|
|
|
69
71
|
|
|
70
72
|
def test_connect_with_password_requires_an_interactive_terminal(monkeypatch) -> None:
|
|
73
|
+
monkeypatch.setattr(ssh, "_is_windows", lambda: False)
|
|
71
74
|
monkeypatch.setattr(ssh.sys, "stdin", SimpleNamespace(isatty=lambda: False))
|
|
72
75
|
|
|
73
76
|
try:
|
|
@@ -382,7 +385,8 @@ def test_captured_password_authentication_cleans_up_on_failure(monkeypatch, runn
|
|
|
382
385
|
password_file = Path(kwargs["env"][ssh._ASKPASS_PASSWORD_FILE_ENV])
|
|
383
386
|
password_files.append(password_file)
|
|
384
387
|
assert password_file.read_text() == "temporary-secret"
|
|
385
|
-
|
|
388
|
+
if os.name != "nt":
|
|
389
|
+
assert password_file.stat().st_mode & 0o777 == 0o600
|
|
386
390
|
raise OSError("test process failure")
|
|
387
391
|
|
|
388
392
|
monkeypatch.setattr(ssh.subprocess, "run", run)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import os
|
|
2
3
|
import stat
|
|
3
4
|
|
|
4
5
|
import pytest
|
|
@@ -28,9 +29,14 @@ def test_ssh_cache_round_trip_is_profile_scoped_and_permission_restricted(tmp_pa
|
|
|
28
29
|
key: value for key, value in _host().items() if key != "Unrelated"
|
|
29
30
|
}
|
|
30
31
|
assert cache.get("beta", "uhost-1", ttl=60, now=150) is None
|
|
31
|
-
|
|
32
|
+
if os.name != "nt":
|
|
33
|
+
assert stat.S_IMODE(path.stat().st_mode) == 0o600
|
|
32
34
|
saved = json.loads(path.read_text(encoding="utf-8"))
|
|
33
|
-
|
|
35
|
+
saved_host = next(iter(saved["entries"].values()))["host"]
|
|
36
|
+
assert "Unrelated" not in saved_host
|
|
37
|
+
if os.name == "nt":
|
|
38
|
+
assert saved_host["Password"].startswith("dpapi:")
|
|
39
|
+
assert saved_host["Password"] != _host()["Password"]
|
|
34
40
|
|
|
35
41
|
|
|
36
42
|
def test_ssh_cache_expires_and_can_be_deleted(tmp_path) -> None:
|
|
@@ -68,8 +74,9 @@ def test_non_utf8_cache_is_ignored(tmp_path) -> None:
|
|
|
68
74
|
|
|
69
75
|
def test_cache_does_not_change_existing_parent_permissions(tmp_path) -> None:
|
|
70
76
|
tmp_path.chmod(0o755)
|
|
77
|
+
permissions = stat.S_IMODE(tmp_path.stat().st_mode)
|
|
71
78
|
SSHCredentialCache(tmp_path / "ssh-cache.json").put("default", "uhost-1", _host())
|
|
72
|
-
assert stat.S_IMODE(tmp_path.stat().st_mode) ==
|
|
79
|
+
assert stat.S_IMODE(tmp_path.stat().st_mode) == permissions
|
|
73
80
|
|
|
74
81
|
|
|
75
82
|
@pytest.mark.parametrize("field", ["Region", "Zone", "SshLoginCommand", "Password"])
|
|
@@ -93,7 +100,8 @@ def test_failed_cache_write_keeps_previous_credentials_and_removes_temporary_fil
|
|
|
93
100
|
) -> None:
|
|
94
101
|
cache = SSHCredentialCache(tmp_path / "private" / "ssh-cache.json")
|
|
95
102
|
cache.put("default", "uhost-1", _host("old-password"), now=100)
|
|
96
|
-
|
|
103
|
+
if os.name != "nt":
|
|
104
|
+
assert stat.S_IMODE(cache.path.parent.stat().st_mode) == 0o700
|
|
97
105
|
|
|
98
106
|
def fail(*_):
|
|
99
107
|
raise OSError("simulated replacement failure")
|
|
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
|