@mkterswingman/5mghost-wonder 0.0.7 → 0.0.9
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/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -44,6 +44,12 @@ try {
|
|
|
44
44
|
} else {
|
|
45
45
|
console.log("[wonder] No skill targets updated.");
|
|
46
46
|
}
|
|
47
|
+
// Always remind the user to restart their AI session — skill text loaded
|
|
48
|
+
// into a running session does not refresh after files on disk are replaced.
|
|
49
|
+
console.log("");
|
|
50
|
+
console.log("[wonder] ⚠️ IMPORTANT: Restart your AI session (Claude Code / Codex / Gemini / etc.)");
|
|
51
|
+
console.log("[wonder] before invoking any wonder skill. Open a new chat, or run /exit and re-enter.");
|
|
52
|
+
console.log("[wonder] The AI cannot pick up the newly installed skill text in this running session.");
|
|
47
53
|
} catch (err) {
|
|
48
54
|
// Skill install failure must never break npm install
|
|
49
55
|
console.log(`[wonder] Skill install failed (non-fatal): ${String(err)}`);
|
|
@@ -5,6 +5,16 @@ description: Use this skill when the user wants to install or set up wonder, say
|
|
|
5
5
|
|
|
6
6
|
# Setup wonder — 企微文档 CLI 安装向导
|
|
7
7
|
|
|
8
|
+
## Skill version
|
|
9
|
+
|
|
10
|
+
This skill matches **wonder 0.0.9**.
|
|
11
|
+
|
|
12
|
+
Once the CLI is installed in Step 1, run `wonder --version`. If the output does not equal `0.0.9`, the CLI on disk has drifted from the skill text loaded in this session. Ask the user to run `/update-5mghost-wonder`, then **start a fresh AI session** (`/exit` and re-enter, or open a new chat) — skill text already loaded into a running session does not refresh after `wonder update`, even though the file on disk has been replaced.
|
|
13
|
+
|
|
14
|
+
After a successful first install, also remind the user to start a fresh AI session before invoking `/use-5mghost-wonder` for the first time. The skill files were just written to disk; the current session never loaded them.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
8
18
|
You are guiding the user through installing and configuring `wonder`, the WeCom document reader CLI.
|
|
9
19
|
|
|
10
20
|
Execute each step in order using the Bash tool. Stop and ask for user interaction only when a step requires it (e.g., browser OAuth, QR code scan). After each detection step, only proceed to installation if the tool is missing.
|
|
@@ -5,6 +5,12 @@ description: Use this skill when the user wants to update or upgrade wonder, say
|
|
|
5
5
|
|
|
6
6
|
# Update wonder — 升级 5mghost-wonder CLI
|
|
7
7
|
|
|
8
|
+
## Skill version
|
|
9
|
+
|
|
10
|
+
This skill matches **wonder 0.0.9**.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
8
14
|
Run the CLI's built-in updater. It reinstalls the latest published version globally via npm.
|
|
9
15
|
|
|
10
16
|
```bash
|
|
@@ -17,7 +23,7 @@ When the command completes, verify the new version is in place:
|
|
|
17
23
|
wonder --version
|
|
18
24
|
```
|
|
19
25
|
|
|
20
|
-
After updating, **the bundled skills (`setup-5mghost-wonder`, `use-5mghost-wonder`, `update-5mghost-wonder`) on disk are refreshed by the package's `postinstall`**, but the AI session's already-loaded skill text is the old version. Tell the user
|
|
26
|
+
After updating, **the bundled skills (`setup-5mghost-wonder`, `use-5mghost-wonder`, `update-5mghost-wonder`) on disk are refreshed by the package's `postinstall`**, but the AI session's already-loaded skill text is the old version. **Tell the user — clearly and proactively — that they must start a new AI session before the new skill text takes effect**: open a fresh chat, restart the CLI, or run `/exit` and re-enter. Until they do, the AI is still operating on the old skill regardless of what `wonder --version` reports.
|
|
21
27
|
|
|
22
28
|
If `wonder update` exits non-zero, the most common cause is npm permission or registry issues. Re-run with the user's terminal so they can see the npm error directly:
|
|
23
29
|
|
|
@@ -5,6 +5,12 @@ description: Use this skill when the user shares a URL containing "doc.weixin.qq
|
|
|
5
5
|
|
|
6
6
|
# use-5mghost-wonder — 企微文档读取操作指南
|
|
7
7
|
|
|
8
|
+
## Skill version
|
|
9
|
+
|
|
10
|
+
This skill matches **wonder 0.0.9**.
|
|
11
|
+
|
|
12
|
+
In the Session Initialization step below, after running `wonder --version`, compare the output to `0.0.9`. If they differ, the loaded skill text and the CLI on disk are out of sync. Stop, tell the user to run `/update-5mghost-wonder`, and then **start a fresh AI session** (`/exit` and re-enter, or open a new chat) before trying again. `wonder update` rewrites the skill files on disk, but skill text already loaded into the current session does not auto-refresh.
|
|
13
|
+
|
|
8
14
|
## Session Initialization (first use only per session)
|
|
9
15
|
|
|
10
16
|
The **first time** you encounter a WeCom document URL in a session, run these checks before processing the document. Remember you have already done this — do not repeat in subsequent calls within the same session.
|
|
@@ -13,7 +19,10 @@ The **first time** you encounter a WeCom document URL in a session, run these ch
|
|
|
13
19
|
# 1. Check for updates
|
|
14
20
|
wonder update
|
|
15
21
|
|
|
16
|
-
# 2.
|
|
22
|
+
# 2. Confirm the CLI version matches this skill's expected version (0.0.9)
|
|
23
|
+
wonder --version
|
|
24
|
+
|
|
25
|
+
# 3. Check WeCom cookie status
|
|
17
26
|
wonder wecom status
|
|
18
27
|
```
|
|
19
28
|
|
|
@@ -130,19 +139,20 @@ Read("/Users/<you>/Downloads/5mghost-wonder/media/image3.png")
|
|
|
130
139
|
|
|
131
140
|
**Note:** Images are full-resolution originals (up to several MB each). Only load images the user specifically asks about.
|
|
132
141
|
|
|
133
|
-
### Viewing visual layout
|
|
142
|
+
### Viewing visual layout — required when colour or layout carries meaning
|
|
143
|
+
|
|
144
|
+
The JSON does not carry cell colours, font colours, or rendered borders. When colour or position is part of the answer, you cannot recover it from JSON — you must read the rendered sheet.
|
|
134
145
|
|
|
135
|
-
|
|
146
|
+
Render to PDF and Read it whenever any of these are true:
|
|
136
147
|
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
- User explicitly asks about "how it looks", "颜色", "排版", "这个图表", "这张表的结构"
|
|
148
|
+
- The user asks about "how it looks", "颜色", "排版", "这个图表", "这张表的结构", or refers to a visible highlight
|
|
149
|
+
- The sheet is a gantt chart, calendar, status board, or roadmap (colour = stage / owner / priority / "this week")
|
|
150
|
+
- A column or row in the user's question is highlighted (yellow / red / green) in the WeCom UI
|
|
151
|
+
- The merge-to-cell ratio in the JSON is non-trivial (e.g. `merges.length / cells.length > 0.1`) — likely a layout-driven sheet
|
|
142
152
|
|
|
143
|
-
|
|
153
|
+
You cannot detect colour from JSON alone, so when in doubt about a sheet that mixes data with visual cues, render. The cost is ~30 s and ~10 MB; the cost of guessing wrong is worse.
|
|
144
154
|
|
|
145
|
-
Render
|
|
155
|
+
Render command (one PDF page per tab, preserves layout, merges, fills, borders):
|
|
146
156
|
|
|
147
157
|
```bash
|
|
148
158
|
soffice --headless \
|
|
@@ -152,6 +162,8 @@ soffice --headless \
|
|
|
152
162
|
|
|
153
163
|
Then use the Read tool on the generated PDF. Page N corresponds to the Nth tab in workbook order (same as `tabs[]` in the metadata output).
|
|
154
164
|
|
|
165
|
+
Skip rendering only when the user clearly wants a single cell value or a numeric lookup from a plain data table.
|
|
166
|
+
|
|
155
167
|
---
|
|
156
168
|
|
|
157
169
|
## docx Workflow (`doc/w3_`, `doc/e2_`)
|
|
@@ -208,15 +220,17 @@ Output:
|
|
|
208
220
|
{ "type": "slide", "path": "/Users/<you>/Downloads/5mghost-wonder/filename.pptx" }
|
|
209
221
|
```
|
|
210
222
|
|
|
211
|
-
### Step 2 —
|
|
223
|
+
### Step 2 — Always extract both text and visual layout
|
|
212
224
|
|
|
213
|
-
|
|
225
|
+
For pptx, run **both** extractions every time. Most WeCom slides are layout-driven (timelines, image collages, status boards, recap pages) — pure text loses critical meaning, and pure-PDF visual reading can mis-OCR text that pandoc captures cleanly. You cannot tell a "complex" slide from a "simple" slide without first looking at it, so don't try to decide; just run both and use whichever the question calls for.
|
|
226
|
+
|
|
227
|
+
**1. Text** (for exact wording, fast keyword scanning, copy-quoting):
|
|
214
228
|
|
|
215
229
|
```bash
|
|
216
230
|
pandoc <path> -o /tmp/wonder-slide-output.md && cat /tmp/wonder-slide-output.md
|
|
217
231
|
```
|
|
218
232
|
|
|
219
|
-
**
|
|
233
|
+
**2. Visual layout** (for image-text relationships, timelines, colour, embedded screenshots whose text pandoc cannot reach — e.g. Korean / Japanese chat captures):
|
|
220
234
|
|
|
221
235
|
```bash
|
|
222
236
|
soffice --headless --convert-to pdf --outdir /tmp/ <path>
|
|
@@ -224,7 +238,11 @@ soffice --headless --convert-to pdf --outdir /tmp/ <path>
|
|
|
224
238
|
|
|
225
239
|
Then use the Read tool on the generated PDF.
|
|
226
240
|
|
|
227
|
-
|
|
241
|
+
When answering, combine: lean on the PDF for "what's on the slide and how it's organised", lean on the markdown for exact-wording quotes. Don't answer from text-only when a slide visibly relies on layout — the user will spot the gap immediately.
|
|
242
|
+
|
|
243
|
+
If `soffice` is not installed (`wonder check` reports it as optional/missing), fall back to pandoc-only and tell the user upfront that visual cues, embedded screenshot text, and image-text relationships will be missing from your answer.
|
|
244
|
+
|
|
245
|
+
### Optional: access embedded images directly
|
|
228
246
|
|
|
229
247
|
```bash
|
|
230
248
|
mkdir -p /tmp/wonder-pptx-unpack && cp <path> /tmp/wonder-pptx-unpack/slide.zip && unzip -o /tmp/wonder-pptx-unpack/slide.zip -d /tmp/wonder-pptx-unpack/
|
|
@@ -253,7 +271,8 @@ Then use Read tool on files in `/tmp/wonder-pptx-unpack/ppt/media/`.
|
|
|
253
271
|
| pptx slice crash | `prs.slides[:N]` → `AttributeError: 'list' object has no attribute 'rId'` | Use `for slide in prs.slides` |
|
|
254
272
|
| Cookie expiry | Cookie valid for 7–30 days | Run `wonder wecom cookie` to refresh |
|
|
255
273
|
| xlsx images are full-size | Original images can be up to 6 MB each | Only read images when user specifically needs them |
|
|
256
|
-
| xlsx visual layout
|
|
274
|
+
| xlsx colour / visual layout | JSON has no fill colour, font colour, or rendered borders | Render to PDF (xlsx section) when colour or layout carries meaning |
|
|
275
|
+
| pptx layout-driven slides | Pure pandoc loses image-text relationships, timelines, embedded screenshot text (e.g. Korean chats) | pptx workflow now runs pandoc + soffice→pdf together by default |
|
|
257
276
|
| smartpage unsupported | Export API returns 0% progress forever | Manual browser export |
|
|
258
277
|
|
|
259
278
|
---
|