dsh-cloud 0.2.2__tar.gz → 0.2.3__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.3}/PKG-INFO +1 -1
  2. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/pyproject.toml +1 -1
  3. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/cli.py +11 -2
  4. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/release-manifest.json +3 -3
  5. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/wizard.py +28 -0
  6. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/LICENSE +0 -0
  7. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/README.md +0 -0
  8. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/build_backend.py +0 -0
  9. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/__init__.py +0 -0
  10. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/__main__.py +0 -0
  11. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/Caddyfile +0 -0
  12. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/compose.build.yml +0 -0
  13. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/compose.postgres.yml +0 -0
  14. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/i18n/en.json +0 -0
  15. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/i18n/zh.json +0 -0
  16. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/models.curated.txt +0 -0
  17. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/models.json +0 -0
  18. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/pricing.cny.json +0 -0
  19. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/pricing.eur.json +0 -0
  20. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/pricing.gbp.json +0 -0
  21. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/pricing.hkd.json +0 -0
  22. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/pricing.jpy.json +0 -0
  23. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/src/dsh_cloud_cli/templates/config/pricing.usd.json +0 -0
  24. {dsh_cloud-0.2.2 → dsh_cloud-0.2.3}/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.3
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.3"
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.3",
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.3",
12
+ "workspace": "ghcr.io/agentsdanceai/dsh-cloud-workspace:0.2.3"
13
13
  },
14
14
  "baseImages": {
15
15
  "python": "python:3.11-slim-bookworm@sha256:2e32f7d302adc1c37428355c1e646897c0c53f4fd60b6a551245fb90ee129f91",
@@ -125,6 +125,34 @@ def next_steps(*, url: str, directory: str, has_upstream_key: bool,
125
125
  return "\n".join(lines)
126
126
 
127
127
 
128
+ def init_summary(*, directory: str, prefix: str = "dsh-cloud", mode: str = "trial",
129
+ work_domain: str = "") -> str:
130
+ """``init`` 的收尾摘要。
131
+
132
+ init 只写配置、不起容器, 所以不能用 next_steps (那张面板说的是"已就绪")。
133
+ 它原本无论如何都吐一整坨 JSON —— 那是给脚本解析的, 而人在终端前只想知道
134
+ "写到哪了、下一步敲什么"。带 --json 或非 TTY 时仍然只吐 JSON。
135
+ """
136
+ lines = [
137
+ "",
138
+ " 配置已写入,容器还没起",
139
+ "",
140
+ f" 目录 {directory}",
141
+ f" 启动 {prefix} up --dir {directory}",
142
+ "",
143
+ ]
144
+ if mode == "selfhost":
145
+ lines += [
146
+ " 这是对外服务的配置:绑 0.0.0.0、占用 80/443、申请真证书,",
147
+ " 请在目标服务器上启动,而不是本机。",
148
+ "",
149
+ ]
150
+ if work_domain:
151
+ lines += [f" 别忘了给 {work_domain} 加一条指向该服务器的 DNS 记录(云工作台按域名路由)", ""]
152
+ lines += [f" 启动前可以先过一遍 {directory}/.env", ""]
153
+ return "\n".join(lines)
154
+
155
+
128
156
  def _ask(prompt: str) -> str:
129
157
  """Read one line; EOF (Ctrl-D, or `start < /dev/null`) means "take the default"."""
130
158
  try:
File without changes
File without changes
File without changes