@mkterswingman/5mghost-wonder 0.0.13 → 0.0.14

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.
@@ -0,0 +1,81 @@
1
+ # No-Export Browser Read
2
+
3
+ Use this experimental path when export-backed `wonder read` is unavailable or
4
+ insufficient:
5
+
6
+ - Read-only document.
7
+ - Export disabled.
8
+ - Export job fails or never completes.
9
+ - Smart page / mind map / unsupported type.
10
+ - User specifically needs browser-visible images, floating images, merged
11
+ tables, or layout that export misses.
12
+
13
+ ## Goal
14
+
15
+ Read from the browser-loaded document without relying on WeCom's export API.
16
+ Prefer structured runtime or network data over screenshots.
17
+
18
+ ## Evidence Ladder
19
+
20
+ Treat results by evidence strength:
21
+
22
+ | Result | Requirement |
23
+ | --- | --- |
24
+ | `pass` | Text, table cells, merge ranges, image resources or URLs, and image-to-cell/position relationships are captured without export. |
25
+ | `partial` | Some structured data is captured, but images, merges, anchors, or positions are missing. |
26
+ | `fail` | Only screenshots/OCR are available, or the page cannot be loaded. |
27
+
28
+ Do not describe screenshot/OCR output as lossless.
29
+
30
+ ## Procedure
31
+
32
+ 1. Confirm cookies are valid. If not, follow `cookie-recovery.md`.
33
+ 2. Start with the built-in evidence probe:
34
+
35
+ ```bash
36
+ wonder browser probe <url> --save /tmp/wonder-browser-probe
37
+ ```
38
+
39
+ Use `--headed` only when login/debug visibility is needed.
40
+
41
+ 3. If the probe is insufficient, continue with the available browser automation
42
+ runtime.
43
+ 4. Capture non-destructive evidence:
44
+ - page URL and document type
45
+ - visible title
46
+ - loaded script/runtime globals that look like document stores
47
+ - network responses that contain cell text, merge ranges, image metadata, or
48
+ media URLs
49
+ - WebSocket messages if they expose structured document operations
50
+ - screenshots only as a fallback or visual cross-check
51
+ 5. For tables, specifically look for:
52
+ - cell coordinates
53
+ - displayed text
54
+ - merge ranges
55
+ - row/column sizes if available
56
+ - fixed cell images
57
+ - floating images with position, size, and anchor
58
+ 6. For image-heavy docs, verify whether each image can be fetched as an original
59
+ resource or only appears in a raster screenshot.
60
+ 7. Report `pass`, `partial`, or `fail` with the missing fields.
61
+
62
+ ## Output Contract
63
+
64
+ Return a concise result:
65
+
66
+ ```json
67
+ {
68
+ "mode": "browser-no-export",
69
+ "status": "pass|partial|fail",
70
+ "textAvailable": true,
71
+ "tablesAvailable": true,
72
+ "mergeRangesAvailable": true,
73
+ "imagesAvailable": true,
74
+ "imageAnchorsAvailable": true,
75
+ "evidence": ["runtime-store", "network-response", "websocket", "screenshot"],
76
+ "missing": []
77
+ }
78
+ ```
79
+
80
+ If the user asked for an answer, answer only from fields that are backed by
81
+ evidence. State any partial gaps plainly.
@@ -0,0 +1,21 @@
1
+ # Route Map
2
+
3
+ Classify by the user's job, not only by URL shape.
4
+
5
+ | Signal | Route |
6
+ | --- | --- |
7
+ | User asks to read, summarize, translate, extract, inspect content | `read-export.md` first |
8
+ | `wonder read` fails due to export disabled, read-only, unsupported export, or stuck export | `read-no-export-browser.md` |
9
+ | User asks to edit, append, format, rewrite in place, or change toolbar styles | `edit-browser-runtime.md` |
10
+ | User asks about images, screenshots, layout, colors, embedded media, merged cells, or table structure | `read-export.md` plus `verification.md`; use `read-no-export-browser.md` if export is unavailable |
11
+ | Cookie/auth failure | `cookie-recovery.md` |
12
+ | Need exact command syntax | `cli-reference.md` |
13
+
14
+ Mixed task order:
15
+
16
+ 1. Session init if not already done.
17
+ 2. Cookie recovery if needed.
18
+ 3. Read enough context.
19
+ 4. Execute edit or extraction.
20
+ 5. Verify with `verification.md`.
21
+ 6. Report supported, partial, and not-verified parts separately.
@@ -0,0 +1,19 @@
1
+ # Session Initialization
2
+
3
+ Run this once per AI session before processing a WeCom document.
4
+
5
+ ```bash
6
+ wonder update
7
+ wonder --version
8
+ wonder wecom status
9
+ ```
10
+
11
+ Compare `wonder --version` with the version in `SKILL.md`. If they differ, the
12
+ loaded skill text and CLI are out of sync. Stop and tell the user to run
13
+ `/update-5mghost-wonder`, then start a fresh AI session.
14
+
15
+ If `wonder wecom status` reports missing, expired, invalid, 401, or 403, follow
16
+ `cookie-recovery.md`.
17
+
18
+ Do not repeat these checks for every document in the same session unless a
19
+ Wonder command reports an auth/cookie failure.
@@ -0,0 +1,49 @@
1
+ # Verification
2
+
3
+ Verification depends on the path.
4
+
5
+ ## Export-Backed Reads
6
+
7
+ - For sheets, trust structured JSON for text, values, merges, and extracted
8
+ image files.
9
+ - Use PDF rendering when visual layout, colors, screenshots, or image
10
+ relationships matter.
11
+ - For docs/slides, combine text extraction with PDF rendering when layout
12
+ matters.
13
+
14
+ ## Browser Writes
15
+
16
+ Clicking a toolbar button is not success.
17
+
18
+ When export is available:
19
+
20
+ 1. Write a unique marker or make a targeted change.
21
+ 2. Run `wonder read <url> --save <dir>`.
22
+ 3. Inspect the exported DOCX/XLSX/PPTX internals or parsed output.
23
+ 4. Confirm the marker/change carries the expected semantic property.
24
+
25
+ Examples:
26
+
27
+ - DOCX bold uses Word XML run properties such as `<w:b`.
28
+ - DOCX underline uses `<w:u`.
29
+ - Lists use paragraph numbering properties such as `<w:numPr`.
30
+ - Quote-like blocks may show paragraph borders or related paragraph properties.
31
+
32
+ When export is unavailable:
33
+
34
+ 1. Use browser runtime/network evidence.
35
+ 2. Prefer structured editor state over screenshot evidence.
36
+ 3. If only screenshot/OCR proves the change, report `partial`, not `success`.
37
+
38
+ ## No-Export Reads
39
+
40
+ The goal is lossless structured data. Verify each field independently:
41
+
42
+ - text
43
+ - table cell coordinates
44
+ - merge ranges
45
+ - image original resources or URLs
46
+ - image anchors, positions, and sizes
47
+ - floating vs fixed cell images
48
+
49
+ If any field is missing, report exactly which capability is missing.