dsh-cloud 0.2.2__tar.gz → 0.2.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 (24) hide show
  1. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/PKG-INFO +1 -1
  2. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/pyproject.toml +1 -1
  3. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/cli.py +11 -2
  4. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/release-manifest.json +3 -3
  5. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/wizard.py +37 -3
  6. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/LICENSE +0 -0
  7. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/README.md +0 -0
  8. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/build_backend.py +0 -0
  9. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/__init__.py +0 -0
  10. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/__main__.py +0 -0
  11. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/Caddyfile +0 -0
  12. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/compose.build.yml +0 -0
  13. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/compose.postgres.yml +0 -0
  14. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/i18n/en.json +0 -0
  15. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/i18n/zh.json +0 -0
  16. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/models.curated.txt +0 -0
  17. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/models.json +0 -0
  18. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/pricing.cny.json +0 -0
  19. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/pricing.eur.json +0 -0
  20. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/pricing.gbp.json +0 -0
  21. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/pricing.hkd.json +0 -0
  22. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/pricing.jpy.json +0 -0
  23. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/config/pricing.usd.json +0 -0
  24. {dsh_cloud-0.2.2 → dsh_cloud-0.2.4}/src/dsh_cloud_cli/templates/docker-compose.yml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dsh-cloud
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Safe self-host installer and lifecycle CLI for DSH Cloud Community Edition
5
5
  Requires-Python: >=3.11
6
6
  License-Expression: LicenseRef-DSH-Cloud-Community-1.0
@@ -5,7 +5,7 @@ backend-path = ["."]
5
5
 
6
6
  [project]
7
7
  name = "dsh-cloud"
8
- version = "0.2.2"
8
+ version = "0.2.4"
9
9
  description = "Safe self-host installer and lifecycle CLI for DSH Cloud Community Edition"
10
10
  requires-python = ">=3.11"
11
11
  dependencies = []
@@ -10,7 +10,8 @@ import shutil
10
10
  import subprocess
11
11
  import sys
12
12
 
13
- from .wizard import apply_answers, command_prefix, next_steps, prompt_answers, should_run_wizard
13
+ from .wizard import (apply_answers, command_prefix, init_summary, next_steps,
14
+ prompt_answers, should_run_wizard)
14
15
  from pathlib import Path
15
16
 
16
17
 
@@ -334,7 +335,15 @@ def execute(parsed: dict) -> dict:
334
335
  if parsed["options"].get("dryRun"):
335
336
  return {"json": value}
336
337
  initialize(parsed, manifest, value, answers)
337
- return {"json": {**value, "initialized": True}}
338
+ # 人在终端前看的是"写到哪了、下一步敲什么"; 脚本要的才是那坨 JSON。
339
+ if parsed["options"].get("json") or not sys.stdout.isatty():
340
+ return {"json": {**value, "initialized": True}}
341
+ return {"text": init_summary(
342
+ directory=value["directory"],
343
+ prefix=command_prefix(resolved=shutil.which("dsh-cloud") or "", entry=sys.argv[0]),
344
+ mode=value["mode"],
345
+ work_domain=(f"work.{parsed['options'].get('domain')}"
346
+ if value["mode"] == "selfhost" else ""))}
338
347
  if parsed["command"] == "start" and fresh_init and not parsed["options"].get("dryRun"):
339
348
  initialize(parsed, manifest, value, answers)
340
349
  if state.is_file():
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "license": "LicenseRef-DSH-Cloud-Community-1.0",
5
5
  "stackSchema": 1,
6
6
  "databaseSchema": 1,
@@ -8,8 +8,8 @@
8
8
  "minUpgradeFrom": "0.1.0",
9
9
  "harnessRuntime": "0.1.0-rc.8",
10
10
  "images": {
11
- "server": "ghcr.io/agentsdanceai/dsh-cloud-server:0.2.2",
12
- "workspace": "ghcr.io/agentsdanceai/dsh-cloud-workspace:0.2.2"
11
+ "server": "ghcr.io/agentsdanceai/dsh-cloud-server:0.2.4",
12
+ "workspace": "ghcr.io/agentsdanceai/dsh-cloud-workspace:0.2.4"
13
13
  },
