wezard 2.8.8 → 3.0.1
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-plugin/plugin.json +0 -6
- package/CLAUDE.md +36 -16
- package/README.md +41 -54
- package/cli/wezard.sh +3 -0
- package/config.example.jsonc +6 -8
- package/dist/cli/codex-hook.js +20 -4
- package/dist/cli/codex-hook.js.map +1 -1
- package/dist/cli/init.js +45 -8
- 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 +32 -112
- package/dist/cli/sync.js.map +1 -1
- package/dist/daemon/apprentice.js +75 -0
- package/dist/daemon/apprentice.js.map +1 -0
- package/dist/daemon/approval.js +78 -20
- package/dist/daemon/approval.js.map +1 -1
- package/dist/daemon/channel-context.js +69 -0
- package/dist/daemon/channel-context.js.map +1 -0
- package/dist/daemon/channel-posts.js +53 -0
- package/dist/daemon/channel-posts.js.map +1 -0
- package/dist/daemon/channel-store.js +96 -0
- package/dist/daemon/channel-store.js.map +1 -0
- package/dist/daemon/channel.js +805 -0
- package/dist/daemon/channel.js.map +1 -0
- package/dist/daemon/chat-name.js +24 -161
- package/dist/daemon/chat-name.js.map +1 -1
- package/dist/daemon/classes.js +418 -0
- package/dist/daemon/classes.js.map +1 -0
- package/dist/daemon/config-api.js +11 -3
- package/dist/daemon/config-api.js.map +1 -1
- package/dist/daemon/danger.js +24 -205
- package/dist/daemon/danger.js.map +1 -1
- package/dist/daemon/detail.js +14 -8
- package/dist/daemon/detail.js.map +1 -1
- package/dist/daemon/handoff.js +266 -50
- package/dist/daemon/handoff.js.map +1 -1
- package/dist/daemon/http.js +25 -18
- 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 +366 -143
- package/dist/daemon/inbound.js.map +1 -1
- package/dist/daemon/index.js +2232 -2616
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/last-response.js +44 -9
- package/dist/daemon/last-response.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 +10 -2
- package/dist/daemon/message-format.js.map +1 -1
- package/dist/daemon/mirror-bridge.js +714 -485
- 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 +2 -2
- package/dist/daemon/notices.js.map +1 -1
- package/dist/daemon/onboarding.js +384 -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 +38 -230
- package/dist/daemon/peers.js.map +1 -1
- package/dist/daemon/pending.js +7 -5
- package/dist/daemon/pending.js.map +1 -1
- package/dist/daemon/picker-policy.js +27 -12
- package/dist/daemon/picker-policy.js.map +1 -1
- package/dist/daemon/plans.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-facts.js +35 -0
- package/dist/daemon/room-facts.js.map +1 -0
- package/dist/daemon/room-hub.js +430 -0
- package/dist/daemon/room-hub.js.map +1 -0
- package/dist/daemon/room-overdue.js +98 -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 +153 -0
- package/dist/daemon/room-watchdog.js.map +1 -0
- package/dist/daemon/rooms.js +107 -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/spawn-tmux.js +171 -55
- package/dist/daemon/spawn-tmux.js.map +1 -1
- package/dist/daemon/steward-guard.js +2 -2
- package/dist/daemon/steward.js +132 -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/turn-opening.js +25 -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 +7 -2
- package/dist/daemon/wezard-session.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 +589 -145
- package/dist/daemon/wizard.js.map +1 -1
- package/dist/mcp/output.js +6 -5
- package/dist/mcp/output.js.map +1 -1
- package/dist/mcp/tools.js +258 -236
- package/dist/mcp/tools.js.map +1 -1
- package/dist/shared/allow-rules.js +32 -8
- 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 +374 -459
- 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 +27 -5
- package/dist/shared/cli-backends.js.map +1 -1
- package/dist/shared/config.js +122 -38
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/detail-render.js +104 -21
- package/dist/shared/detail-render.js.map +1 -1
- package/dist/shared/detail-store.js.map +1 -1
- package/dist/shared/group-members.js +35 -0
- package/dist/shared/group-members.js.map +1 -0
- package/dist/shared/inject-view.js +105 -0
- package/dist/shared/inject-view.js.map +1 -0
- package/dist/shared/json-map-store.js +23 -6
- package/dist/shared/json-map-store.js.map +1 -1
- 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 +4 -3
- package/dist/shared/message-footer.js.map +1 -1
- package/dist/shared/pricing.js +5 -0
- package/dist/shared/pricing.js.map +1 -1
- package/dist/shared/reminder.js +30 -38
- package/dist/shared/reminder.js.map +1 -1
- package/dist/shared/repl-script.js +114 -26
- package/dist/shared/repl-script.js.map +1 -1
- package/dist/shared/role-render.js +209 -210
- package/dist/shared/role-render.js.map +1 -1
- package/dist/shared/role-view.js +61 -299
- 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 +81 -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 +261 -0
- package/dist/shared/room-view.js.map +1 -0
- package/dist/shared/room.js +610 -0
- package/dist/shared/room.js.map +1 -0
- package/dist/shared/session-hooks.js +58 -0
- package/dist/shared/session-hooks.js.map +1 -0
- package/dist/shared/session-label.js +80 -60
- package/dist/shared/session-label.js.map +1 -1
- package/dist/shared/session-mcp.js +77 -0
- package/dist/shared/session-mcp.js.map +1 -0
- package/dist/shared/session-skills.js +63 -0
- package/dist/shared/session-skills.js.map +1 -0
- package/dist/shared/skill-sync.js +229 -0
- package/dist/shared/skill-sync.js.map +1 -0
- package/dist/shared/smarts.js +39 -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 +76 -17
- 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 +62 -6
- package/dist/svr/index.js.map +1 -1
- package/hooks/pre-tool-use.sh +18 -0
- package/hooks/stop.sh +26 -0
- package/package.json +7 -3
- package/scripts/install.sh +11 -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.service.template +6 -0
- package/web/chat.css +70 -273
- package/web/chat.js +2228 -2190
- 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 -69
- package/dist/daemon/idle-nudge.js.map +0 -1
- package/dist/daemon/message-events.js +0 -1083
- 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
- package/hooks/hooks.json +0 -16
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# 企业微信发送消息
|
|
2
|
+
|
|
3
|
+
1. 可以向授权人发送消息。
|
|
4
|
+
2. 可以向授权人以外的、机器人最近有消息往来的聊天会话(单聊和群聊)发送消息。
|
|
5
|
+
|
|
6
|
+
## 适用范围
|
|
7
|
+
|
|
8
|
+
### 适用
|
|
9
|
+
|
|
10
|
+
- 适用于给授权人发消息,使用 `wecom-cli identity whoami` 获取授权人ID,可作为 `chat_id` 使用,无需调用 `sessions list`。
|
|
11
|
+
- 适用于查询当前有权限发送消息的聊天会话范围并给这些范围中的成员或群聊发送 Markdown 消息、图片、文件、AMR 语音或视频
|
|
12
|
+
|
|
13
|
+
### 不适用
|
|
14
|
+
|
|
15
|
+
- 发送对象不是授权人且不在本次 `sessions list` 返回结果中 → 告知用户当前只能向最近活跃的会话或授权人发送
|
|
16
|
+
|
|
17
|
+
## 能力依赖
|
|
18
|
+
|
|
19
|
+
调用依赖能力前,必须先完整读取对应 `SKILL.md`。
|
|
20
|
+
|
|
21
|
+
| 依赖 | 触发场景 | 数据流向 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `wecomcli-media.md` | 发送图片、文件、语音或视频时只有本地文件路径,没有可直接复用的 `media_id` | 包含媒体上传接口,如没有已有的 `media_id`,必须先阅读该技能获取 `media_id`,上传时传入的 `type` 应和发送时的`msg_type` 对齐|
|
|
24
|
+
|
|
25
|
+
## 获取能发送消息的会话列表
|
|
26
|
+
|
|
27
|
+
### 命令
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
wecom-cli message aibot sessions list
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 返回
|
|
34
|
+
|
|
35
|
+
| 字段 | 类型 | 说明 |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `sessions` | array | 会话列表,按最后一条消息时间从新到旧排序,具体数量以实际回包为准 |
|
|
38
|
+
| `sessions[].chat_id` | string | 会话 ID |
|
|
39
|
+
| `sessions[].chat_name` | string | 群名称或单聊名称 |
|
|
40
|
+
| `sessions[].chat_type` | string | `single` 单聊或 `group` 群聊 |
|
|
41
|
+
| `sessions[].last_msg_time` | string | 最后一条消息时间,格式 `YYYY-MM-DD HH:MM:SS` |
|
|
42
|
+
| `sessions_count` | integer | `sessions` 数组元素数量 |
|
|
43
|
+
|
|
44
|
+
### `chat_id` 来源
|
|
45
|
+
|
|
46
|
+
向授权人以外的用户发送消息,调用 `wecom-cli message aibot send` 前,需要先调用一次 `sessions list`,然后从本次返回的 `sessions[]` 中选定目标项,把该项的 `chat_id` 原样复制到 `send.chat_id`。
|
|
47
|
+
|
|
48
|
+
以下值都不能直接作为 `send.chat_id`:
|
|
49
|
+
|
|
50
|
+
- 用户输入的 ID
|
|
51
|
+
- 之前轮次或历史上下文保存的 `chat_id`
|
|
52
|
+
- `wecomcli-contact.md` 返回的 `userid`
|
|
53
|
+
- 根据姓名、群名或其他字段自行构造的值
|
|
54
|
+
|
|
55
|
+
这些值最多只能作为匹配线索;最终发送参数必须重新取自本次 `sessions list` 的匹配项。
|
|
56
|
+
|
|
57
|
+
### 目标会话匹配
|
|
58
|
+
|
|
59
|
+
- **聊天名称**:在本次 `sessions[]` 中按非空 `chat_name` 精确匹配;不能精确匹配需要向用户反问确认发送目标,唯一命中时从匹配项复制 `chat_id`。
|
|
60
|
+
- **最近第一个/最近某个会话**:按 `sessions[]` 原始顺序选择用户明确指定的项。
|
|
61
|
+
- **用户提供 ID**:只能与本次 `sessions[].chat_id` 做完全相等校验;命中后仍从匹配项复制 `chat_id`,不能直接复用用户输入值。
|
|
62
|
+
|
|
63
|
+
匹配结果处理:
|
|
64
|
+
|
|
65
|
+
- 唯一匹配时继续发送。
|
|
66
|
+
- 多个聊天会话候选时,按返回顺序展示聊天名和最后消息时间,让用户选择。
|
|
67
|
+
- 用户完成选择后,必须重新调用 `sessions list`,再用选定对象匹配当次返回值。
|
|
68
|
+
- 无匹配时停止发送,如实告知目标不在最近 10 个会话中;不要接受外部 `chat_id` 绕过限制。
|
|
69
|
+
- `sessions_count=0` 时停止发送,告知当前没有可发送的最近会话。
|
|
70
|
+
- 展示会话列表时保持接口原始顺序;展示名称和时间,不展示内部 `chat_id`。
|
|
71
|
+
|
|
72
|
+
## 发送消息
|
|
73
|
+
|
|
74
|
+
### 前置条件
|
|
75
|
+
|
|
76
|
+
调用本接口前必须完成以下步骤:
|
|
77
|
+
|
|
78
|
+
1. 根据发送对象选择调用 `wecom-cli message aibot sessions list`获取 `chat_id` 或 `wecom-cli identity whoami` 获取授权人ID。
|
|
79
|
+
2. 在本次列表中唯一匹配目标。
|
|
80
|
+
3. 如果发送授权人以外的对象,从列表中匹配项原样复制 `sessions[].chat_id`。
|
|
81
|
+
4. 目标是媒体消息时,再准备对应的 `media_id`。
|
|
82
|
+
|
|
83
|
+
在目标会话匹配成功前,不上传媒体,也不调用 `send`。
|
|
84
|
+
|
|
85
|
+
### 命令
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
wecom-cli message aibot send --json '<JSON 参数>'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 公共参数
|
|
92
|
+
|
|
93
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
94
|
+
|---|---|:---:|---|
|
|
95
|
+
| `chat_id` | string | 是 | 必须取自 `wecom-cli identity whoami` 或当前发送流程中刚调用的 `sessions list` 返回的目标 `sessions[].chat_id` |
|
|
96
|
+
| `msg_type` | string | 是 | `markdown` / `image` / `file` / `voice` / `video` |
|
|
97
|
+
| `markdown` | object | 条件必填 | 仅 `msg_type="markdown"` 时传 |
|
|
98
|
+
| `image` | object | 条件必填 | 仅 `msg_type="image"` 时传 |
|
|
99
|
+
| `file` | object | 条件必填 | 仅 `msg_type="file"` 时传 |
|
|
100
|
+
| `voice` | object | 条件必填 | 仅 `msg_type="voice"` 时传 |
|
|
101
|
+
| `video` | object | 条件必填 | 仅 `msg_type="video"` 时传 |
|
|
102
|
+
|
|
103
|
+
每次请求必须且只能携带一个与 `msg_type` 同名的内容对象。不要传空对象,也不要同时传多个消息对象。
|
|
104
|
+
|
|
105
|
+
### Markdown 消息
|
|
106
|
+
|
|
107
|
+
`markdown.content` 必填,最长 20480 UTF-8 字节。普通文本也按 Markdown 发送。
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
wecom-cli message aibot send --json '{
|
|
111
|
+
"chat_id": "<本次 sessions[].chat_id>",
|
|
112
|
+
"msg_type": "markdown",
|
|
113
|
+
"markdown": {
|
|
114
|
+
"content": "<markdown 消息内容>"
|
|
115
|
+
}
|
|
116
|
+
}'
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 图片消息
|
|
120
|
+
|
|
121
|
+
`image.media_id` 必填,必须由媒体上传接口以 `type=image` 上传获得。
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
wecom-cli message aibot send --json '{
|
|
125
|
+
"chat_id": "<本次 sessions[].chat_id>",
|
|
126
|
+
"msg_type": "image",
|
|
127
|
+
"image": {
|
|
128
|
+
"media_id": "<media_id>"
|
|
129
|
+
}
|
|
130
|
+
}'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 文件消息
|
|
134
|
+
|
|
135
|
+
`file.media_id` 必填,必须由媒体上传接口以 `type=file` 上传获得;文件名取上传时的原始文件名。
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
wecom-cli message aibot send --json '{
|
|
139
|
+
"chat_id": "<本次 sessions[].chat_id>",
|
|
140
|
+
"msg_type": "file",
|
|
141
|
+
"file": {
|
|
142
|
+
"media_id": "<media_id>"
|
|
143
|
+
}
|
|
144
|
+
}'
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 语音消息
|
|
148
|
+
|
|
149
|
+
`voice.media_id` 必填,必须由媒体上传接口以 `type=voice` 上传获得;源文件仅支持 AMR 格式,不能只改扩展名冒充 AMR。
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
wecom-cli message aibot send --json '{
|
|
153
|
+
"chat_id": "<本次 sessions[].chat_id>",
|
|
154
|
+
"msg_type": "voice",
|
|
155
|
+
"voice": {
|
|
156
|
+
"media_id": "<media_id>"
|
|
157
|
+
}
|
|
158
|
+
}'
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 视频消息
|
|
162
|
+
|
|
163
|
+
| 字段 | 必填 | 说明 |
|
|
164
|
+
|---|:---:|---|
|
|
165
|
+
| `video.media_id` | 是 | 由媒体上传接口以 `type=video` 上传获得 |
|
|
166
|
+
| `video.title` | 否 | 最长 128 UTF-8 字节;省略时使用上传时的原始文件名 |
|
|
167
|
+
| `video.description` | 否 | 最长 512 UTF-8 字节;省略时不展示描述 |
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
wecom-cli message aibot send --json '{
|
|
171
|
+
"chat_id": "<本次 sessions[].chat_id>",
|
|
172
|
+
"msg_type": "video",
|
|
173
|
+
"video": {
|
|
174
|
+
"media_id": "<media_id>",
|
|
175
|
+
"title": "产品演示",
|
|
176
|
+
"description": "本周版本的核心功能演示"
|
|
177
|
+
}
|
|
178
|
+
}'
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
用户没有提供视频标题或描述时直接省略对应字段,不传空字符串,也不追问非必填字段。
|
|
182
|
+
|
|
183
|
+
## 关键约束
|
|
184
|
+
|
|
185
|
+
- 用户明确要求发送且目标与内容完整时直接执行,不重复追问确认;缺少目标、内容或本地文件时只追问缺失项。
|
|
186
|
+
- 连续发送多条时,不用每次 `send` 前都重新调用 `sessions list` 或 `wecom-cli identity whoami`,但连续发送中途上下文发生压缩时重新调用确保 `chat_id` 正确。
|
|
187
|
+
- `chat_id`、`userid`、`media_id` 都是内部调用值,禁止面向用户展示。
|
|
188
|
+
- Markdown 正文、视频标题和描述限制按 UTF-8 字节数计算;超限时不静默截断,请用户缩短或明确同意拆分。
|
|
189
|
+
- 发送成功后只说明目标和消息类型,不编造消息 ID。
|
|
190
|
+
- 接口失败时如实转达错误,不使用 curl / Python 等方式绕过 `wecom-cli`。
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Animation 组件规范
|
|
2
|
+
|
|
3
|
+
`<Animation>` 包裹**单个子元素**为其添加动画,本身不占布局。导出时写入 OOXML `<p:timing>`,在 PowerPoint 放映模式下按顺序播放。
|
|
4
|
+
|
|
5
|
+
## 基础用法
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
<Animation animType="fadeIn" duration={800}>
|
|
9
|
+
<Text>标题</Text>
|
|
10
|
+
</Animation>
|
|
11
|
+
|
|
12
|
+
<Animation animType="fadeIn" startType="afterPrevious">
|
|
13
|
+
<Text>第一句</Text>
|
|
14
|
+
</Animation>
|
|
15
|
+
<Animation animType="fadeIn" startType="afterPrevious">
|
|
16
|
+
<Text>第二句</Text>
|
|
17
|
+
</Animation>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
一个 `<Animation>` 只能包**一个**子元素。若需要一组元素同步入场,用 Box 包起来再套 Animation。
|
|
21
|
+
|
|
22
|
+
## 属性速查
|
|
23
|
+
|
|
24
|
+
| 属性 | 说明 |
|
|
25
|
+
| :--- | :--- |
|
|
26
|
+
| `animType` | **必填**。动画类型字符串,见下方白名单 |
|
|
27
|
+
| `startType` | `'click'`(默认,点击触发)/ `'withPrevious'`(与前一个同时)/ `'afterPrevious'`(前一个播完自动播) |
|
|
28
|
+
| `duration` | 时长毫秒,默认 500 |
|
|
29
|
+
| `delay` | 延迟毫秒,默认 0 |
|
|
30
|
+
| `direction` | 方向类动画(flyIn / peekIn 等)用,取值 `'top' / 'bottom' / 'left' / 'right' / 'topLeft' / 'topRight' / 'bottomLeft' / 'bottomRight' / 'center' / 'toCenter' / 'horizontal' / 'vertical' / 'clockwise' / 'counterClockwise'` 等 |
|
|
31
|
+
|
|
32
|
+
## 常用 animType 白名单
|
|
33
|
+
|
|
34
|
+
**入场(entrance)**:`appear` / `fadeIn` / `flyIn` / `wipe` / `zoom` / `floatIn` / `floatDown` / `bounce` / `blinds` / `box` / `checkerboard` / `circle` / `diamond` / `dissolve` / `peekIn` / `plus` / `randomBars` / `stretch` / `barnDoor` / `peekFrom` / `strips` / `wedge` / `wheel` / `flip` / `credits` / `easeIn` / `lightSpeed` / `growShrink` / `curveUp` / `riseUp` / `spiralIn` / `compress` / `ascend` / `swivel` / `spinner` / `sling` / `centerRevolve` / `pinwheel` / `swish` / `split`
|
|
35
|
+
|
|
36
|
+
**退出(exit)**:`disappear` / `fadeOut` / `flyOut` / `floatOut` / `floatDownOut` / `exitWipe` / `exitBlinds` / `exitBox` / `exitZoom` / `exitCircle` / `exitDiamond` / `exitFlip` / …(`exit*` 变体一一对应上方入场)
|
|
37
|
+
|
|
38
|
+
**强调(emphasis)**:`pulse` / `spin` / `transparency` / `fillColor` / `fontColor` / `lineColor` / `boldFlash` / `wave`
|
|
39
|
+
|
|
40
|
+
## 嵌套(一个元素叠多个动画)
|
|
41
|
+
|
|
42
|
+
```jsx
|
|
43
|
+
<Animation animType="fadeIn" duration={600}>
|
|
44
|
+
<Animation animType="pulse" delay={800}>
|
|
45
|
+
<Text style={{ fontSize: 48 }}>核心数据</Text>
|
|
46
|
+
</Animation>
|
|
47
|
+
</Animation>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 硬性限制
|
|
51
|
+
|
|
52
|
+
- 每个 `<Animation>` **只能有一个直接子元素**(多个会报错)
|
|
53
|
+
- `animType` 必填,且必须在上方白名单中
|
|
54
|
+
- 一期不支持:路径动画(`animMotion`)、trigger 触发器(点 A 触发 B)
|
|
55
|
+
- `startType` 默认 `'click'`。**不显式声明** = 需要观众手动点击才播;连续自动播必须显式写 `'afterPrevious'`
|
|
56
|
+
|
|
57
|
+
## 使用建议
|
|
58
|
+
|
|
59
|
+
- **不是每页都要动画**。优先用于封面 / 章节过渡 / 关键数字揭示;正文页密集列表禁止逐条 fadeIn(放映节奏拖沓)
|
|
60
|
+
- 单页动画数量 ≤ 4,全篇风格统一(要么都 `fadeIn`,要么都 `flyIn`,避免混用)
|
|
61
|
+
- `duration` 建议 300–800 ms,`delay` ≤ 500 ms,超过会显得卡顿
|
|
62
|
+
- 装饰元素、页脚、页码**不加**动画
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Box 组件规范
|
|
2
|
+
|
|
3
|
+
Box 是本 DSL 中最基础的容器组件,承担所有**布局与分组**职责。支持 Flexbox 布局,可任意嵌套,是构建页面结构的基本单元。
|
|
4
|
+
|
|
5
|
+
## 默认布局
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
<Box>...</Box>
|
|
9
|
+
// 等价于
|
|
10
|
+
<Box style={{ display: 'flex', flexDirection: 'column' }}>...</Box>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- 默认 `display: 'flex'`,`flexDirection: 'column'`(纵向流)
|
|
14
|
+
- 未指定 `width` / `height` 时,尺寸由子组件与父容器共同决定
|
|
15
|
+
|
|
16
|
+
## 盒模型
|
|
17
|
+
|
|
18
|
+
**遵循 `box-sizing: border-box`**:设置 `width` 时已包含 padding 和 border,内容可用空间 = `width - padding - border`。
|
|
19
|
+
|
|
20
|
+
例如:`<Box style={{ width: 400, padding: 20, border: '2px solid #333' }}>` 内部子组件可用宽度 = 400 − 20×2 − 2×2 = **356px**。
|
|
21
|
+
|
|
22
|
+
## 常用样式
|
|
23
|
+
|
|
24
|
+
| 类别 | 属性 |
|
|
25
|
+
| :--- | :--- |
|
|
26
|
+
| 布局 | `flexDirection` / `justifyContent` / `alignItems` / `gap` / `flex` / `flexWrap` |
|
|
27
|
+
| 尺寸 | `width` / `height` / `minWidth` / `minHeight` / `maxWidth` / `maxHeight` |
|
|
28
|
+
| 间距 | `padding` / `margin`(及其方向变体) |
|
|
29
|
+
| 视觉 | `background` / `border` / `borderRadius` / `boxShadow` / `opacity` |
|
|
30
|
+
| 定位 | `position: 'absolute' / 'relative'` / `top` / `left` / `right` / `bottom` / `zIndex` |
|
|
31
|
+
|
|
32
|
+
## 硬性限制(必须遵守)
|
|
33
|
+
|
|
34
|
+
1. **仅支持 `display: 'flex'`**。严禁 `display: 'grid'`、`display: 'table'` 以及任何 grid 相关属性(`gridTemplateColumns` 等)
|
|
35
|
+
2. **不支持 CSS `calc()` 函数**。需要动态尺寸时改用 `flex: 1` / 百分比 / 精确计算的固定值
|
|
36
|
+
3. **容器只用 `<Box>`,禁止 `<View>`**——`<View>` 是 React Native 组件,本 DSL 不存在;所有布局容器一律 `<Box>`
|
|
37
|
+
4. 子组件类型可以是 `Text` / `FAIcon` / `Image` / `Chart` / `Table` / `Box`(嵌套)等任意本 DSL 组件
|
|
38
|
+
|
|
39
|
+
## 使用示例
|
|
40
|
+
|
|
41
|
+
### 横向排列(图标 + 文字组合)
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
<Box style={{
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
gap: 20,
|
|
48
|
+
padding: 20,
|
|
49
|
+
background: '#f0f4f8',
|
|
50
|
+
borderRadius: 8,
|
|
51
|
+
}}>
|
|
52
|
+
<FAIcon name='info-circle' style={{ fill: '#3b82f6', width: 24, height: 24 }} />
|
|
53
|
+
<Box>
|
|
54
|
+
<Text style={{ fontSize: 18, fontWeight: 'bold' }}>标题</Text>
|
|
55
|
+
<Text style={{ fontSize: 14, color: '#64748b' }}>描述文本</Text>
|
|
56
|
+
</Box>
|
|
57
|
+
</Box>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Flex 纵向均分(内容卡片组)
|
|
61
|
+
|
|
62
|
+
```jsx
|
|
63
|
+
<Box style={{
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flexDirection: 'column',
|
|
66
|
+
gap: 24,
|
|
67
|
+
height: '100%',
|
|
68
|
+
justifyContent: 'space-between',
|
|
69
|
+
}}>
|
|
70
|
+
<Box style={{ flex: 1 }}>...卡片 1...</Box>
|
|
71
|
+
<Box style={{ flex: 1 }}>...卡片 2...</Box>
|
|
72
|
+
<Box style={{ flex: 1 }}>...卡片 3...</Box>
|
|
73
|
+
</Box>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 绝对定位装饰元素
|
|
77
|
+
|
|
78
|
+
```jsx
|
|
79
|
+
<Box style={{ position: 'relative', width: '100%', height: '100%' }}>
|
|
80
|
+
{/* 背景装饰 */}
|
|
81
|
+
<Box style={{
|
|
82
|
+
position: 'absolute',
|
|
83
|
+
top: 0, right: 0,
|
|
84
|
+
width: 200, height: 200,
|
|
85
|
+
background: 'linear-gradient(135deg, #3b82f6 0%, transparent 100%)',
|
|
86
|
+
opacity: 0.1,
|
|
87
|
+
}} />
|
|
88
|
+
{/* 主内容 */}
|
|
89
|
+
<Box style={{ position: 'relative', zIndex: 1 }}>...</Box>
|
|
90
|
+
</Box>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 最佳实践
|
|
94
|
+
|
|
95
|
+
- 页面内**每个视觉区块**用独立的容器 Box 包裹,必要时加背景(纯色或半透明)增强分区感
|
|
96
|
+
- 卡片组用 **Flex + `flex: 1`** 均分空间,而非固定高度堆叠
|
|
97
|
+
- 布局、留白与信息密度规范见本次任务的 `DESIGN.md`(Step4 产出的设计契约)
|
|
98
|
+
|
|
99
|
+
## 扩展能力
|
|
100
|
+
|
|
101
|
+
- 容器超链接(`<Box href="...">`,含跳页 action)→ [component-hyperlink.md](wecomcli-pptx-component-hyperlink.md)
|
|
102
|
+
- 入场 / 退出 / 强调动画(`<Animation>` 包裹)→ [component-animation.md](wecomcli-pptx-component-animation.md)
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Chart 组件规范
|
|
2
|
+
|
|
3
|
+
Chart 组件用于在 PPT 中嵌入数据图表,适合展示:趋势(折线/面积)、对比(柱/条)、占比(饼/圆环)。
|
|
4
|
+
|
|
5
|
+
> 继承关系:`Chart` 继承自 `Box`,完整兼容 `Box` 的 `style` 属性,可直接设置宽高、背景、边距、阴影等样式。
|
|
6
|
+
|
|
7
|
+
## 1) 快速使用(推荐写法)
|
|
8
|
+
|
|
9
|
+
> 推荐:让 `Chart` 直接参与父级布局,宽度可依赖父容器(默认 `width: '100%'`),只需通过 `style.height` 或 `style.flex`(如 `flex: 1`, `minHeight`)保证垂直空间,否则无法撑满。
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
<Chart
|
|
13
|
+
// 只指定高度,宽度默认占满父容器
|
|
14
|
+
style={{ height: 450 }}
|
|
15
|
+
chartType='barChart'
|
|
16
|
+
title='季度销售对比'
|
|
17
|
+
data={[
|
|
18
|
+
['季度', '2023', '2024'],
|
|
19
|
+
['Q1', 120, 145],
|
|
20
|
+
['Q2', 156, 178],
|
|
21
|
+
['Q3', 198, 210],
|
|
22
|
+
['Q4', 230, 256],
|
|
23
|
+
]}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 2) 支持的图表类型
|
|
28
|
+
|
|
29
|
+
- 柱状/条形:`barChart`, `bar3dChart`
|
|
30
|
+
- `barDirection: 'bar' | 'column'`(默认 `column`)
|
|
31
|
+
- **注意**: `'bar'` 表示横向条形图,`'column'` 表示纵向柱形图(不要使用 `'horizontal'` 或 `'vertical'`)
|
|
32
|
+
- 折线/面积:`lineChart`, `areaChart`
|
|
33
|
+
- 支持 `grouping='stacked'`(面积/柱状常用)
|
|
34
|
+
- 饼图/圆环:`pieChart`, `doughnutChart`
|
|
35
|
+
- **仅支持单系列数据**(两列:类别 + 数值)
|
|
36
|
+
|
|
37
|
+
## 3) 数据格式(必须遵守)
|
|
38
|
+
|
|
39
|
+
- `data` 为二维数组
|
|
40
|
+
- 第 1 行:表头(第一列是分类名,其余列为系列名)
|
|
41
|
+
- 后续行:数据行(第一列为分类值,其余列为数值)
|
|
42
|
+
- **数值必须是 `number`,不要用字符串**(例如 `120` 而不是 `'120'`)
|
|
43
|
+
|
|
44
|
+
基础格式:
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
[
|
|
48
|
+
['类别名', '系列1', '系列2'],
|
|
49
|
+
['分类1', 10, 20],
|
|
50
|
+
['分类2', 15, 18],
|
|
51
|
+
];
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
饼图/圆环(单系列)格式:
|
|
55
|
+
|
|
56
|
+
```jsx
|
|
57
|
+
[
|
|
58
|
+
['类别', '占比'],
|
|
59
|
+
['产品A', 35],
|
|
60
|
+
['产品B', 25],
|
|
61
|
+
['产品C', 20],
|
|
62
|
+
['产品D', 15],
|
|
63
|
+
['其他', 5],
|
|
64
|
+
];
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 4) 颜色与背景(纯色 / 渐变)
|
|
68
|
+
|
|
69
|
+
- `colors: string[]`:系列配色(可纯色、可渐变)
|
|
70
|
+
- `background: string`:图表背景(可纯色、可渐变)
|
|
71
|
+
- `titleColor / legendColor / axisColor / dataLabelColor`:**文本颜色只支持纯色**
|
|
72
|
+
|
|
73
|
+
支持的渐变语法(CSS 字符串):
|
|
74
|
+
|
|
75
|
+
```txt
|
|
76
|
+
linear-gradient(90deg, #起始颜色 0%, #结束颜色 100%)
|
|
77
|
+
radial-gradient(circle, #起始颜色 0%, #结束颜色 100%)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
混合纯色与渐变示例:
|
|
81
|
+
|
|
82
|
+
```jsx
|
|
83
|
+
<Chart
|
|
84
|
+
chartType='areaChart'
|
|
85
|
+
grouping='stacked'
|
|
86
|
+
title='用户增长趋势'
|
|
87
|
+
colors={['#4472C4', 'linear-gradient(90deg, #ea580c 0%, #fdba74 100%)']}
|
|
88
|
+
background='linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%)'
|
|
89
|
+
data={[
|
|
90
|
+
['月份', '活跃用户', '新增用户'],
|
|
91
|
+
['1月', 1200, 350],
|
|
92
|
+
['2月', 1450, 420],
|
|
93
|
+
['3月', 1780, 480],
|
|
94
|
+
['4月', 2100, 520],
|
|
95
|
+
]}
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## 5) 属性说明
|
|
100
|
+
|
|
101
|
+
| 属性 | 类型 | 必需 | 说明 |
|
|
102
|
+
| ---------------- | ---------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
103
|
+
| `chartType` | `string` | ✅ | 图表类型(小驼峰字符串,如 `barChart`) |
|
|
104
|
+
| `data` | `any[]` | ✅ | 二维数组数据(数值必须为 `number`) |
|
|
105
|
+
| `style` | `object` | ✅ | 必填。可继承 `Box` 的所有样式;宽度可依赖父容器(默认 `100%`),但必须提供高度(`height`)或 `flex`/`minHeight` 等设置来撑满垂直空间 |
|
|
106
|
+
| `title` | `string` | ❌ | 标题 |
|
|
107
|
+
| `colors` | `string[]` | ❌ | 系列配色(纯色或渐变) |
|
|
108
|
+
| `background` | `string` | ❌ | 背景(纯色或渐变) |
|
|
109
|
+
| `showLegend` | `boolean` | ❌ | 是否显示图例(默认 `true`) |
|
|
110
|
+
| `showDataLabels` | `boolean` | ❌ | 是否显示数据标签(默认 `false`) |
|
|
111
|
+
| `titleColor` | `string` | ❌ | 标题文本颜色(纯色) |
|
|
112
|
+
| `legendColor` | `string` | ❌ | 图例文本颜色(纯色) |
|
|
113
|
+
| `axisColor` | `string` | ❌ | 坐标轴文本颜色(纯色) |
|
|
114
|
+
| `dataLabelColor` | `string` | ❌ | 数据标签颜色(纯色) |
|
|
115
|
+
| `grouping` | `string` | ❌ | 分组方式:`clustered \| stacked \| percentStacked \| standard` |
|
|
116
|
+
| `barDirection` | `string` | ❌ | 柱状方向:`'bar'`(横向) \| `'column'`(纵向,默认)。**不要使用** `'horizontal'` 或 `'vertical'` |
|
|
117
|
+
|
|
118
|
+
`grouping` 取值说明:
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
'clustered'; // 簇状图:多系列并排显示,柱子之间有间隙
|
|
122
|
+
'stacked'; // 堆积图:多系列堆叠显示,显示绝对值总和
|
|
123
|
+
'percentStacked'; // 百分比堆积图:多系列堆叠显示,显示百分比(总和100%)
|
|
124
|
+
'standard'; // 标准图:用于折线图等
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**注意拼写**:是 `percentStacked` (有字母 r),不是 `precentStacked`
|
|
128
|
+
|
|
129
|
+
`barDirection` 取值示例:
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
'bar'; // 横向条形图
|
|
133
|
+
'column'; // 纵向柱形图(默认)
|
|
134
|
+
// ❌ 不要使用: 'horizontal', 'vertical'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 6) 常见场景怎么选
|
|
138
|
+
|
|
139
|
+
| 场景 | 推荐图表 | 说明 |
|
|
140
|
+
| ------------- | ------------------------------------- | -------------------------------- |
|
|
141
|
+
| 数据对比 | 柱状/条形(`barChart`) | 适合多类别横向比较 |
|
|
142
|
+
| 趋势展示 | 折线(`lineChart`) | 时间序列/趋势最清晰 |
|
|
143
|
+
| 数量变化/构成 | 面积(`areaChart`) | 强调累积与变化幅度;可 `stacked` |
|
|
144
|
+
| 占比分析 | 饼/圆环(`pieChart`/`doughnutChart`) | 单系列、占比表达直观 |
|
|
145
|
+
| 精确数值清单 | Table(不建议用图表) | 静态明细更适合表格 |
|
|
146
|
+
|
|
147
|
+
## 7) 代表性示例
|
|
148
|
+
|
|
149
|
+
### A. 折线趋势
|
|
150
|
+
|
|
151
|
+
```jsx
|
|
152
|
+
<Chart
|
|
153
|
+
style={{ width: 900, height: 450 }}
|
|
154
|
+
chartType='lineChart'
|
|
155
|
+
title='月度用户增长趋势'
|
|
156
|
+
titleColor='#11182A'
|
|
157
|
+
showLegend={true}
|
|
158
|
+
showDataLabels={false}
|
|
159
|
+
legendColor='#9ca3af'
|
|
160
|
+
axisColor='#9ca3af'
|
|
161
|
+
colors={['#4472C4', '#ED7D31']}
|
|
162
|
+
background='#FFFFFF'
|
|
163
|
+
data={[
|
|
164
|
+
['月份', '活跃用户', '新增用户'],
|
|
165
|
+
['1月', 1200, 350],
|
|
166
|
+
['2月', 1450, 420],
|
|
167
|
+
['3月', 1780, 480],
|
|
168
|
+
['4月', 2100, 520],
|
|
169
|
+
['5月', 2450, 580],
|
|
170
|
+
['6月', 2800, 620],
|
|
171
|
+
]}
|
|
172
|
+
/>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### B. 堆积面积图(产品构成)
|
|
176
|
+
|
|
177
|
+
```jsx
|
|
178
|
+
<Chart
|
|
179
|
+
style={{ width: 800, height: 400 }}
|
|
180
|
+
chartType='areaChart'
|
|
181
|
+
grouping='stacked'
|
|
182
|
+
title='产品线收入构成'
|
|
183
|
+
titleColor='#1e293b'
|
|
184
|
+
showLegend={true}
|
|
185
|
+
showDataLabels={false}
|
|
186
|
+
legendColor='#94a3b8'
|
|
187
|
+
axisColor='#94a3b8'
|
|
188
|
+
colors={[
|
|
189
|
+
'linear-gradient(90deg, #5b21b6 0%, #a78bfa 100%)',
|
|
190
|
+
'linear-gradient(90deg, #dc2626 0%, #fca5a5 100%)',
|
|
191
|
+
'linear-gradient(90deg, #05966A 0%, #6ee7b7 100%)',
|
|
192
|
+
]}
|
|
193
|
+
background='linear-gradient(180deg, #fefce8 0%, #fef3c7 100%)'
|
|
194
|
+
data={[
|
|
195
|
+
['季度', '产品A', '产品B', '产品C'],
|
|
196
|
+
['Q1', 50, 30, 20],
|
|
197
|
+
['Q2', 65, 35, 25],
|
|
198
|
+
['Q3', 80, 40, 30],
|
|
199
|
+
['Q4', 95, 45, 35],
|
|
200
|
+
]}
|
|
201
|
+
/>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### C. 横向条形对比(`barDirection='bar'`)
|
|
205
|
+
|
|
206
|
+
```jsx
|
|
207
|
+
<Chart
|
|
208
|
+
style={{ width: 700, height: 500 }}
|
|
209
|
+
chartType='barChart'
|
|
210
|
+
barDirection='bar'
|
|
211
|
+
grouping='clustered'
|
|
212
|
+
title='部门业绩对比'
|
|
213
|
+
titleColor='#0f172a'
|
|
214
|
+
showLegend={true}
|
|
215
|
+
showDataLabels={true}
|
|
216
|
+
legendColor='#64748b'
|
|
217
|
+
axisColor='#64748b'
|
|
218
|
+
dataLabelColor='#1e293b'
|
|
219
|
+
colors={['#10b981', '#f59e0b', '#ef4444']}
|
|
220
|
+
data={[
|
|
221
|
+
['部门', '目标', '实际', '差距'],
|
|
222
|
+
['销售部', 100, 115, 15],
|
|
223
|
+
['市场部', 80, 72, -8],
|
|
224
|
+
['研发部', 120, 125, 5],
|
|
225
|
+
['运营部', 90, 88, -2],
|
|
226
|
+
]}
|
|
227
|
+
/>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### D. 饼图占比(单系列 + 渐变背景)
|
|
231
|
+
|
|
232
|
+
```jsx
|
|
233
|
+
<Chart
|
|
234
|
+
style={{ width: 600, height: 400 }}
|
|
235
|
+
chartType='pieChart'
|
|
236
|
+
title='市场份额分布'
|
|
237
|
+
titleColor='#1f2937'
|
|
238
|
+
showLegend={true}
|
|
239
|
+
showDataLabels={true}
|
|
240
|
+
legendColor='#37414F'
|
|
241
|
+
dataLabelColor='#ffffff'
|
|
242
|
+
colors={['#3b82f6', '#8b5cf6', '#ec4899', '#f59e0b']}
|
|
243
|
+
background='linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%)'
|
|
244
|
+
data={[
|
|
245
|
+
['产品', '市场份额'],
|
|
246
|
+
['产品A', 35],
|
|
247
|
+
['产品B', 28],
|
|
248
|
+
['产品C', 22],
|
|
249
|
+
['产品D', 15],
|
|
250
|
+
]}
|
|
251
|
+
/>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## 8) 最佳实践
|
|
255
|
+
|
|
256
|
+
1. **尺寸**:`Chart` 默认横向拉伸,可省略宽度;务必提供 `style.height` 或 `style.flex`(如 `flex: 1` + `minHeight`),否则高度为 0。
|
|
257
|
+
2. **数据类型**:所有数值必须为 `number`。
|
|
258
|
+
3. **饼/圆环限制**:仅支持单系列(两列)。
|
|
259
|
+
4. **颜色策略**:`colors/background` 可渐变;文本色(`titleColor/legendColor/axisColor/dataLabelColor`)仅纯色。
|
|
260
|
+
5. **可读性**:`axisColor` 建议中性灰(如 `#9A9999` / `#9ca3af`),避免喧宾夺主;`dataLabelColor` 确保与背景对比足够。
|
|
261
|
+
6. **选型**:趋势用折线,构成用堆积面积或堆积柱,对比用柱/条,占比用饼/圆环;静态明细优先 Table。
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# CodeBlock 组件规范
|
|
2
|
+
|
|
3
|
+
CodeBlock 组件用于展示语法高亮的代码块,支持多种编程语言,macOS 风格设计。
|
|
4
|
+
|
|
5
|
+
## 核心属性
|
|
6
|
+
|
|
7
|
+
- **code**: 代码字符串
|
|
8
|
+
- **language**: 编程语言,如 `"javascript"`, `"python"`, `"typescript"`
|
|
9
|
+
- **width**: 宽度(像素)
|
|
10
|
+
- **fontSize**: 字体大小(默认 12)
|
|
11
|
+
- **theme**: `"github-dark"` 或 `"github-light"`(默认 `"github-dark"`)
|
|
12
|
+
- **macHeader**: 是否显示 macOS 三色点(默认 true)
|
|
13
|
+
|
|
14
|
+
## 示例代码
|
|
15
|
+
|
|
16
|
+
### 1. 基础 JavaScript 代码
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
<CodeBlock
|
|
20
|
+
code={`function fibonacci(n) {
|
|
21
|
+
if (n <= 1) return n;
|
|
22
|
+
return fibonacci(n - 1) + fibonacci(n - 2);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
console.log(fibonacci(10)); // 55`}
|
|
26
|
+
language='javascript'
|
|
27
|
+
width={700}
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 2. Python 代码
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
<CodeBlock
|
|
35
|
+
code={`def quick_sort(arr):
|
|
36
|
+
if len(arr) <= 1:
|
|
37
|
+
return arr
|
|
38
|
+
pivot = arr[len(arr) // 2]
|
|
39
|
+
left = [x for x in arr if x < pivot]
|
|
40
|
+
middle = [x for x in arr if x == pivot]
|
|
41
|
+
right = [x for x in arr if x > pivot]
|
|
42
|
+
return quick_sort(left) + middle + quick_sort(right)`}
|
|
43
|
+
language='python'
|
|
44
|
+
width={800}
|
|
45
|
+
fontSize={14}
|
|
46
|
+
/>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. TypeScript 代码(明亮主题)
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
<CodeBlock
|
|
53
|
+
code={`interface User {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
class UserService {
|
|
59
|
+
private users: Map<string, User> = new Map();
|
|
60
|
+
|
|
61
|
+
addUser(user: User): void {
|
|
62
|
+
this.users.set(user.id, user);
|
|
63
|
+
}
|
|
64
|
+
}`}
|
|
65
|
+
language='typescript'
|
|
66
|
+
width={750}
|
|
67
|
+
theme='github-light'
|
|
68
|
+
background='#ffffff'
|
|
69
|
+
/>
|
|
70
|
+
```
|