wezard 2.9.0 → 3.0.2
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/CLAUDE.md +43 -21
- package/README.md +37 -50
- package/cli/wezard.sh +59 -20
- package/config.example.jsonc +5 -8
- package/dist/cli/audit.js +11 -13
- package/dist/cli/audit.js.map +1 -1
- package/dist/cli/codex-hook.js +20 -17
- package/dist/cli/codex-hook.js.map +1 -1
- package/dist/cli/ext.js +271 -0
- package/dist/cli/ext.js.map +1 -0
- package/dist/cli/init.js +44 -13
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/skills.js +113 -0
- package/dist/cli/skills.js.map +1 -0
- package/dist/cli/sync.js +3 -2
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/wx.js +7 -6
- package/dist/cli/wx.js.map +1 -1
- package/dist/daemon/aibot-media.js +28 -20
- package/dist/daemon/aibot-media.js.map +1 -1
- package/dist/daemon/apprentice.js +75 -0
- package/dist/daemon/apprentice.js.map +1 -0
- package/dist/daemon/approval.js +75 -33
- package/dist/daemon/approval.js.map +1 -1
- package/dist/daemon/channel-context.js +7 -0
- package/dist/daemon/channel-context.js.map +1 -1
- package/dist/daemon/channel-onboarding.js +61 -0
- package/dist/daemon/channel-onboarding.js.map +1 -0
- package/dist/daemon/channel-posts.js +93 -0
- package/dist/daemon/channel-posts.js.map +1 -0
- package/dist/daemon/channel-rebind.js +100 -0
- package/dist/daemon/channel-rebind.js.map +1 -0
- package/dist/daemon/channel-store.js.map +1 -1
- package/dist/daemon/channel.js +273 -409
- package/dist/daemon/channel.js.map +1 -1
- package/dist/daemon/chat-name.js +24 -161
- package/dist/daemon/chat-name.js.map +1 -1
- package/dist/daemon/claim.js +1 -45
- package/dist/daemon/claim.js.map +1 -1
- package/dist/daemon/classes.js +416 -0
- package/dist/daemon/classes.js.map +1 -0
- package/dist/daemon/config-api.js +6 -30
- package/dist/daemon/config-api.js.map +1 -1
- package/dist/daemon/control-socket.js +93 -0
- package/dist/daemon/control-socket.js.map +1 -0
- package/dist/daemon/danger-scrub.js +315 -0
- package/dist/daemon/danger-scrub.js.map +1 -0
- package/dist/daemon/danger.js +146 -16
- package/dist/daemon/danger.js.map +1 -1
- package/dist/daemon/detail.js +50 -22
- package/dist/daemon/detail.js.map +1 -1
- package/dist/daemon/exec-surface.js +108 -0
- package/dist/daemon/exec-surface.js.map +1 -0
- package/dist/daemon/external.js +595 -0
- package/dist/daemon/external.js.map +1 -0
- package/dist/daemon/handoff.js +51 -50
- package/dist/daemon/handoff.js.map +1 -1
- package/dist/daemon/http.js +119 -31
- package/dist/daemon/http.js.map +1 -1
- package/dist/daemon/idle-reap.js +30 -0
- package/dist/daemon/idle-reap.js.map +1 -0
- package/dist/daemon/inbound.js +436 -207
- package/dist/daemon/inbound.js.map +1 -1
- package/dist/daemon/index.js +3353 -2760
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/last-response.js +51 -25
- package/dist/daemon/last-response.js.map +1 -1
- package/dist/daemon/legacy-panes.js +67 -0
- package/dist/daemon/legacy-panes.js.map +1 -0
- package/dist/daemon/mcp-http.js.map +1 -1
- package/dist/daemon/me-room.js +137 -0
- package/dist/daemon/me-room.js.map +1 -0
- package/dist/daemon/media.js +14 -0
- package/dist/daemon/media.js.map +1 -1
- package/dist/daemon/memory-steward.js +1 -1
- package/dist/daemon/memory-steward.js.map +1 -1
- package/dist/daemon/message-format.js +15 -2
- package/dist/daemon/message-format.js.map +1 -1
- package/dist/daemon/mirror-bridge.js +583 -488
- package/dist/daemon/mirror-bridge.js.map +1 -1
- package/dist/daemon/mirror-store.js +24 -0
- package/dist/daemon/mirror-store.js.map +1 -1
- package/dist/daemon/notices.js +5 -6
- package/dist/daemon/notices.js.map +1 -1
- package/dist/daemon/onboarding.js +459 -0
- package/dist/daemon/onboarding.js.map +1 -0
- package/dist/daemon/outbound.js +21 -11
- package/dist/daemon/outbound.js.map +1 -1
- package/dist/daemon/peers.js +39 -231
- package/dist/daemon/peers.js.map +1 -1
- package/dist/daemon/plan-http.js +2 -3
- package/dist/daemon/plan-http.js.map +1 -1
- package/dist/daemon/plans.js.map +1 -1
- package/dist/daemon/reach.js +1 -5
- package/dist/daemon/reach.js.map +1 -1
- package/dist/daemon/room-auto-adhoc.js +18 -0
- package/dist/daemon/room-auto-adhoc.js.map +1 -0
- package/dist/daemon/room-bind.js +297 -0
- package/dist/daemon/room-bind.js.map +1 -0
- package/dist/daemon/room-facts.js +35 -0
- package/dist/daemon/room-facts.js.map +1 -0
- package/dist/daemon/room-hub.js +569 -0
- package/dist/daemon/room-hub.js.map +1 -0
- package/dist/daemon/room-overdue.js +160 -0
- package/dist/daemon/room-overdue.js.map +1 -0
- package/dist/daemon/room-prune.js +74 -0
- package/dist/daemon/room-prune.js.map +1 -0
- package/dist/daemon/room-spawn.js +20 -0
- package/dist/daemon/room-spawn.js.map +1 -0
- package/dist/daemon/room-watchdog.js +175 -0
- package/dist/daemon/room-watchdog.js.map +1 -0
- package/dist/daemon/rooms.js +204 -0
- package/dist/daemon/rooms.js.map +1 -0
- package/dist/daemon/route.js +7 -18
- package/dist/daemon/route.js.map +1 -1
- package/dist/daemon/session-scan.js +1 -1
- package/dist/daemon/session-scan.js.map +1 -1
- package/dist/daemon/short-id-log.js +43 -0
- package/dist/daemon/short-id-log.js.map +1 -0
- package/dist/daemon/spawn-tmux.js +60 -45
- package/dist/daemon/spawn-tmux.js.map +1 -1
- package/dist/daemon/steward-guard.js +3 -3
- package/dist/daemon/steward-guard.js.map +1 -1
- package/dist/daemon/steward-model.js +17 -3
- package/dist/daemon/steward-model.js.map +1 -1
- package/dist/daemon/steward-repair.js +171 -0
- package/dist/daemon/steward-repair.js.map +1 -0
- package/dist/daemon/steward.js +171 -0
- package/dist/daemon/steward.js.map +1 -0
- package/dist/daemon/tasks.js +4 -14
- package/dist/daemon/tasks.js.map +1 -1
- package/dist/daemon/tool-face.js +31 -0
- package/dist/daemon/tool-face.js.map +1 -0
- package/dist/daemon/turn-opening.js +30 -0
- package/dist/daemon/turn-opening.js.map +1 -0
- package/dist/daemon/wake-tail.js +55 -0
- package/dist/daemon/wake-tail.js.map +1 -0
- package/dist/daemon/weixin-cmd.js +10 -14
- package/dist/daemon/weixin-cmd.js.map +1 -1
- package/dist/daemon/wezard-session.js +6 -2
- package/dist/daemon/wezard-session.js.map +1 -1
- package/dist/daemon/wizard-memory.js +4 -10
- package/dist/daemon/wizard-memory.js.map +1 -1
- package/dist/daemon/wizard-names.js +0 -22
- package/dist/daemon/wizard-names.js.map +1 -1
- package/dist/daemon/wizard.js +683 -159
- package/dist/daemon/wizard.js.map +1 -1
- package/dist/daemon/ws.js +1 -1
- package/dist/daemon/ws.js.map +1 -1
- package/dist/mcp/output.js +30 -7
- package/dist/mcp/output.js.map +1 -1
- package/dist/mcp/relay.js +152 -0
- package/dist/mcp/relay.js.map +1 -0
- package/dist/mcp/tools.js +318 -265
- package/dist/mcp/tools.js.map +1 -1
- package/dist/shared/allow-rules.js +1 -7
- package/dist/shared/allow-rules.js.map +1 -1
- package/dist/shared/charter-rearm.js +179 -0
- package/dist/shared/charter-rearm.js.map +1 -0
- package/dist/shared/chat-http.js +412 -480
- package/dist/shared/chat-http.js.map +1 -1
- package/dist/shared/chat-record.js +55 -0
- package/dist/shared/chat-record.js.map +1 -0
- package/dist/shared/chat-render.js +7 -4
- package/dist/shared/chat-render.js.map +1 -1
- package/dist/shared/chat-view.js +2 -41
- package/dist/shared/chat-view.js.map +1 -1
- package/dist/shared/cli-backends.js +13 -5
- package/dist/shared/cli-backends.js.map +1 -1
- package/dist/shared/cli-local-status.js +28 -0
- package/dist/shared/cli-local-status.js.map +1 -0
- package/dist/shared/cli-socket.js +14 -0
- package/dist/shared/cli-socket.js.map +1 -0
- package/dist/shared/codex-hooks.js +5 -2
- package/dist/shared/codex-hooks.js.map +1 -1
- package/dist/shared/config.js +90 -66
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/daemon-addr.js +23 -0
- package/dist/shared/daemon-addr.js.map +1 -0
- package/dist/shared/daemon-client.js +41 -0
- package/dist/shared/daemon-client.js.map +1 -0
- package/dist/shared/daemon-token.js +2 -2
- package/dist/shared/daemon-token.js.map +1 -1
- package/dist/shared/detail-render.js +98 -21
- package/dist/shared/detail-render.js.map +1 -1
- package/dist/shared/detail-store.js.map +1 -1
- package/dist/shared/external.js +402 -0
- package/dist/shared/external.js.map +1 -0
- package/dist/shared/group-members.js +35 -0
- package/dist/shared/group-members.js.map +1 -0
- package/dist/shared/inject-view.js +143 -0
- package/dist/shared/inject-view.js.map +1 -0
- package/dist/shared/instance-id.js +21 -0
- package/dist/shared/instance-id.js.map +1 -0
- package/dist/shared/legacy-routes.js +199 -0
- package/dist/shared/legacy-routes.js.map +1 -0
- package/dist/shared/mem-guard.js +32 -0
- package/dist/shared/mem-guard.js.map +1 -0
- package/dist/shared/message-footer.js +11 -3
- package/dist/shared/message-footer.js.map +1 -1
- package/dist/shared/model-tiers.js +39 -1
- package/dist/shared/model-tiers.js.map +1 -1
- package/dist/shared/ports.js +56 -0
- package/dist/shared/ports.js.map +1 -0
- package/dist/shared/reminder.js +30 -38
- package/dist/shared/reminder.js.map +1 -1
- package/dist/shared/role-render.js +210 -210
- package/dist/shared/role-render.js.map +1 -1
- package/dist/shared/role-view.js +65 -300
- package/dist/shared/role-view.js.map +1 -1
- package/dist/shared/room-label.js +13 -0
- package/dist/shared/room-label.js.map +1 -0
- package/dist/shared/room-migrate.js +404 -0
- package/dist/shared/room-migrate.js.map +1 -0
- package/dist/shared/room-overdue.js +153 -0
- package/dist/shared/room-overdue.js.map +1 -0
- package/dist/shared/room-search.js +102 -0
- package/dist/shared/room-search.js.map +1 -0
- package/dist/shared/room-view.js +275 -0
- package/dist/shared/room-view.js.map +1 -0
- package/dist/shared/room.js +827 -0
- package/dist/shared/room.js.map +1 -0
- package/dist/shared/session-hooks.js +20 -8
- package/dist/shared/session-hooks.js.map +1 -1
- package/dist/shared/session-label.js +82 -84
- package/dist/shared/session-label.js.map +1 -1
- package/dist/shared/session-mcp.js +36 -40
- package/dist/shared/session-mcp.js.map +1 -1
- package/dist/shared/session-skills.js +8 -0
- package/dist/shared/session-skills.js.map +1 -1
- package/dist/shared/skill-sync.js +229 -0
- package/dist/shared/skill-sync.js.map +1 -0
- package/dist/shared/smarts.js +24 -0
- package/dist/shared/smarts.js.map +1 -0
- package/dist/shared/stream-page.js +22 -0
- package/dist/shared/stream-page.js.map +1 -0
- package/dist/shared/task-file.js +0 -5
- package/dist/shared/task-file.js.map +1 -1
- package/dist/shared/task-template.js +1 -1
- package/dist/shared/task-template.js.map +1 -1
- package/dist/shared/tool-hints.js +20 -11
- package/dist/shared/tool-hints.js.map +1 -1
- package/dist/shared/workspace-trust.js +8 -0
- package/dist/shared/workspace-trust.js.map +1 -1
- package/dist/shared/world.js +101 -166
- package/dist/shared/world.js.map +1 -1
- package/dist/svr/facts-store.js +26 -0
- package/dist/svr/facts-store.js.map +1 -0
- package/dist/svr/index.js +114 -16
- package/dist/svr/index.js.map +1 -1
- package/hooks/pre-tool-use.sh +14 -10
- package/hooks/stop.sh +28 -0
- package/launchd/com.wezard.svr.plist.template +2 -0
- package/package.json +9 -2
- package/scripts/install.sh +23 -0
- package/skills/LICENSE.wecom-unified.txt +21 -0
- package/skills/wecom-unified/SKILL.md +151 -0
- package/skills/wecom-unified/assets/templates/broadside/DESIGN.preset.md +172 -0
- package/skills/wecom-unified/assets/templates/broadside/shell/content.jsx +31 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/01_cover.slide +48 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/02_section.slide +58 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/03_cards.slide +53 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/04_image.slide +64 -0
- package/skills/wecom-unified/assets/templates/cartesian/DESIGN.preset.md +139 -0
- package/skills/wecom-unified/assets/templates/cartesian/shell/content.jsx +28 -0
- package/skills/wecom-unified/assets/templates/cartesian/slides/01_cover.slide +44 -0
- package/skills/wecom-unified/assets/templates/cartesian/slides/02_compare.slide +79 -0
- package/skills/wecom-unified/assets/templates/cartesian/slides/03_table.slide +79 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/DESIGN.preset.md +118 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/shell/content.jsx +24 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/slides/01_cover.slide +61 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/slides/02_structure.slide +85 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/slides/03_data.slide +60 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/DESIGN.preset.md +135 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/shell/content.jsx +19 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/01_cover.slide +29 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/02_cards.slide +60 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/03_data.slide +49 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/04_image.slide +46 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/DESIGN.preset.md +119 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/shell/content.jsx +18 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/01_cover.slide +36 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/02_section.slide +39 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/03_data.slide +79 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/04_steps.slide +53 -0
- package/skills/wecom-unified/assets/templates/grove/DESIGN.preset.md +159 -0
- package/skills/wecom-unified/assets/templates/grove/shell/content.jsx +18 -0
- package/skills/wecom-unified/assets/templates/grove/shell/content_light.jsx +18 -0
- package/skills/wecom-unified/assets/templates/grove/slides/01_cover.slide +26 -0
- package/skills/wecom-unified/assets/templates/grove/slides/02_compare.slide +92 -0
- package/skills/wecom-unified/assets/templates/grove/slides/03_table.slide +68 -0
- package/skills/wecom-unified/assets/templates/index.json +280 -0
- package/skills/wecom-unified/assets/templates/long-table/DESIGN.preset.md +135 -0
- package/skills/wecom-unified/assets/templates/long-table/shell/content.jsx +36 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/01_cover.slide +71 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/02_cards.slide +72 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/03_timeline.slide +81 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/04_image.slide +60 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/DESIGN.preset.md +121 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/shell/content.jsx +13 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/01_cover.slide +54 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/02_products.slide +134 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/03_section.slide +30 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/04_schedule.slide +65 -0
- package/skills/wecom-unified/assets/templates/signal/DESIGN.preset.md +121 -0
- package/skills/wecom-unified/assets/templates/signal/shell/content.jsx +18 -0
- package/skills/wecom-unified/assets/templates/signal/shell/content_dark.jsx +23 -0
- package/skills/wecom-unified/assets/templates/signal/slides/01_cover.slide +48 -0
- package/skills/wecom-unified/assets/templates/signal/slides/02_cards.slide +67 -0
- package/skills/wecom-unified/assets/templates/signal/slides/03_data.slide +68 -0
- package/skills/wecom-unified/references/wecomcli-calendar-agenda.md +227 -0
- package/skills/wecom-unified/references/wecomcli-calendar-cancel.md +108 -0
- package/skills/wecom-unified/references/wecomcli-calendar-create.md +238 -0
- package/skills/wecom-unified/references/wecomcli-calendar-freebusy.md +207 -0
- package/skills/wecom-unified/references/wecomcli-calendar-meeting-room.md +170 -0
- package/skills/wecom-unified/references/wecomcli-calendar-search.md +209 -0
- package/skills/wecom-unified/references/wecomcli-calendar-update.md +272 -0
- package/skills/wecom-unified/references/wecomcli-calendar.md +296 -0
- package/skills/wecom-unified/references/wecomcli-contact.md +48 -0
- package/skills/wecom-unified/references/wecomcli-disk.md +380 -0
- package/skills/wecom-unified/references/wecomcli-doc-contents-append.md +20 -0
- package/skills/wecom-unified/references/wecomcli-doc-contents-overwrite.md +27 -0
- package/skills/wecom-unified/references/wecomcli-doc-create.md +162 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage-doc-members-update.md +24 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage-doc-names-update.md +20 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage-doc-rules-update.md +22 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage.md +127 -0
- package/skills/wecom-unified/references/wecomcli-doc.md +135 -0
- package/skills/wecom-unified/references/wecomcli-email-forward-mail.md +131 -0
- package/skills/wecom-unified/references/wecomcli-email-get-mail.md +187 -0
- package/skills/wecom-unified/references/wecomcli-email-reply-mail.md +138 -0
- package/skills/wecom-unified/references/wecomcli-email-search-mail.md +114 -0
- package/skills/wecom-unified/references/wecomcli-email-security.md +52 -0
- package/skills/wecom-unified/references/wecomcli-email-send-mail.md +186 -0
- package/skills/wecom-unified/references/wecomcli-email-send-schedule.md +83 -0
- package/skills/wecom-unified/references/wecomcli-email.md +206 -0
- package/skills/wecom-unified/references/wecomcli-media.md +89 -0
- package/skills/wecom-unified/references/wecomcli-meeting-cancel.md +113 -0
- package/skills/wecom-unified/references/wecomcli-meeting-create.md +167 -0
- package/skills/wecom-unified/references/wecomcli-meeting-list.md +228 -0
- package/skills/wecom-unified/references/wecomcli-meeting-original-get.md +101 -0
- package/skills/wecom-unified/references/wecomcli-meeting-search.md +176 -0
- package/skills/wecom-unified/references/wecomcli-meeting-update.md +217 -0
- package/skills/wecom-unified/references/wecomcli-meeting.md +366 -0
- package/skills/wecom-unified/references/wecomcli-message.md +190 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-animation.md +62 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-box.md +102 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-chart.md +261 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-codeblock.md +70 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-diagram.md +54 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-faicon.md +71 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-hyperlink.md +55 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-image.md +107 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-math.md +65 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-qrcode.md +22 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-slide.md +74 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-svg.md +95 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-table.md +72 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-text.md +96 -0
- package/skills/wecom-unified/references/wecomcli-pptx-content-contract.md +73 -0
- package/skills/wecom-unified/references/wecomcli-pptx-create-from-material.md +67 -0
- package/skills/wecom-unified/references/wecomcli-pptx-create-from-scratch.md +178 -0
- package/skills/wecom-unified/references/wecomcli-pptx-create-from-template.md +123 -0
- package/skills/wecom-unified/references/wecomcli-pptx-design-principle.md +65 -0
- package/skills/wecom-unified/references/wecomcli-pptx-government-contract.md +40 -0
- package/skills/wecom-unified/references/wecomcli-pptx-human-alignment.md +140 -0
- package/skills/wecom-unified/references/wecomcli-pptx-pptx-api.md +161 -0
- package/skills/wecom-unified/references/wecomcli-pptx-pptx-edit.md +37 -0
- package/skills/wecom-unified/references/wecomcli-pptx-story-principle.md +184 -0
- package/skills/wecom-unified/references/wecomcli-pptx-templates-README.md +165 -0
- package/skills/wecom-unified/references/wecomcli-pptx-templates-anti-ai-slop.md +52 -0
- package/skills/wecom-unified/references/wecomcli-pptx.md +158 -0
- package/skills/wecom-unified/references/wecomcli-sheet-conditional-formatting.md +203 -0
- package/skills/wecom-unified/references/wecomcli-sheet-filter.md +179 -0
- package/skills/wecom-unified/references/wecomcli-sheet-float-image.md +235 -0
- package/skills/wecom-unified/references/wecomcli-sheet-formulas.md +71 -0
- package/skills/wecom-unified/references/wecomcli-sheet-history.md +118 -0
- package/skills/wecom-unified/references/wecomcli-sheet-protection.md +170 -0
- package/skills/wecom-unified/references/wecomcli-sheet-range-operations.md +306 -0
- package/skills/wecom-unified/references/wecomcli-sheet-read-data.md +151 -0
- package/skills/wecom-unified/references/wecomcli-sheet-search-replace.md +121 -0
- package/skills/wecom-unified/references/wecomcli-sheet-structure-operations.md +394 -0
- package/skills/wecom-unified/references/wecomcli-sheet-style.md +246 -0
- package/skills/wecom-unified/references/wecomcli-sheet-table-style.md +199 -0
- package/skills/wecom-unified/references/wecomcli-sheet-validation.md +217 -0
- package/skills/wecom-unified/references/wecomcli-sheet-visual-standards.md +166 -0
- package/skills/wecom-unified/references/wecomcli-sheet-workbook.md +264 -0
- package/skills/wecom-unified/references/wecomcli-sheet-write-cells.md +320 -0
- package/skills/wecom-unified/references/wecomcli-sheet-xlsx-process.md +324 -0
- package/skills/wecom-unified/references/wecomcli-sheet.md +96 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-data-driven-pages.md +50 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-edit.md +526 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-arraylist.md +369 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-datetime.md +283 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-logic.md +247 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-math.md +362 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-operators.md +246 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-pageblock.md +76 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-reference.md +192 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-templates.md +410 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-text.md +377 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-user.md +22 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-mdx-syntax.md +739 -0
- package/skills/wecom-unified/references/wecomcli-smartpage.md +179 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-chart-types.md +95 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-common.md +160 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-edit.md +609 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-field-types.md +438 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-formula.md +845 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-read.md +411 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-record-values.md +218 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-ai_efficiency.md +709 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-connect_to_app.md +380 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-financial_accounting.md +369 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-hr_and_administration.md +475 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-ledger_records.md +156 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-manufacturing.md +395 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-marketing.md +186 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-office_essentials.md +299 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-personal_efficiency.md +70 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-procurement_logistics.md +325 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-project_management.md +564 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_customer.md +222 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_ops.md +105 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_project.md +109 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_research.md +92 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-sales_and_operations.md +446 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-store_management.md +431 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-team_tasks.md +274 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-wechat_customer.md +384 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-work_report.md +100 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-templates.md +53 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-view-types.md +373 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-webhook-examples.md +176 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-webhook.md +186 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet.md +147 -0
- package/skills/wecom-unified/references/wecomcli-todo-create.md +137 -0
- package/skills/wecom-unified/references/wecomcli-todo-delete.md +63 -0
- package/skills/wecom-unified/references/wecomcli-todo-finish.md +72 -0
- package/skills/wecom-unified/references/wecomcli-todo-get.md +69 -0
- package/skills/wecom-unified/references/wecomcli-todo-list.md +136 -0
- package/skills/wecom-unified/references/wecomcli-todo-update.md +112 -0
- package/skills/wecom-unified/references/wecomcli-todo.md +68 -0
- package/skills/wecom-unified/scripts/build_docx.py +1274 -0
- package/skills/wecom-unified/scripts/build_page.py +2449 -0
- package/skills/wecom-unified/scripts/collect.py +868 -0
- package/skills/wecom-unified/scripts/doc_image_extractor.py +498 -0
- package/skills/wecom-unified/scripts/pptx2image.py +268 -0
- package/skills/wecom-unified/scripts/recalc.py +403 -0
- package/systemd/wezard-svr.service.template +2 -0
- package/systemd/wezard.service.template +6 -0
- package/web/chat.css +70 -273
- package/web/chat.js +2269 -2190
- package/dist/daemon/bot-mux.js +0 -161
- package/dist/daemon/bot-mux.js.map +0 -1
- package/dist/daemon/chat-log.js +0 -130
- package/dist/daemon/chat-log.js.map +0 -1
- package/dist/daemon/dispatch.js +0 -6
- package/dist/daemon/dispatch.js.map +0 -1
- package/dist/daemon/idle-nudge.js +0 -90
- package/dist/daemon/idle-nudge.js.map +0 -1
- package/dist/daemon/message-events.js +0 -1155
- package/dist/daemon/message-events.js.map +0 -1
- package/dist/daemon/pending-items.js +0 -160
- package/dist/daemon/pending-items.js.map +0 -1
- package/dist/daemon/router.js +0 -742
- package/dist/daemon/router.js.map +0 -1
- package/dist/daemon/tips.js +0 -25
- package/dist/daemon/tips.js.map +0 -1
- package/dist/daemon/wedoc.js +0 -210
- package/dist/daemon/wedoc.js.map +0 -1
- package/dist/shared/role-search.js +0 -100
- package/dist/shared/role-search.js.map +0 -1
- package/dist/shared/startup-notice.js +0 -21
- package/dist/shared/startup-notice.js.map +0 -1
- package/dist/shared/turn-state.js +0 -27
- package/dist/shared/turn-state.js.map +0 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# 读取表格数据
|
|
2
|
+
|
|
3
|
+
## 前置必做
|
|
4
|
+
|
|
5
|
+
### 获取工作簿全局结构
|
|
6
|
+
|
|
7
|
+
读取 `wecomcli-sheet-workbook.md`,通过 `wecom-cli sheet workbook get` 获取全部子表的 `sheet_id`、名称和范围。后续读取优先使用稳定的 `sheet_id`。
|
|
8
|
+
|
|
9
|
+
- 用户明确指定唯一子表,且全部要求均可由该子表回答时,可只读取该子表;
|
|
10
|
+
- 用户只提供工作簿链接、使用“这张表/整个表格/全部数据”等工作簿级表达,或一次要求多个不同指标时,不得默认第一个业务子表就是唯一数据源;
|
|
11
|
+
- 无法唯一确定目标子表,且不同选择会改变结果时,先向用户确认;能够通过字段、分类值或记录内容定位时,先读取 `wecomcli-sheet-search-replace.md`,依据 `workbook get` 的子表清单,对每个相关子表分别调用 `wecom-cli sheet cells find`(每次必须传单个 `sheet`)定位,不要先追问。
|
|
12
|
+
|
|
13
|
+
### 探查候选子表结构
|
|
14
|
+
|
|
15
|
+
将候选子表的 `sheets[].range` 作为探查上界,按以下规则预读数据:
|
|
16
|
+
|
|
17
|
+
- **必须读取公式**:结构探查必须使用 `cells get` 并传入 `include:["formula"]`;不得使用与 `include` 互斥的 `csv` 模式探查,否则无法识别公式列;
|
|
18
|
+
- 总行数不超过 20 行时,读取全部数据;
|
|
19
|
+
- 总行数超过 20 行时,首次至少读取前 20 行;预读范围必须覆盖完整列跨度。例如工作簿返回 `A1:Z301`,首次探查至少为 `A1:Z20`;
|
|
20
|
+
|
|
21
|
+
根据预读数据判断表头位置和数据展开方向,不要默认第一行就是表头:
|
|
22
|
+
|
|
23
|
+
- **横向表头**:字段位于前一行或前几行,数据按行向下展开;
|
|
24
|
+
- **纵向表头**:字段、指标或分类位于前一列或前几列,数据按列向右展开;
|
|
25
|
+
- **交叉表头**:前几行和前几列共同构成表头,数据由行标签与列标签的交点定位;
|
|
26
|
+
- **多级表头**:一个字段可能由多行或多列标签共同表达,需要结合上下级标签理解完整含义。
|
|
27
|
+
|
|
28
|
+
同时区分表格标题、说明、单位、空行空列、父级分组行、汇总行与真正的字段标签和明细记录。结合相邻数据的类型和分布确定表头边界、数据起始位置和记录粒度。
|
|
29
|
+
|
|
30
|
+
写入任务中,必须根据上述带 `include:["formula"]` 的预读结果识别公式列;仅有单元格值的探查结果不能用于判断。后续新增或补写公式列时,沿用相邻记录的公式结构并调整相对引用,禁止自行计算后写入静态值。公式写入与校验按 `wecomcli-sheet-write-cells.md` 执行。
|
|
31
|
+
|
|
32
|
+
### 映射字段并确定实际读取范围
|
|
33
|
+
|
|
34
|
+
根据识别出的表头,将用户提到的字段、时间、人员、分类或指标映射到实际行列,计算最终 A1 `range`:
|
|
35
|
+
|
|
36
|
+
- 20 行数据不足以判断表头、记录粒度或目标标签时,沿数据展开方向继续扩大探查范围;
|
|
37
|
+
- 需要完整统计时,读取范围必须覆盖全部参与计算的记录和字段,不能只读取样本;
|
|
38
|
+
- 多轮对话中出现新字段、新维度、新时间范围、新分类或新指标时,重新执行需求覆盖检查。当前子表无法覆盖新增要求时,重新做工作簿级定位,不得机械复用上一轮的 `sheet_id`、缓存文件或读取范围。
|
|
39
|
+
|
|
40
|
+
## 先判断:局部查询还是完整统计
|
|
41
|
+
|
|
42
|
+
| 任务类型 | 典型请求 | 完整性要求 | 数据获取方式 |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| 已知小范围局部查询 | 查看 `B2:D10`、读取已定位记录的相邻列、确认某个单元格值 | 只需覆盖明确 A1 范围 | 可用 `cells get` |
|
|
45
|
+
| 结构探查 | 识别表头、字段列、数据展开方向、记录粒度 | 只需样本,不得输出完整统计结论 | 用 `cells get` 小范围采样 |
|
|
46
|
+
| 完整统计分析 | 实际多少行/人数/订单数、计数、分组、汇总、去重、排序、TopN、占比、趋势、跨子表比较、完整列表 | 必须覆盖全部参与计算的记录 | 按下方当前环境对应的“完整统计执行流程”处理 |
|
|
47
|
+
|
|
48
|
+
**硬门禁**:只要结论会因漏掉任意后续记录而变化,就属于完整统计分析。
|
|
49
|
+
|
|
50
|
+
## 读取单元格数据
|
|
51
|
+
|
|
52
|
+
### 命令
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
wecom-cli sheet cells get --json '<JSON 参数>'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 参数
|
|
59
|
+
|
|
60
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
61
|
+
|---|---|---|---|
|
|
62
|
+
| `docid` | string | 是 | 工作簿定位 |
|
|
63
|
+
| `sheet` | string | 是 | 子表 ID 或名称;大表和自动化任务优先传子表 ID |
|
|
64
|
+
| `range` | string | 否 | 纯 A1 区域,如 `A1:B3`;大表读取必须显式传入分批后的范围 |
|
|
65
|
+
| `include` | array(string) | 否 | 要额外返回的维度,可任意组合:`formula` / `style` |
|
|
66
|
+
| `csv` | bool | 否 | 以 CSV 文本返回;与 `include` 互斥 |
|
|
67
|
+
|
|
68
|
+
> 当前协议没有定义省略 `range` 时的精确读取边界。需要完整读取子表时,先通过 `wecomcli-sheet-workbook.md` 获取 `sheets[].range`,再自行分批读取,不要直接省略 `range`。
|
|
69
|
+
|
|
70
|
+
### 返回
|
|
71
|
+
|
|
72
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
73
|
+
|---|---|---|-------------------------------------------------|
|
|
74
|
+
| `cells` | array(2D) | 条件 | 2D 单元格数组;未截断时维度与请求区域一致,截断时维度与 `actual_range` 一致 |
|
|
75
|
+
| `csv_data` | string | 条件 | CSV 文本(`csv=true` 时返回,此时不返回 `cells`) |
|
|
76
|
+
| `actual_range` | string | 否 | 实际读取的区域 A1 |
|
|
77
|
+
| `truncated` | bool | 否 | 是否因单次读取上限而截断(单次读区上限 8,000 格) |
|
|
78
|
+
|
|
79
|
+
### `cells` 中的单元格格式
|
|
80
|
+
|
|
81
|
+
`cells` 是二维数组,每个元素为一个 `Cell` 对象;无内容或未请求的字段会省略。
|
|
82
|
+
|
|
83
|
+
| 字段 | 类型 | 说明 |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `value` | any | 单元格值,自动推断类型 |
|
|
86
|
+
| `formula` | string | 公式,仅在 `include` 包含 `formula` 时返回 |
|
|
87
|
+
| `link` / `link_text` | string | 超链接 URL / 展示文本 |
|
|
88
|
+
| `image` | string | 图片 URL |
|
|
89
|
+
| `rich_string` | array | 富文本分段,按顺序组成单元格内容 |
|
|
90
|
+
| `style` | object | 单元格样式,仅在 `include` 包含 `style` 时返回 |
|
|
91
|
+
|
|
92
|
+
`rich_string` 的每段使用 `value` 表示文本,或使用 `link` + `link_text` 表示链接,可带独立的 `style`。
|
|
93
|
+
|
|
94
|
+
`style` 可能包含:
|
|
95
|
+
|
|
96
|
+
- 字体:`font_family`、`font_size`、`bold`、`italic`、`underline`、`strike`、`font_color`
|
|
97
|
+
- 单元格:`bg_color`、`horizontal_align`、`vertical_align`、`wrap`
|
|
98
|
+
- 数字显示:`number_format`(Excel 格式代码)
|
|
99
|
+
|
|
100
|
+
颜色使用 8 位 ARGB hex,如 `"FFFF0000"`;返回对象只包含实际存在的样式字段。
|
|
101
|
+
|
|
102
|
+
### 响应示例(`include: ["formula","style"]`)
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"cells": [
|
|
107
|
+
[{"value": "名称", "style": {"bold": true, "bg_color": "FFFFFF00"}}, {"value": "详情"}],
|
|
108
|
+
[{"value": "苹果"}, {"formula": "=SUM(C2:C10)", "value": 1560, "style": {"number_format": "0.00"}}]
|
|
109
|
+
],
|
|
110
|
+
"actual_range": "A1:B2",
|
|
111
|
+
"truncated": false
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 使用原则
|
|
116
|
+
|
|
117
|
+
- 只看值、不需要公式和样式时,使用 `csv` 模式,减少返回体和模型上下文占用。
|
|
118
|
+
- 需要保留值类型、公式、链接、图片、富文本或样式时,使用 `cells` 模式。
|
|
119
|
+
- `cells get` 的核心用途是局部查询与结构探查;完整统计分析按下方“完整统计执行流程”处理。
|
|
120
|
+
- 原始表格数据不得复制进模型上下文或 Python 命令;脚本应直接读取落盘文件。
|
|
121
|
+
|
|
122
|
+
### 将回包直接落盘
|
|
123
|
+
|
|
124
|
+
需要把 CLI 回包保存为 JSON 文件时,无需先将完整回包载入模型上下文后再另行写入文件:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
wecom-cli sheet cells get --json '<JSON 参数>' --output '<文件路径>'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**落盘格式必须正确理解**:
|
|
131
|
+
|
|
132
|
+
- `--output` 保存的是 CLI 的 **JSON 响应外壳**,不是可直接交给 pandas 的原始 CSV 文件;
|
|
133
|
+
- 请求使用 `"csv":true` 时,真正的表格数据只在 JSON 的 `csv_data` 字段中;必须解析 JSON 后提取 `csv_data`,不能对整个 `.json` 文件执行 `pd.read_csv()`;
|
|
134
|
+
- 未使用 `csv` 模式时,真正的表格数据在 `cells` 字段中;`actual_range` 和 `truncated` 是元数据,不是业务数据;
|
|
135
|
+
- 每个落盘响应都必须先检查 `truncated`。若为 `true`,该文件只含被截断的数据,禁止用于完整统计;
|
|
136
|
+
- 分块读取时,每批单独落盘,并由脚本从各 JSON 文件中提取 `csv_data` 或 `cells` 后按范围顺序合并。
|
|
137
|
+
|
|
138
|
+
## 数据统计分析执行流程
|
|
139
|
+
|
|
140
|
+
1. 基于 `sheets[].range` 预先生成覆盖全部目标行列的分块读取计划,每批不超过 8,000 格;
|
|
141
|
+
2. 每批使用 `--output '<批次文件>.json'` 落盘,并逐批校验 `truncated:false` 与 `actual_range`;
|
|
142
|
+
3. 由脚本直接读取全部批次 JSON,从 `csv_data` 或 `cells` 提取并按范围合并数据,形成数据最终文件;
|
|
143
|
+
4. 编写 Python 脚本对最终数据文件进行统计分析
|
|
144
|
+
5. 校验计划范围无缺口、无重复,所有目标子表均已处理后,才能输出统计结论
|
|
145
|
+
|
|
146
|
+
## 读取与搜索的边界
|
|
147
|
+
|
|
148
|
+
- `cells get` 用于理解表头、读取已知 A1 区域,以及在已定位单元格后读取其所在行或相邻上下文。它不是按内容查找目标位置的接口。
|
|
149
|
+
- 当待查找的目标文本已知,但其所在子表、单元格地址或行号未知时:读取 `wecomcli-sheet-search-replace.md`,使用 `cells find` 定位;每次调用必须传单个 `sheet`。子表未知时,先通过 `workbook get` 获取列表,再逐个搜索相关子表。
|
|
150
|
+
- 分析任务中当前子表缺少所需字段、分类值或记录时,分别对其他相关子表调用 `cells find`,再读取命中位置上下文;不要省略 `sheet` 试图做工作簿级搜索,也不要只扩大当前子表的读取范围。
|
|
151
|
+
- `cells find` 每个子表的分页结果都必须读取到 `next_cursor` 为空;只读取首页或只搜索部分相关子表,不能用于完整统计或工作簿范围的否定结论。
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# 单元格搜索与替换
|
|
2
|
+
|
|
3
|
+
在指定的单个子表中搜索文本命中位置,或在该子表中查找并替换文本。`cells find` 与 `cells replace` 均必须传 `sheet`,一次调用只能作用于一个子表。
|
|
4
|
+
|
|
5
|
+
## 使用场景
|
|
6
|
+
|
|
7
|
+
| 操作需求 | CLI | 说明 |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| 搜索文本并返回命中位置 | `sheet cells find` | 只读搜索,必须指定单个子表 |
|
|
10
|
+
| 在指定区域查找并替换文本 | `sheet cells replace` | 必须指定单个子表;写操作可先用 `dry_run` 预览替换结果 |
|
|
11
|
+
|
|
12
|
+
## 单元格搜索
|
|
13
|
+
|
|
14
|
+
### 命令
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
wecom-cli sheet cells find --json '<JSON>'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 入参
|
|
21
|
+
|
|
22
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
23
|
+
| --- | --- | --- |-----------------------------------------|
|
|
24
|
+
| `docid` | `string` | 是 | 工作簿定位 |
|
|
25
|
+
| `sheet` | `string` | 是 | 单个子表 ID 或名称;不能省略或一次传入多个子表 |
|
|
26
|
+
| `keyword` | `string` | 是 | 搜索关键字 |
|
|
27
|
+
| `range` | `string` | 否 | 限定该子表的纯 A1 区域,不填搜索该子表全部区域 |
|
|
28
|
+
| `match_case` | `bool` | 否 | 大小写敏感,默认 `false` |
|
|
29
|
+
| `match_entire_cell` | `bool` | 否 | 整单元格完整匹配,默认 `false` |
|
|
30
|
+
| `use_regex` | `bool` | 否 | 按正则表达式搜索,默认 `false` |
|
|
31
|
+
| `match_formulas` | `bool` | 否 | 搜索公式字符内容,默认 `false` |
|
|
32
|
+
| `include` | `string[]` | 否 | 是否返回公式内容:`formula` |
|
|
33
|
+
| `cursor` | `string` | 否 | 分页游标。首页传空字符串或不传;后续页传上一页的 `next_cursor` |
|
|
34
|
+
| `limit` | `int32` | 否 | 每页条数,默认 `50`,最大 `100` |
|
|
35
|
+
|
|
36
|
+
### 出参
|
|
37
|
+
|
|
38
|
+
| 字段 | 类型 | 说明 |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| `matches` | `Match[]` | **当前页**命中项,结构见下 |
|
|
41
|
+
| `total` | `int` | 命中总数(**所有页合计**)|
|
|
42
|
+
| `next_cursor` | `string` | 下一页游标。**为空字符串表示已是最后一页** |
|
|
43
|
+
|
|
44
|
+
**`Match` 结构:**
|
|
45
|
+
|
|
46
|
+
| 字段 | 类型 | 说明 |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| `sheet_id` | `string` | 命中所在的子表 ID |
|
|
49
|
+
| `address` | `string` | A1 地址,如 `"A2"` |
|
|
50
|
+
| `cell` | `Cell` | 命中单元格的内容,结构同读写 `Cell`(见 `wecomcli-sheet-write-cells.md` 的 `Cell` 定义)|
|
|
51
|
+
|
|
52
|
+
### 大数据直接落盘
|
|
53
|
+
|
|
54
|
+
支持把回包内容保存为 JSON 文件,无需先将完整回包载入模型上下文后再另行写入文件:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
wecom-cli sheet cells find --json '<JSON 参数>' --output '<文件路径>'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 使用规则
|
|
61
|
+
|
|
62
|
+
- 必须传 `sheet`,只在该子表内搜索;`range` 只限定该子表内的 A1 区域,不能用于跨子表搜索。反例:仅传 `docid` 和 `keyword`、省略 `sheet` 期望搜索整个工作簿。
|
|
63
|
+
- 目标子表未知,或需要在多个子表中查找字段、分类值或记录时:先用 `sheet workbook get` 获取子表列表,再对每个相关子表分别调用 `cells find`,每次传一个 `sheet`。不得将多个子表 ID 填进一次请求;只搜索一个子表未命中,不能断言整个工作簿不存在。
|
|
64
|
+
- `matches` 只代表当前子表的当前页。每个子表存在 `next_cursor` 时持续翻页直到为空;需要全量计数或工作簿范围的否定结论时,汇总所有相关子表的完整结果。
|
|
65
|
+
|
|
66
|
+
### 请求示例
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
wecom-cli sheet cells find --json '{"docid":"e3_ABC123","sheet":"sheet_id_1","keyword":"订单号"}'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 查找替换单元格内容
|
|
73
|
+
|
|
74
|
+
### 命令
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
wecom-cli sheet cells replace --json '<JSON>'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 入参
|
|
81
|
+
|
|
82
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
83
|
+
| --- | --- |----|------------------------------------|
|
|
84
|
+
| `docid` | `string` | 是 | 工作簿定位 |
|
|
85
|
+
| `sheet` | `string` | 是 | 单个子表 ID 或名称;不能省略或一次传入多个子表 |
|
|
86
|
+
| `range` | `string` | 否 | 查找替换的纯 A1 区域,不填默认全子表 |
|
|
87
|
+
| `find_text` | `string` | 是 | 要查找的文本 |
|
|
88
|
+
| `replace_text` | `string` | 是 | 替换后的文本 |
|
|
89
|
+
| `match_case` | `bool` | 否 | 是否区分大小写;`true` 表示区分,默认 `false` |
|
|
90
|
+
| `match_entire_cell` | `bool` | 否 | 是否要求整单元格完整匹配,默认 `false` |
|
|
91
|
+
| `find_in_formula` | `bool` | 否 | 是否匹配公式表达式;`true` 表示匹配公式,默认 `false` |
|
|
92
|
+
| `dry_run` | `bool` | 否 | 预览替换结果但不执行,默认 `false` |
|
|
93
|
+
|
|
94
|
+
### 出参
|
|
95
|
+
|
|
96
|
+
| 字段 | 类型 | 说明 |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `replaced_cells` | `int` | 完成替换的单元格数 |
|
|
99
|
+
| `replacements` | `Replacement[]` | 替换明细,结构见下 |
|
|
100
|
+
| `replacements_truncated` | `bool` | `true` 表示替换明细因数量限制被截断 |
|
|
101
|
+
|
|
102
|
+
**`Replacement` 结构:**
|
|
103
|
+
|
|
104
|
+
| 字段 | 类型 | 说明 |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| `sheet_id` | `string` | 替换所在的子表 ID |
|
|
107
|
+
| `address` | `string` | 被替换单元格的 A1 地址 |
|
|
108
|
+
| `cell` | `string` | 替换后的单元格文本 |
|
|
109
|
+
|
|
110
|
+
### 使用规则
|
|
111
|
+
|
|
112
|
+
- 必须传 `sheet`,一次只替换该子表内的匹配内容;`range` 只限定该子表内的 A1 区域。反例:省略 `sheet` 期望替换整个工作簿,或在一次请求中传入多个子表。
|
|
113
|
+
- 用户要求替换多个子表时,先用 `sheet workbook get` 确认目标子表,再对每个目标子表分别调用 `cells replace`;对每个子表分别预览和核对影响范围,不得默认一次调用覆盖全部子表。
|
|
114
|
+
- 替换是写操作;范围较大或匹配条件可能过宽时,先传 `dry_run=true` 查看影响范围,再正式执行。
|
|
115
|
+
- `find_in_formula=true` 时匹配公式表达式;否则按单元格显示文本查找。
|
|
116
|
+
|
|
117
|
+
### 请求示例
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
wecom-cli sheet cells replace --json '{"docid":"e3_ABC123","sheet":"sheet_id_1","find_text":"旧值","replace_text":"新值","dry_run":true}'
|
|
121
|
+
```
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
# 子表结构与布局操作
|
|
2
|
+
|
|
3
|
+
读取和调整**在线表格某个子表**的整行整列结构、行高列宽和合并单元格。查看工作簿及子表范围请先读 `wecomcli-sheet-workbook.md`;本文覆盖以下结构与布局操作:
|
|
4
|
+
|
|
5
|
+
| 命令 | 风险 | 用途 |
|
|
6
|
+
|------------------------------|---|---|
|
|
7
|
+
| `wecom-cli sheet info get` | 只读 | 读取指定子表的合并范围、行高、列宽 |
|
|
8
|
+
| `wecom-cli sheet dims insert` | 结构写入 | 插入整行或整列 |
|
|
9
|
+
| `wecom-cli sheet dims delete` | 高风险写入 | 删除整行或整列 |
|
|
10
|
+
| `wecom-cli sheet dims move` | 高风险写入 | 移动连续整行或整列 |
|
|
11
|
+
| `wecom-cli sheet dims visible` | 结构写入 | 显示或隐藏连续整行或整列 |
|
|
12
|
+
| `wecom-cli sheet dims resize` | 结构写入 | 调整行高或列宽 |
|
|
13
|
+
| `wecom-cli sheet merge set` | 结构写入 | 合并单元格 |
|
|
14
|
+
| `wecom-cli sheet merge clear` | 高风险写入 | 取消合并 |
|
|
15
|
+
| `wecom-cli sheet merge get` | 只读 | 查询合并范围 |
|
|
16
|
+
|
|
17
|
+
## 通用规则
|
|
18
|
+
|
|
19
|
+
- `docid` 用于定位在线表格;`sheet` 接受子表 ID 或名称,优先按 ID 精确匹配,未命中再按名称匹配。
|
|
20
|
+
- `range`、合并范围等区域参数只写纯 A1 表达式,不得包含子表名。
|
|
21
|
+
- 整行范围写成 `3:7`,整列范围写成 `C:F`;行位置使用 1-based 数字,列位置使用列字母。
|
|
22
|
+
- 结构性写入、高风险写入应先传 `"dry_run":true` 预览影响,确认后再正式执行。
|
|
23
|
+
|
|
24
|
+
## 结构变更前预检
|
|
25
|
+
|
|
26
|
+
插入、删除或移动行列会改变原有坐标和引用关系。执行前按影响范围检查以下内容:
|
|
27
|
+
|
|
28
|
+
1. **检查合并区域**:调用本文件的 `sheet info get` 或 `sheet merge get`,确认目标范围及其相邻区域是否存在合并单元格。
|
|
29
|
+
2. **检查引用影响**:结构变更可能使公式、图表、透视表、条件格式或筛选器的数据源范围发生偏移。若任务涉及这些对象,应先通过对应读取接口检查其引用范围;当前无法完整枚举所有引用时,应明确提示存在潜在影响,不得编造引用数量。
|
|
30
|
+
3. **先预览再执行**:删除、移动等高风险写入先传 `"dry_run":true`,核对目标范围后再正式执行。
|
|
31
|
+
|
|
32
|
+
## 批量结构操作的串行与索引规则
|
|
33
|
+
|
|
34
|
+
当一个用户请求包含多个独立的行列插入、删除或移动操作时,这些操作可能改变后续目标的行号、列号或引用关系,必须按以下规则执行:
|
|
35
|
+
|
|
36
|
+
1. **直接调用时每轮只执行一个结构变更 CLI**:模型直接调用 CLI 时,一次响应中最多调用一个 `sheet dims insert`、`sheet dims delete` 或 `sheet dims move`。禁止在同一轮并发调用多个结构变更 CLI;取得当前调用结果后,下一轮才能继续处理剩余目标。
|
|
37
|
+
2. **插入、删除按索引从大到小执行**:多个行目标按行号从大到小执行,多个列目标按列序从右到左执行。先处理较大索引,避免前面的操作改变剩余较小目标的原始位置。
|
|
38
|
+
3. **连续目标优先合并**:多个相邻行或列应尽量合并为一个连续范围,或使用一次带 `count` 的插入调用;不连续目标才拆成多个串行调用。不得为了减少调用而合并不相邻目标,否则会误处理目标之间的行列。
|
|
39
|
+
4. **每次执行后使用最新结构**:不得让多个调用继续使用操作前缓存的坐标。若前一次操作可能影响剩余目标,应根据返回结果或重新读取的子表范围,校验下一次调用的位置。
|
|
40
|
+
5. **移动操作不得只套用倒序规则**:多个 `dims move` 必须逐个执行,并在每次移动后重新计算剩余操作的源范围和目标位置;源范围、目标位置或中间区域存在重叠时,不得直接连续执行。
|
|
41
|
+
|
|
42
|
+
### 目标较多时使用 Python 串行调用
|
|
43
|
+
|
|
44
|
+
当独立的插入或删除目标较多、逐轮直接调用效率过低时,可以针对当前任务临时生成 Python 脚本批量调用 CLI。Python 只用于串行编排,不改变以上索引规则:
|
|
45
|
+
|
|
46
|
+
- 先合并相邻目标,再将行目标按行号从大到小、列目标按列序从右到左排序。
|
|
47
|
+
- 逐个同步调用 CLI;等待当前调用结束并检查退出状态与返回结果后,才能执行下一个。禁止使用线程池、进程池、`asyncio`、后台进程或其他并发方式。
|
|
48
|
+
- 任意一步失败时立即停止,明确列出已完成、失败和未执行的目标;不得自动重试写操作,也不得从头重跑完整列表。继续处理前,先按最新子表结构重新生成剩余计划。
|
|
49
|
+
- Python 批量串行只适用于可按倒序稳定处理的独立 `dims insert` / `dims delete` 目标。`dims move` 仍须逐步执行,并在每次移动后重新定位,不得按初始坐标写入循环批量执行。
|
|
50
|
+
|
|
51
|
+
示例:删除原始第 3、8、12 行时,按 `12:12` → `8:8` → `3:3` 分轮串行执行;目标较多时也只能由 Python 按该顺序逐个同步调用,不得并发提交。
|
|
52
|
+
|
|
53
|
+
反例:先删除 `3:3`,再按原始索引删除 `8:8`。第 3 行删除后,原第 8 行已变为第 7 行,后续操作会删除错误行。
|
|
54
|
+
|
|
55
|
+
## 定位语法速查
|
|
56
|
+
|
|
57
|
+
| 操作 | 定位字段 | 正确示例 | 常见错误 |
|
|
58
|
+
|---|---|---|-----------------------|
|
|
59
|
+
| 插入行列 | `position` + `count` | `{"position":"3","count":2}` / `{"position":"C","count":2}` | 把列字母换算成 0-based 数字 |
|
|
60
|
+
| 删除行列 | `range` | `"3:7"` / `"C:F"` | 使用局部区域 `"A3:F7"` |
|
|
61
|
+
| 移动行列 | `range` + `position` | `{"range":"3:7","position":"12"}` | 行范围搭配列目标,如 `"position":"H"` |
|
|
62
|
+
| 显示/隐藏行列 | `range` | `"3:7"` / `"C:F"` | 使用局部区域 `"A3:F7"` |
|
|
63
|
+
| 调整尺寸 | `range` | `{"range":"C:E"}` | 行 `range` 用 `col_width` 等维度错配 |
|
|
64
|
+
| 合并操作 | `range` | `"A1:B2"` | 在范围中嵌入子表名 |
|
|
65
|
+
|
|
66
|
+
## 获取子表布局信息
|
|
67
|
+
|
|
68
|
+
读取指定子表的合并范围、行高、列宽。该接口只返回布局和结构元信息,不读取单元格值;要读取表头、样本、公式或样式,请使用 `wecomcli-sheet-read-data.md` 中的 `cells get`。
|
|
69
|
+
|
|
70
|
+
### 命令
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
wecom-cli sheet info get --json '<JSON 参数>'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 参数
|
|
77
|
+
|
|
78
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
79
|
+
|---|---|---|---|---|
|
|
80
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
81
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
82
|
+
| `range` | string | 否 | 整张子表 | 限定查询范围,纯 A1,如 `A1:F200` |
|
|
83
|
+
| `include` | string[] | 否 | 全部已支持项 | 返回维度:`merges`(合并单元格) / `row_heights`(行高) / `col_widths`(列宽)。缺省返回全部已支持项 |
|
|
84
|
+
|
|
85
|
+
### 返回
|
|
86
|
+
|
|
87
|
+
| 字段 | 类型 | 说明 |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| `merges` | string[] | 合并范围列表,纯 A1 |
|
|
90
|
+
| `row_heights` | object | 行高映射,键为行索引,值为像素 px |
|
|
91
|
+
| `col_widths` | object | 列宽映射,键为列索引,值为像素 px |
|
|
92
|
+
|
|
93
|
+
### 示例
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
wecom-cli sheet info get --json '{"docid":"e3_ABC123","sheet":"销售","include":["merges","col_widths"]}'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 使用规则
|
|
100
|
+
|
|
101
|
+
- 调整行列尺寸、写入合并区域、放置图表或执行结构变更前,可先读取现有布局,避免覆盖未知结构。
|
|
102
|
+
- 默认行高 20px,列宽 100px。返回的 `row_heights` 和 `col_widths` 只展示和默认值不同的行和列。不展示的行列即是默认值。
|
|
103
|
+
- 如果 `merges` 为空,说明当前子表没有单元格合并的情况。
|
|
104
|
+
|
|
105
|
+
## 插入整行或整列
|
|
106
|
+
|
|
107
|
+
在指定行或列之前/之后插入连续的整行或整列,自动继承原表格的样式。
|
|
108
|
+
|
|
109
|
+
### 命令
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
wecom-cli sheet dims insert --json '<JSON 参数>'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 参数
|
|
116
|
+
|
|
117
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
118
|
+
|-----------------|---|---|---|---|
|
|
119
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
120
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
121
|
+
| `position` | string | 是 | — | 插入位置;行用 1-based 数字字符串,如 `"3"`;列用字母,如 `"C"` |
|
|
122
|
+
| `count` | int | 是 | — | 插入数量,必须大于 `0` |
|
|
123
|
+
| `direction` | string | 否 | `before` | `before` / `after` |
|
|
124
|
+
| `dry_run` | bool | 否 | `false` | `true` 时仅预览,不落盘 |
|
|
125
|
+
|
|
126
|
+
### 示例
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
wecom-cli sheet dims insert --json '{"docid":"e3_ABC123","sheet":"销售","position":"C","count":3,"direction":"after"}'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 扩展当前子表边界
|
|
133
|
+
|
|
134
|
+
当插入行列的目的是把表格可用范围向右或向下扩展时,先用 `wecomcli-sheet-workbook.md` 中的 `sheet workbook get` 确认当前子表范围,再用**当前边界内已有的最后一行或最后一列**作为 `position`,通过 `direction:"after"` 和 `count` 向外扩展。`position` 不要填目标新增区域的第一行或第一列;它必须落在当前范围内,否则会报错:“操作超出工作表边界”。
|
|
135
|
+
|
|
136
|
+
当前子表范围为 `A1:H10` 时,向右扩展 3 列,新增 `I:K`:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
wecom-cli sheet dims insert --json '{"docid":"e3_ABC123","sheet":"销售","position":"H","count":3,"direction":"after"}'
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
当前子表范围为 `A1:H10` 时,向下扩展 5 行,新增第 `11:15` 行:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
wecom-cli sheet dims insert --json '{"docid":"e3_ABC123","sheet":"销售","position":"10","count":5,"direction":"after"}'
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 使用规则
|
|
149
|
+
|
|
150
|
+
- **扩展边界必须锚在边界内**:向右扩展用当前末列;向下扩展用当前末行。不要把新位置直接当作 `position`。
|
|
151
|
+
- **多个不连续插入位置必须分轮串行执行**:多个行位置按行号从大到小,多个列位置按列序从右到左;一次模型响应中只调用一次本命令,取得结果后再处理下一位置。
|
|
152
|
+
- 插入后原有数据的行号、列字母和引用范围可能偏移。后续写入、合并、调整尺寸等操作必须按新结构重新计算位置,不要复用插入前缓存的 A1 地址。
|
|
153
|
+
|
|
154
|
+
## 删除整行或整列
|
|
155
|
+
|
|
156
|
+
删除一个连续的整行或整列范围。破坏性操作,必须传 `yes` 确认;建议先 `dry_run` 预览,确认后带 `yes` 执行。
|
|
157
|
+
|
|
158
|
+
### 命令
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
wecom-cli sheet dims delete --json '<JSON 参数>'
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 参数
|
|
165
|
+
|
|
166
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
167
|
+
|---|---|---|---|--------------------------|
|
|
168
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
169
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
170
|
+
| `range` | string | 是 | — | 整行范围如 `3:7`,或整列范围如 `C:F` |
|
|
171
|
+
| `yes` | bool | 是 | — | 确认执行(缺省拒绝) |
|
|
172
|
+
| `dry_run` | bool | 否 | `false` | `true` 时仅预览,不落盘 |
|
|
173
|
+
|
|
174
|
+
### 返回
|
|
175
|
+
|
|
176
|
+
| 字段 | 类型 | 说明 |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
| `deleted_range` | string | 实际删除的 A1 范围 |
|
|
179
|
+
|
|
180
|
+
### 使用规则
|
|
181
|
+
|
|
182
|
+
- 这里只能删除**整行或整列**。删除局部单元格块并让周边数据回填,不属于本接口,请读取 `wecomcli-sheet-range-operations.md`。
|
|
183
|
+
- **多个不连续删除范围必须分轮串行执行**:先合并相邻目标,再按行号从大到小或列序从右到左删除;一次模型响应中只调用一次本命令,禁止并发删除。
|
|
184
|
+
- 删除不可逆。执行前先确认目标范围;必要时通过数据读取接口读取该范围的内容,并检查相交的合并区域和引用关系。
|
|
185
|
+
- 删除后原有数据的坐标会前移,后续操作必须重新读取或计算目标位置。
|
|
186
|
+
|
|
187
|
+
## 移动整行或整列
|
|
188
|
+
|
|
189
|
+
将连续的整行或整列作为一个整体移动到新位置;值、公式和样式随行列一起移动。破坏性操作,必须传 `yes` 确认;建议先 `dry_run` 预览参数与影响区域,确认后带 `yes` 执行。
|
|
190
|
+
|
|
191
|
+
### 命令
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
wecom-cli sheet dims move --json '<JSON 参数>'
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### 参数
|
|
198
|
+
|
|
199
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
200
|
+
|-----------|---|---|--------|----------------------------|
|
|
201
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
202
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
203
|
+
| `range` | string | 是 | — | 源范围:整行 `3:7` 或整列 `C:F` |
|
|
204
|
+
| `position` | string | 是 | — | 目标位置;行用 1-based 数字字符串,列用字母 |
|
|
205
|
+
| `dry_run` | bool | 否 | `false` | `true` 时仅预览,不落盘 |
|
|
206
|
+
| `yes` | `bool` | 是 | — | 确认执行(缺省拒绝) |
|
|
207
|
+
|
|
208
|
+
### 示例
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
wecom-cli sheet dims move --json '{"docid":"e3_ABC123","sheet":"销售","range":"3:7","position":"12","yes":true}'
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### 使用规则
|
|
215
|
+
|
|
216
|
+
- 源范围与目标位置必须属于同一维度:`range="3:7"` 时 `position` 必须是行号;`range="C:F"` 时 `position` 必须是列字母。禁止 `{"range":"3:7","position":"H"}` 这类行列混用。
|
|
217
|
+
- **多个移动任务必须分轮串行执行**:一次模型响应中只调用一次本命令;每次移动完成后,重新定位剩余任务的源范围和目标位置,不得只按初始坐标并发或连续提交。
|
|
218
|
+
- 移动会改变源范围及其间隔区域的坐标。后续操作应以移动后的结构重新定位,不要继续使用移动前缓存的 A1 地址。
|
|
219
|
+
|
|
220
|
+
## 显示或隐藏行列
|
|
221
|
+
|
|
222
|
+
显示或隐藏连续整行 / 整列。隐藏行列只改变可见性,不删除数据、公式或样式。
|
|
223
|
+
|
|
224
|
+
### 命令
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
wecom-cli sheet dims visible --json '<JSON 参数>'
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 参数
|
|
231
|
+
|
|
232
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
233
|
+
|---|---|---|---|---|
|
|
234
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
235
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
236
|
+
| `range` | string | 是 | — | 整行范围如 `3:7`,或整列范围如 `D:D` / `C:F` |
|
|
237
|
+
| `visible` | bool | 是 | — | `true` 表示显示,`false` 表示隐藏 |
|
|
238
|
+
| `dry_run` | bool | 否 | `false` | `true` 时仅预览,不落盘 |
|
|
239
|
+
|
|
240
|
+
### 返回
|
|
241
|
+
|
|
242
|
+
| 字段 | 类型 | 说明 |
|
|
243
|
+
|---|---|---|
|
|
244
|
+
| `dimension` | string | 处理维度:`row` / `col` |
|
|
245
|
+
| `affected_range` | string | 实际生效范围 |
|
|
246
|
+
| `count` | int | 生效的行/列数量 |
|
|
247
|
+
| `visible` | bool | 当前可见状态 |
|
|
248
|
+
|
|
249
|
+
### 示例
|
|
250
|
+
|
|
251
|
+
隐藏 D 列:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
wecom-cli sheet dims visible --json '{"docid":"e3_ABC123","sheet":"销售","range":"D:D","visible":false}'
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
显示第 3 到 7 行:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
wecom-cli sheet dims visible --json '{"docid":"e3_ABC123","sheet":"销售","range":"3:7","visible":true}'
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 使用规则
|
|
264
|
+
|
|
265
|
+
- **只能整行或整列**:`range` 必须是 `3:7`、`D:D`、`C:F` 这类整行/整列范围,不要传 `A3:F7` 这种局部单元格区域。
|
|
266
|
+
- **只支持单个连续范围**:不支持 `D:D,F:F` 这类逗号分隔多段范围;需要隐藏多个不连续范围时分多次调用。
|
|
267
|
+
- **隐藏不是删除**:用户要求“暂时不显示/收起辅助列”时用本命令;用户要求彻底移除数据时才考虑 `dims delete`。
|
|
268
|
+
|
|
269
|
+
## 调整行高或列宽
|
|
270
|
+
|
|
271
|
+
按 `range` 指定的维度统一或逐项设置行高 / 列宽,单位均为 pixel。
|
|
272
|
+
|
|
273
|
+
### 命令
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
wecom-cli sheet dims resize --json '<JSON 参数>'
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### 参数
|
|
280
|
+
|
|
281
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
282
|
+
|---|---|---|---|--------------------------------------------------------|
|
|
283
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
284
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
285
|
+
| `range` | string | 是 | — | 目标行/列范围(纯 A1),格式决定维度:纯数字为行(如 `2:5`),字母为列(如 `B:D`) |
|
|
286
|
+
| `row_height` | int | 条件必填 | — | 统一行高(pixel);`range` 为行时与 `row_heights` 二选一 |
|
|
287
|
+
| `row_heights` | object | 条件必填 | — | 逐行行高(pixel);`range` 为行时与 `row_height` 二选一,键为行号 |
|
|
288
|
+
| `col_width` | int | 条件必填 | — | 统一列宽(pixel);`range` 为列时与 `col_widths` 二选一 |
|
|
289
|
+
| `col_widths` | object | 条件必填 | — | 逐列列宽(pixel);`range` 为列时与 `col_width` 二选一,键为列字母 |
|
|
290
|
+
| `dry_run` | bool | 否 | `false` | `true` 时仅预览,不落盘 |
|
|
291
|
+
|
|
292
|
+
### 返回
|
|
293
|
+
|
|
294
|
+
| 字段 | 类型 | 说明 |
|
|
295
|
+
|---|---|---|
|
|
296
|
+
| `dimension` | string | 处理维度:`rows` / `cols` |
|
|
297
|
+
| `affected_range` | string | 实际生效区域 A1 |
|
|
298
|
+
| `resized` | int | 实际调整的行/列数 |
|
|
299
|
+
|
|
300
|
+
### 示例
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# 逐列列宽(range 为列)
|
|
304
|
+
wecom-cli sheet dims resize --json '{"docid":"e3_ABC123","sheet":"销售","range":"A:E","col_widths":{"A":100,"C:E":140}}'
|
|
305
|
+
|
|
306
|
+
# 统一行高(range 为行)
|
|
307
|
+
wecom-cli sheet dims resize --json '{"docid":"e3_ABC123","sheet":"销售","range":"2:10","row_height":30}'
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### 使用规则
|
|
311
|
+
|
|
312
|
+
- `range` 格式决定维度:纯数字为行(`2:5`),字母为列(`B:D`)。同一调用只能调一种维度——行用 `row_height`(统一)或 `row_heights`(逐行),列用 `col_width`(统一)或 `col_widths`(逐列),不可行列混用。
|
|
313
|
+
- `row_heights` / `col_widths` 的键可以是单项或连续区间(如 `{"A":100,"C:E":140}`),可在一次调用设多个不连续尺寸组,不要为了不同尺寸拆成多次调用。
|
|
314
|
+
|
|
315
|
+
## 合并单元格
|
|
316
|
+
|
|
317
|
+
### 命令
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
wecom-cli sheet merge set --json '<JSON 参数>'
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### 参数
|
|
324
|
+
|
|
325
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
326
|
+
|---|---|---|---|---|
|
|
327
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
328
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
329
|
+
| `range` | string | 是 | — | 待合并区域,纯 A1 |
|
|
330
|
+
| `merge_type` | string | 否 | `all` | `all` / `rows` / `columns` |
|
|
331
|
+
| `dry_run` | bool | 否 | `false` | `true` 时仅预览,不落盘 |
|
|
332
|
+
|
|
333
|
+
### 返回
|
|
334
|
+
|
|
335
|
+
| 字段 | 类型 | 说明 |
|
|
336
|
+
|---|---|---|
|
|
337
|
+
| `merged_range` | string | 实际合并区域 |
|
|
338
|
+
|
|
339
|
+
### 使用规则
|
|
340
|
+
|
|
341
|
+
- `all` 将整个区域合为一个单元格。`rows` 将区域内每一行分别合并;`columns` 将区域内每一列分别合并。
|
|
342
|
+
- 合并前先调用 `sheet merge get` 检查相交的已有合并范围,避免与现有合并块冲突。
|
|
343
|
+
|
|
344
|
+
## 取消合并单元格
|
|
345
|
+
|
|
346
|
+
取消合并单元格。破坏性操作,必须传 `yes` 确认;建议先 `dry_run` 预览参数与影响区域,确认后带 `yes` 执行。
|
|
347
|
+
|
|
348
|
+
### 命令
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
wecom-cli sheet merge clear --json '<JSON 参数>'
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### 参数
|
|
355
|
+
|
|
356
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
357
|
+
|---|---|---|---|-----------------|
|
|
358
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
359
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
360
|
+
| `range` | string | 是 | — | 待取消合并的纯 A1 区域 |
|
|
361
|
+
| `dry_run` | bool | 否 | `false` | `true` 时仅预览,不落盘 |
|
|
362
|
+
| `yes` | bool | 是 | — | 确认执行(缺省拒绝) |
|
|
363
|
+
|
|
364
|
+
### 返回
|
|
365
|
+
|
|
366
|
+
| 字段 | 类型 | 说明 |
|
|
367
|
+
|---|---|---|
|
|
368
|
+
| `unmerged_range` | string | 实际取消合并的区域 |
|
|
369
|
+
|
|
370
|
+
### 使用规则
|
|
371
|
+
|
|
372
|
+
- 区域不明确时先用 `sheet merge get` 查询,再对准确的合并范围执行取消。
|
|
373
|
+
|
|
374
|
+
## 查询合并范围
|
|
375
|
+
|
|
376
|
+
### 命令
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
wecom-cli sheet merge get --json '<JSON 参数>'
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### 参数
|
|
383
|
+
|
|
384
|
+
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|
|
385
|
+
|---|---|---|---|---|
|
|
386
|
+
| `docid` | string | 是 | — | 在线表格 ID 或 URL |
|
|
387
|
+
| `sheet` | string | 是 | — | 子表 ID 或名称 |
|
|
388
|
+
| `range` | string | 是 | — | 查询区域,纯 A1 |
|
|
389
|
+
|
|
390
|
+
### 返回
|
|
391
|
+
|
|
392
|
+
| 字段 | 类型 | 说明 |
|
|
393
|
+
|---|---|---|
|
|
394
|
+
| `merges` | string[] | 与查询区域相交的合并范围列表,纯 A1;无合并时为空数组 |
|