14
14
  "baseImages": {
15
15
  "python": "python:3.11-slim-bookworm@sha256:2e32f7d302adc1c37428355c1e646897c0c53f4fd60b6a551245fb90ee129f91",
@@ -46,7 +46,12 @@ def should_run_wizard(parsed: dict, *, is_tty: bool, fresh_init: bool) -> bool:
46
46
  options = parsed.get("options", {})
47
47
  if options.get("json") or options.get("dryRun") or options.get("yes"):
48
48
  return False
49
- return parsed.get("command") in {"start", "init"}
49
+ if parsed.get("command") not in {"start", "init"}:
50
+ return False
51
+ # 试用模式一句不问: 那条命令的意义就是"一行装完看看长什么样", 而看的东西
52
+ # (下载、云工作台) 本来就指向官方站点, 本机根本用不到上游密钥。想在本地真
53
+ # 跑模型的人去改 .env。自部署才问 —— 没有 SMTP/OAuth 谁也注册不了第一个账号。
54
+ return str(options.get("mode", "trial")) == "selfhost"
50
55
 
51
56
 
52
57
  def apply_answers(pairs: list[tuple[str, str]], answers: dict) -> list[tuple[str, str]]:
@@ -101,9 +106,10 @@ def next_steps(*, url: str, directory: str, has_upstream_key: bool,
101
106
  "",
102
107
  ]
103
108
  if not has_upstream_key:
109
+ # 不再写成"注意/警告": 试用模式本来就不在本机跑模型 —— 下载与云工作台都
110
+ # 指向官方站点, 没有上游密钥是**正常状态**而不是出错。
104
111
  lines += [
105
- " 注意 还没有配模型上游,聊天会返回 503。把 UPSTREAM_API_KEY 填进",
106
- f" {directory}/.env 后执行 dsh-cloud up 生效。",
112
+ f" 想在本机跑模型:把 UPSTREAM_API_KEY 填进 {directory}/.env,再执行一次上面的启动命令",
107
113
  "",
108
114
  ]
109
115
  if work_domain:
@@ -125,6 +131,34 @@ def next_steps(*, url: str, directory: str, has_upstream_key: bool,
125
131
  return "\n".join(lines)
126
132
 
127
133
 
134
+ def init_summary(*, directory: str, prefix: str = "dsh-cloud", mode: str = "trial",
135
+ work_domain: str = "") -> str:
136
+ """``init`` 的收尾摘要。
137
+
138
+ init 只写配置、不起容器, 所以不能用 next_steps (那张面板说的是"已就绪")。
139
+ 它原本无论如何都吐一整坨 JSON —— 那是给脚本解析的, 而人在终端前只想知道
140
+ "写到哪了、下一步敲什么"。带 --json 或非 TTY 时仍然只吐 JSON。
141
+ """
142
+ lines = [
143
+ "",
144
+ " 配置已写入,容器还没起",
145
+ "",
146
+ f" 目录 {directory}",
147
+ f" 启动 {prefix} up --dir {directory}",
148
+ "",
149
+ ]
150
+ if mode == "selfhost":
151
+ lines += [
152
+ " 这是对外服务的配置:绑 0.0.0.0、占用 80/443、申请真证书,",
153
+ " 请在目标服务器上启动,而不是本机。",
154
+ "",
155
+ ]
156
+ if work_domain:
157
+ lines += [f" 别忘了给 {work_domain} 加一条指向该服务器的 DNS 记录(云工作台按域名路由)", ""]
158
+ lines += [f" 启动前可以先过一遍 {directory}/.env", ""]
159
+ return "\n".join(lines)
160
+
161
+
128
162
  def _ask(prompt: str) -> str:
129
163
  """Read one line; EOF (Ctrl-D, or `start < /dev/null`) means "take the default"."""
130
164
  try:
File without changes
File without changes
File without changes