Repository navigation
feat(table-scan-to-excel): add table scan to Excel UI plugin - #224
Open
ppppp2005-p wants to merge 16 commits into
Open
ppppp2005-p wants to merge 16 commits into
ppppp2005-p wants to merge 16 commits into
Conversation
Author
|
ZCode desktop demo (ZCode 4.0.0, macOS arm64) table-scan-to-excel-demo.mp4Flow shown:
演示流程:本地 marketplace 安装 → |
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
…rop blank line at EOF in xlsx.ts
…rop blank line at EOF in xlsx.ts
…rop blank line at EOF in xlsx.ts
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
table-scan-to-excel(UI Plugin, new)What / 改动内容
New community UI plugin Table Scan to Excel / 扫描表格转 Excel: photo or scan of a table → checked, user-confirmed .xlsx / .csv. The ZCode agent's own vision model reads the image; the plugin adds what a model alone can't guarantee — arithmetic checks, a side-by-side review and a faithful Excel export.
table_scan_open(image): returns the image (≤ 2000 px JPEG) as tool-result image content plus transcription rules (copy verbatim, never calculate, merges, uncertain cells, bounds); opens the panel; reloads an earlier transcription instead of re-reading.table_submit(image, tables): pads ragged rows, checks subtotals against their section and totals against all detail rows (subtotals skipped), finds text in numeric columns, lists uncertain cells; savestables/<image>.tablescan.json; keeps the user's confirmations on re-submission when the cell text is unchanged.table_export(image, format, output?):.xlsx(one sheet per table, bold frozen header rows, merged cells, real numbers with the printed thousands/decimal/percent/bracket format, flagged cells coloured + cell comment) and/or UTF-8-BOM.csv.ui://table-scan-to-excel/panel.html): image (zoom, approximate cell outline from bounds) next to an editable grid with merges; yellow = uncertain / not a number, red = total mismatch; issue list, "Looks right", "Ask the agent" (sends a message on click), save, export. App-only tools:table_save,image_view,workspace_files.Network / API / side effects: local stdio MCP server only; no network, no API keys, no hooks, no command execution. Reads only the chosen image; writes only inside the workspace (
tables/or the given export path). The image goes to the user's ZCode model as a tool result, same as attaching it.Third-party: ExcelJS (MIT; optional
unzipperstubbed), pngjs (MIT), jpeg-js (BSD-3-Clause), MCP SDK / ext-apps (MIT); notices indist/THIRD_PARTY_NOTICES.txt. Test images: self-made purchase list (CC0) and a 1912 Census of India page from Wikimedia Commons (no known copyright restrictions).Tests: vitest over MCP (number parsing incl. full-width/brackets/percent/currency, subtotal + grand total check with a deliberately wrong printed total, ragged rows, text in numeric columns, confirmations, input validation, xlsx values/formats/merges/fills/comments, CSV); Chrome e2e with the official AppBridge host: photographed purchase list → review → confirm → correct the wrong total → export (xlsx verified), plus a real 1912 census scan.
validate.py,build_dist.py,git diff --check,oxlint,tscpass.A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。
Self-check / 自查清单
external_plugins/<name>/categoryis set (productivity)version0.1.0 in bothplugin.jsonandmarketplace.jsonREADME.md(EN) andREADME_CN.md(中文) both provided and equivalentdescription_i18nhas bothenandzh-CNpython3 scripts/validate.pyandpython3 scripts/build_dist.pypass locallytable_scan_open→ side panel → agent transcription viatable_submit(11 rows × 6 cols, 6 merges) → check flagged a total that differs by 10 from the printed sum (kept as printed) →table_exporttotables/purchase-photo.xlsx; demo video in the comments)