@yuhan1124/draw-prompt 0.4.2 → 0.4.4

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/README.md CHANGED
@@ -34,14 +34,20 @@ Prompt 的默认结构是三段:`User visual brief` 原始视觉需求、`Styl
34
34
  发布到 npm 后可以直接:
35
35
 
36
36
  ```bash
37
- npx @yuhan1124/draw-prompt status
38
- npx @yuhan1124/draw-prompt convert "茶饮新品海报,写冷泡系列"
39
- npx @yuhan1124/draw-prompt install-skill --target codex
37
+ npx --yes --registry=https://registry.npmjs.org/ @yuhan1124/draw-prompt@latest status
38
+ npx --yes --registry=https://registry.npmjs.org/ @yuhan1124/draw-prompt@latest convert "茶饮新品海报,写冷泡系列"
39
+ npx --yes --registry=https://registry.npmjs.org/ @yuhan1124/draw-prompt@latest install-skill --target codex
40
40
  ```
41
41
 
42
42
  `npx` 包内置同一份 Python CLI 和 references。执行时优先使用 `uv run` 自动处理
43
43
  PEP723 依赖;没有 `uv` 时退回 `python3`。`overlay`、`visual-check`、`edit-check`
44
44
  需要 Pillow,推荐用户安装 `uv` 获得最稳运行链路。
45
+ 显式 `--registry=https://registry.npmjs.org/` 是为了避开公司/镜像 registry 的同步延迟;
46
+ 如果你的 npm 默认 registry 已经是公网 npm,也可以省略。
47
+
48
+ 如果当前目录就是本仓库源码目录,`npx @yuhan1124/draw-prompt ...` 可能被 npm 解析到同名本地
49
+ package 而失败;本地开发请直接用 `node bin/draw-prompt.js ...` 或
50
+ `python3 scripts/prompt_cli.py ...`。
45
51
 
46
52
  `visual-regress` / `benchmark` 用到的回归集只保留在开发仓库本地,不随 npm 包发布。
47
53
 
@@ -51,13 +57,13 @@ PEP723 依赖;没有 `uv` 时退回 `python3`。`overlay`、`visual-check`、`
51
57
 
52
58
  ```bash
53
59
  # 安装到 Codex:~/.codex/skills/draw-prompt
54
- npx @yuhan1124/draw-prompt install-skill --target codex
60
+ npx --yes --registry=https://registry.npmjs.org/ @yuhan1124/draw-prompt@latest install-skill --target codex
55
61
 
56
62
  # 安装到 Claude Code:~/.claude/skills/draw-prompt
57
- npx @yuhan1124/draw-prompt install-skill --target claude
63
+ npx --yes --registry=https://registry.npmjs.org/ @yuhan1124/draw-prompt@latest install-skill --target claude
58
64
 
59
65
  # 同时安装两边;更新已有安装时加 --force
60
- npx @yuhan1124/draw-prompt install-skill --target both --force
66
+ npx --yes --registry=https://registry.npmjs.org/ @yuhan1124/draw-prompt@latest install-skill --target both --force
61
67
  ```
62
68
 
63
69
  `install-skill` 默认复制 npm 包内的运行文件,避免软链到 npx 缓存导致后续路径失效。它只复制
@@ -73,7 +79,9 @@ ln -s ~/Desktop/draw-prompt ~/.claude/skills/draw-prompt
73
79
 
74
80
  依赖:`uv`(推荐,PEP723 自动装 pyyaml)或 `python3`。检查环境:
75
81
  ```bash
76
- uv run scripts/prompt_cli.py status
82
+ node bin/draw-prompt.js status
83
+ # 或
84
+ python3 scripts/prompt_cli.py status
77
85
  ```
78
86
 
79
87
  ## 怎么用
package/SKILL.md CHANGED
@@ -8,7 +8,7 @@ description: >-
8
8
  画图的指令"、"优化我的出图 prompt"、"按我的风格生成 prompt",或在用 GPT Image 2 /
9
9
  gpt-image-2 出图前需要一段精准提示词时,使用本 skill。
10
10
  metadata:
11
- version: 0.4.2
11
+ version: 0.4.4
12
12
  openclaw:
13
13
  anyBins: ["uv", "python3"]
14
14
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuhan1124/draw-prompt",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Convert natural-language image requests into high-quality gpt-image-2 prompts and Codex handoff blocks.",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -135,7 +135,7 @@ def ensure_home() -> None:
135
135
 
136
136
 
137
137
  SCHEMA_VERSION = 1
138
- COMPILER_VERSION = "0.4.2"
138
+ COMPILER_VERSION = "0.4.4"
139
139
 
140
140
 
141
141
  PACKAGED_SKILL_FILES = [
@@ -2488,8 +2488,9 @@ def extract_required_texts(request: str, explicit_texts: list[str]) -> list[str]
2488
2488
  for match in re.finditer(pat, request):
2489
2489
  add_candidate(match.start(1), match.group(1))
2490
2490
  labeled_single_patterns = [
2491
- r"(?:主标题|标题|副标题|主题|时间|地点)\s*(?:写上|写|显示|为|是|叫|[::])\s*([^,,。;;\n]{2,40})",
2492
- r"(?:时间|地点)\s+([^,,。;;\n]{2,40})",
2491
+ r"(?:主标题|标题|副标题|主题|时间|地点)\s*(?:写上|写|显示|为|是|叫|[::])\s*([^,,、。;;\n]{2,40})",
2492
+ r"(?:主标题|标题|副标题|主题|时间|地点)\s+([^,,、。;;\n]{2,40})",
2493
+ r"(?:时间|地点)\s+([^,,、。;;\n]{2,40})",
2493
2494
  r"(?:核心卡片|主要按钮|主按钮|按钮)\s*(?:写上|写|显示|为|是|叫|[::])\s*([^,,。;;\n]{2,30})",
2494
2495
  r"(?:需要)?包含\s*([A-Za-z][A-Za-z0-9_-]{2,30})\s*字样",
2495
2496
  r"(?:名为|叫做|名称是|名字叫)\s*([A-Za-z][A-Za-z0-9_-]{2,30})\b",
@@ -4177,7 +4178,8 @@ def load_json_value(value: str | None) -> dict:
4177
4178
 
4178
4179
  def missing_pillow_message(command: str) -> str:
4179
4180
  return (
4180
- f"{command} 需要 Pillow 图像库。请优先用 `uv run` / `npx @yuhan1124/draw-prompt ...` 自动安装依赖,"
4181
+ f"{command} 需要 Pillow 图像库。请优先用 `uv run` / "
4182
+ "`npx --yes --registry=https://registry.npmjs.org/ @yuhan1124/draw-prompt@latest ...` 自动安装依赖,"
4181
4183
  "或在当前 Python 环境中安装:python3 -m pip install pillow"
4182
4184
  )
4183
4185