@yuhan1124/draw-prompt 0.4.4 → 0.4.6
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 +38 -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.6"
|
|
139
140
|
|
|
140
141
|
|
|
141
142
|
PACKAGED_SKILL_FILES = [
|
|
@@ -5571,6 +5572,41 @@ def cmd_install_skill(args: argparse.Namespace) -> int:
|
|
|
5571
5572
|
# --------------------------------------------------------------------------- #
|
|
5572
5573
|
# status
|
|
5573
5574
|
# --------------------------------------------------------------------------- #
|
|
5575
|
+
def find_npm_binary() -> str:
|
|
5576
|
+
npm = which("npm")
|
|
5577
|
+
if npm:
|
|
5578
|
+
return npm
|
|
5579
|
+
candidates = [
|
|
5580
|
+
Path("/opt/homebrew/bin/npm"),
|
|
5581
|
+
Path("/usr/local/bin/npm"),
|
|
5582
|
+
]
|
|
5583
|
+
candidates.extend(sorted(Path.home().glob(".nvm/versions/node/*/bin/npm"), reverse=True))
|
|
5584
|
+
for candidate in candidates:
|
|
5585
|
+
if candidate.exists():
|
|
5586
|
+
return str(candidate)
|
|
5587
|
+
return ""
|
|
5588
|
+
|
|
5589
|
+
|
|
5590
|
+
def npm_registry_status() -> str:
|
|
5591
|
+
npm = find_npm_binary()
|
|
5592
|
+
if not npm:
|
|
5593
|
+
return "未找到 npm(如需 npx 安装,请确认 npm 在 PATH 中)"
|
|
5594
|
+
try:
|
|
5595
|
+
result = subprocess.run(
|
|
5596
|
+
[npm, "config", "get", "registry"],
|
|
5597
|
+
text=True,
|
|
5598
|
+
capture_output=True,
|
|
5599
|
+
check=False,
|
|
5600
|
+
timeout=3,
|
|
5601
|
+
)
|
|
5602
|
+
except Exception as exc:
|
|
5603
|
+
return f"读取失败:{exc}"
|
|
5604
|
+
registry = (result.stdout or "").strip() or "未知"
|
|
5605
|
+
if registry == "https://registry.npmjs.org/" or registry == "https://registry.npmjs.org":
|
|
5606
|
+
return f"{registry}(公网 npm)"
|
|
5607
|
+
return f"{registry}(建议 npx 加 --registry=https://registry.npmjs.org/)"
|
|
5608
|
+
|
|
5609
|
+
|
|
5574
5610
|
def cmd_status(args: argparse.Namespace) -> int:
|
|
5575
5611
|
print("draw-prompt 环境检查")
|
|
5576
5612
|
print(f" 数据目录 : {data_home()} ({'存在' if data_home().exists() else '未创建'})")
|
|
@@ -5587,6 +5623,7 @@ def cmd_status(args: argparse.Namespace) -> int:
|
|
|
5587
5623
|
claude_skill = Path.home() / ".claude" / "skills" / "draw-prompt"
|
|
5588
5624
|
print(f" Codex skill: {codex_skill} ({'已安装' if is_draw_prompt_install(codex_skill) else '未安装,可运行 install-skill --target codex'})")
|
|
5589
5625
|
print(f" Claude skill: {claude_skill} ({'已安装' if is_draw_prompt_install(claude_skill) else '未安装,可运行 install-skill --target claude'})")
|
|
5626
|
+
print(f" npm registry: {npm_registry_status()}")
|
|
5590
5627
|
print(" ── 下游出图通道(本 skill 不主动调用,仅提示可用性)──")
|
|
5591
5628
|
print(f" codex CLI : {which('codex') or '未找到'}")
|
|
5592
5629
|
plugin = Path.home() / ".claude" / "plugins" / "cache" / "codex-image-in-cc"
|