@mkterswingman/5mghost-wonder 0.0.13 → 0.0.15

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,91 @@
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 browser read:
34
+
35
+ ```bash
36
+ wonder browser read <url> --save /tmp/wonder-browser-read
37
+ ```
38
+
39
+ This currently attempts text extraction from the browser `opendoc`
40
+ `initialAttributedText`. Treat it as `partial` unless it also proves image and
41
+ table structure.
42
+
43
+ 3. If the read is insufficient, run the evidence probe:
44
+
45
+ ```bash
46
+ wonder browser probe <url> --save /tmp/wonder-browser-probe
47
+ ```
48
+
49
+ Use `--headed` only when login/debug visibility is needed.
50
+
51
+ 4. If the probe is insufficient, continue with the available browser automation
52
+ runtime.
53
+ 5. Capture non-destructive evidence:
54
+ - page URL and document type
55
+ - visible title
56
+ - loaded script/runtime globals that look like document stores
57
+ - network responses that contain cell text, merge ranges, image metadata, or
58
+ media URLs
59
+ - WebSocket messages if they expose structured document operations
60
+ - screenshots only as a fallback or visual cross-check
61
+ 6. For tables, specifically look for:
62
+ - cell coordinates
63
+ - displayed text
64
+ - merge ranges
65
+ - row/column sizes if available
66
+ - fixed cell images
67
+ - floating images with position, size, and anchor
68
+ 7. For image-heavy docs, verify whether each image can be fetched as an original
69
+ resource or only appears in a raster screenshot.
70
+ 8. Report `pass`, `partial`, or `fail` with the missing fields.
71
+
72
+ ## Output Contract
73
+
74
+ Return a concise result:
75
+
76
+ ```json
77
+ {
78
+ "mode": "browser-no-export",
79
+ "status": "pass|partial|fail",
80
+ "textAvailable": true,
81
+ "tablesAvailable": true,
82
+ "mergeRangesAvailable": true,
83
+ "imagesAvailable": true,
84
+ "imageAnchorsAvailable": true,
85
+ "evidence": ["runtime-store", "network-response", "websocket", "screenshot"],
86
+ "missing": []
87
+ }
88
+ ```
89
+
90
+ If the user asked for an answer, answer only from fields that are backed by
91
+ 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.