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.
Files changed (70) hide show
  1. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/CHANGELOG.md +8 -0
  2. {compshare_cli-0.5.3/src/compshare_cli.egg-info → compshare_cli-0.5.4}/PKG-INFO +1 -1
  3. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/connector-meta.json +1 -1
  4. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/mcp.json +1 -1
  5. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/skills/compshare/SKILL.md +1 -1
  6. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/__init__.py +1 -1
  7. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/output.py +4 -1
  8. {compshare_cli-0.5.3 → compshare_cli-0.5.4/src/compshare_cli.egg-info}/PKG-INFO +1 -1
  9. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_config.py +4 -2
  10. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_output.py +13 -0
  11. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_remote_jobs.py +4 -0
  12. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_ssh.py +5 -1
  13. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_ssh_cache.py +12 -4
  14. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/LICENSE +0 -0
  15. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/MANIFEST.in +0 -0
  16. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/README.md +0 -0
  17. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/RELEASING.md +0 -0
  18. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/icon.svg +0 -0
  19. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/connector/compshare/token-schema.json +0 -0
  20. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/pyproject.toml +0 -0
  21. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/setup.cfg +0 -0
  22. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/skills/compshare-cli/SKILL.md +0 -0
  23. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/skills/compshare-cli/agents/openai.yaml +0 -0
  24. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/__main__.py +0 -0
  25. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/actions.py +0 -0
  26. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/api.py +0 -0
  27. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/cli.py +0 -0
  28. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/__init__.py +0 -0
  29. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/bandwidth.py +0 -0
  30. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/common.py +0 -0
  31. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/doctor.py +0 -0
  32. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/feedback.py +0 -0
  33. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/image.py +0 -0
  34. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/instance.py +0 -0
  35. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/minimax.py +0 -0
  36. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/storage.py +0 -0
  37. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/commands/team.py +0 -0
  38. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/config.py +0 -0
  39. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/errors.py +0 -0
  40. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/i18n.py +0 -0
  41. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/insights.py +0 -0
  42. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/instance_templates.py +0 -0
  43. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/location.py +0 -0
  44. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/mcp_server.py +0 -0
  45. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/parsing.py +0 -0
  46. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/remote_jobs.py +0 -0
  47. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/runtime.py +0 -0
  48. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/sdk.py +0 -0
  49. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/ssh.py +0 -0
  50. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli/ssh_cache.py +0 -0
  51. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/SOURCES.txt +0 -0
  52. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/dependency_links.txt +0 -0
  53. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/entry_points.txt +0 -0
  54. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/requires.txt +0 -0
  55. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/src/compshare_cli.egg-info/top_level.txt +0 -0
  56. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_actions.py +0 -0
  57. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_api.py +0 -0
  58. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_bandwidth.py +0 -0
  59. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_cli.py +0 -0
  60. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_feedback.py +0 -0
  61. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_instance_templates.py +0 -0
  62. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_location.py +0 -0
  63. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_mcp_server.py +0 -0
  64. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_minimax.py +0 -0
  65. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_minimax_media.py +0 -0
  66. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_parsing.py +0 -0
  67. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_release_version.py +0 -0
  68. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_sdk.py +0 -0
  69. {compshare_cli-0.5.3 → compshare_cli-0.5.4}/tests/test_ssh_integration.py +0 -0
  70. {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 台分批查询,终端显示各设备最新
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compshare-cli
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: Command-line client for CompShare GPU compute and MiniMax H3
5
5
  Author: CompShare
6
6
  License-Expression: Apache-2.0
@@ -8,7 +8,7 @@
8
8
  "source": "compshare",
9
9
  "type": "mcp",
10
10
  "auth_mode": "token",
11
- "version": "0.5.3",
11
+ "version": "0.5.4",
12
12
  "minWorkbuddyVersion": "5.0.0",
13
13
  "examples_zh": [
14
14
  "查询上海可用的 RTX 4090 GPU 规格、库存和价格",
@@ -7,7 +7,7 @@
7
7
  "--python",
8
8
  "3.11",
9
9
  "--from",
10
- "compshare-cli[mcp]==0.5.3",
10
+ "compshare-cli[mcp]==0.5.4",
11
11
  "compshare-mcp"
12
12
  ],
13
13
  "env": {
@@ -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.3"
6
+ version: "0.5.4"
7
7
  author: "CompShare"
8
8
  ---
9
9
 
@@ -1,3 +1,3 @@
1
1
  """CompShare command-line client."""
2
2
 
3
- __version__ = "0.5.3"
3
+ __version__ = "0.5.4"
@@ -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
- document = json.dumps(payload, ensure_ascii=False, separators=(",", ":")) + "\n"
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compshare-cli
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: Command-line client for CompShare GPU compute and MiniMax H3
5
5
  Author: CompShare
6
6
  License-Expression: Apache-2.0
@@ -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
- assert stat.S_IMODE(path.stat().st_mode) == 0o600
25
- assert stat.S_IMODE(path.parent.stat().st_mode) == 0o700
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
- assert password_file.stat().st_mode & 0o777 == 0o600
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
- assert stat.S_IMODE(path.stat().st_mode) == 0o600
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
- assert "Unrelated" not in next(iter(saved["entries"].values()))["host"]
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) == 0o755
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
- assert stat.S_IMODE(cache.path.parent.stat().st_mode) == 0o700
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