wezard 2.9.0 → 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.md +34 -15
- package/README.md +36 -49
- package/cli/wezard.sh +3 -0
- package/config.example.jsonc +2 -8
- package/dist/cli/init.js +35 -0
- 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.map +1 -1
- package/dist/daemon/apprentice.js +75 -0
- package/dist/daemon/apprentice.js.map +1 -0
- package/dist/daemon/approval.js +26 -7
- 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-posts.js +53 -0
- package/dist/daemon/channel-posts.js.map +1 -0
- package/dist/daemon/channel.js +124 -12
- 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/classes.js +418 -0
- package/dist/daemon/classes.js.map +1 -0
- package/dist/daemon/config-api.js +1 -1
- package/dist/daemon/detail.js +14 -8
- package/dist/daemon/detail.js.map +1 -1
- package/dist/daemon/handoff.js +51 -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 +360 -142
- package/dist/daemon/inbound.js.map +1 -1
- package/dist/daemon/index.js +2172 -2676
- 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 +511 -467
- 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/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 +48 -36
- 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 +6 -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 +247 -242
- 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 +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 +13 -5
- package/dist/shared/cli-backends.js.map +1 -1
- package/dist/shared/config.js +48 -24
- package/dist/shared/config.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/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/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/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 +20 -8
- package/dist/shared/session-hooks.js.map +1 -1
- package/dist/shared/session-label.js +80 -60
- package/dist/shared/session-label.js.map +1 -1
- package/dist/shared/session-mcp.js +21 -3
- 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 +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 +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 +62 -6
- package/dist/svr/index.js.map +1 -1
- package/hooks/stop.sh +26 -0
- package/package.json +7 -2
- 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 -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
package/dist/mcp/tools.js
CHANGED
|
@@ -73,7 +73,7 @@ const daemonGet = async (path) => {
|
|
|
73
73
|
return { j: (await resp.json().catch(() => ({}))), status: resp.status };
|
|
74
74
|
};
|
|
75
75
|
// Routes answer with either `reason` or `error`; `pick` narrows a payload that
|
|
76
|
-
// is nested rather than spread at the top level
|
|
76
|
+
// is nested rather than spread at the top level.
|
|
77
77
|
const unwrap = (name, { j, status }, pick, input) => j.ok ? ok(present(name, pick ? pick(j) : j, input)) : fail(`${name} failed: ${(j.reason ?? j.error ?? `http ${status}`)}${Object.keys(recovery(j)).length ? `\n${JSON.stringify(recovery(j))}` : ""}`);
|
|
78
78
|
// 读侧工具 (名册 / 对话 / 聊天记录) 的回执是守护进程排好的**文本**, 原样交出去:
|
|
79
79
|
// 这些东西是给模型读的, 包一层 json 只是让它为字段名和转义的换行多付 token。
|
|
@@ -83,72 +83,28 @@ const unwrapCandidates = (r) => r.j.ok && typeof r.j.text === "string"
|
|
|
83
83
|
: unwrap("route_candidates", r);
|
|
84
84
|
// 地址语法只有一套, 每个吃地址的工具都把它原样重述一遍: 模型单看一个 schema
|
|
85
85
|
// 时没有别的地方能学到它, 而猜出来的地址会安静地指向另一个 wizard 的终端。
|
|
86
|
-
const ADDRESS_DOC = "wizard 的名字 —— 全机唯一, 它就是地址: `'fix'`
|
|
86
|
+
const ADDRESS_DOC = "wizard 的名字 —— 全机唯一, 它就是地址: 写裸名 `'fix'` 即可 (人面前的气泡头显示 `🧙♂️ fix`; wizard 之间与 rolepage 都显示裸名; 带 `'.fix'` / `'🧙♂️ fix'` 前缀也认), 不分它住在哪个群。`''` = 你这个聊天的默认 wizard。永远别自己拼 key: wizard_roster / spawn_wizard / clone_wizard 返回的名字 (或 409 里的 `address`) 原样传回来。";
|
|
87
87
|
// 生 wizard 的三个工具共用: 模型名是口语, 落地的是 `/model` 列表里最接近的那一项。
|
|
88
88
|
const MODEL_DOC = "跑在哪个模型上, 最好写确切的 id ('claude-opus-5.5' / 'deepseek-v4.1-flash')。原样带 `--model` 启动; CLI 不认 (口语名 'opus' / '最新的 opus' 也算) 就不带它重起一次, 再从它 `/model` 列表里挑最接近的一项 —— 多花一次启动, 不丢 wizard。落地的见返回的 `model`, 走了兜底或对不上时带 `modelWarning` (仍在跑, 对不上则停在默认模型)。省略 = 该 CLI 默认。之后换用 set_model。";
|
|
89
89
|
const EFFORT_DOC = "推理档位, 启动时就带上 (`--effort`), 之后它每次重启都沿用。判断密集的活给 high 以上, 跑腿的给 low。省略 = 该 CLI 默认 (克隆则跟被克隆者同档)。之后换用 set_model 的 `effort`。";
|
|
90
|
-
// ──
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
.describe("对方**正忙**时怎么投 (它闲着三者一样, 立刻投)。`normal` (默认) 等它这一轮结束再投 —— 派新活用它, 否则你和别人的两段话会挤进同一个输入框被当成一轮读掉; 等的是你这次调用 (最多 `waitSec`)。`urgent` 先打断它这一轮 (同 stop_wizard 的 interrupt) 再投 —— 只给真紧急的改道, 它手上那一轮作废; 那一轮若是别的 wizard 派的活, 不打断, 降成 normal (回包 `urgentDowngraded`)。`now` 不等不打断, 落进它的输入框并进当前这一轮 —— 插话、补一句、答它的问。带 `re` 续问时默认 `now`。返回里 `wasBusy` / `interrupted` / `waitedMs` 说明实际怎么投的。"),
|
|
106
|
-
waitSec: z.number().optional().describe("`normal` 等它闲下来最多等多少秒 (10-3600, 默认 600)。等不到就返回失败, 不会强行投。"),
|
|
107
|
-
planId: z.string().optional().describe("这次派活归属的 plan id。仅关联 event 供 owner 的闲时提醒判断,不会自动推进 plan。补充同一 event 时沿用原关联。"),
|
|
108
|
-
public: z
|
|
109
|
-
.boolean()
|
|
110
|
-
.optional()
|
|
111
|
-
.describe("true = 在公开频道 (你这一轮所在的群) 里说: 群里出 `.你: .它` 气泡, 它的回复也进群 (同时照样回执给你)。默认 false = 私聊, 只记在 rolepage。需要人知道 / 该当着人讨论才用 true。"),
|
|
112
|
-
return: z.enum(["self", "transfer", "detach", "none"]).optional().describe(RETURN_DOC),
|
|
113
|
-
for: z.string().optional().describe(FOR_DOC),
|
|
114
|
-
kind: z
|
|
115
|
-
.enum(["task", "ask", "fyi"])
|
|
116
|
-
.optional()
|
|
117
|
-
.describe("对方该怎么接这句话 (与 `priority` 的何时投、`return` 的要不要回执正交): `task` (默认) 一件活, 同一发送者与接收者的未完成任务会合并补充; `ask` 提一个问题, 可用于正常反问/追问; `fyi` 知会, 不用回。"),
|
|
118
|
-
re: z.union([z.boolean(), z.string()]).optional().describe("续问参数。重复派活会自动补充同一接收者的未完成任务, 不需要 `re`。`true` 可把内容追加到明确指定的原件; 有多个相关路由时以 event id 指明。"),
|
|
119
|
-
force: z
|
|
120
|
-
.boolean()
|
|
121
|
-
.optional()
|
|
122
|
-
.describe("派新活给一个缓存已冷、ctx ≥100k 的 wizard 时, 守护进程先退回一行代价说明不投递 (唤醒 ≈ 白板 spawn 的几倍)。确认这件活真依赖它那段上下文, 才带 `force:true` 重发; 否则白板 spawn。续问 (`re`)、`now`、`ask` / `fyi` 不受此限。"),
|
|
123
|
-
after: z
|
|
124
|
-
.array(z.string())
|
|
125
|
-
.optional()
|
|
126
|
-
.describe("receiver 欠账依赖: wizard 名字数组 (= 你派给它的那一笔: 在飞的优先, 否则最近落定的; 并发两笔才需写 event id), 都得是你自己派出去的件 (查不到 → 400)。全部回执为 done 就立即投; 有失败前置 → 409; 还有未落定前置就持久停放, 前置都 done 后由 daemon 投递并把前置结论附在信封上。只用于新 task、不带 re;独立于 plans DAG。"),
|
|
127
|
-
};
|
|
128
|
-
const TELL_DESC = "跟另一个 wizard 说话 —— 文本原样落进它的输入框, 它当成新的一轮接手 (派活、答它的问题、叫它继续都走这里)。目标不存在就先 spawn_wizard / clone_wizard。独立新活先按目标与难度 delegate; re / now 仅用于当前任务的补充证据、纠正或答问, 不把无关小活追加给正在处理复杂任务的 lead, 也不要用 ask 包装需要另行检查的新任务。\n" +
|
|
129
|
-
"返回实际队列状态、事件标识及异常信息,不重复固定回执提示。对方用 `@.你的名字 RESULT:` 提交结果后, 结果持久化为回执;同批结果收齐再合并送到你这里, 你正忙时排队。等待回执不阻止你接收其他消息。对方长任务每阶段可用 `PROGRESS:` 报一行进展 (任务不因此落定)。\n" +
|
|
130
|
-
"默认私聊, 只记在双方 rolepage; 守护进程给 `text` 挂信封 (发话人、私聊/公开、终句收口约定)。拒绝对自己发送。\n" +
|
|
131
|
-
"**协作方向**: wizard 的直属 parent 代表管理归属;横向沟通不改变家谱。反问用 `kind:\"ask\"`,知会用 `kind:\"fyi\"`,派新工作用默认 `task`。`fyi` 永远放行。";
|
|
132
|
-
const tellBody = (a) => ({
|
|
133
|
-
name: a.name,
|
|
134
|
-
...(a.text !== undefined ? { text: a.text } : {}),
|
|
135
|
-
...(a.taskFile !== undefined ? { taskFile: a.taskFile } : {}),
|
|
136
|
-
...(a.params !== undefined ? { params: a.params } : {}),
|
|
137
|
-
...(a.return ? { return: a.return } : {}),
|
|
138
|
-
...(a.for ? { for: a.for } : {}),
|
|
139
|
-
...(a.kind ? { kind: a.kind } : {}),
|
|
140
|
-
...(a.priority ? { priority: a.priority } : {}),
|
|
141
|
-
...(a.waitSec ? { waitSec: a.waitSec } : {}),
|
|
142
|
-
...(a.planId ? { planId: a.planId } : {}),
|
|
143
|
-
...(a.public ? { public: true } : {}),
|
|
144
|
-
...(a.re !== undefined ? { re: a.re } : {}),
|
|
145
|
-
...(a.after?.length ? { after: a.after } : {}),
|
|
146
|
-
// 显式传布尔值, 让 daemon 只在调用方明确请求时越过冷缓存门控。
|
|
147
|
-
force: a.force === true,
|
|
148
|
-
});
|
|
90
|
+
// ── room: 唯一的沟通对象 ────────────────────────────────────────────────────
|
|
91
|
+
// 一个 room 一份账本 (shared/room.ts), 人和 wizard 走同一个 append 口子。这些工具只负责
|
|
92
|
+
// 把参数变成一次 HTTP 调用 —— 发言权、status 写入权、覆盖检查、唤醒预算都在 daemon 侧。
|
|
93
|
+
// 三条不会变的事实: 完成只认 chat_reply 的 status; 终句没有任何路由语义 (只进 turn store
|
|
94
|
+
// 与 rolepage); 被唤醒的 duty 只能用 chat_reply 交代。
|
|
95
|
+
const HISTORY_DOC = '被拉者入座后第一次被唤醒时能读到的旧话范围: "none" 只看之后的 | 正整数 N 最近 N 条 | "from:<msgId>" 从那条起 | "all" 全部 (缺省)。仍受 ~6000 字未读预算截断; 更早的随时 room_read。';
|
|
96
|
+
const historyArg = () => z.union([z.literal("none"), z.literal("all"), z.number().int().min(1), z.string().regex(/^from:.+/)]).optional().describe(HISTORY_DOC);
|
|
97
|
+
const ROOM_DOC = "room: 绑定了企微传输的群 / 单聊 / topic 帖写 base principal 原样 (`chat:…` / `user:…`) 或聊天名; " +
|
|
98
|
+
"`dm:…` 是你和某个 wizard 的两人 room, `adhoc:…` 是 room_open 开的临时 room。缺省 = 唤醒你这一轮的那条消息所在的 room; " +
|
|
99
|
+
"本轮由多个 room 一起唤醒时必须显式给 (否则 400)。绑定 room 里每条消息都真的进企微, dm / adhoc 只在 rolepage。";
|
|
100
|
+
const TO_DOC = "点名的 wizard (裸名, 带 `.` 也认); chat_ask 还可点名本 room 的人 (`human:<userid>`, room_members 里能看到)。只认本 room 的成员 —— chat_say 的 `to` 只是指出对谁说, 不唤醒、不开 duty; chat_ask 的每个 `to` 各开一条 duty (人名下的那条由人的下一句话关账, 并唤醒你)。";
|
|
101
|
+
const INTERRUPT_DOC = "true = 先 Esc 打断对方当前这一轮再投本条 (不拆 pane)。限权: 只有对方的直属 parent、本 room 的 host、或人能用, 其余 403; 计入本 room 的回合预算 (10 分钟 20 次), 超了 409。被打断那一轮的 duty 不关 —— 它下次被唤醒时按游标重投, 只是那一轮白付。";
|
|
102
|
+
const FOR_DOC = "这件活为你欠着的**哪一笔**派的: 写提问方的名字, 或那条消息的 id。只作血缘记录, 不参与关账 (完成只认 status); 缺省 = 本轮唤醒你的那一条, 通常不用给。";
|
|
103
|
+
const STATUS_DOC = "done = 做完了 · passed = 无需答复 · canceled = 不做了 (这三者关账) · need = 反问, 等提问方补信息 (提问方是人时, 在人名下开一条 duty, 人回话会叫醒你) · progress = 中间进展 (后两者不关账)。";
|
|
104
|
+
const ASK_KIND_DOC = "`ask` (默认) 一个问题, `task` 一件活 —— 两者都开 duty, 区别只写在行上给读的人看。";
|
|
149
105
|
// 交接只有一个动词: 不点名 = 交接你自己 (你写简报), 点名 = 替别人交接 (守护进程让它写)。
|
|
150
106
|
const handoffSelf = (tool, brief) => daemonPost("/wizard/handoff-self", { brief }).then((r) => unwrap(tool, r));
|
|
151
|
-
const DELEGATE_DESC = "派活一步到位: 给 task 或 taskFile+params
|
|
107
|
+
const DELEGATE_DESC = "派活一步到位: 给 task 或 taskFile+params。产出是一条 chat_ask —— 选中的 wizard 收到一条 duty, 只能用 chat_reply 交代, 没有别的回执通道; 返回实际决定、目标、room 与档位, dryRun 只返回决定与简短理由。lead 只在复杂任务使用。planId 只记录 event 与 plan 的关联,daemon 不会代替 owner 推进 DAG。\n" +
|
|
152
108
|
"先按验收目标分清独立新活和原任务续篇。独立新活另派不等于强制新生, 允许复用近期实际材料相关、空闲且无职责占用的非 lead; 按本次难度派, 不因同项目、公共 AGENTS.md/CLAUDE.md 或词面重叠塞给已有 lead。自动复用要求实质上下文证据、无 lead/任务占用、成本合适; 其余白板 spawn。难度看所需判断而非句长: 指明函数、接口、文件、按钮等具体对象且范围清楚的低风险 coding 默认 light; 其他常规任务默认 standard; 只有复杂方案判断、疑难升级或安全/并发/架构等高风险审查才显式 hard。\n" +
|
|
153
109
|
"你不同意就**显式推翻**: `to` 用于人明确指定或已确认必需的上下文连续性, `spawn:true` 硬要新的, `force:true` 只越过缓存成本门控, 不放宽自动复用的相关性。复杂任务用 `lead:true`: lead 建 plan,按阶段创建执行者并验收;简单任务直接派活、不建 plan。";
|
|
154
110
|
const DELEGATE_SCHEMA = {
|
|
@@ -158,17 +114,16 @@ const DELEGATE_SCHEMA = {
|
|
|
158
114
|
task: z.string().optional().describe("这件活的正文, 与 `taskFile` 二选一。给了 `taskFile` 就别再给 task —— 守护进程用展开后的全文派生选人与默认 description。写清目标与交付, 带文件名 / 模块名帮助找上下文; 公共规则文件或同目录不构成复用理由。不要把独立核查改写成原 lead 的附加交付。"),
|
|
159
115
|
taskFile: z.string().optional().describe("模板文件路径, **相对你的工作区**的相对路径 (绝对路径与 `~` 开头一律 400)。给了它, 投递正文由 daemon 用模板 + `params` 展开; 与 `task` 至少给一个。"),
|
|
160
116
|
params: z.record(z.string()).optional().describe("`taskFile` 模板里 `{{name}}` 占位符的参数值 (全为字符串)。缺参数 / 多余参数都会被 400 拒绝。"),
|
|
161
|
-
return: z.enum(["self", "transfer", "detach", "none"]).optional().describe(RETURN_DOC + " delegate 不能配 lead:true 用 transfer。"),
|
|
162
117
|
for: z.string().optional().describe(FOR_DOC),
|
|
163
118
|
name: z.string().optional().describe("可选的新 wizard 短名, 不是已有执行者的地址 (指定已有执行者用 to)。推荐省略或空白,新建时由 daemon 分配全机唯一中性英文名,职责另存; 复用时忽略。"),
|
|
164
119
|
description: z.string().optional().describe("可选的新 wizard 职责, 一句话。省略或空白 = 取 task 摘要; 复用时忽略。"),
|
|
165
120
|
tier: z.enum(TIERS).optional().describe("本次任务难度及 spawn 档位 (mini / light / standard / hard / ultra)。明确代码对象且范围清楚的低风险 coding 默认 light; 其他常规任务默认 standard; lead 默认 hard。只有复杂方案判断、疑难升级或安全/并发/架构等高风险审查才 hard / ultra。显式 tier 覆盖默认, 按所需判断而非句长选。复用已有 wizard 不会切换它的模型。"),
|
|
166
|
-
to: z.string().optional().describe("显式选定已有 wizard (名字), 绕过自动选人。仅在人明确指定执行者或必需上下文已确认时使用; 不能仅因同项目或已有 lead 在场。原任务续篇用
|
|
121
|
+
to: z.string().optional().describe("显式选定已有 wizard (名字), 绕过自动选人。仅在人明确指定执行者或必需上下文已确认时使用; 不能仅因同项目或已有 lead 在场。原任务续篇用 chat_ask 指回原活。"),
|
|
167
122
|
spawn: z.boolean().optional().describe("推翻默认: 不看候选, 一定白板 spawn。"),
|
|
168
123
|
force: z.boolean().optional().describe("越过冷门控: 缓存冷且 ctx ≥100k 的候选默认不转; 确认这件活真依赖它那段上下文才给 true。"),
|
|
169
|
-
lead: z.boolean().optional().describe("复杂任务由 lead 统筹并逐阶段维护 plan;简单任务不要建 plan
|
|
124
|
+
lead: z.boolean().optional().describe("复杂任务由 lead 统筹并逐阶段维护 plan;简单任务不要建 plan。产出是一条 chat_ask —— 结果由你在它交代后自己收口。"),
|
|
170
125
|
planId: z.string().optional().describe("这次派活归属的 plan id。仅关联event供owner的闲时提醒判断,不会自动推进plan;补充同一event时沿用关联。"),
|
|
171
|
-
|
|
126
|
+
room: z.string().optional().describe(ROOM_DOC + " 给了就把这条 chat_ask 落在这个 room (选中的子 wizard 以 spawn 免审入群; 你须是该 room 成员)。"),
|
|
172
127
|
dryRun: z.boolean().optional().describe("只要默认决定与理由, 不执行。"),
|
|
173
128
|
};
|
|
174
129
|
const runDelegate = async (tool, a) => {
|
|
@@ -182,7 +137,7 @@ const runDelegate = async (tool, a) => {
|
|
|
182
137
|
const offspringShape = {
|
|
183
138
|
description: z.string().describe("它负责什么, 一句话。它会写进它的系统提示, 也会出现在名册里让别人看到。"),
|
|
184
139
|
name: z.string().optional().describe("它的名字 (如 'docs'、'fix', 带不带 '.' 都行)。全机唯一。推荐省略,由 daemon 分配中性英文名,职责另存。"),
|
|
185
|
-
task: z.string().optional().describe("
|
|
140
|
+
task: z.string().optional().describe("就位后立刻开一条 duty 派下去 (等同一次 chat_ask)。省略则它就位待命。"),
|
|
186
141
|
// 出生投递 (bearAs 内直接 acceptPeerDispatch) 不经 tell 的模板展开入口 —— 第一期
|
|
187
142
|
// 不接 taskFile。声明出来是为了显式报错: 没声明的字段会被 zod 静默剥掉, 调用方
|
|
188
143
|
// 会以为模板生效了而实际投出去的是空/残正文。
|
|
@@ -193,8 +148,8 @@ const offspringShape = {
|
|
|
193
148
|
model: z.string().optional().describe(MODEL_DOC),
|
|
194
149
|
effort: z.enum(EFFORTS).optional().describe(EFFORT_DOC),
|
|
195
150
|
planId: z.string().optional().describe("若task属于现有plan,指定plan id以关联派活event;plan仍由owner显式更新。"),
|
|
196
|
-
|
|
197
|
-
|
|
151
|
+
for: z.string().optional().describe(FOR_DOC),
|
|
152
|
+
room: z.string().optional().describe(ROOM_DOC + " 给了就让它在那个 room 里入座 (via spawn, 免审) 并把这件活落在那儿 (你须是该 room 成员; 认不出 / 不是成员在生之前就拒, 派活失败回包 dispatched:false + dispatchError); 省略 = 你的 room。"),
|
|
198
153
|
};
|
|
199
154
|
const bear = (tool, inherit) => async (a) => {
|
|
200
155
|
// 见 offspringShape 的 taskFile 注释: 出生投递没有模板展开这一站。
|
|
@@ -209,10 +164,10 @@ const bear = (tool, inherit) => async (a) => {
|
|
|
209
164
|
...(a.planId ? { planId: a.planId } : {}),
|
|
210
165
|
...(a.cwd ? { cwd: a.cwd } : {}),
|
|
211
166
|
...(a.chat ? { chat: a.chat } : {}),
|
|
167
|
+
...(a.room ? { room: a.room } : {}),
|
|
212
168
|
...(a.model ? { model: a.model } : {}),
|
|
213
169
|
...(a.effort ? { effort: a.effort } : {}),
|
|
214
170
|
...(a.tier ? { tier: a.tier } : {}),
|
|
215
|
-
...(a.return ? { return: a.return } : {}),
|
|
216
171
|
...(a.for ? { for: a.for } : {}),
|
|
217
172
|
...(a.lead ? { lead: true } : {}),
|
|
218
173
|
}));
|
|
@@ -225,32 +180,25 @@ export const createWezardServer = () => {
|
|
|
225
180
|
const server = new McpServer({ name: "wezard", version: "0.0.1" }, { capabilities: { tools: {} } });
|
|
226
181
|
// 人侧 / 罕用的工具 (30 天零调用: 本机会话清单与改接、聊天目录) 不进默认
|
|
227
182
|
// 工具面 —— 每个注册的工具都占模型的上下文, 而这些要么人在 IM 里有对应命令 (`/sessions`
|
|
228
|
-
// `/chats`), 要么由
|
|
183
|
+
// `/chats`), 要么由 chat_ask / room_read 覆盖。路由都还在; `WEZARD_MCP_EXTRA=1` 把它们挂回来。
|
|
229
184
|
const registerRare = process.env.WEZARD_MCP_EXTRA === "1" ? server.registerTool.bind(server) : (() => undefined);
|
|
230
|
-
//
|
|
185
|
+
// v3 §2: 工作区是身份属性 —— set_workspace 只记录 (pendingCwd), 此后新开的会话/化身
|
|
186
|
+
// 在该目录启动; 不再驱动 handoff, 也不再有 keep 问句那一支。
|
|
231
187
|
server.registerTool("set_workspace", {
|
|
232
|
-
title: "
|
|
233
|
-
description: "设置这个 wizard
|
|
234
|
-
+ "**`keep:true` 是另一支**: 人回答「不用换, 就用现在这个目录」时调它 —— 不重开会话, 只把「这个工作区是人认过的」记下来, 此后新会话的开局不再问这件事。一个新聊天的第一个 wizard 落在默认兜底目录里, 开局会被要求先问一句要去哪个项目; 人给路径就走 `cwd`, 人说不用换就走 `keep`。",
|
|
188
|
+
title: "Set workspace directory for this identity",
|
|
189
|
+
description: "设置这个 wizard 身份的工作区 (绝对路径或 ~ 开头), **此后新开的会话/化身都在这个目录启动** (由人决定何时重开; 没有活 pane 时立即在新目录起一个)。活 CLI 进程不原地切 cwd, 当前会话不受影响、不需要 handoff; 要换目录就等下一次 /new 或 respawn。",
|
|
235
190
|
inputSchema: {
|
|
236
|
-
cwd: z.string().
|
|
237
|
-
keep: z
|
|
238
|
-
.boolean()
|
|
239
|
-
.optional()
|
|
240
|
-
.describe("人回答了「不用换, 就用现在这个目录」时传 `true` (不要传 cwd)。只记一笔确认 —— 不重开会话、不动上下文, 此后再没人问这件事。"),
|
|
191
|
+
cwd: z.string().describe("Absolute project path, e.g. /Users/foo/projects/bar. ~ is expanded."),
|
|
241
192
|
target: z
|
|
242
193
|
.string()
|
|
243
194
|
.optional()
|
|
244
195
|
.describe('Optional target override. "vid:<userid>" / "chatid:<chatid>" / raw "user:<id>"/"chat:<id>". Empty → derive from the calling session.'),
|
|
245
196
|
},
|
|
246
|
-
}, async ({ cwd,
|
|
247
|
-
if (!cwd && !keep)
|
|
248
|
-
return fail("set_workspace 要么给 cwd (换到那个目录), 要么给 keep:true (确认沿用当前目录)");
|
|
197
|
+
}, async ({ cwd, target }) => {
|
|
249
198
|
const { sessionId, tmuxPane } = selfRef();
|
|
250
199
|
const normalizedTarget = normalizeTarget(target);
|
|
251
200
|
const { j } = await daemonPost("/mirror/workspace", {
|
|
252
|
-
|
|
253
|
-
...(keep ? { keep: true } : {}),
|
|
201
|
+
cwd,
|
|
254
202
|
...(normalizedTarget ? { target: normalizedTarget } : {}),
|
|
255
203
|
...(sessionId ? { sessionId } : {}),
|
|
256
204
|
...(tmuxPane ? { tmuxPane } : {}),
|
|
@@ -260,68 +208,15 @@ export const createWezardServer = () => {
|
|
|
260
208
|
ok: false,
|
|
261
209
|
tool: "set_workspace",
|
|
262
210
|
reason: j.reason ?? "unknown",
|
|
263
|
-
...(j.pendingCwd ? {
|
|
264
|
-
pendingCwd: j.pendingCwd,
|
|
265
|
-
workspaceStatus: "queued_not_applied",
|
|
266
|
-
nextStep: "新 CLI 未能启动,工作区尚未应用;pendingCwd 仍保留。确认启动条件恢复后重试 set_workspace,之后在活会话中收尾当前任务并调用自身 handoff({brief})。",
|
|
267
|
-
} : {}),
|
|
211
|
+
...(j.pendingCwd ? { pendingCwd: j.pendingCwd } : {}),
|
|
268
212
|
}));
|
|
269
213
|
return ok({
|
|
270
214
|
ok: true,
|
|
271
215
|
target: j.target,
|
|
272
216
|
sessionId: j.sessionId,
|
|
273
217
|
cwd: j.cwd,
|
|
274
|
-
...(j.pendingCwd ? { pendingCwd: j.pendingCwd } : {}),
|
|
275
|
-
...(j.handoffRequired ? {
|
|
276
|
-
handoffRequired: true,
|
|
277
|
-
workspaceStatus: "queued_not_applied",
|
|
278
|
-
nextStep: "当前任务完成后,整理剩余工作的简报并调用 handoff({brief}) 自己交接。daemon 会在新 CLI 进程中应用待切换目录并继续简报;当前进程尚未切目录,不要让用户手动发 /new。",
|
|
279
|
-
} : {}),
|
|
280
|
-
...(j.scheduled ? { scheduled: true } : {}),
|
|
281
|
-
...(j.confirmed ? { confirmed: true } : {}),
|
|
282
|
-
});
|
|
283
|
-
});
|
|
284
|
-
// 企业微信 doc / smartsheet / contact MCP 桥接。把 daemon 远端的 MCP 转发
|
|
285
|
-
// 给本地 Claude: list_tools 列工具, call_tool 调用 (创建文档 / 写表格 / 读
|
|
286
|
-
// 内容)。category 当前可选: "doc" | "smartsheet" | "contact"。
|
|
287
|
-
// 大模型先调 list_tools 看可用方法和入参 schema, 再 call_tool。
|
|
288
|
-
server.registerTool("wecom_doc_list_tools", {
|
|
289
|
-
title: "List WeCom doc/smartsheet tools",
|
|
290
|
-
description: "List available WeCom MCP tools for a given category. Categories: 'doc' (online documents), 'smartsheet' (smart sheets), 'contact'. Returns tool names + JSON Schema. Call this BEFORE wecom_doc_call to discover method names and required arguments.",
|
|
291
|
-
inputSchema: {
|
|
292
|
-
category: z.string().describe("MCP category: 'doc' | 'smartsheet' | 'contact'."),
|
|
293
|
-
requesterUserId: z
|
|
294
|
-
.string()
|
|
295
|
-
.optional()
|
|
296
|
-
.describe("WeCom userid that owns the resulting docs. Optional — daemon falls back to config.wedoc.requesterUserId or defaultChat. 'user:xxx' prefix accepted."),
|
|
297
|
-
},
|
|
298
|
-
}, async ({ category, requesterUserId }) => {
|
|
299
|
-
const r = await daemonPost("/wedoc/list", { category, ...(requesterUserId ? { requesterUserId } : {}) });
|
|
300
|
-
return unwrap("wecom_doc_list_tools", r, (j) => j.result);
|
|
301
|
-
});
|
|
302
|
-
server.registerTool("wecom_doc_call", {
|
|
303
|
-
title: "Call WeCom doc/smartsheet tool",
|
|
304
|
-
description: "Invoke a specific WeCom MCP tool (after discovering it via wecom_doc_list_tools). Typical flow: list tools for 'doc' → pick a method like 'doc_create' → call it with args matching its inputSchema. Daily quota: 20 docs per requesterUserId.",
|
|
305
|
-
inputSchema: {
|
|
306
|
-
category: z.string().describe("MCP category: 'doc' | 'smartsheet' | 'contact'."),
|
|
307
|
-
method: z.string().describe("Tool name from wecom_doc_list_tools (e.g. 'doc_create', 'smartsheet_add_records')."),
|
|
308
|
-
args: z
|
|
309
|
-
.record(z.string(), z.unknown())
|
|
310
|
-
.optional()
|
|
311
|
-
.describe("JSON object matching the tool's inputSchema. Empty object if the tool takes no params."),
|
|
312
|
-
requesterUserId: z
|
|
313
|
-
.string()
|
|
314
|
-
.optional()
|
|
315
|
-
.describe("WeCom userid acting as document owner. Optional — daemon falls back to config / defaultChat. 'user:xxx' prefix accepted."),
|
|
316
|
-
},
|
|
317
|
-
}, async ({ category, method, args, requesterUserId }) => {
|
|
318
|
-
const r = await daemonPost("/wedoc/call", {
|
|
319
|
-
category,
|
|
320
|
-
method,
|
|
321
|
-
args: args ?? {},
|
|
322
|
-
...(requesterUserId ? { requesterUserId } : {}),
|
|
218
|
+
...(j.pendingCwd ? { pendingCwd: j.pendingCwd, appliedTo: "future-sessions" } : {}),
|
|
323
219
|
});
|
|
324
|
-
return unwrap("wecom_doc_call", r, (j) => j.result);
|
|
325
220
|
});
|
|
326
221
|
// ── Session discovery / switching (conversational) ─────────────────────────
|
|
327
222
|
// These let the WeCom-side Claude answer "列出所有 claude session" / "切到 xxx
|
|
@@ -363,26 +258,172 @@ export const createWezardServer = () => {
|
|
|
363
258
|
description: "以 revision 做 CAS 更新。tasks 是整份 DAG 替换;owner 显式推进、暂停、恢复、完成或取消计划。取消不等于完成。task.executor 可选,写执行者 wizard 的全局名字 (.name,带不带点都行) —— 不指派就不写,daemon 不自动填、不给旧记录补值;rolepage 上缺执行者的节点按 plan owner 展示。",
|
|
364
259
|
inputSchema: { planId: z.string().trim().min(1), ...PlanUpdateSchema.innerType().shape },
|
|
365
260
|
}, async (a) => unwrap("plan_update", await daemonPost("/plans/update", a)));
|
|
366
|
-
// ──
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
description: "给**这个聊天**起个短名字: notify 的收件人、spawn_wizard / clone_wizard 的 `chat` 从此能指到这里。没起过名字的聊天不会一直没名字 —— 第一次有人用到时守护进程按它的工作区自动补一个 (`~/develop/foo` → `foo`, 撞名加序号), 所以这个工具的用途是**起一个更好的名字**。这里的默认 wizard 出生时取聊天名; 它若还叫旧聊天名, 会跟着改 (wizard 的名字全局唯一, 撞名加后缀, 返回里的 `wizardRenamed` 就是它的新名字)。wizard 自己的名字用 wizard_identity 改, 与这里无关。用户说「给这个群起名叫 daily」「这个群叫什么」(不传 `name` 就是读) 「取消命名」(传 '-') 时调它。名字全机唯一、大小写不敏感。",
|
|
261
|
+
// ── chat_* / room_*: room 是唯一的沟通对象 ────────────────────────────────
|
|
262
|
+
// 这组 chat_* / room_* 工具就是全部出站与全部可见性管理 —— 没有「回执」通道, 也没有终句兜底:
|
|
263
|
+
// 要谁收到什么, 就写成一行; 要关一笔账, 就给 chat_reply 的 status。
|
|
264
|
+
server.registerTool("chat_say", {
|
|
265
|
+
title: "Say something in a room",
|
|
266
|
+
description: "在一个 room 里说一句 (不开 duty、不关账)。绑定 room 里这一行就真的进企微; dm / adhoc 只在 rolepage。派活 ack / 中间进展 / 只是想让别人看见一句话, 都用它。`to` 只指出对谁说, 不唤醒、不开 duty —— 要对方交代就用 chat_ask。",
|
|
373
267
|
inputSchema: currentAddressSchema({
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
268
|
+
room: z.string().optional().describe(ROOM_DOC),
|
|
269
|
+
text: z.string().describe("要说的话 (markdown)"),
|
|
270
|
+
to: z.array(z.string()).optional().describe(TO_DOC),
|
|
271
|
+
interrupt: z.boolean().optional().describe(INTERRUPT_DOC),
|
|
272
|
+
}),
|
|
273
|
+
}, async ({ room, text, to, interrupt }) => unwrap("chat_say", await daemonPost("/room/say", {
|
|
274
|
+
...(room ? { room } : {}),
|
|
275
|
+
text,
|
|
276
|
+
...(to?.length ? { to } : {}),
|
|
277
|
+
...(interrupt ? { interrupt: true } : {}),
|
|
278
|
+
})));
|
|
279
|
+
server.registerTool("chat_ask", {
|
|
280
|
+
title: "Ask a wizard in a room (opens a duty)",
|
|
281
|
+
description: "向 room 里的一个或多个 wizard 开一条 duty —— 派活、提问、催一件没交代的事都走它; 也可点名本 room 的人 (`human:<userid>`) 向人提问 —— 人名下的 duty 不用 chat_reply, 人在本 room 的下一句话就关账 (带企微引用只关被引用的那条) 并唤醒你, 不需要了就对那条 id chat_reply canceled / passed。对方 wizard 只能用 chat_reply 交代 (done / passed / canceled 才关账)。缺省 room 的落点: `to` 全是本 room 成员 → 本 room; 单个 `to` 不是成员 → 自动落你和它的 dm room; 多个 `to` 里有非成员 wizard → 按成员集合 {你 + 它们} 复用或新开一个 adhoc (你是 host, 不会把它们拉进缺省群; 这条分支里 `interrupt` 只给被点名者的直属 parent); `to` 里含人且不全在缺省 room → 400, 要先在同一个 room。回包的 `id` 就是这一行的消息 id, 之后可以用 room_read 查、用 chat_reply 答。",
|
|
282
|
+
inputSchema: currentAddressSchema({
|
|
283
|
+
room: z.string().optional().describe(ROOM_DOC),
|
|
284
|
+
to: z.union([z.string(), z.array(z.string())]).describe(TO_DOC),
|
|
285
|
+
text: z.string().describe("这件活 / 这一问的正文。写清目标、交付与验收; 对方看不到你这一轮的上下文。"),
|
|
286
|
+
kind: z.enum(["ask", "task"]).optional().describe(ASK_KIND_DOC),
|
|
287
|
+
after: z.array(z.string()).describe("前置: 这些消息 id 的 duty 全部 done 之前不唤醒它 (跨 room 也行)。省略 = 无前置。").optional(),
|
|
288
|
+
for: z.string().optional().describe(FOR_DOC),
|
|
289
|
+
planId: z.string().optional().describe("这件活归属的 plan id, 只做关联记录 —— daemon 不替你推进 DAG。"),
|
|
290
|
+
interrupt: z.boolean().optional().describe(INTERRUPT_DOC),
|
|
291
|
+
}),
|
|
292
|
+
}, async ({ room, to, text, kind, after, for: lineage, planId, interrupt }) => unwrap("chat_ask", await daemonPost("/room/ask", {
|
|
293
|
+
...(room ? { room } : {}),
|
|
294
|
+
to: Array.isArray(to) ? to : [to],
|
|
295
|
+
text,
|
|
296
|
+
...(kind ? { kind } : {}),
|
|
297
|
+
...(after?.length ? { after } : {}),
|
|
298
|
+
...(lineage ? { for: lineage } : {}),
|
|
299
|
+
...(planId ? { planId } : {}),
|
|
300
|
+
...(interrupt ? { interrupt: true } : {}),
|
|
301
|
+
})));
|
|
302
|
+
server.registerTool("chat_reply", {
|
|
303
|
+
title: "Close (or field) a duty — the only completion signal",
|
|
304
|
+
description: "答一条或多条 duty。room 由 `re` 定 —— 消息 id 全机唯一, 自带 room, 不用给。status: " + STATUS_DOC +
|
|
305
|
+
" 只有该 duty 的处理人 (或人) 能写 status, `re` 数组里任一条不归你 → 整行 403。不带 status 且你是处理人 = 有正文记 done、没正文记 passed; 不是处理人 = 普通线程回复 (不关账)。追问用 need, 长活中间报一句用 progress。",
|
|
306
|
+
inputSchema: currentAddressSchema({
|
|
307
|
+
re: z.union([z.string(), z.array(z.string())]).describe("要答的那些消息 id (信封 / 注入的未读行头部的 `[<id>]`)。"),
|
|
308
|
+
text: z.string().optional().describe("答复正文; 不给 (且你是处理人) = passed。"),
|
|
309
|
+
status: z.enum(["done", "need", "progress", "passed", "canceled"]).optional().describe(STATUS_DOC),
|
|
310
|
+
}),
|
|
311
|
+
}, async ({ re, text, status }) => unwrap("chat_reply", await daemonPost("/room/reply", {
|
|
312
|
+
re: Array.isArray(re) ? re : [re],
|
|
313
|
+
...(text !== undefined ? { text } : {}),
|
|
314
|
+
...(status ? { status } : {}),
|
|
315
|
+
})));
|
|
316
|
+
server.registerTool("onboard_bind", {
|
|
317
|
+
title: "Bind a steward for a brand-new chat (onboarding only)",
|
|
318
|
+
description: "**只有新群引导会话能调** (引导期由 daemon 起在 <chat>#guide 的那个), 其余调用 403 —— 已绑过 / 绑定完成就不要再调。"
|
|
319
|
+
+ "把本群管家定下来: 给 workspace (目录; 要新建就 create:true —— 只建最后一级, 父目录必须已存在, 且必须在 $HOME 下) 或给 name (已有管家)。"
|
|
320
|
+
+ "成功 = 绑定完成、引导结束: 管家进 room 接手, 人的原话连 duty 一起转给它; 你这一轮到此为止, 不要再说话、不要再调工具。"
|
|
321
|
+
+ "失败 = 4xx 带原因 (目录不存在 / 父目录不在 / 名字没认出), 引导继续, 用 chat_reply 向人追问。"
|
|
322
|
+
+ "绑定之外的任何要求都不要自己做 —— 绑定后连原话一起交给管家。",
|
|
323
|
+
inputSchema: currentAddressSchema({
|
|
324
|
+
workspace: z.string().optional().describe("管家的工作目录 (绝对路径或 ~ 开头)。要建目录就同时给 create:true。"),
|
|
325
|
+
create: z.boolean().optional().describe("workspace 不存在时建它 (只建最后一级; 父目录必须已存在; 必须在 $HOME 下)。"),
|
|
326
|
+
name: z.string().optional().describe("已有管家的名字 —— 给这个就不给 workspace。"),
|
|
327
|
+
}),
|
|
328
|
+
}, async ({ workspace, create, name }) => unwrap("onboard_bind", await daemonPost("/onboarding/bind", {
|
|
329
|
+
...(workspace ? { workspace } : {}),
|
|
330
|
+
...(create ? { create: true } : {}),
|
|
331
|
+
...(name ? { name } : {}),
|
|
332
|
+
})));
|
|
333
|
+
// ── room 管理面 ──────────────────────────────────────────────────────────
|
|
334
|
+
server.registerTool("room_open", {
|
|
335
|
+
title: "Open an adhoc room",
|
|
336
|
+
description: "开一个 `adhoc:…` 临时 room 并把 `with` 里的人拉进来 (你按 ord=1 入座, 是这个 room 的 host)。多步的活默认开一个跟进 room 把事情关在里面 —— 只有需要人和执行者直接对话时, 才把人拉进主 room。room 没有绑定传输, 消息只在 rolepage 可见。**开 room 请起个名字** (`title`): 写这个 room 在干什么, rolepage 的关系图 / 列表上就显示它; 不给则只显示成员名 (`A·B·C`), 看不出是哪件事; 事后可用 room_name 补。",
|
|
337
|
+
inputSchema: currentAddressSchema({
|
|
338
|
+
with: z.array(z.string()).describe("拉进来的 wizard 名 (裸名)。"),
|
|
339
|
+
title: z.string().optional().describe("room 的名字: 这个 room 在干什么, 一句话 (如「账单迁移 review」)。强烈建议给; 不给 rolepage 上只显示成员名。"),
|
|
340
|
+
}),
|
|
341
|
+
}, async ({ with: members, title }) => unwrap("room_open", await daemonPost("/room/open", { with: members, ...(title ? { title } : {}) })));
|
|
342
|
+
server.registerTool("room_name", {
|
|
343
|
+
title: "Name a room / set its notice (host only)",
|
|
344
|
+
description: "给 room 起显示名 (`name`) 和 / 或设群公告 (`notice`), 两个至少给一个; 只有本 room 的 host 能改。名字只是别名: room 的地址永远是 id (chat:… / user:… / dm:… / adhoc:…), 名字不参与寻址, 同名也不冲突; 它只出现在 rolepage、注入头与 room_read 的标签里。公告是每个 room 一条的一句话 (本周重点 / 某条规矩), 让 room 里所有 wizard 一直知道: 改动时绑定 room 里会发一条「📌 群公告」系统行 (进企微), 在跑的成员下一次注入时随 system-reminder 收到, 新 wizard 的宪章里带着, room_read 头部也有; `notice: \"\"` 清除; 与现有相同则无变化。host 换人后由新 host 改; 人用 `/notice`。",
|
|
345
|
+
inputSchema: currentAddressSchema({
|
|
346
|
+
room: z.string().describe(ROOM_DOC),
|
|
347
|
+
name: z.string().optional().describe("新的显示名, 一句话, 最多 60 字。"),
|
|
348
|
+
notice: z.string().optional().describe("群公告正文, 最多 500 字 (空白会折成单个空格); 空串 = 清除。"),
|
|
349
|
+
}),
|
|
350
|
+
}, async ({ room, name, notice }) => unwrap("room_name", await daemonPost("/room/name", { room, ...(name !== undefined ? { name } : {}), ...(notice !== undefined ? { notice } : {}) })));
|
|
351
|
+
server.registerTool("room_invite", {
|
|
352
|
+
title: "Invite someone into a room",
|
|
353
|
+
description: "把 `who` 拉进 room: host / 人 / 拉自己直属的子 wizard 时立即入群 (via invite / spawn); 其余成员的邀请转成一条 join-req, 等 host 批 (此时 history 不生效, 由 host 在 room_approve 时选)。",
|
|
354
|
+
inputSchema: currentAddressSchema({
|
|
355
|
+
room: z.string().describe(ROOM_DOC),
|
|
356
|
+
who: z.string().describe("要拉进来的 wizard 名 (裸名)。"),
|
|
357
|
+
history: historyArg(),
|
|
378
358
|
}),
|
|
379
|
-
}, async ({
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
359
|
+
}, async ({ room, who, history }) => unwrap("room_invite", await daemonPost("/room/invite", { room, who, ...(history !== undefined ? { history } : {}) })));
|
|
360
|
+
server.registerTool("room_join", {
|
|
361
|
+
title: "Ask to join a room",
|
|
362
|
+
description: "申请加入一个你还不是成员的 room: 写一条 join-req 并唤醒 host。批准之前你在那个 room 里的话落不成行。`reason` 是给 host 看的理由, 一句话。",
|
|
363
|
+
inputSchema: currentAddressSchema({
|
|
364
|
+
room: z.string().describe(ROOM_DOC),
|
|
365
|
+
reason: z.string().describe("为什么需要进来, 一句话。"),
|
|
366
|
+
}),
|
|
367
|
+
}, async ({ room, reason }) => unwrap("room_join", await daemonPost("/room/join", { room, reason })));
|
|
368
|
+
server.registerTool("room_approve", {
|
|
369
|
+
title: "Approve or reject a join request",
|
|
370
|
+
description: "host / 人批一条 join-req: `accept:false` 拒绝。`re` 是那条 join-req 的消息 id。",
|
|
371
|
+
inputSchema: currentAddressSchema({
|
|
372
|
+
re: z.string().describe("join-req 的消息 id。"),
|
|
373
|
+
accept: z.boolean().describe("true = 放进来, false = 拒绝。"),
|
|
374
|
+
history: historyArg(),
|
|
375
|
+
}),
|
|
376
|
+
}, async ({ re, accept, history }) => unwrap("room_approve", await daemonPost("/room/approve", { re, accept, ...(history !== undefined ? { history } : {}) })));
|
|
377
|
+
server.registerTool("room_leave", {
|
|
378
|
+
title: "Leave a room (or remove someone)",
|
|
379
|
+
description: "退出 room, 缺省是自己; host / 人可以用 `who` 移出别人。你手上这个 room 未结的 duty 由守护进程写成 canceled 并唤醒提问者 —— 走之前能交代的先 chat_reply 交代。",
|
|
380
|
+
inputSchema: currentAddressSchema({
|
|
381
|
+
room: z.string().describe(ROOM_DOC),
|
|
382
|
+
who: z.string().optional().describe("移出谁 (wizard 名)。省略 = 自己退出。"),
|
|
383
|
+
}),
|
|
384
|
+
}, async ({ room, who }) => unwrap("room_leave", await daemonPost("/room/leave", { room, ...(who ? { who } : {}) })));
|
|
385
|
+
server.registerTool("room_members", {
|
|
386
|
+
title: "Who is in this room",
|
|
387
|
+
description: "列本 room 的成员 (加入序、host、各自未结 duty 数) 与已读游标。纯文本。缺省 = 唤醒你这一轮的 room。",
|
|
388
|
+
inputSchema: currentAddressSchema({ room: z.string().optional().describe(ROOM_DOC) }),
|
|
389
|
+
}, async ({ room }) => unwrapText("room_members", await daemonPost("/room/members", { ...(room ? { room } : {}) })));
|
|
390
|
+
server.registerTool("room_transfer", {
|
|
391
|
+
title: "Hand a duty over to another wizard",
|
|
392
|
+
description: "把一条 duty 转给另一个 wizard (账本上写一行 move, 关账权随之过去)。`to` 不是成员时按 room_invite 的规则先入群。转出去之后这件事不再归你, 你也不需要再 chat_reply 它。",
|
|
393
|
+
inputSchema: currentAddressSchema({
|
|
394
|
+
re: z.string().describe("要转的那条 duty 的消息 id。"),
|
|
395
|
+
to: z.string().describe("转给谁 (wizard 名, 裸名)。"),
|
|
396
|
+
}),
|
|
397
|
+
}, async ({ re, to }) => unwrap("room_transfer", await daemonPost("/room/transfer", { re, to })));
|
|
398
|
+
server.registerTool("room_read", {
|
|
399
|
+
title: "Read a room's ledger",
|
|
400
|
+
description: "读 room 账本, 纯文本, 一行一条 (行首 `[<id>]` 就是可以拿去 chat_reply 的 id)。默认只给游标之后你还没读过的那些; `all:true` 给全量。按时间 / 条数翻: `from` 从某条 id 之后, `since` / `until` 按时刻, `limit` 条数, `per` 单条字数上限。想读某个 wizard 会话里的原始对话用 peek_peer; 频道 (topic) 的历史用 read_channel。",
|
|
401
|
+
inputSchema: currentAddressSchema({
|
|
402
|
+
room: z.string().optional().describe(ROOM_DOC),
|
|
403
|
+
from: z.string().optional().describe("从这条消息 id 之后开始 (不含它)。"),
|
|
404
|
+
since: z.string().optional().describe("从什么时候起: `2h` / `30m` / `3d`、`14:30`、`09-30 14:30` 或 ISO 时间。"),
|
|
405
|
+
until: z.string().optional().describe("到什么时候为止 (不含), 写法同 `since`。往回翻页就把回执里给的时刻传进来。"),
|
|
406
|
+
limit: z.number().optional().describe("最多回多少条 (1-200)。"),
|
|
407
|
+
all: z.boolean().optional().describe("true = 不看游标, 给全量 (受 limit / 时间窗约束)。"),
|
|
408
|
+
per: z.number().optional().describe("单条正文最多多少字 (40-4000, 默认 500); 超出的标成 `…(+N)`。"),
|
|
409
|
+
}),
|
|
410
|
+
}, async ({ room, from, since, until, limit, all, per }) => unwrapText("room_read", await daemonPost("/room/read", {
|
|
411
|
+
...(room ? { room } : {}),
|
|
412
|
+
...(from ? { from } : {}),
|
|
413
|
+
...(since ? { since } : {}),
|
|
414
|
+
...(until ? { until } : {}),
|
|
415
|
+
...(limit ? { limit } : {}),
|
|
416
|
+
...(all ? { all } : {}),
|
|
417
|
+
...(per ? { per } : {}),
|
|
418
|
+
})));
|
|
419
|
+
server.registerTool("room_watch", {
|
|
420
|
+
title: "Subscribe to a room",
|
|
421
|
+
description: "订阅一个 room: 之后人新说一句、或有 duty 被关账时也唤醒你 (默认关)。每次唤醒都真的花你一轮, 所以不需要实时跟就看一眼 room_read —— 别顺手订阅。",
|
|
422
|
+
inputSchema: currentAddressSchema({
|
|
423
|
+
room: z.string().describe(ROOM_DOC),
|
|
424
|
+
on: z.boolean().describe("true = 订阅, false = 退订。"),
|
|
425
|
+
}),
|
|
426
|
+
}, async ({ room, on }) => unwrap("room_watch", await daemonPost("/room/watch", { room, on })));
|
|
386
427
|
registerRare("list_chats", {
|
|
387
428
|
title: "List every chat and its sessions",
|
|
388
429
|
description: "(罕用 · 同 IM `/chats`) 每个聊天的名字与住在那里的 wizard。只在要给 notify / spawn 的 `chat` 找聊天名时用; 找 wizard 用 wizard_roster。",
|
|
@@ -390,39 +431,15 @@ export const createWezardServer = () => {
|
|
|
390
431
|
}, async () => unwrap("list_chats", await daemonPost("/chats/list", {})));
|
|
391
432
|
server.registerTool("peek_peer", {
|
|
392
433
|
title: "Read what another wizard has been saying",
|
|
393
|
-
description: "**不打扰**地读另一个 wizard 的会话: 首行是它此刻的状态 (正在生成 / 空闲 / 停在哪个工具调用上等人点), 下面是它最近 N 个来回的正文 —— `▸` 是别人对它说的, `◂` 是它对这句最新说的一句 (跑完的是终句, 还在跑的是途中最近那句), 最后一条给得最全; 截掉的地方都标了 `…(+N)` / `…(略 N 字)…`。全部从它的 transcript 读: 只有说出来的话, 没有工具调用的过程, 回答「.fix 进展如何」「它卡在哪」, 或者判断要不要推它一把, 都读这里。这是**一个会话**的视角 (它从各处听到的都在里面);
|
|
434
|
+
description: "**不打扰**地读另一个 wizard 的会话: 首行是它此刻的状态 (正在生成 / 空闲 / 停在哪个工具调用上等人点), 下面是它最近 N 个来回的正文 —— `▸` 是别人对它说的, `◂` 是它对这句最新说的一句 (跑完的是终句, 还在跑的是途中最近那句), 最后一条给得最全; 截掉的地方都标了 `…(+N)` / `…(略 N 字)…`。全部从它的 transcript 读: 只有说出来的话, 没有工具调用的过程, 回答「.fix 进展如何」「它卡在哪」, 或者判断要不要推它一把, 都读这里。这是**一个会话**的视角 (它从各处听到的都在里面); 要看**一个 room** 里谁对谁说了什么, 用 room_read。只读, 随便轮询。",
|
|
394
435
|
inputSchema: currentAddressSchema({
|
|
395
436
|
name: z.string().describe(ADDRESS_DOC),
|
|
396
437
|
turns: z.number().optional().describe("回最近多少个来回 (1-40, 默认 6); 一个来回 = 一句问话 + 它的回答。"),
|
|
397
438
|
}),
|
|
398
439
|
}, async ({ name, turns }) => unwrapText("peek_peer", await daemonPost("/peers/peek", { name, ...(turns ? { turns } : {}) })));
|
|
399
|
-
server.registerTool("read_chat", {
|
|
400
|
-
title: "Read chat history like a person would",
|
|
401
|
-
description: "像人翻聊天记录那样读往来, 一行一句: `[时刻] .谁: .谁 说了什么` (wizard 名字前带 `.`, 人只写名字)。三级收窄, 每一级都可以不给: `role` (谁的视角 —— 只留它说的或听的) → `chat` (哪个群 —— 只留那个群里公开说的) → `target` (和谁 —— 只留与它的往来)。什么都不给 = 你这一轮所在的群: 人说的、各个 wizard 答的、wizard 之间公开说的都在里面。只给 `target` = 你和它的全部往来 (含 tell_peer 默认走的私聊, 群里看不见的那部分); `role` + `target` = 那两方之间; 只给 `role` = 它在所有群与私聊里的往来; 再加 `chat` 就限定在那个群里。没给 `chat` 时每行会标出这句是在哪个聊天 / 私聊里说的。一条消息一行起头, 正文的续行缩进; 还没等到回答的问话行尾标 `(还没有回复)`。\n" +
|
|
402
|
-
"按时间和条数读: 默认回最新的 `limit` 条; `until` = 只看那之前的 (往回翻页), `since` = 从那时起 (只给 `since` 就从它往后数 `limit` 条)。回执末尾给出翻页用的时刻, 原样传回即可; 往回已经没有了会明说到头。\n" +
|
|
403
|
-
"只有正文: 每个来回取问话和终句, 工具调用的过程不在里面, 记录是从各个 wizard 当前会话的 transcript 现拼的: 一个 wizard `/clear` 或交接之前说的不在里面, 除点名的 role / target 外只并最近一周动过的会话。用户说「群里刚才聊了什么」「.fix 之前怎么答的」「我上次让 .docs 干了什么」, 或者你被叫进一个已经聊了一阵的群、需要来龙去脉时调它。要读**某一个 wizard** 会话里的原始对话用 peek_peer。",
|
|
404
|
-
inputSchema: {
|
|
405
|
-
role: z.string().optional().describe("谁的视角: wizard 的名字 ('fix' / '.fix') 或人的 userid。省略 = 不限 (给了 `target` 时默认是你自己)。"),
|
|
406
|
-
chat: z.string().optional().describe("哪个群: 聊天名 (wizard_roster 里的 home 聊天名) 或裸 principal。省略 = 不限群 (公开与私聊都算); 三个都省略 = 你这一轮所在的群。"),
|
|
407
|
-
target: z.string().optional().describe("和谁的往来: wizard 的名字或人的 userid。"),
|
|
408
|
-
since: z.string().optional().describe("从什么时候起: `2h` / `30m` / `3d` (多久以前)、`14:30` (今天)、`09-30 14:30`、或 ISO 时间。"),
|
|
409
|
-
until: z.string().optional().describe("到什么时候为止 (不含), 写法同 `since`。往回翻页就把回执里的「更早的」时刻传进来。"),
|
|
410
|
-
limit: z.number().optional().describe("最多回多少条 (1-200, 默认 30)。"),
|
|
411
|
-
per: z.number().optional().describe("单条正文最多多少字 (40-4000, 默认 500); 超出的部分标成 `…(+N)`。"),
|
|
412
|
-
},
|
|
413
|
-
}, async ({ role, chat, target, since, until, limit, per }) => unwrapText("read_chat", await daemonPost("/chats/read", {
|
|
414
|
-
...(role ? { role } : {}),
|
|
415
|
-
...(chat ? { chat } : {}),
|
|
416
|
-
// `target` 在守护进程的请求体里是「调用方是谁」的覆盖 (resolveSelf), 不能占用。
|
|
417
|
-
...(target ? { with: target } : {}),
|
|
418
|
-
...(since ? { since } : {}),
|
|
419
|
-
...(until ? { until } : {}),
|
|
420
|
-
...(limit ? { limit } : {}),
|
|
421
|
-
...(per ? { per } : {}),
|
|
422
|
-
})));
|
|
423
440
|
server.registerTool("read_channel", {
|
|
424
441
|
title: "Read a WeCom channel's history",
|
|
425
|
-
description: "翻一个**频道**(企微 topic,不是群聊)的聊天历史,或者按关键词搜。频道里派给你的活,消息头上有 `topic=<id>` —— 注入的上下文(当前线程 + 最近若干条 + 搜索命中)不够时用它自己往前翻。先读本地缓存(daemon 为每个频道存了一份,含 reload / 断线期回填的消息);给了 `query` 且本地不够时才走官方搜索(`aibot_topic_search` 两步:先出 jobid 再取摘要,正文再按 post_id 取回)。返回一行一条:`[HH:MM] 作者: 正文`,作者是 userid 或 `bot:<aibotid 前十位>`。这是**频道**视角;群聊 /
|
|
442
|
+
description: "翻一个**频道**(企微 topic,不是群聊)的聊天历史,或者按关键词搜。频道里派给你的活,消息头上有 `topic=<id>` —— 注入的上下文(当前线程 + 最近若干条 + 搜索命中)不够时用它自己往前翻。先读本地缓存(daemon 为每个频道存了一份,含 reload / 断线期回填的消息);给了 `query` 且本地不够时才走官方搜索(`aibot_topic_search` 两步:先出 jobid 再取摘要,正文再按 post_id 取回)。返回一行一条:`[HH:MM] 作者: 正文`,作者是 userid 或 `bot:<aibotid 前十位>`。这是**频道**视角;群聊 / 私聊 / dm 的账本用 room_read,单个 wizard 的会话用 peek_peer。只读,随便查。",
|
|
426
443
|
inputSchema: {
|
|
427
444
|
topic: z.string().describe("频道 id:`chat:<topic_id>` 或裸 topic_id —— 频道消息上下文头的 `topic=` 就是它。"),
|
|
428
445
|
query: z.string().optional().describe("按关键词搜历史(先本地 grep,不够再走官方搜索)。不给 = 按时间翻最新若干条。"),
|
|
@@ -437,64 +454,48 @@ export const createWezardServer = () => {
|
|
|
437
454
|
...(since ? { since } : {}),
|
|
438
455
|
...(until ? { until } : {}),
|
|
439
456
|
})));
|
|
440
|
-
server.registerTool("tell_peer", { title: "Say something to another wizard (reply comes back by itself)", description: TELL_DESC, inputSchema: currentAddressSchema(TELL_SCHEMA) }, async (a) => {
|
|
441
|
-
if (a.text === undefined && a.taskFile === undefined)
|
|
442
|
-
return fail("tell_peer: `text` 与 `taskFile` 至少给一个 (后者是相对你工作区的模板路径, 由 daemon 展开)");
|
|
443
|
-
return unwrap("tell_peer", await daemonPost("/peers/tell", tellBody(a)));
|
|
444
|
-
});
|
|
445
457
|
server.registerTool("notify", {
|
|
446
|
-
title: "Post a message into a
|
|
447
|
-
description: "把一段 markdown
|
|
448
|
-
"
|
|
449
|
-
"什么时候用: 长活跑完了要通知另一个群的人; 一批分身收工后把汇总播给发起那个群; 定时任务 (schedule_task) 到点跑完把结论送到该看的人那里。",
|
|
458
|
+
title: "Post a message into a room for people to read",
|
|
459
|
+
description: "把一段 markdown 发进一个或多个 room **给人看**: 不唤醒任何 wizard、不点名、不开 duty。绑定 room 里它作为一条消息进企微 (气泡头自动署你的名字), dm / adhoc 只在 rolepage。和 chat_say 的区别只在落点: notify 发去别的 room, chat_say 说在你此刻所在的 room。长活跑完通知另一个群、批量分身收工后把汇总播给发起方、定时任务把结论送到该看的人那里, 都用它。\n" +
|
|
460
|
+
"给谁看是 room 的事 —— 说话的对象是 room, 不再是某个收件人。",
|
|
450
461
|
inputSchema: currentAddressSchema({
|
|
451
|
-
|
|
452
|
-
.array(z.string())
|
|
462
|
+
room: z
|
|
463
|
+
.union([z.string(), z.array(z.string())])
|
|
453
464
|
.optional()
|
|
454
|
-
.describe(
|
|
465
|
+
.describe(ROOM_DOC + " 可以给一组; 认不出的整条拒绝并列出来, 不会部分送达。省略 = 唤醒你这一轮的 room。"),
|
|
455
466
|
markdown: z.string().describe("正文, markdown。头 (是谁发的) 由守护进程自动加, 别自己写。"),
|
|
456
467
|
}),
|
|
457
|
-
}, async ({
|
|
468
|
+
}, async ({ room, markdown }) => unwrap("notify", await daemonPost("/room/notify", {
|
|
469
|
+
...(room === undefined ? {} : { room: Array.isArray(room) ? room : [room] }),
|
|
470
|
+
markdown,
|
|
471
|
+
})));
|
|
458
472
|
server.registerTool("send_file", {
|
|
459
|
-
title: "Send a local file / image into a
|
|
460
|
-
description: "把本机一个文件作为**图片 / 文件 / 语音 /
|
|
461
|
-
"`kind` 省略按扩展名定: png/jpg/jpeg/gif → image, mp4 → video, amr → voice, 其余 → file。企微上限: 图片 ≤10MB、视频 mp4 ≤10MB、语音只收 amr ≤2MB、文件 ≤20MB; 超了直接报错并告诉你怎么改 (
|
|
462
|
-
|
|
473
|
+
title: "Send a local file / image into a room",
|
|
474
|
+
description: "把本机一个文件作为**图片 / 文件 / 语音 / 视频消息**发进 room —— notify 的媒体版, 同样不唤醒谁、不开 duty。截图、图表、导出报表、日志包要给人时用它, 别只在回复里写一个本地路径 (人那边打不开)。\n" +
|
|
475
|
+
"`kind` 省略按扩展名定: png/jpg/jpeg/gif → image, mp4 → video, amr → voice, 其余 → file。企微上限: 图片 ≤10MB、视频 mp4 ≤10MB、语音只收 amr ≤2MB、文件 ≤20MB; 超了直接报错并告诉你怎么改 (大图改 `kind:\"file\"`)。\n" +
|
|
476
|
+
"`re` 只把这行挂到那条消息的线程上 —— 它不关任何 duty, 要交代就另调 chat_reply。",
|
|
477
|
+
inputSchema: currentAddressSchema({
|
|
478
|
+
room: z.string().optional().describe(ROOM_DOC),
|
|
463
479
|
path: z.string().describe("本机绝对路径 (`~` 可用)"),
|
|
464
480
|
kind: z.enum(["image", "file", "voice", "video"]).optional().describe("省略 = 按扩展名推断"),
|
|
465
|
-
to: z.string().optional().describe("收件聊天名或裸 principal; 省略 = 你这一轮所在的群 (私聊轮则是你的 home 群)"),
|
|
466
481
|
caption: z.string().optional().describe("附一句说明: 先以一条带你名字的 markdown 气泡发出, 再发文件"),
|
|
467
482
|
title: z.string().optional().describe("仅视频: 标题"),
|
|
468
483
|
description: z.string().optional().describe("仅视频: 描述"),
|
|
469
|
-
|
|
470
|
-
}, async (a) => unwrap("send_file", await daemonPost("/send_file", a)));
|
|
471
|
-
server.registerTool("wait_peer", {
|
|
472
|
-
title: "Wait until another wizard stops working",
|
|
473
|
-
description: "`tell_peer` 的结论通常会自动作为新的一轮送到你这里 (回执), 不必守着等。只有下一步硬依赖当前结果、拆成两轮会丢上下文, 或需要 `need:1` 谁先完成先处理时, 才用它阻塞等。代价是你这个 pane 在等待期间不能处理其他工作。\n" +
|
|
474
|
-
"被它取走的那一份**不会再作为回执注入**一遍 (返回里 `delivered: true` = 回执已经抢先进过你的会话, 别重复处理)。\n" +
|
|
475
|
-
"挂起, 直到点名的 wizard 停下来 (它的终端不再显示中断提示), 然后返回它最新的回复。超时先到则返回 `idle: false` 与原因: 它只是还在干, 你可以 peek 一眼再等。很便宜: 守护进程轮询的是 pane, 不烧 token。回的只算**你上次 tell_peer 之后**它说的: 它收口了 `RESULT: …` 就只回 `result` (`omitted` = 正文还有多少字没给, 要读用 peek_peer), 没收口才回 `lastText` (超长掐中间); `stale: true` = 它停下了却没有新回复 (卡在弹窗上, 或那句话没被接住) —— peek_peer 看一眼, 别把它当成答完了。\n" +
|
|
476
|
-
"**真要等一批就用 `names` 一次等一组**, 别一个一个等: 它们本来在同时干活, 串行等的墙钟是所有人之和, 并行等只等最慢的那一个。等一组时 `results` 按你给的顺序逐个回, 只等一个则直接摊平在顶层。`need` 决定满几个就返回 (默认全部; `need:1` = 谁先完事就先处理谁, 剩下的还在跑, 再调一次接着等)。",
|
|
477
|
-
inputSchema: currentAddressSchema({
|
|
478
|
-
name: z.string().optional().describe(`${ADDRESS_DOC} 等一组时改用 \`names\`。`),
|
|
479
|
-
names: z
|
|
480
|
-
.array(z.string())
|
|
481
|
-
.optional()
|
|
482
|
-
.describe("一次等多个 wizard 的名字 (最多 16 个), 每个的写法同 `name`。fan-out 之后的 join 用它 —— 五个分身并行等只花最慢那一个的时间。"),
|
|
483
|
-
need: z
|
|
484
|
-
.number()
|
|
485
|
-
.optional()
|
|
486
|
-
.describe("满几个就返回 (1 到地址个数, 默认全部)。`1` = 任意一个先完事就返回; 中间值 = 法定人数。满足后剩下的等待会被撤掉, 它们照常继续干活, 结果里 `idle:false`。"),
|
|
487
|
-
timeoutSec: z.number().optional().describe("Max seconds to wait (10-7200, default 900)."),
|
|
484
|
+
re: z.string().optional().describe("挂到哪条消息的线程上 (消息 id)。"),
|
|
488
485
|
}),
|
|
489
|
-
}, async ({
|
|
490
|
-
...(
|
|
491
|
-
|
|
492
|
-
...(
|
|
486
|
+
}, async ({ room, path, kind, caption, title, description, re }) => unwrap("send_file", await daemonPost("/room/file", {
|
|
487
|
+
...(room ? { room } : {}),
|
|
488
|
+
path,
|
|
489
|
+
...(kind ? { kind } : {}),
|
|
490
|
+
...(caption ? { caption } : {}),
|
|
491
|
+
...(title ? { title } : {}),
|
|
492
|
+
...(description ? { description } : {}),
|
|
493
|
+
...(re ? { re } : {}),
|
|
493
494
|
})));
|
|
494
495
|
server.registerTool("handoff", {
|
|
495
496
|
title: "Hand work over to a fresh context (yourself or another wizard)",
|
|
496
497
|
description: "把工作压成简报并在当前轮结束后交给新上下文。没有待切换工作区时,守护进程在原 pane 清空上下文并接回简报;存在 pendingCwd 时,会启动新的 CLI 进程,在待切换目录中接回简报。\n" +
|
|
497
|
-
"**不传 `name` = 交接你自己**: 简报由你写在 `brief` 里, 守护进程给这一轮一个短收尾窗口, 到点即打断并交接 (欠着的回执会在新会话里逐笔续答, 不会丢)
|
|
498
|
+
"**不传 `name` = 交接你自己**: 简报由你写在 `brief` 里, 守护进程给这一轮一个短收尾窗口, 到点即打断并交接 (欠着的回执会在新会话里逐笔续答, 不会丢)。交接是纯上下文管理 —— 想同时换目录就先 `set_workspace({cwd})` 记下 (此后新会话生效), handoff 会顺手在新目录接回简报。简报要写到零上下文的自己仅凭它就能接着干: 总目标 / 已完成与关键决策 / 当前状态 / 有序的下一步 / 关键文件与非显然的坑。\n" +
|
|
498
499
|
"**传 `name` = 替那个 wizard 交接**: 守护进程让它自己写简报 (`focus` 指定要特别交代的点), 抓到后在原 pane 清空并贴回; 返回被带过去的那份简报。",
|
|
499
500
|
inputSchema: currentAddressSchema({
|
|
500
501
|
name: z.string().optional().describe("替谁交接 —— wizard 的名字 ('fix' / '.fix')。省略 = 你自己。"),
|
|
@@ -588,38 +589,42 @@ export const createWezardServer = () => {
|
|
|
588
589
|
}, async () => unwrap("wizard_whoami", await daemonPost("/wizard/whoami", {})));
|
|
589
590
|
server.registerTool("wizard_identity", {
|
|
590
591
|
title: "Name yourself / declare your job",
|
|
591
|
-
description: "
|
|
592
|
+
description: "修改 name、description 或 expertise。不给 to = 改自己; 给 to (实例名, 带不带点都认) = 改那个 wizard —— 只有它的直属 parent 或管家实例能改。目标是类实例时 name 是**新类名** (该类的全部实例同步成 新类名-N, 序号不变; 形如 X-3 的名字直接拒)。返回落定名; 类改名附类名与实例清单。",
|
|
592
593
|
inputSchema: currentAddressSchema({
|
|
593
|
-
|
|
594
|
+
to: z.string().optional().describe("要改谁: wizard 的地址 (实例名 / 类名, 例如 `wezard-2` 或 `.wezard-2`)。不传 = 改自己。"),
|
|
595
|
+
name: z.string().optional().describe("新名字, 1-32 位字母/数字/`_`/`-`, 全机唯一。类实例 = 新类名 (不以 -数字 结尾)。不改就别传。"),
|
|
594
596
|
description: z.string().optional().describe("一句话职责, 例如 '盯 wezard 主仓的重构与发版'。不改就别传。"),
|
|
595
597
|
expertise: z.string().optional().describe("一句话专长: 熟哪块代码 / 领域, 例如 'rolepage 前端 (web/chat.js · role-view)'。名册与 delegate 候选行都显示它, 任务与它重叠时可据此选择。传 '-' 清掉。"),
|
|
596
598
|
}),
|
|
597
|
-
}, async ({ name, description, expertise }) => unwrap("wizard_identity", await daemonPost("/wizard/identity", {
|
|
599
|
+
}, async ({ to, name, description, expertise }) => unwrap("wizard_identity", await daemonPost("/wizard/identity", {
|
|
600
|
+
...(to !== undefined ? { to } : {}),
|
|
598
601
|
...(name !== undefined ? { name } : {}),
|
|
599
602
|
...(description !== undefined ? { description } : {}),
|
|
600
603
|
...(expertise !== undefined ? { expertise } : {}),
|
|
601
604
|
}), undefined, { name, description, expertise }));
|
|
602
605
|
server.registerTool("wizard_roster", {
|
|
603
|
-
title: "
|
|
604
|
-
description: "
|
|
605
|
-
"
|
|
606
|
+
title: "Roster pyramid: 在场 → 本群 → 全机",
|
|
607
|
+
description: "名册是金字塔, 默认只给 **L0 在场** (≤12 行): 你 + 本群管家 + 本聊天 48h 内动过的化身, 各一行, 尾行全机普查 (N 身份 · M 群 · 忙/闲/冷)。\n" +
|
|
608
|
+
"**升级靠显式参数**: `chat` (聊天名) = **L1 本群** 该聊天全部化身含冷的, 带职责/最近/家谱 (≤40 行); `scope:\"all\"` = **L2 组团** 每个聊天一行名字概览 (≤60 行); 单个 wizard 的详情用 `peek_peer`。\n" +
|
|
609
|
+
"**自动降级**: 你的 ctx 到交接线时只回 L0 并注明 —— 那时候也别拉大表。\n" +
|
|
610
|
+
"`query` 匹配名字/职责/地址, `cwd` 反查工作区, `alive:true` 只看活着的; 这些过滤器对每一层都生效。问了一个名字、它不在本群在场名单里时, L0 尾行会提示升级参数。这是你感知同伴的唯一入口 —— 拿到名字再 chat_ask / peek_peer。",
|
|
606
611
|
inputSchema: {
|
|
607
612
|
query: z.string().optional().describe("在名字 / 职责 / target 里做子串匹配 (不分大小写)。「让懂 X 的那个来看看」就把 X 写在这里。"),
|
|
608
|
-
chat: z.string().optional().describe("
|
|
613
|
+
chat: z.string().optional().describe("升级到 L1: 只看某个聊天的全部化身 (含冷)。聊天名, 或聊天 principal 的一段。「同群有谁」就写你自己的群名。"),
|
|
609
614
|
cwd: z.string().optional().describe("只看工作区路径包含这一段的 wizard —— 「谁在 /path 下干活」的反查。"),
|
|
610
615
|
alive: z.boolean().optional().describe("true = 只看 pane 还活着的。默认全给 (冷会话发消息就会被唤醒)。"),
|
|
611
|
-
|
|
616
|
+
scope: z.enum(["all"]).optional().describe("升级到 L2: 全机分群概览, 每个聊天一行 (名字串, ≤60 行)。"),
|
|
612
617
|
},
|
|
613
|
-
}, async ({ query, chat, cwd, alive,
|
|
618
|
+
}, async ({ query, chat, cwd, alive, scope }) => unwrapText("wizard_roster", await daemonPost("/wizard/roster", {
|
|
614
619
|
...(query ? { query } : {}),
|
|
615
620
|
...(chat ? { chat } : {}),
|
|
616
621
|
...(cwd ? { cwd } : {}),
|
|
617
622
|
...(alive ? { alive } : {}),
|
|
618
|
-
...(
|
|
623
|
+
...(scope ? { scope } : {}),
|
|
619
624
|
})));
|
|
620
625
|
server.registerTool("route_candidates", {
|
|
621
626
|
title: "Who could take this task",
|
|
622
|
-
description: "一件活要不要转给已有 wizard 时调它。只返回按 limit 截断的候选文本,不包含完整诊断或未展示候选。候选排序不等于推荐追加任务;独立新活按本次难度 delegate
|
|
627
|
+
description: "一件活要不要转给已有 wizard 时调它。只返回按 limit 截断的候选文本,不包含完整诊断或未展示候选。候选排序不等于推荐追加任务;独立新活按本次难度 delegate,同一验收目标的续篇用 chat_ask 的 \`for\\` 指回原活。",
|
|
623
628
|
inputSchema: {
|
|
624
629
|
task: z.string().describe("这件活及验收目标, 原话或一句概括都行。文件名 / 模块名 / 函数名帮助找线索; 公共规则文件、同工作区和关键词重叠不证明是同一任务。"),
|
|
625
630
|
cwd: z.string().optional().describe("这件活落在哪个工作区。省略 = 你自己的工作区。"),
|
|
@@ -646,8 +651,8 @@ export const createWezardServer = () => {
|
|
|
646
651
|
}, async ({ model, effort, name, scope }) => unwrap("set_model", await daemonPost("/wizard/model", { ...(model ? { model } : {}), ...(effort ? { effort } : {}), ...(name ? { name } : {}), ...(scope ? { scope } : {}) })));
|
|
647
652
|
server.registerTool("spawn_wizard", {
|
|
648
653
|
title: "Spawn a blank child wizard",
|
|
649
|
-
description: "**从白板生**一个子 wizard —— 新的 tmux pane、自己的全局名字 (
|
|
650
|
-
"带上 `task`
|
|
654
|
+
description: "**从白板生**一个子 wizard —— 新的 tmux pane、自己的全局名字 (裸名)、自己的职责, 归你管 (家谱里挂在你名下)。它**不继承你的任何上下文**, 只拿到身份。适合干一件与你手头无关的事, 或者要去别的目录 (`cwd`) / 别的聊天里干活。要一个开局就带着你读过的材料的, 用 clone_wizard。\n" +
|
|
655
|
+
"带上 `task` 就是在它就位的同时开一条 duty (等同一次 chat_ask), 省一次往返; 不带它就位待命, 之后用 chat_ask 找它。返回 name、cwd、继承状态、实际模型/档位与警告。" +
|
|
651
656
|
OFFSPRING_TAIL,
|
|
652
657
|
inputSchema: currentAddressSchema({
|
|
653
658
|
...offspringShape,
|
|
@@ -658,8 +663,8 @@ export const createWezardServer = () => {
|
|
|
658
663
|
server.registerTool("clone_wizard", {
|
|
659
664
|
title: "Clone a wizard, context and all",
|
|
660
665
|
description: "**克隆**一个 wizard 出分身 —— fork 它此刻的上下文: 分身开局就拥有它已经读过的一切 (规范、目录结构、刚啃完的那份文档), 不必重读; 被克隆的那个毫发无损。默认克隆你自己; `from` 点名就克隆别的 wizard (比如一个已经把某个模块啃透的同伴) —— 分身仍归你管 (占你的名额), 只是上下文来自它。分身留在被克隆者的工作区。\n" +
|
|
661
|
-
"要白纸一张、或要去别的目录, 用 spawn_wizard。被克隆者正在干活时, 分身拿到的是它此刻为止的上下文 —— 想要它读完再分:
|
|
662
|
-
"带上 `task`
|
|
666
|
+
"要白纸一张、或要去别的目录, 用 spawn_wizard。被克隆者正在干活时, 分身拿到的是它此刻为止的上下文 —— 想要它读完再分: 等它那条 chat_reply, 或看 wizard_roster 的忙闲。\n" +
|
|
667
|
+
"带上 `task` 就是在它就位的同时开一条 duty (分叉本来就由第一句话触发, 省一次往返)。返回 name、cwd、继承状态、实际模型/档位与警告。" +
|
|
663
668
|
OFFSPRING_TAIL,
|
|
664
669
|
inputSchema: currentAddressSchema({
|
|
665
670
|
...offspringShape,
|
|
@@ -668,7 +673,7 @@ export const createWezardServer = () => {
|
|
|
668
673
|
}, bear("clone_wizard", true));
|
|
669
674
|
server.registerTool("pending_items", {
|
|
670
675
|
title: "What I dispatched and is still open",
|
|
671
|
-
description: "挂起事项全表: 你派出去 (
|
|
676
|
+
description: "挂起事项全表: 你派出去 (chat_ask / delegate / 带 task 的 spawn) 还没了结的每一件 —— 件号、对象、一句话题、为谁派的; 关账只认对方那条 chat_reply 的 status。已交代的、同一对改派了的自动消掉; 没结论的留着, 直到你改派、chat_ask 追问, 或用 `drop` 显式消掉。\n" +
|
|
672
677
|
"管家平时只会在注入尾巴上收到必要的一行增量, 快忘的时候 (交接 / 压缩后、隔了很多轮) 收到一次全表; 其余时候想看就调它。",
|
|
673
678
|
inputSchema: currentAddressSchema({
|
|
674
679
|
drop: z.array(z.string()).optional().describe("要消掉的那几项: 写对方的名字 (= 你派给它、还开着的那项), 或表里每行开头的 event id: 不再需要、或已经另行处理了。"),
|