pi-feishu-cli 0.1.0
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/LICENSE +21 -0
- package/README.md +111 -0
- package/dist/src/bot.d.ts +29 -0
- package/dist/src/bot.js +75 -0
- package/dist/src/cards.d.ts +6 -0
- package/dist/src/cards.js +87 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/config.js +28 -0
- package/dist/src/daemon.d.ts +2 -0
- package/dist/src/daemon.js +151 -0
- package/dist/src/extension.d.ts +2 -0
- package/dist/src/extension.js +124 -0
- package/dist/src/poller.d.ts +33 -0
- package/dist/src/poller.js +94 -0
- package/dist/src/renderer.d.ts +8 -0
- package/dist/src/renderer.js +31 -0
- package/dist/src/session-registry.d.ts +15 -0
- package/dist/src/session-registry.js +82 -0
- package/dist/src/types.d.ts +25 -0
- package/dist/src/types.js +1 -0
- package/dist/tests/bot.test.d.ts +1 -0
- package/dist/tests/bot.test.js +89 -0
- package/dist/tests/cards.test.d.ts +1 -0
- package/dist/tests/cards.test.js +39 -0
- package/dist/tests/config.test.d.ts +1 -0
- package/dist/tests/config.test.js +59 -0
- package/dist/tests/renderer.test.d.ts +1 -0
- package/dist/tests/renderer.test.js +61 -0
- package/dist/tests/session-registry.test.d.ts +1 -0
- package/dist/tests/session-registry.test.js +92 -0
- package/dist/tests/types.test.d.ts +1 -0
- package/dist/tests/types.test.js +30 -0
- package/package.json +35 -0
- package/skills/lark-approval/SKILL.md +56 -0
- package/skills/lark-apps/SKILL.md +92 -0
- package/skills/lark-apps/references/lark-apps-access-scope-get.md +104 -0
- package/skills/lark-apps/references/lark-apps-access-scope-set.md +126 -0
- package/skills/lark-apps/references/lark-apps-create.md +112 -0
- package/skills/lark-apps/references/lark-apps-html-publish.md +151 -0
- package/skills/lark-apps/references/lark-apps-list.md +95 -0
- package/skills/lark-apps/references/lark-apps-update.md +86 -0
- package/skills/lark-attendance/SKILL.md +57 -0
- package/skills/lark-base/SKILL.md +359 -0
- package/skills/lark-base/references/dashboard-block-data-config.md +350 -0
- package/skills/lark-base/references/examples.md +140 -0
- package/skills/lark-base/references/formula-field-guide.md +737 -0
- package/skills/lark-base/references/lark-base-advperm-disable.md +83 -0
- package/skills/lark-base/references/lark-base-advperm-enable.md +80 -0
- package/skills/lark-base/references/lark-base-base-copy.md +74 -0
- package/skills/lark-base/references/lark-base-base-create.md +68 -0
- package/skills/lark-base/references/lark-base-base-get.md +39 -0
- package/skills/lark-base/references/lark-base-cell-value.md +151 -0
- package/skills/lark-base/references/lark-base-dashboard-arrange.md +83 -0
- package/skills/lark-base/references/lark-base-dashboard-block-create.md +108 -0
- package/skills/lark-base/references/lark-base-dashboard-block-delete.md +46 -0
- package/skills/lark-base/references/lark-base-dashboard-block-get.md +57 -0
- package/skills/lark-base/references/lark-base-dashboard-block-list.md +53 -0
- package/skills/lark-base/references/lark-base-dashboard-block-update.md +84 -0
- package/skills/lark-base/references/lark-base-dashboard-create.md +73 -0
- package/skills/lark-base/references/lark-base-dashboard-delete.md +44 -0
- package/skills/lark-base/references/lark-base-dashboard-get.md +59 -0
- package/skills/lark-base/references/lark-base-dashboard-list.md +52 -0
- package/skills/lark-base/references/lark-base-dashboard-update.md +69 -0
- package/skills/lark-base/references/lark-base-dashboard.md +240 -0
- package/skills/lark-base/references/lark-base-data-analysis-sop.md +88 -0
- package/skills/lark-base/references/lark-base-data-query.md +375 -0
- package/skills/lark-base/references/lark-base-field-create.md +104 -0
- package/skills/lark-base/references/lark-base-field-delete.md +51 -0
- package/skills/lark-base/references/lark-base-field-get.md +42 -0
- package/skills/lark-base/references/lark-base-field-list.md +44 -0
- package/skills/lark-base/references/lark-base-field-search-options.md +48 -0
- package/skills/lark-base/references/lark-base-field-update.md +97 -0
- package/skills/lark-base/references/lark-base-field.md +22 -0
- package/skills/lark-base/references/lark-base-form-create.md +87 -0
- package/skills/lark-base/references/lark-base-form-delete.md +64 -0
- package/skills/lark-base/references/lark-base-form-detail.md +198 -0
- package/skills/lark-base/references/lark-base-form-get.md +68 -0
- package/skills/lark-base/references/lark-base-form-list.md +73 -0
- package/skills/lark-base/references/lark-base-form-questions-create.md +118 -0
- package/skills/lark-base/references/lark-base-form-questions-delete.md +68 -0
- package/skills/lark-base/references/lark-base-form-questions-list.md +84 -0
- package/skills/lark-base/references/lark-base-form-questions-update.md +92 -0
- package/skills/lark-base/references/lark-base-form-questions.md +23 -0
- package/skills/lark-base/references/lark-base-form-submit.md +171 -0
- package/skills/lark-base/references/lark-base-form-update.md +82 -0
- package/skills/lark-base/references/lark-base-form.md +25 -0
- package/skills/lark-base/references/lark-base-history.md +16 -0
- package/skills/lark-base/references/lark-base-record-batch-create.md +58 -0
- package/skills/lark-base/references/lark-base-record-batch-update.md +53 -0
- package/skills/lark-base/references/lark-base-record-delete.md +62 -0
- package/skills/lark-base/references/lark-base-record-history-list.md +86 -0
- package/skills/lark-base/references/lark-base-record-share-link-create.md +72 -0
- package/skills/lark-base/references/lark-base-record-upsert.md +64 -0
- package/skills/lark-base/references/lark-base-record.md +31 -0
- package/skills/lark-base/references/lark-base-role-create.md +89 -0
- package/skills/lark-base/references/lark-base-role-delete.md +83 -0
- package/skills/lark-base/references/lark-base-role-get.md +87 -0
- package/skills/lark-base/references/lark-base-role-list.md +81 -0
- package/skills/lark-base/references/lark-base-role-update.md +94 -0
- package/skills/lark-base/references/lark-base-shortcut-field-properties.md +481 -0
- package/skills/lark-base/references/lark-base-table-create.md +62 -0
- package/skills/lark-base/references/lark-base-table-delete.md +51 -0
- package/skills/lark-base/references/lark-base-table-get.md +46 -0
- package/skills/lark-base/references/lark-base-table-list.md +43 -0
- package/skills/lark-base/references/lark-base-table-update.md +49 -0
- package/skills/lark-base/references/lark-base-table.md +20 -0
- package/skills/lark-base/references/lark-base-view-create.md +50 -0
- package/skills/lark-base/references/lark-base-view-delete.md +48 -0
- package/skills/lark-base/references/lark-base-view-get-card.md +38 -0
- package/skills/lark-base/references/lark-base-view-get-filter.md +38 -0
- package/skills/lark-base/references/lark-base-view-get-group.md +38 -0
- package/skills/lark-base/references/lark-base-view-get-sort.md +38 -0
- package/skills/lark-base/references/lark-base-view-get-timebar.md +38 -0
- package/skills/lark-base/references/lark-base-view-get-visible-fields.md +28 -0
- package/skills/lark-base/references/lark-base-view-get.md +38 -0
- package/skills/lark-base/references/lark-base-view-list.md +44 -0
- package/skills/lark-base/references/lark-base-view-rename.md +44 -0
- package/skills/lark-base/references/lark-base-view-set-card.md +55 -0
- package/skills/lark-base/references/lark-base-view-set-filter.md +181 -0
- package/skills/lark-base/references/lark-base-view-set-group.md +65 -0
- package/skills/lark-base/references/lark-base-view-set-sort.md +63 -0
- package/skills/lark-base/references/lark-base-view-set-timebar.md +51 -0
- package/skills/lark-base/references/lark-base-view-set-visible-fields.md +46 -0
- package/skills/lark-base/references/lark-base-view.md +44 -0
- package/skills/lark-base/references/lark-base-workflow-create.md +180 -0
- package/skills/lark-base/references/lark-base-workflow-disable.md +94 -0
- package/skills/lark-base/references/lark-base-workflow-enable.md +94 -0
- package/skills/lark-base/references/lark-base-workflow-get.md +147 -0
- package/skills/lark-base/references/lark-base-workflow-guide.md +718 -0
- package/skills/lark-base/references/lark-base-workflow-list.md +124 -0
- package/skills/lark-base/references/lark-base-workflow-schema.md +935 -0
- package/skills/lark-base/references/lark-base-workflow-update.md +167 -0
- package/skills/lark-base/references/lark-base-workflow.md +23 -0
- package/skills/lark-base/references/lark-base-workspace.md +18 -0
- package/skills/lark-base/references/lookup-field-guide.md +512 -0
- package/skills/lark-base/references/role-config.md +539 -0
- package/skills/lark-calendar/SKILL.md +154 -0
- package/skills/lark-calendar/references/lark-calendar-agenda.md +78 -0
- package/skills/lark-calendar/references/lark-calendar-create.md +109 -0
- package/skills/lark-calendar/references/lark-calendar-freebusy.md +124 -0
- package/skills/lark-calendar/references/lark-calendar-room-find.md +113 -0
- package/skills/lark-calendar/references/lark-calendar-rsvp.md +42 -0
- package/skills/lark-calendar/references/lark-calendar-schedule-meeting.md +265 -0
- package/skills/lark-calendar/references/lark-calendar-suggestion.md +125 -0
- package/skills/lark-calendar/references/lark-calendar-update.md +105 -0
- package/skills/lark-contact/SKILL.md +45 -0
- package/skills/lark-contact/references/lark-contact-get-user.md +19 -0
- package/skills/lark-contact/references/lark-contact-search-user.md +124 -0
- package/skills/lark-doc/SKILL.md +65 -0
- package/skills/lark-doc/references/lark-doc-create.md +89 -0
- package/skills/lark-doc/references/lark-doc-fetch.md +141 -0
- package/skills/lark-doc/references/lark-doc-md.md +71 -0
- package/skills/lark-doc/references/lark-doc-media-download.md +50 -0
- package/skills/lark-doc/references/lark-doc-media-insert.md +114 -0
- package/skills/lark-doc/references/lark-doc-media-preview.md +41 -0
- package/skills/lark-doc/references/lark-doc-update.md +252 -0
- package/skills/lark-doc/references/lark-doc-whiteboard.md +100 -0
- package/skills/lark-doc/references/lark-doc-xml.md +169 -0
- package/skills/lark-doc/references/style/lark-doc-create-workflow.md +56 -0
- package/skills/lark-doc/references/style/lark-doc-style.md +106 -0
- package/skills/lark-doc/references/style/lark-doc-update-workflow.md +54 -0
- package/skills/lark-drive/SKILL.md +369 -0
- package/skills/lark-drive/references/lark-drive-add-comment.md +182 -0
- package/skills/lark-drive/references/lark-drive-apply-permission.md +77 -0
- package/skills/lark-drive/references/lark-drive-create-folder.md +73 -0
- package/skills/lark-drive/references/lark-drive-create-shortcut.md +103 -0
- package/skills/lark-drive/references/lark-drive-delete.md +79 -0
- package/skills/lark-drive/references/lark-drive-download.md +31 -0
- package/skills/lark-drive/references/lark-drive-export-download.md +50 -0
- package/skills/lark-drive/references/lark-drive-export.md +119 -0
- package/skills/lark-drive/references/lark-drive-import.md +159 -0
- package/skills/lark-drive/references/lark-drive-inspect.md +50 -0
- package/skills/lark-drive/references/lark-drive-move.md +120 -0
- package/skills/lark-drive/references/lark-drive-pull.md +137 -0
- package/skills/lark-drive/references/lark-drive-push.md +162 -0
- package/skills/lark-drive/references/lark-drive-reactions.md +113 -0
- package/skills/lark-drive/references/lark-drive-search.md +266 -0
- package/skills/lark-drive/references/lark-drive-status.md +198 -0
- package/skills/lark-drive/references/lark-drive-task-result.md +302 -0
- package/skills/lark-drive/references/lark-drive-upload.md +67 -0
- package/skills/lark-drive/references/lark-drive-version-delete.md +38 -0
- package/skills/lark-drive/references/lark-drive-version-get.md +71 -0
- package/skills/lark-drive/references/lark-drive-version-history.md +73 -0
- package/skills/lark-drive/references/lark-drive-version-revert.md +198 -0
- package/skills/lark-event/SKILL.md +145 -0
- package/skills/lark-event/references/lark-event-im.md +86 -0
- package/skills/lark-im/SKILL.md +162 -0
- package/skills/lark-im/references/lark-im-chat-create.md +162 -0
- package/skills/lark-im/references/lark-im-chat-identity.md +55 -0
- package/skills/lark-im/references/lark-im-chat-list.md +198 -0
- package/skills/lark-im/references/lark-im-chat-messages-list.md +148 -0
- package/skills/lark-im/references/lark-im-chat-search.md +136 -0
- package/skills/lark-im/references/lark-im-chat-update.md +84 -0
- package/skills/lark-im/references/lark-im-flag-cancel.md +198 -0
- package/skills/lark-im/references/lark-im-flag-create.md +67 -0
- package/skills/lark-im/references/lark-im-flag-list.md +100 -0
- package/skills/lark-im/references/lark-im-messages-mget.md +95 -0
- package/skills/lark-im/references/lark-im-messages-reply.md +228 -0
- package/skills/lark-im/references/lark-im-messages-resources-download.md +94 -0
- package/skills/lark-im/references/lark-im-messages-search.md +232 -0
- package/skills/lark-im/references/lark-im-messages-send.md +229 -0
- package/skills/lark-im/references/lark-im-reactions.md +297 -0
- package/skills/lark-im/references/lark-im-threads-messages-list.md +111 -0
- package/skills/lark-mail/SKILL.md +648 -0
- package/skills/lark-mail/references/lark-mail-decline-receipt.md +115 -0
- package/skills/lark-mail/references/lark-mail-draft-create.md +123 -0
- package/skills/lark-mail/references/lark-mail-draft-edit.md +400 -0
- package/skills/lark-mail/references/lark-mail-forward.md +173 -0
- package/skills/lark-mail/references/lark-mail-message.md +230 -0
- package/skills/lark-mail/references/lark-mail-messages.md +108 -0
- package/skills/lark-mail/references/lark-mail-reply-all.md +206 -0
- package/skills/lark-mail/references/lark-mail-reply.md +242 -0
- package/skills/lark-mail/references/lark-mail-send-receipt.md +198 -0
- package/skills/lark-mail/references/lark-mail-send.md +216 -0
- package/skills/lark-mail/references/lark-mail-share-to-chat.md +198 -0
- package/skills/lark-mail/references/lark-mail-signature.md +98 -0
- package/skills/lark-mail/references/lark-mail-template-create.md +129 -0
- package/skills/lark-mail/references/lark-mail-template-update.md +198 -0
- package/skills/lark-mail/references/lark-mail-thread.md +111 -0
- package/skills/lark-mail/references/lark-mail-triage.md +122 -0
- package/skills/lark-mail/references/lark-mail-watch.md +94 -0
- package/skills/lark-minutes/SKILL.md +139 -0
- package/skills/lark-minutes/references/lark-minutes-download.md +137 -0
- package/skills/lark-minutes/references/lark-minutes-search.md +206 -0
- package/skills/lark-minutes/references/lark-minutes-upload.md +104 -0
- package/skills/lark-okr/SKILL.md +133 -0
- package/skills/lark-okr/references/lark-okr-contentblock.md +359 -0
- package/skills/lark-okr/references/lark-okr-cycle-detail.md +84 -0
- package/skills/lark-okr/references/lark-okr-cycle-list.md +90 -0
- package/skills/lark-okr/references/lark-okr-entities.md +329 -0
- package/skills/lark-okr/references/lark-okr-image-upload.md +116 -0
- package/skills/lark-okr/references/lark-okr-progress-create.md +81 -0
- package/skills/lark-okr/references/lark-okr-progress-delete.md +47 -0
- package/skills/lark-okr/references/lark-okr-progress-get.md +62 -0
- package/skills/lark-okr/references/lark-okr-progress-list.md +80 -0
- package/skills/lark-okr/references/lark-okr-progress-update.md +81 -0
- package/skills/lark-openapi-explorer/SKILL.md +153 -0
- package/skills/lark-shared/SKILL.md +144 -0
- package/skills/lark-sheets/SKILL.md +343 -0
- package/skills/lark-sheets/references/lark-sheets-cell-data.md +197 -0
- package/skills/lark-sheets/references/lark-sheets-cell-images.md +59 -0
- package/skills/lark-sheets/references/lark-sheets-cell-style-and-merge.md +141 -0
- package/skills/lark-sheets/references/lark-sheets-dropdown.md +133 -0
- package/skills/lark-sheets/references/lark-sheets-filter-views.md +193 -0
- package/skills/lark-sheets/references/lark-sheets-float-images.md +125 -0
- package/skills/lark-sheets/references/lark-sheets-formula.md +88 -0
- package/skills/lark-sheets/references/lark-sheets-row-column-management.md +151 -0
- package/skills/lark-sheets/references/lark-sheets-sheet-management.md +164 -0
- package/skills/lark-sheets/references/lark-sheets-spreadsheet-management.md +140 -0
- package/skills/lark-skill-maker/SKILL.md +85 -0
- package/skills/lark-slides/SKILL.md +296 -0
- package/skills/lark-slides/assets/templates/administration--all_hands_meeting.xml +1999 -0
- package/skills/lark-slides/assets/templates/administration--annual_gala.xml +1160 -0
- package/skills/lark-slides/assets/templates/administration--company_intro.xml +1376 -0
- package/skills/lark-slides/assets/templates/administration--corporate_culture.xml +1765 -0
- package/skills/lark-slides/assets/templates/hr--employee_training.xml +912 -0
- package/skills/lark-slides/assets/templates/hr--employee_training_workshop.xml +1504 -0
- package/skills/lark-slides/assets/templates/hr--onboarding.xml +933 -0
- package/skills/lark-slides/assets/templates/marketing--brand_communication.xml +1367 -0
- package/skills/lark-slides/assets/templates/marketing--brand_logo_design.xml +1347 -0
- package/skills/lark-slides/assets/templates/marketing--brand_operations_plan.xml +1309 -0
- package/skills/lark-slides/assets/templates/marketing--business_plan.xml +1646 -0
- package/skills/lark-slides/assets/templates/marketing--marketing_plan.xml +198 -0
- package/skills/lark-slides/assets/templates/marketing--marketing_strategy.xml +1484 -0
- package/skills/lark-slides/assets/templates/marketing--product_whitepaper.xml +198 -0
- package/skills/lark-slides/assets/templates/marketing--roadshow_business_plan.xml +1506 -0
- package/skills/lark-slides/assets/templates/misc--book_sharing.xml +198 -0
- package/skills/lark-slides/assets/templates/misc--club_event_plan.xml +4885 -0
- package/skills/lark-slides/assets/templates/misc--student_career_plan.xml +1854 -0
- package/skills/lark-slides/assets/templates/office--dark_general.xml +3763 -0
- package/skills/lark-slides/assets/templates/office--dept_annual_report.xml +1192 -0
- package/skills/lark-slides/assets/templates/office--light_general.xml +3378 -0
- package/skills/lark-slides/assets/templates/office--project_kickoff.xml +3152 -0
- package/skills/lark-slides/assets/templates/office--quarterly_review.xml +1253 -0
- package/skills/lark-slides/assets/templates/office--work_report.xml +1099 -0
- package/skills/lark-slides/assets/templates/office--work_summary.xml +4420 -0
- package/skills/lark-slides/assets/templates/office--work_summary_report.xml +1523 -0
- package/skills/lark-slides/assets/templates/operations--brand_logo_design.xml +1347 -0
- package/skills/lark-slides/assets/templates/operations--brand_operations_plan.xml +1309 -0
- package/skills/lark-slides/assets/templates/operations--marketing_plan.xml +1469 -0
- package/skills/lark-slides/assets/templates/operations--product_promotion.xml +687 -0
- package/skills/lark-slides/assets/templates/personal--experience_sharing.xml +2242 -0
- package/skills/lark-slides/assets/templates/personal--personal_resume.xml +2047 -0
- package/skills/lark-slides/assets/templates/personal--promotion_defense.xml +1099 -0
- package/skills/lark-slides/assets/templates/personal--promotion_report.xml +1039 -0
- package/skills/lark-slides/assets/templates/personal--self_intro.xml +696 -0
- package/skills/lark-slides/assets/templates/personal--teaching_sharing.xml +3013 -0
- package/skills/lark-slides/assets/templates/product--business_case_analysis.xml +1341 -0
- package/skills/lark-slides/assets/templates/product--market_analysis.xml +898 -0
- package/skills/lark-slides/assets/templates/product--product_analysis.xml +1537 -0
- package/skills/lark-slides/assets/templates/product--product_intro.xml +2838 -0
- package/skills/lark-slides/assets/templates/product--product_promotion.xml +687 -0
- package/skills/lark-slides/assets/templates/product--product_promotion_2.xml +198 -0
- package/skills/lark-slides/references/asset-planning.md +124 -0
- package/skills/lark-slides/references/examples.md +261 -0
- package/skills/lark-slides/references/lark-slides-create.md +137 -0
- package/skills/lark-slides/references/lark-slides-edit-workflows.md +142 -0
- package/skills/lark-slides/references/lark-slides-media-upload.md +128 -0
- package/skills/lark-slides/references/lark-slides-replace-slide.md +239 -0
- package/skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md +220 -0
- package/skills/lark-slides/references/lark-slides-xml-presentation-slide-delete.md +123 -0
- package/skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md +110 -0
- package/skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md +186 -0
- package/skills/lark-slides/references/lark-slides-xml-presentations-get.md +98 -0
- package/skills/lark-slides/references/planning-layer.md +219 -0
- package/skills/lark-slides/references/slide-templates.md +201 -0
- package/skills/lark-slides/references/slides_demo.xml +226 -0
- package/skills/lark-slides/references/slides_xml_schema_definition.xml +3004 -0
- package/skills/lark-slides/references/template-catalog.md +463 -0
- package/skills/lark-slides/references/template-index.json +198 -0
- package/skills/lark-slides/references/troubleshooting.md +198 -0
- package/skills/lark-slides/references/validation-checklist.md +102 -0
- package/skills/lark-slides/references/visual-planning.md +250 -0
- package/skills/lark-slides/references/xml-format-guide.md +369 -0
- package/skills/lark-slides/references/xml-schema-quick-ref.md +215 -0
- package/skills/lark-slides/scripts/template_tool.py +970 -0
- package/skills/lark-slides/scripts/template_tool_test.py +177 -0
- package/skills/lark-slides/scripts/xml_text_overlap_lint.py +367 -0
- package/skills/lark-slides/scripts/xml_text_overlap_lint_test.py +263 -0
- package/skills/lark-task/SKILL.md +165 -0
- package/skills/lark-task/references/lark-task-assign.md +38 -0
- package/skills/lark-task/references/lark-task-comment.md +28 -0
- package/skills/lark-task/references/lark-task-complete.md +27 -0
- package/skills/lark-task/references/lark-task-create.md +57 -0
- package/skills/lark-task/references/lark-task-followers.md +35 -0
- package/skills/lark-task/references/lark-task-get-my-tasks.md +55 -0
- package/skills/lark-task/references/lark-task-get-related-tasks.md +53 -0
- package/skills/lark-task/references/lark-task-reminder.md +36 -0
- package/skills/lark-task/references/lark-task-reopen.md +27 -0
- package/skills/lark-task/references/lark-task-search.md +41 -0
- package/skills/lark-task/references/lark-task-set-ancestor.md +32 -0
- package/skills/lark-task/references/lark-task-subscribe-event.md +86 -0
- package/skills/lark-task/references/lark-task-tasklist-create.md +35 -0
- package/skills/lark-task/references/lark-task-tasklist-members.md +36 -0
- package/skills/lark-task/references/lark-task-tasklist-search.md +38 -0
- package/skills/lark-task/references/lark-task-tasklist-task-add.md +38 -0
- package/skills/lark-task/references/lark-task-update.md +37 -0
- package/skills/lark-task/references/lark-task-upload-attachment.md +59 -0
- package/skills/lark-vc/SKILL.md +168 -0
- package/skills/lark-vc/references/lark-vc-notes.md +126 -0
- package/skills/lark-vc/references/lark-vc-recording.md +153 -0
- package/skills/lark-vc/references/lark-vc-search.md +193 -0
- package/skills/lark-vc-agent/SKILL.md +121 -0
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-events.md +247 -0
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-join.md +133 -0
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-leave.md +111 -0
- package/skills/lark-whiteboard/SKILL.md +144 -0
- package/skills/lark-whiteboard/references/connectors.md +102 -0
- package/skills/lark-whiteboard/references/content.md +40 -0
- package/skills/lark-whiteboard/references/image.md +80 -0
- package/skills/lark-whiteboard/references/lark-whiteboard-query.md +49 -0
- package/skills/lark-whiteboard/references/lark-whiteboard-update.md +100 -0
- package/skills/lark-whiteboard/references/layout.md +374 -0
- package/skills/lark-whiteboard/references/schema.md +357 -0
- package/skills/lark-whiteboard/references/style.md +318 -0
- package/skills/lark-whiteboard/references/typography.md +73 -0
- package/skills/lark-whiteboard/routes/dsl.md +107 -0
- package/skills/lark-whiteboard/routes/mermaid.md +27 -0
- package/skills/lark-whiteboard/routes/svg.md +54 -0
- package/skills/lark-whiteboard/scenes/architecture.md +433 -0
- package/skills/lark-whiteboard/scenes/bar-chart.md +187 -0
- package/skills/lark-whiteboard/scenes/comparison.md +135 -0
- package/skills/lark-whiteboard/scenes/fishbone.md +238 -0
- package/skills/lark-whiteboard/scenes/flowchart.md +198 -0
- package/skills/lark-whiteboard/scenes/flywheel.md +195 -0
- package/skills/lark-whiteboard/scenes/funnel.md +198 -0
- package/skills/lark-whiteboard/scenes/line-chart.md +214 -0
- package/skills/lark-whiteboard/scenes/mermaid.md +130 -0
- package/skills/lark-whiteboard/scenes/milestone.md +139 -0
- package/skills/lark-whiteboard/scenes/organization.md +173 -0
- package/skills/lark-whiteboard/scenes/photo-showcase.md +198 -0
- package/skills/lark-whiteboard/scenes/pyramid.md +99 -0
- package/skills/lark-whiteboard/scenes/swimlane.md +371 -0
- package/skills/lark-whiteboard/scenes/treemap.md +198 -0
- package/skills/lark-wiki/SKILL.md +119 -0
- package/skills/lark-wiki/references/lark-wiki-delete-space.md +205 -0
- package/skills/lark-wiki/references/lark-wiki-member-add.md +66 -0
- package/skills/lark-wiki/references/lark-wiki-member-list.md +76 -0
- package/skills/lark-wiki/references/lark-wiki-member-remove.md +61 -0
- package/skills/lark-wiki/references/lark-wiki-move.md +183 -0
- package/skills/lark-wiki/references/lark-wiki-node-copy.md +72 -0
- package/skills/lark-wiki/references/lark-wiki-node-create.md +127 -0
- package/skills/lark-wiki/references/lark-wiki-node-delete.md +62 -0
- package/skills/lark-wiki/references/lark-wiki-node-get.md +56 -0
- package/skills/lark-wiki/references/lark-wiki-node-list.md +198 -0
- package/skills/lark-wiki/references/lark-wiki-space-create.md +46 -0
- package/skills/lark-wiki/references/lark-wiki-space-list.md +198 -0
- package/skills/lark-workflow-meeting-summary/SKILL.md +104 -0
- package/skills/lark-workflow-standup-report/SKILL.md +120 -0
- package/skills/mmx-cli/SKILL.md +440 -0
- package/src/bot.ts +109 -0
- package/src/cards.ts +105 -0
- package/src/config.ts +33 -0
- package/src/daemon.ts +217 -0
- package/src/extension.ts +132 -0
- package/src/poller.ts +135 -0
- package/src/renderer.ts +47 -0
- package/src/session-registry.ts +90 -0
- package/src/types.ts +29 -0
- package/tests/bot.test.ts +104 -0
- package/tests/cards.test.ts +48 -0
- package/tests/config.test.ts +59 -0
- package/tests/renderer.test.ts +74 -0
- package/tests/session-registry.test.ts +94 -0
- package/tests/types.test.ts +35 -0
- package/tsconfig.json +16 -0
- package/vitest.config.ts +7 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# 对比图 / 矩阵图
|
|
2
|
+
|
|
3
|
+
适用于:方案对比、功能矩阵、技术选型等多选项按多维度比较的场景。
|
|
4
|
+
|
|
5
|
+
## Content 约束
|
|
6
|
+
|
|
7
|
+
- **每格内容要充实**:不要只写一个关键词,给出具体说明(如"MVCC 多版本并发控制,支持行级锁"而非仅"支持")
|
|
8
|
+
- 单格内容不同格子允许不同长度,但每格不超过 5 行
|
|
9
|
+
- 长文本(超过 15 字)用 `textAlign: "left"`(不要居中)
|
|
10
|
+
- 第一行是标题行(对象名称),第一列是维度标签列
|
|
11
|
+
- 维度数量至少 4 个,充分展开对比维度
|
|
12
|
+
|
|
13
|
+
## Layout 选型
|
|
14
|
+
|
|
15
|
+
| 模式 | 适用条件 | 特征 |
|
|
16
|
+
|------|---------|------|
|
|
17
|
+
| **严格 grid(默认)** | 所有对比场景 | 表头行 + 数据行,每行 horizontal frame,行内 rect 等分 |
|
|
18
|
+
| **卡片式对比(替代)** | 维度较少(2-3 个) | 每个对象做一张独立卡片,卡片内纵向列出各维度。卡片横向等分:外层 `layout: "horizontal"`,每张卡片 `width: "fill-container"` |
|
|
19
|
+
|
|
20
|
+
## Layout 规则
|
|
21
|
+
|
|
22
|
+
- 最外层 frame:`layout: "vertical"`,固定 `width`(如 1000),`height: "fit-content"`
|
|
23
|
+
- 每行:horizontal frame,`width: "fill-container"`,`alignItems: "stretch"`
|
|
24
|
+
- 行内单元格全部 `width: "fill-container"` 等分列宽
|
|
25
|
+
- 行间 `gap >= 12`(不要 8,太紧)
|
|
26
|
+
- 行内列间 `gap: 8-12`
|
|
27
|
+
- 标题行:深色底白字(由 style 控制具体颜色)
|
|
28
|
+
- 每列同色边框保持视觉一致性
|
|
29
|
+
- 单元格 `height: "fit-content"`,不要写固定 height
|
|
30
|
+
|
|
31
|
+
## 骨架示例
|
|
32
|
+
|
|
33
|
+
### 3 列 4 行表格
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"version": 2,
|
|
38
|
+
"nodes": [
|
|
39
|
+
{
|
|
40
|
+
"type": "frame",
|
|
41
|
+
"width": 1000,
|
|
42
|
+
"height": "fit-content",
|
|
43
|
+
"layout": "vertical",
|
|
44
|
+
"gap": 12,
|
|
45
|
+
"padding": 0,
|
|
46
|
+
"children": [
|
|
47
|
+
{
|
|
48
|
+
"type": "text",
|
|
49
|
+
"id": "title",
|
|
50
|
+
"width": "fill-container",
|
|
51
|
+
"height": "fit-content",
|
|
52
|
+
"text": "[对比图标题]",
|
|
53
|
+
"fontSize": 24,
|
|
54
|
+
"textAlign": "center",
|
|
55
|
+
"verticalAlign": "middle"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "frame",
|
|
59
|
+
"id": "header-row",
|
|
60
|
+
"width": "fill-container",
|
|
61
|
+
"height": "fit-content",
|
|
62
|
+
"layout": "horizontal",
|
|
63
|
+
"gap": 8,
|
|
64
|
+
"padding": 0,
|
|
65
|
+
"alignItems": "stretch",
|
|
66
|
+
"children": [
|
|
67
|
+
{ "type": "rect", "id": "h-dim", "width": "fill-container", "height": "fit-content", "text": "[维度]", "fontSize": 15, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 0, "borderWidth": 2 },
|
|
68
|
+
{ "type": "rect", "id": "h-col-1", "width": "fill-container", "height": "fit-content", "text": "[对象A]", "fontSize": 15, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
69
|
+
{ "type": "rect", "id": "h-col-2", "width": "fill-container", "height": "fit-content", "text": "[对象B]", "fontSize": 15, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
70
|
+
{ "type": "rect", "id": "h-col-3", "width": "fill-container", "height": "fit-content", "text": "[对象C]", "fontSize": 15, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "frame",
|
|
75
|
+
"id": "data-row-1",
|
|
76
|
+
"width": "fill-container",
|
|
77
|
+
"height": "fit-content",
|
|
78
|
+
"layout": "horizontal",
|
|
79
|
+
"gap": 8,
|
|
80
|
+
"padding": 0,
|
|
81
|
+
"alignItems": "stretch",
|
|
82
|
+
"children": [
|
|
83
|
+
{ "type": "rect", "id": "d1-dim", "width": "fill-container", "height": "fit-content", "text": "[维度1]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
84
|
+
{ "type": "rect", "id": "d1-c1", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
85
|
+
{ "type": "rect", "id": "d1-c2", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
86
|
+
{ "type": "rect", "id": "d1-c3", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 }
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "frame",
|
|
91
|
+
"id": "data-row-2",
|
|
92
|
+
"width": "fill-container",
|
|
93
|
+
"height": "fit-content",
|
|
94
|
+
"layout": "horizontal",
|
|
95
|
+
"gap": 8,
|
|
96
|
+
"padding": 0,
|
|
97
|
+
"alignItems": "stretch",
|
|
98
|
+
"children": [
|
|
99
|
+
{ "type": "rect", "id": "d2-dim", "width": "fill-container", "height": "fit-content", "text": "[维度2]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
100
|
+
{ "type": "rect", "id": "d2-c1", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
101
|
+
{ "type": "rect", "id": "d2-c2", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
102
|
+
{ "type": "rect", "id": "d2-c3", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 }
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "frame",
|
|
107
|
+
"id": "data-row-3",
|
|
108
|
+
"width": "fill-container",
|
|
109
|
+
"height": "fit-content",
|
|
110
|
+
"layout": "horizontal",
|
|
111
|
+
"gap": 8,
|
|
112
|
+
"padding": 0,
|
|
113
|
+
"alignItems": "stretch",
|
|
114
|
+
"children": [
|
|
115
|
+
{ "type": "rect", "id": "d3-dim", "width": "fill-container", "height": "fit-content", "text": "[维度3]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
116
|
+
{ "type": "rect", "id": "d3-c1", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
117
|
+
{ "type": "rect", "id": "d3-c2", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 },
|
|
118
|
+
{ "type": "rect", "id": "d3-c3", "width": "fill-container", "height": "fit-content", "text": "[...]", "fontSize": 14, "textAlign": "center", "verticalAlign": "middle", "borderRadius": 8, "borderWidth": 2 }
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## 陷阱
|
|
128
|
+
|
|
129
|
+
- **行间距 8px 太紧**:行间 gap 至少 12,8 会让行与行视觉粘连。
|
|
130
|
+
- **长文本居中对齐**:超过一行的文本应改为 `textAlign: "left"`,居中多行文本可读性差。
|
|
131
|
+
- **列数太多导致每列太窄**:对比对象建议 ≤ 5 列(含维度列),超过时合并维度或拆分为多张表。
|
|
132
|
+
- **列宽不等**:所有数据列必须用 `width: "fill-container"` 等分,不要给某列写固定宽度。
|
|
133
|
+
- **行高不等**:每行 frame 必须 `alignItems: "stretch"`,否则同行单元格因文字行数不同高矮不齐。
|
|
134
|
+
- **忘记维度标签列**:第一列放维度名称,标题行(维度列)用与数据列不同的视觉处理。
|
|
135
|
+
- **单元格用固定 height**:单元格必须 `height: "fit-content"`,固定高度会导致文字截断。
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# 鱼骨图(因果图)
|
|
2
|
+
|
|
3
|
+
> **必须写脚本生成 JSON。** 鱼骨图的分支角度、原因小骨坐标需要三角函数计算,直接手写 JSON 极易导致节点重叠和连线穿模。请用下方脚本模板。
|
|
4
|
+
|
|
5
|
+
## Content 约束
|
|
6
|
+
|
|
7
|
+
- 分类 4-6 个
|
|
8
|
+
- 每个分类的原因 ≤ 4
|
|
9
|
+
- 总原因 ≤ 20(超过必须合并分类)
|
|
10
|
+
|
|
11
|
+
## Layout 选型
|
|
12
|
+
|
|
13
|
+
- **脚本生成坐标**(必须):用 .cjs 脚本通过三角函数计算鱼骨坐标,脚本输出 JSON 文件后调用 `npx -y @larksuite/whiteboard-cli@^0.2.11` 渲染
|
|
14
|
+
|
|
15
|
+
## Layout 规则
|
|
16
|
+
|
|
17
|
+
- 主干水平居中,从左向右延伸
|
|
18
|
+
- 分类节点按 spineX 从左到右排列,奇数(第 1、3、5...)在上方,偶数(第 2、4...)在下方
|
|
19
|
+
- 每个分类的原因沿斜线(分支骨)等距排列
|
|
20
|
+
- 鱼头(中心问题)在右侧,用 ellipse
|
|
21
|
+
- 主干连线带箭头指向鱼头,分支骨和原因小骨连线 endArrow: "none"
|
|
22
|
+
- 原因小骨水平延伸到原因框右侧,Y 坐标精准对齐
|
|
23
|
+
|
|
24
|
+
## 骨架示例
|
|
25
|
+
|
|
26
|
+
**上下交替**:分类标签按 spineX 从左到右排列,奇数(第1、3、5...)在上方,偶数(第2、4...)在下方。
|
|
27
|
+
|
|
28
|
+
**视觉同色系**:同一个分支的分类标签、连线及其下的所有原因节点,必须使用同一个色系(如相同的背景色与边框色组合),以保持图形风格统一和逻辑连贯。可以预定义一组颜色数组,按分支轮询使用。
|
|
29
|
+
|
|
30
|
+
### 坐标计算脚本模板(必须严格参照此算法生成)
|
|
31
|
+
|
|
32
|
+
以下 Node.js 脚本模板包含了完整的动态布局算法,能够自动适配任意数量的分类和原因,生成完美不重叠的鱼骨图:
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
const fs = require('fs');
|
|
36
|
+
|
|
37
|
+
const nodes = [];
|
|
38
|
+
|
|
39
|
+
// 1. 数据定义 (根据用户需求填充)
|
|
40
|
+
const categories = [
|
|
41
|
+
{ id: "c0", text: "前端代码", reasons: ["未压缩资源", "冗余请求", "超大图片未懒加载"] },
|
|
42
|
+
{ id: "c1", text: "后端服务", reasons: ["数据库慢查询", "缓存失效", "并发量过大"] },
|
|
43
|
+
{ id: "c2", text: "网络环境", reasons: ["CDN配置错误", "DNS解析缓慢", "带宽限制", "网络抖动"] }
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
// 2. 动态布局计算
|
|
47
|
+
const catWidth = 120;
|
|
48
|
+
const catHeight = 40;
|
|
49
|
+
const reasonWidth = 140; // 调整原因框宽度以适应长文本
|
|
50
|
+
const reasonHeight = 32;
|
|
51
|
+
const lineLength = 20; // 原因小骨连线的水平延伸长度
|
|
52
|
+
const paddingX = 40; // 同侧节点间的水平安全间距
|
|
53
|
+
|
|
54
|
+
// 预置的分支色系数组(分支骨分类和具体原因保持同一色系)
|
|
55
|
+
const branchColors = [
|
|
56
|
+
{ fill: "#E8F3FF", stroke: "#1664FF" }, // 蓝色系
|
|
57
|
+
{ fill: "#E6FFED", stroke: "#00B42A" }, // 绿色系
|
|
58
|
+
{ fill: "#FFF7E8", stroke: "#FF7D00" }, // 橙色系
|
|
59
|
+
{ fill: "#FFECE8", stroke: "#F5319D" }, // 粉色系
|
|
60
|
+
{ fill: "#F2E8FF", stroke: "#722ED1" }, // 紫色系
|
|
61
|
+
{ fill: "#E8FFFF", stroke: "#14C9C9" } // 青色系
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
let maxSpineY_up = 0;
|
|
65
|
+
let maxSpineY_down = 0;
|
|
66
|
+
|
|
67
|
+
// 第一步:计算每个 category 的内部尺寸和相对包围盒
|
|
68
|
+
categories.forEach((cat, index) => {
|
|
69
|
+
const isTop = index % 2 === 0;
|
|
70
|
+
const numReasons = cat.reasons.length;
|
|
71
|
+
|
|
72
|
+
// 动态计算分支高度,确保原因小骨不会垂直重叠
|
|
73
|
+
// 每个原因需要 reasonHeight + 上下间距(约 16)
|
|
74
|
+
const requiredY = (numReasons + 1) * (reasonHeight + 16);
|
|
75
|
+
const branchDY = Math.max(160, requiredY);
|
|
76
|
+
const branchDX = -branchDY * 0.7; // 保持固定的倾斜角度向左延伸
|
|
77
|
+
|
|
78
|
+
cat.isTop = isTop;
|
|
79
|
+
cat.branchDX = branchDX;
|
|
80
|
+
cat.branchDY = branchDY;
|
|
81
|
+
|
|
82
|
+
// 记录最大分支高度,用于计算背景高度和主骨 Y 坐标
|
|
83
|
+
if (isTop) maxSpineY_up = Math.max(maxSpineY_up, branchDY + catHeight + 40);
|
|
84
|
+
else maxSpineY_down = Math.max(maxSpineY_down, branchDY + catHeight + 40);
|
|
85
|
+
|
|
86
|
+
// 计算该分类的相对包围盒的极值(相对于 spineX 锚点)
|
|
87
|
+
// 最左侧可能由分类框或原因框决定
|
|
88
|
+
cat.minX = Math.min(branchDX - catWidth / 2, branchDX - lineLength - reasonWidth);
|
|
89
|
+
// 最右侧为主骨挂载点 0 或 分类框右侧
|
|
90
|
+
cat.maxX = Math.max(0, branchDX + catWidth / 2);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// 第二步:计算每个 category 在主骨上的绝对 X 坐标 (spineX)
|
|
94
|
+
let currentSpineX = 100; // 初始偏移
|
|
95
|
+
for (let i = 0; i < categories.length; i++) {
|
|
96
|
+
const cat = categories[i];
|
|
97
|
+
let startX = currentSpineX;
|
|
98
|
+
|
|
99
|
+
// 需要和上一个同侧的 category 保持距离,防止水平重叠
|
|
100
|
+
if (i >= 2) {
|
|
101
|
+
const prevSameSideCat = categories[i - 2];
|
|
102
|
+
const requiredX = prevSameSideCat.spineX + prevSameSideCat.maxX - cat.minX + paddingX;
|
|
103
|
+
startX = Math.max(startX, requiredX);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// 确保左侧最长分支不会超出画布左边界
|
|
107
|
+
if (startX + cat.minX < 50) {
|
|
108
|
+
startX = 50 - cat.minX;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
cat.spineX = startX;
|
|
112
|
+
// 每次略微向前推进,确保异侧节点也能稍微错开
|
|
113
|
+
currentSpineX = startX + 80;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// 第三步:计算全局画布尺寸
|
|
117
|
+
const lastCat = categories[categories.length - 1];
|
|
118
|
+
const spineY = maxSpineY_up + 50; // 动态推导主骨 Y 坐标
|
|
119
|
+
const totalWidth = lastCat.spineX + 350; // 右侧留出鱼头的空间
|
|
120
|
+
const totalHeight = spineY + maxSpineY_down + 50;
|
|
121
|
+
|
|
122
|
+
// 4. 生成节点数据
|
|
123
|
+
// 背景
|
|
124
|
+
nodes.push({ type: "rect", x: 0, y: 0, width: totalWidth, height: totalHeight, fillColor: "#FFFFFF", borderWidth: 0 });
|
|
125
|
+
|
|
126
|
+
// 鱼头
|
|
127
|
+
const headWidth = 180;
|
|
128
|
+
const headHeight = 80;
|
|
129
|
+
const headX = totalWidth - headWidth - 40;
|
|
130
|
+
const headY = spineY - headHeight / 2;
|
|
131
|
+
nodes.push({ type: "ellipse", id: "head", x: headX, y: headY, width: headWidth, height: headHeight, text: "核心问题" });
|
|
132
|
+
|
|
133
|
+
// 主骨连线
|
|
134
|
+
const firstSpineX = categories[0].spineX + categories[0].minX;
|
|
135
|
+
nodes.push({
|
|
136
|
+
type: "connector",
|
|
137
|
+
connector: { from: { x: firstSpineX, y: spineY }, to: "head", toAnchor: "left", lineShape: "straight", endArrow: "arrow" }
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// 遍历生成分类和原因小骨
|
|
141
|
+
categories.forEach((cat, index) => {
|
|
142
|
+
const isTop = cat.isTop;
|
|
143
|
+
const branchDY = cat.branchDY;
|
|
144
|
+
const branchDX = cat.branchDX;
|
|
145
|
+
const color = branchColors[index % branchColors.length];
|
|
146
|
+
|
|
147
|
+
// 分类标签
|
|
148
|
+
const catX = cat.spineX + branchDX - catWidth / 2;
|
|
149
|
+
const catY = spineY + (isTop ? -branchDY - catHeight : branchDY);
|
|
150
|
+
|
|
151
|
+
nodes.push({
|
|
152
|
+
type: "rect", id: cat.id, x: catX, y: catY, width: catWidth, height: catHeight, text: cat.text,
|
|
153
|
+
fillColor: color.fill, strokeColor: color.stroke
|
|
154
|
+
});
|
|
155
|
+
// 分支骨连线
|
|
156
|
+
nodes.push({
|
|
157
|
+
type: "connector",
|
|
158
|
+
connector: { from: { x: cat.spineX, y: spineY }, to: cat.id, toAnchor: isTop ? "bottom" : "top", lineShape: "straight", endArrow: "none", lineColor: color.stroke }
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// 原因小骨
|
|
162
|
+
cat.reasons.forEach((reason, rIndex) => {
|
|
163
|
+
// 线性插值,均匀分布在分支骨上
|
|
164
|
+
const t = (rIndex + 1) / (cat.reasons.length + 1);
|
|
165
|
+
const attachX = cat.spineX + branchDX * t;
|
|
166
|
+
const attachY = spineY + (isTop ? -branchDY : branchDY) * t;
|
|
167
|
+
|
|
168
|
+
// 关键对齐:确保原因盒子完全在连线左侧,并且 Y 坐标中心精准对齐
|
|
169
|
+
const boxX = attachX - lineLength - reasonWidth;
|
|
170
|
+
const boxY = attachY - reasonHeight / 2;
|
|
171
|
+
|
|
172
|
+
const rId = `${cat.id}-r${rIndex}`;
|
|
173
|
+
nodes.push({
|
|
174
|
+
type: "rect", id: rId, x: boxX, y: boxY, width: reasonWidth, height: reasonHeight, text: reason,
|
|
175
|
+
fillColor: color.fill, strokeColor: color.stroke
|
|
176
|
+
});
|
|
177
|
+
// 原因小骨连线
|
|
178
|
+
nodes.push({
|
|
179
|
+
type: "connector",
|
|
180
|
+
connector: { from: { x: attachX, y: attachY }, to: rId, toAnchor: "right", lineShape: "straight", endArrow: "none", lineColor: color.stroke }
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
fs.writeFileSync('diagram.json', JSON.stringify({ version: 2, nodes }, null, 2));
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 连线格式与注意点
|
|
189
|
+
|
|
190
|
+
所有 connector 都用 `{ "type": "connector", "connector": { ... } }` 格式。
|
|
191
|
+
**注意:除了主骨外,其他所有连线(分支骨、原因小骨)都必须设置 `"endArrow": "none"`,否则会默认带箭头,导致方向混乱。**
|
|
192
|
+
|
|
193
|
+
分支骨:从主骨上的绝对坐标点 → 分类标签节点:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"version": 2,
|
|
198
|
+
"nodes": [
|
|
199
|
+
{ "type": "rect", "x": 0, "y": 0, "width": "__totalWidth__", "height": "__totalHeight__" },
|
|
200
|
+
|
|
201
|
+
{ "type": "ellipse", "id": "head", "x": "__headX__", "y": "__headY__",
|
|
202
|
+
"width": 180, "height": 80, "text": "[中心问题]" },
|
|
203
|
+
|
|
204
|
+
{ "type": "connector", "connector": {
|
|
205
|
+
"from": { "x": "__spineStartX__", "y": "__spineY__" },
|
|
206
|
+
"to": "head", "toAnchor": "left",
|
|
207
|
+
"lineShape": "straight", "endArrow": "arrow"
|
|
208
|
+
}},
|
|
209
|
+
|
|
210
|
+
{ "type": "rect", "id": "c0", "x": "__catX__", "y": "__catY__",
|
|
211
|
+
"width": 120, "height": 40, "text": "[分类A]" },
|
|
212
|
+
{ "type": "connector", "connector": {
|
|
213
|
+
"from": { "x": "__spineX0__", "y": "__spineY__" },
|
|
214
|
+
"to": "c0", "toAnchor": "bottom",
|
|
215
|
+
"lineShape": "straight", "endArrow": "none"
|
|
216
|
+
}},
|
|
217
|
+
|
|
218
|
+
{ "type": "rect", "id": "c0-r0", "x": "__reasonX__", "y": "__reasonY__",
|
|
219
|
+
"width": 140, "height": 32, "text": "[原因1]" },
|
|
220
|
+
{ "type": "connector", "connector": {
|
|
221
|
+
"from": { "x": "__attachX__", "y": "__attachY__" },
|
|
222
|
+
"to": "c0-r0", "toAnchor": "right",
|
|
223
|
+
"lineShape": "straight", "endArrow": "none"
|
|
224
|
+
}}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
上述骨架展示一个分类(上方)+ 一条原因的模式。完整鱼骨图重复此模式,上下交替。每个分类下可有多条原因,均匀插值分布在分支骨上。
|
|
230
|
+
|
|
231
|
+
## 陷阱
|
|
232
|
+
|
|
233
|
+
- **代码生成**:必须使用带有动态防重叠算法的脚本来计算坐标并输出 JSON。
|
|
234
|
+
- **分支骨防重叠**:同一侧的相邻分支骨和原因框必须没有任何交叉。
|
|
235
|
+
- **自适应高度**:原因数量较多时,分支骨自动拉长以容纳所有小骨。
|
|
236
|
+
- **原因小骨水平**:原因框右侧的附着点必须与连线起点 Y 坐标一致。
|
|
237
|
+
- **无箭头**:所有分类的分支连线、小骨连线均必须关闭箭头。
|
|
238
|
+
- **同色系**:同一个分支骨、分类标签节点以及原因小骨节点和连线,必须使用同色系的颜色以保持视觉连贯性。
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<link rel="icon" href="favicon.ico" />
|
|
7
|
+
<title></title>
|
|
8
|
+
<style>
|
|
9
|
+
* {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
padding: 0;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.open-platform-wrapper {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
height: 100vh;
|
|
21
|
+
background-color: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.open-platform-icon {
|
|
25
|
+
width: 120px;
|
|
26
|
+
height: 120px;
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.open-platform-desc {
|
|
31
|
+
margin-top: 16px;
|
|
32
|
+
line-height: 22px;
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
color: #646a73;
|
|
35
|
+
text-align: center
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.open-platform-back {
|
|
39
|
+
border-radius: 6px;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
height: 32px;
|
|
42
|
+
line-height: 22px;
|
|
43
|
+
min-width: 80px;
|
|
44
|
+
padding: 4px 11px;
|
|
45
|
+
text-align: center;
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
touch-action: manipulation;
|
|
48
|
+
transition: color .1s ease-in, background-color .1s ease-in, border-color .1s ease-in, width .2s ease-in;
|
|
49
|
+
user-select: none;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
background: #1456f0;
|
|
52
|
+
border: 1px solid #1456f0;
|
|
53
|
+
color: #ffffff;
|
|
54
|
+
margin-top: 16px;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
57
|
+
</head>
|
|
58
|
+
<body>
|
|
59
|
+
<div class="open-platform-wrapper">
|
|
60
|
+
<img class="open-platform-icon"
|
|
61
|
+
src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyLjkxMyA1NS4yNDRjLTUuNjMyIDIuOTUtOC4yNDYgNi4yODQtOC4yNDYgOS40NHY5LjcyYzAtMy4xNTYgMi42MTQtNi40OSA4LjI0Ni05LjQ0di05LjcyWm05NC4xNjMtMTIuMDg0di05LjcyNmM1LjkzNC0zLjE5IDguOTgxLTYuODkxIDguOTgxLTEwLjcyNXY5LjcyYzAgMy44NC0zLjA0NyA3LjU0My04Ljk4MSAxMC43MzJaIiBmaWxsPSIjMEMyOTZFIi8+PHBhdGggZD0iTTYwLjIyOSAxOS4wNTkgNDguNzMgNDkuOTIyIDYwLjM2NSA3Mi45MmwtOC40NzQgMjMuODczSDE2LjkyM2E0IDQgMCAwIDEtNC00VjIzLjA2YTQgNCAwIDAgMSA0LTRINjAuMjNaIiBmaWxsPSIjQkJCRkM0IiBmaWxsLW9wYWNpdHk9Ii40NSIvPjxwYXRoIGQ9Ik03MS40MDggMTkuMDU5IDYwLjAxMyA0OS45MjIgNzEuNDYgNzIuOTJsLTguMzI1IDIzLjg3M2gzOS45NDNhNCA0IDAgMCAwIDQtNFYyMy4wNmE0IDQgMCAwIDAtNC00aC0zMS42N1oiIGZpbGw9IiNCQkJGQzQiIGZpbGwtb3BhY2l0eT0iLjQ1Ii8+PHBhdGggZD0iTTIxLjkyMyAyNi4xYTIgMiAwIDEgMSAwIDQgMiAyIDAgMCAxIDAtNFptMyAyYTMgMyAwIDEgMC02IDAgMyAzIDAgMCAwIDYgMFptNi45MTUtMmEyIDIgMCAxIDEgMCA0IDIgMiAwIDAgMSAwLTRabTMgMmEzIDMgMCAxIDAtNiAwIDMgMyAwIDAgMCA2IDBabS0xNS43NjMgNy4zOTRhLjUuNSAwIDAgMSAuNS0uNWgzMS41ODFhLjUuNSAwIDAgMSAwIDFIMTkuNTc1YS41LjUgMCAwIDEtLjUtLjVabTQ4LjQ3NyAwYS41LjUgMCAwIDEgLjUtLjVoMzIuNDY1YS41LjUgMCAwIDEgMCAxSDY4LjA1MmEuNS41IDAgMCAxLS41LS41WiIgZmlsbD0iIzhGOTU5RSIvPjxwYXRoIGQ9Ik05OCAxMTFjOS45NDEgMCAxOC04LjA1OSAxOC0xOHMtOC4wNTktMTgtMTgtMThjLTkuOTQyIDAtMTggOC4wNTktMTggMThzOC4wNTggMTggMTggMThaIiBmaWxsPSIjRjgwIi8+PHBhdGggZD0iTTk3LjE4MSA4NC44MThhLjgxOC44MTggMCAwIDAtLjgxOC44MTl2OS44MThjMCAuNDUyLjM2Ni44MTguODE4LjgxOGgxLjYzN2EuODE4LjgxOCAwIDAgMCAuODE4LS44MTh2LTkuODE5YS44MTguODE4IDAgMCAwLS44MTgtLjgxOEg5Ny4xOFptMCAxMy4wOTJhLjgxOC44MTggMCAwIDAtLjgxOC44MTh2MS42MzZjMCAuNDUyLjM2Ni44MTguODE4LjgxOGgxLjYzN2EuODE4LjgxOCAwIDAgMCAuODE4LS44MTh2LTEuNjM2YS44MTguODE4IDAgMCAwLS44MTgtLjgxOUg5Ny4xOFoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNNC4wMjcgODUuMzFjMi40OSA1LjUxIDE0Ljc3IDkuOTQgNDEuNDUgOS45M3Y5LjcyMWMtMjYuNjguMDEtMzguOTYtNC40Mi00MS40NS05Ljkzdi05LjcyWm04NC44MS0yNy4yN2MxNy41Mi0yLjY5IDI1LjgwNy03LjAyNiAyNy4yLTExLjcxdjkuNzJjLS4zMyA0LjY3LTkuNjggOS4wMi0yNy4yIDExLjcxdi05LjcyWiIgZmlsbD0iIzMzNzBGRiIvPjxwYXRoIGQ9Ik04OS4yMzcgMTMuMDFjMTguMDU4IDAgMjYuOCAzLjI1IDI2LjggOS43MnY5LjcyYzAtNi40Ny04Ljc0Mi05LjcyLTI2LjgtOS43MnYtOS43MlptLTg0LjU3IDUxLjdjMCA2LjYgMTEuMzcgMTIuNDUgMzAuNDcgMTIuNDR2OS43MmMtMTkuMSAwLTMwLjQ3LTUuODQtMzAuNDctMTIuNDR2LTkuNzJaIiBmaWxsPSIjMDBENkI5Ii8+PC9zdmc+"
|
|
62
|
+
alt="">
|
|
63
|
+
<div class="open-platform-desc">The page does not exist.</div>
|
|
64
|
+
<a class="open-platform-back" href="/">Go to homepage</a>
|
|
65
|
+
</div>
|
|
66
|
+
<script>window.gfdatav1={"env":"prod","ver":"1.0.0.13","canary":0,"garrModules":null,"envName":"prod","region":"CN","idc":"hl","webServerCodeType":"DeployServerlessWebServer","runtime":"node","extra":{"canaryType":null}}</script><script>
|
|
67
|
+
|
|
68
|
+
function parseQueryString(queryString) {
|
|
69
|
+
// 移除开头的 "?"
|
|
70
|
+
if (queryString.charAt(0) === '?') {
|
|
71
|
+
queryString = queryString.substring(1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var params = {};
|
|
75
|
+
if (!queryString) return params;
|
|
76
|
+
|
|
77
|
+
// 分割参数对
|
|
78
|
+
var paramPairs = queryString.split('&');
|
|
79
|
+
|
|
80
|
+
for (var i = 0; i < paramPairs.length; i++) {
|
|
81
|
+
var paramPair = paramPairs[i].split('=');
|
|
82
|
+
var key = decodeURIComponent(paramPair[0]);
|
|
83
|
+
var value = paramPair.length > 1 ? decodeURIComponent(paramPair[1]) : '';
|
|
84
|
+
|
|
85
|
+
// 处理重复参数(转为数组)
|
|
86
|
+
if (params[key] === undefined) {
|
|
87
|
+
params[key] = value;
|
|
88
|
+
} else if (!Array.isArray(params[key])) {
|
|
89
|
+
params[key] = [params[key], value];
|
|
90
|
+
} else {
|
|
91
|
+
params[key].push(value);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return params;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function getLocale() {
|
|
99
|
+
var zhLang = 'zh-CN';
|
|
100
|
+
var enLang = 'en-US';
|
|
101
|
+
|
|
102
|
+
var queryLang = parseQueryString(window.location.search).lang;
|
|
103
|
+
var cookieLang = getCookieLocale();
|
|
104
|
+
var lang = enLang;
|
|
105
|
+
|
|
106
|
+
<!--从cookie中取值-->
|
|
107
|
+
function getCookieLocale() {
|
|
108
|
+
var locale = '';
|
|
109
|
+
var cookies = document.cookie.split('; ');
|
|
110
|
+
var loclaeKey = 'open_locale';
|
|
111
|
+
|
|
112
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
113
|
+
var cookie = cookies[i].trim();
|
|
114
|
+
var cookieArr = cookie.split('=');
|
|
115
|
+
if (cookieArr[0] === loclaeKey) {
|
|
116
|
+
locale = cookieArr[1];
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return locale;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function setLocaleCookie(lang) {
|
|
124
|
+
var date = new Date();
|
|
125
|
+
// 300天到期
|
|
126
|
+
date.setTime(date.getTime() + (300 * 24 * 60 * 60 * 1000));
|
|
127
|
+
var expires = 'expires=' + date.toUTCString();
|
|
128
|
+
document.cookie = 'open_locale=' + lang + '; ' + expires + '; path=/;';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// 获取浏览器默认语言
|
|
132
|
+
if (navigator.language.indexOf('en') !== -1) {
|
|
133
|
+
lang = enLang;
|
|
134
|
+
} else if (navigator.language.indexOf('zh') !== -1) {
|
|
135
|
+
lang = zhLang;
|
|
136
|
+
}
|
|
137
|
+
if (cookieLang === enLang) {
|
|
138
|
+
lang = enLang;
|
|
139
|
+
} else if (cookieLang === zhLang) {
|
|
140
|
+
lang = zhLang;
|
|
141
|
+
}
|
|
142
|
+
if (queryLang === enLang) {
|
|
143
|
+
lang = enLang;
|
|
144
|
+
} else if (queryLang === zhLang) {
|
|
145
|
+
lang = zhLang;
|
|
146
|
+
}
|
|
147
|
+
// 设置cookie
|
|
148
|
+
setLocaleCookie(lang);
|
|
149
|
+
return lang;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 根据域名获取当前brand
|
|
153
|
+
function isLarkDomain() {
|
|
154
|
+
var defaultBrandMap = {
|
|
155
|
+
lark: ['larksuite'],
|
|
156
|
+
feishu: ['feishu', 'larkoffice', 'larkenterprise'],
|
|
157
|
+
};
|
|
158
|
+
const { hostname } = window.location;
|
|
159
|
+
|
|
160
|
+
if (defaultBrandMap.feishu.some((item) => hostname.includes(item))) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (defaultBrandMap.lark.some((item) => hostname.includes(item))) {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (window.domainBrand) {
|
|
169
|
+
return window.domainBrand === 'lark';
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var isLarkBrand = isLarkDomain();
|
|
176
|
+
|
|
177
|
+
var config = {
|
|
178
|
+
'zh-CN': {
|
|
179
|
+
'desc': '抱歉,您访问的页面不存在',
|
|
180
|
+
'back': '返回首页',
|
|
181
|
+
'title': (isLarkBrand ? 'Lark' : '飞书') + '开放平台',
|
|
182
|
+
},
|
|
183
|
+
'en-US': {
|
|
184
|
+
'desc': 'The page does not exist.',
|
|
185
|
+
'back': 'Go to homepage',
|
|
186
|
+
'title': (isLarkBrand ? 'Lark': 'Feishu') + ' Open Platform',
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
var locale = getLocale();
|
|
190
|
+
var descObj = document.querySelector('.open-platform-desc');
|
|
191
|
+
var backObj = document.querySelector('.open-platform-back');
|
|
192
|
+
descObj.innerHTML = config[locale].desc;
|
|
193
|
+
backObj.innerHTML = config[locale].back;
|
|
194
|
+
document.title = config[locale].title;
|
|
195
|
+
|
|
196
|
+
</script>
|
|
197
|
+
</body>
|
|
198
|
+
</html>
|