@yuhan1124/draw-prompt 0.4.4 → 0.4.5
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.
- package/SKILL.md +1 -1
- package/package.json +1 -1
- package/scripts/prompt_cli.py +41 -1
package/SKILL.md
CHANGED
package/package.json
CHANGED
package/scripts/prompt_cli.py
CHANGED
|
@@ -51,6 +51,7 @@ import json
|
|
|
51
51
|
import os
|
|
52
52
|
import re
|
|
53
53
|
import shutil
|
|
54
|
+
import subprocess
|
|
54
55
|
import sys
|
|
55
56
|
from datetime import datetime, timezone
|
|
56
57
|
from pathlib import Path
|
|
@@ -135,7 +136,7 @@ def ensure_home() -> None:
|
|
|
135
136
|
|
|
136
137
|
|
|
137
138
|
SCHEMA_VERSION = 1
|
|
138
|
-
COMPILER_VERSION = "0.4.
|
|
139
|
+
COMPILER_VERSION = "0.4.5"
|
|
139
140
|
|
|
140
141
|
|
|
141
142
|
PACKAGED_SKILL_FILES = [
|
|
@@ -5571,6 +5572,44 @@ def cmd_install_skill(args: argparse.Namespace) -> int:
|
|
|
5571
5572
|
# --------------------------------------------------------------------------- #
|
|
5572
5573
|
# status
|
|
5573
5574
|
# --------------------------------------------------------------------------- #
|
|
5575
|
+
def npm_registry_status() -> str:
|
|
5576
|
+
npm = which("npm")
|
|
5577
|
+
if not npm:
|
|
5578
|
+
try:
|
|
5579
|
+
probe = subprocess.run(
|
|
5580
|
+
["/bin/zsh", "-lic", "command -v npm"],
|
|
5581
|
+
text=True,
|
|
5582
|
+
capture_output=True,
|
|
5583
|
+
check=False,
|
|
5584
|
+
timeout=5,
|
|
5585
|
+
)
|
|
5586
|
+
except Exception:
|
|
5587
|
+
probe = None
|
|
5588
|
+
npm = ""
|
|
5589
|
+
if probe and probe.stdout:
|
|
5590
|
+
for line in probe.stdout.splitlines():
|
|
5591
|
+
candidate = line.strip()
|
|
5592
|
+
if candidate and Path(candidate).name == "npm" and Path(candidate).exists():
|
|
5593
|
+
npm = candidate
|
|
5594
|
+
break
|
|
5595
|
+
if not npm:
|
|
5596
|
+
return "未找到 npm(如需 npx 安装,请确认 npm 在 PATH 中)"
|
|
5597
|
+
try:
|
|
5598
|
+
result = subprocess.run(
|
|
5599
|
+
[npm, "config", "get", "registry"],
|
|
5600
|
+
text=True,
|
|
5601
|
+
capture_output=True,
|
|
5602
|
+
check=False,
|
|
5603
|
+
timeout=3,
|
|
5604
|
+
)
|
|
5605
|
+
except Exception as exc:
|
|
5606
|
+
return f"读取失败:{exc}"
|
|
5607
|
+
registry = (result.stdout or "").strip() or "未知"
|
|
5608
|
+
if registry == "https://registry.npmjs.org/" or registry == "https://registry.npmjs.org":
|
|
5609
|
+
return f"{registry}(公网 npm)"
|
|
5610
|
+
return f"{registry}(建议 npx 加 --registry=https://registry.npmjs.org/)"
|
|
5611
|
+
|
|
5612
|
+
|
|
5574
5613
|
def cmd_status(args: argparse.Namespace) -> int:
|
|
5575
5614
|
print("draw-prompt 环境检查")
|
|
5576
5615
|
print(f" 数据目录 : {data_home()} ({'存在' if data_home().exists() else '未创建'})")
|
|
@@ -5587,6 +5626,7 @@ def cmd_status(args: argparse.Namespace) -> int:
|
|
|
5587
5626
|
claude_skill = Path.home() / ".claude" / "skills" / "draw-prompt"
|
|
5588
5627
|
print(f" Codex skill: {codex_skill} ({'已安装' if is_draw_prompt_install(codex_skill) else '未安装,可运行 install-skill --target codex'})")
|
|
5589
5628
|
print(f" Claude skill: {claude_skill} ({'已安装' if is_draw_prompt_install(claude_skill) else '未安装,可运行 install-skill --target claude'})")
|
|
5629
|
+
print(f" npm registry: {npm_registry_status()}")
|
|
5590
5630
|
print(" ── 下游出图通道(本 skill 不主动调用,仅提示可用性)──")
|
|
5591
5631
|
print(f" codex CLI : {which('codex') or '未找到'}")
|
|
5592
5632
|
plugin = Path.home() / ".claude" / "plugins" / "cache" / "codex-image-in-cc"
|