@rainbow-robotics/muscat-plugin-kit 0.1.2-dev.44 → 0.1.2-dev.46
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/README.md +1 -1
- package/cli/README.md +184 -0
- package/cli/bin/muscat-pk.mjs +13 -0
- package/cli/prepack.mjs +10 -0
- package/cli/src/build.mjs +2 -29
- package/cli/src/dev.mjs +10 -2
- package/cli/src/devBack.mjs +54 -11
- package/cli/src/devUi.mjs +100 -34
- package/cli/src/manifest.mjs +15 -0
- package/cli/src/mcp.mjs +534 -0
- package/cli/src/new.mjs +16 -1
- package/cli/src/pluginDevServer.mjs +113 -0
- package/cli/src/ports.mjs +160 -0
- package/cli/src/sdk.mjs +11 -9
- package/cli/src/storybook.mjs +168 -0
- package/cli/src/templates-embedded.mjs +1 -1
- package/cli/src/util.mjs +29 -0
- package/cli/storybook-dist/_design-tokens.css +4957 -0
- package/cli/storybook-dist/_stories-src/NxAvatar.stories.tsx +27 -0
- package/cli/storybook-dist/_stories-src/NxPagination.stories.tsx +28 -0
- package/cli/storybook-dist/_stories-src/RBAccordion/RBAccordion.stories.tsx +46 -0
- package/cli/storybook-dist/_stories-src/RBAccordion/RBAccordionGroup.stories.tsx +73 -0
- package/cli/storybook-dist/_stories-src/RBBadge/RBBadge.stories.tsx +93 -0
- package/cli/storybook-dist/_stories-src/RBBattery/RBBattery.stories.tsx +74 -0
- package/cli/storybook-dist/_stories-src/RBButton/RBCheckIconButton.stories.tsx +28 -0
- package/cli/storybook-dist/_stories-src/RBButton/RBCheckLabelButton.stories.tsx +84 -0
- package/cli/storybook-dist/_stories-src/RBButton/RBIconButton.stories.tsx +57 -0
- package/cli/storybook-dist/_stories-src/RBButton/RBInlineLabelButton.stories.tsx +41 -0
- package/cli/storybook-dist/_stories-src/RBButton/RBLabelButton.stories.tsx +60 -0
- package/cli/storybook-dist/_stories-src/RBDatePicker/RBDateInput.stories.tsx +44 -0
- package/cli/storybook-dist/_stories-src/RBDatePicker/RBRangeDateInput.stories.tsx +44 -0
- package/cli/storybook-dist/_stories-src/RBDialog/RBAlert.stories.tsx +51 -0
- package/cli/storybook-dist/_stories-src/RBDialog/RBConfirm.stories.tsx +55 -0
- package/cli/storybook-dist/_stories-src/RBDialog/RBPrompt.stories.tsx +52 -0
- package/cli/storybook-dist/_stories-src/RBDivider/RBDivider.stories.tsx +93 -0
- package/cli/storybook-dist/_stories-src/RBEmptyView/RBEmptyView.stories.tsx +49 -0
- package/cli/storybook-dist/_stories-src/RBIcons/RBColorIcons.stories.tsx +108 -0
- package/cli/storybook-dist/_stories-src/RBIcons/RBIcons.stories.tsx +106 -0
- package/cli/storybook-dist/_stories-src/RBIcons/RBMenuTreeIcons.stories.tsx +108 -0
- package/cli/storybook-dist/_stories-src/RBIcons/RBProgramIcons.stories.tsx +116 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBCheckBox.stories.tsx +89 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBMultiRangeInput.stories.tsx +64 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBRadioBox.stories.tsx +65 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBRadioButton.stories.tsx +68 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBSelectBox.stories.tsx +119 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBSideNumberInput.stories.tsx +90 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBText/RBTextArea.stories.tsx +45 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBText/RBTextInput.stories.tsx +50 -0
- package/cli/storybook-dist/_stories-src/RBInput/RBTextField.stories.tsx +102 -0
- package/cli/storybook-dist/_stories-src/RBJoyStick/RBJoyStick.stories.tsx +31 -0
- package/cli/storybook-dist/_stories-src/RBLight/RBLight.stories.tsx +36 -0
- package/cli/storybook-dist/_stories-src/RBPagination/RBPagination.stories.tsx +49 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBCard/RBCard.stories.tsx +89 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBCommand/RBCommand.stories.tsx +116 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBDialog/RBDialog.stories.tsx +74 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBDrawer/RBDrawer.stories.tsx +99 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBDropdownMenu/RBDropdownMenu.stories.tsx +123 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBMenubar/RBMenubar.stories.tsx +135 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBPopover/RBPopover.stories.tsx +69 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBResizable/RBResizable.stories.tsx +49 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBSheet/RBSheet.stories.tsx +91 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBSlider/RBSlider.stories.tsx +38 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBSwitch/RBSwitch.stories.tsx +112 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBTabs/RBTabs.stories.tsx +75 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBToggle/RBToggle.stories.tsx +51 -0
- package/cli/storybook-dist/_stories-src/RBShadcn/RBToggleGroup/RBToggleGroup.stories.tsx +84 -0
- package/cli/storybook-dist/_stories-src/RBTab/RBChipTab.stories.tsx +102 -0
- package/cli/storybook-dist/_stories-src/RBTab/RBChipsBoxTab.stories.tsx +78 -0
- package/cli/storybook-dist/_stories-src/RBTab/RBTab.stories.tsx +57 -0
- package/cli/storybook-dist/_stories-src/RBTable/RBTable.stories.tsx +177 -0
- package/cli/storybook-dist/_stories-src/RBTable/RBTableRow.stories.tsx +64 -0
- package/cli/storybook-dist/_stories-src/RBToast/RBToast.stories.tsx +117 -0
- package/cli/storybook-dist/_stories-src/RBTooltip/RBTooltip.stories.tsx +50 -0
- package/cli/storybook-dist/_stories-src/loading/RBSpinner.stories.tsx +30 -0
- package/cli/storybook-dist/_stories-src/nx-button/NxButton.stories.tsx +54 -0
- package/cli/storybook-dist/_stories-src/nx-button/NxPointerHoldButton.stories.tsx +57 -0
- package/cli/storybook-dist/_stories-src/nx-icons/NxIcons.stories.tsx +48 -0
- package/cli/storybook-dist/_stories-src/nx-inputs/NxNumberInput.stories.tsx +103 -0
- package/cli/storybook-dist/_stories-src/nx-inputs/NxRangeInput.stories.tsx +27 -0
- package/cli/storybook-dist/_stories-src/nx-inputs/NxSelectBox.stories.tsx +67 -0
- package/cli/storybook-dist/_stories-src/nx-inputs/NxSlideRange.stories.tsx +45 -0
- package/cli/storybook-dist/_stories-src/nx-inputs/NxSwitch.stories.tsx +27 -0
- package/cli/storybook-dist/_stories-src/nx-inputs/NxTextArea.stories.tsx +48 -0
- package/cli/storybook-dist/_stories-src/nx-inputs/NxTextInput.stories.tsx +46 -0
- package/cli/storybook-dist/assets/Color-YHDXOIA2-BjuzF3Je.js +1 -0
- package/cli/storybook-dist/assets/Docs-BAFZYTMR.js +12 -0
- package/cli/storybook-dist/assets/Docs-BQesYW-Q.js +8 -0
- package/cli/storybook-dist/assets/Docs-BsMEe093.js +7 -0
- package/cli/storybook-dist/assets/Docs-By6k6vcM.js +20 -0
- package/cli/storybook-dist/assets/Docs-D1J63cJc.js +7 -0
- package/cli/storybook-dist/assets/Docs-GoNbntAU.js +8 -0
- package/cli/storybook-dist/assets/DocsRenderer-CFRXHY34-BwY_WiM7.js +2 -0
- package/cli/storybook-dist/assets/NxAvatar.stories-CvzBHfYa.js +13 -0
- package/cli/storybook-dist/assets/NxButton.stories-B83PesgN.js +20 -0
- package/cli/storybook-dist/assets/NxIcons.stories-Ca7qpAaO.js +3 -0
- package/cli/storybook-dist/assets/NxNumberInput.stories-DpNcCG6B.js +26 -0
- package/cli/storybook-dist/assets/NxPagination.stories-Xnvd3xhH.js +11 -0
- package/cli/storybook-dist/assets/NxPointerHoldButton.stories-C3YSIpM0.js +14 -0
- package/cli/storybook-dist/assets/NxRangeInput.stories-DIhaNZig.js +17 -0
- package/cli/storybook-dist/assets/NxSelectBox.stories-BGwO2mYJ.js +17 -0
- package/cli/storybook-dist/assets/NxSlideRange.stories-BXlt5Bgt.js +14 -0
- package/cli/storybook-dist/assets/NxSwitch.stories-C5ZqIRtw.js +11 -0
- package/cli/storybook-dist/assets/NxTextArea.stories-hm_ycALo.js +11 -0
- package/cli/storybook-dist/assets/NxTextInput.stories-DkZAySr_.js +11 -0
- package/cli/storybook-dist/assets/PretendardVariable-CJuje-Rk.woff2 +0 -0
- package/cli/storybook-dist/assets/RBAccordion.stories--bY36GZY.js +17 -0
- package/cli/storybook-dist/assets/RBAccordionGroup.stories-BVr1ccI4.js +33 -0
- package/cli/storybook-dist/assets/RBAlert.stories-CkjFBEkv.js +17 -0
- package/cli/storybook-dist/assets/RBBadge.stories-CNXILDPh.js +1 -0
- package/cli/storybook-dist/assets/RBBattery.stories-AokMv8ZY.js +10 -0
- package/cli/storybook-dist/assets/RBCard.stories-CX1sLKB2.js +45 -0
- package/cli/storybook-dist/assets/RBCheckBox.stories-By3QHBFm.js +1 -0
- package/cli/storybook-dist/assets/RBCheckIconButton.stories-Dud1uK3X.js +1 -0
- package/cli/storybook-dist/assets/RBCheckLabelButton.stories-C8iBkZxY.js +24 -0
- package/cli/storybook-dist/assets/RBChipTab.stories-DsgbiS2U.js +21 -0
- package/cli/storybook-dist/assets/RBChipsBoxTab.stories-C3DZGmq0.js +1 -0
- package/cli/storybook-dist/assets/RBColorIcons.stories-CusR20qk.js +3 -0
- package/cli/storybook-dist/assets/RBCommand.stories-DhJNgaLZ.js +73 -0
- package/cli/storybook-dist/assets/RBConfirm.stories-B6LKpCDa.js +20 -0
- package/cli/storybook-dist/assets/RBDateInput.stories-PEEhQ1wJ.js +15 -0
- package/cli/storybook-dist/assets/RBDialog.stories-CAtOdRen.js +38 -0
- package/cli/storybook-dist/assets/RBDivider.stories-0zpIUlXT.js +1 -0
- package/cli/storybook-dist/assets/RBDrawer.stories-CWMG4glY.js +14 -0
- package/cli/storybook-dist/assets/RBDropdownMenu.stories-6fbEYZfk.js +86 -0
- package/cli/storybook-dist/assets/RBEmptyView.stories-BRDZHjn4.js +12 -0
- package/cli/storybook-dist/assets/RBIconButton.stories-sYrRLYob.js +1 -0
- package/cli/storybook-dist/assets/RBIcons.stories-DFe8O1_g.js +3 -0
- package/cli/storybook-dist/assets/RBInlineLabelButton.stories-DX4VdUfk.js +1 -0
- package/cli/storybook-dist/assets/RBJoyStick.stories-SA2Foelf.js +11 -0
- package/cli/storybook-dist/assets/RBLabelButton.stories-CicBns_Y.js +1 -0
- package/cli/storybook-dist/assets/RBLight.stories-WlP3oEmY.js +1 -0
- package/cli/storybook-dist/assets/RBMenuTreeIcons.stories-CrWjPfxj.js +3 -0
- package/cli/storybook-dist/assets/RBMenubar.stories-Di4phWw7.js +3 -0
- package/cli/storybook-dist/assets/RBMultiRangeInput.stories-DS3wrR3l.js +14 -0
- package/cli/storybook-dist/assets/RBPagination.stories-BDVPAUVD.js +17 -0
- package/cli/storybook-dist/assets/RBPopover.stories-DL9b_iX9.js +11 -0
- package/cli/storybook-dist/assets/RBProgramIcons.stories-ByRVx-on.js +3 -0
- package/cli/storybook-dist/assets/RBPrompt.stories-vTmKWyA5.js +20 -0
- package/cli/storybook-dist/assets/RBRadioBox.stories-C9WHt4jb.js +1 -0
- package/cli/storybook-dist/assets/RBRadioButton.stories-D8KYq63j.js +11 -0
- package/cli/storybook-dist/assets/RBRangeDateInput.stories-Bvcf4Su7.js +15 -0
- package/cli/storybook-dist/assets/RBResizable.stories-3O2OMuH_.js +20 -0
- package/cli/storybook-dist/assets/RBSelectBox.stories-CKZLmPzX.js +6 -0
- package/cli/storybook-dist/assets/RBSheet.stories-Dko0It1W.js +39 -0
- package/cli/storybook-dist/assets/RBSideNumberInput.stories-CUvqVtId.js +5 -0
- package/cli/storybook-dist/assets/RBSlider.stories-CcbaKRYo.js +5 -0
- package/cli/storybook-dist/assets/RBSpinner.stories-D15e_JlE.js +14 -0
- package/cli/storybook-dist/assets/RBSwitch.stories-C4JRsYJ6.js +65 -0
- package/cli/storybook-dist/assets/RBTab.stories-BPvzQSM-.js +1 -0
- package/cli/storybook-dist/assets/RBTable.stories-nr8OS1mV.js +62 -0
- package/cli/storybook-dist/assets/RBTableRow.stories-rI0rK8Ci.js +11 -0
- package/cli/storybook-dist/assets/RBTabs.stories-CxMtHGWA.js +21 -0
- package/cli/storybook-dist/assets/RBTextArea.stories-Bru4AhJ3.js +5 -0
- package/cli/storybook-dist/assets/RBTextField.stories-Ah3D9lto.js +45 -0
- package/cli/storybook-dist/assets/RBTextInput.stories-C3qAVngJ.js +5 -0
- package/cli/storybook-dist/assets/RBToast.stories-C1occsvf.js +11 -0
- package/cli/storybook-dist/assets/RBToggle.stories-BNrNERc7.js +12 -0
- package/cli/storybook-dist/assets/RBToggleGroup.stories-D_RRBwxY.js +17 -0
- package/cli/storybook-dist/assets/RBTooltip.stories-DuyOQqrB.js +9 -0
- package/cli/storybook-dist/assets/RainbowUiProvider-BYlbsa69.css +1 -0
- package/cli/storybook-dist/assets/RainbowUiProvider-B_piZBLb.js +31 -0
- package/cli/storybook-dist/assets/browserUtils-DeopUpDy.js +1 -0
- package/cli/storybook-dist/assets/chunk-XP5HYGXS-BHXC9YeQ.js +1 -0
- package/cli/storybook-dist/assets/client-DTf7SId2.js +1 -0
- package/cli/storybook-dist/assets/createConveyorBeltLayer-Cn41pFRH.js +6210 -0
- package/cli/storybook-dist/assets/createConveyorBeltLayer-Ds5AOper.css +21 -0
- package/cli/storybook-dist/assets/entry-preview-D-mLV0cS.js +2 -0
- package/cli/storybook-dist/assets/entry-preview-docs-b8bpVBXy.js +46 -0
- package/cli/storybook-dist/assets/iframe-DNru2eN7.js +211 -0
- package/cli/storybook-dist/assets/index-B4FGfHer.js +1 -0
- package/cli/storybook-dist/assets/index-BRq5TIsn.js +24 -0
- package/cli/storybook-dist/assets/index-C1OzuK6-.js +240 -0
- package/cli/storybook-dist/assets/index-CT3U1fyk.js +1 -0
- package/cli/storybook-dist/assets/index-ChsGqxH_.js +9 -0
- package/cli/storybook-dist/assets/index-Cwr2bQOB.js +575 -0
- package/cli/storybook-dist/assets/index-DKFBREX_.js +1 -0
- package/cli/storybook-dist/assets/index-DgH-xKnr.js +11 -0
- package/cli/storybook-dist/assets/index-Dmy2JGbm.js +1 -0
- package/cli/storybook-dist/assets/index-DrFu-skq.js +6 -0
- package/cli/storybook-dist/assets/jsx-runtime-BTJTZTIL.js +9 -0
- package/cli/storybook-dist/assets/keymapTileIndex.worker-BsNYNbqs.js +1 -0
- package/cli/storybook-dist/assets/preview-B8lJiyuQ.js +34 -0
- package/cli/storybook-dist/assets/preview-BBWR9nbA.js +1 -0
- package/cli/storybook-dist/assets/preview-BWzBA1C2.js +396 -0
- package/cli/storybook-dist/assets/preview-CILRoSnB.js +1 -0
- package/cli/storybook-dist/assets/preview-CVgpLj3b.js +1 -0
- package/cli/storybook-dist/assets/preview-CvbIS5ZJ.js +1 -0
- package/cli/storybook-dist/assets/preview-DD_OYowb.js +1 -0
- package/cli/storybook-dist/assets/preview-DGUiP6tS.js +7 -0
- package/cli/storybook-dist/assets/preview-DHQbi4pV.js +1 -0
- package/cli/storybook-dist/assets/preview-DUTcCPBe.css +1 -0
- package/cli/storybook-dist/assets/preview-QAsoD6Sa.js +2 -0
- package/cli/storybook-dist/assets/preview-rcRMbKPr.js +3 -0
- package/cli/storybook-dist/assets/react-18-hB3smqWJ.js +1 -0
- package/cli/storybook-dist/assets/react-resizable-panels.browser-CvAJUcrm.js +72 -0
- package/cli/storybook-dist/assets/test-utils-BQudk2xt.js +9 -0
- package/cli/storybook-dist/favicon.svg +1 -0
- package/cli/storybook-dist/iframe.html +666 -0
- package/cli/storybook-dist/index.html +190 -0
- package/cli/storybook-dist/index.json +1 -0
- package/cli/storybook-dist/nunito-sans-bold-italic.woff2 +0 -0
- package/cli/storybook-dist/nunito-sans-bold.woff2 +0 -0
- package/cli/storybook-dist/nunito-sans-italic.woff2 +0 -0
- package/cli/storybook-dist/nunito-sans-regular.woff2 +0 -0
- package/cli/storybook-dist/project.json +1 -0
- package/cli/storybook-dist/sb-addons/chromatic-com-storybook-10/manager-bundle.js +331 -0
- package/cli/storybook-dist/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +51 -0
- package/cli/storybook-dist/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
- package/cli/storybook-dist/sb-addons/essentials-controls-2/manager-bundle.js +405 -0
- package/cli/storybook-dist/sb-addons/essentials-docs-4/manager-bundle.js +245 -0
- package/cli/storybook-dist/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/links-1/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/storybook-13/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-addons/storybook-experimental-addon-test-12/manager-bundle.js +223 -0
- package/cli/storybook-dist/sb-addons/themes-11/manager-bundle.js +3 -0
- package/cli/storybook-dist/sb-common-assets/favicon.svg +1 -0
- package/cli/storybook-dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/cli/storybook-dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/cli/storybook-dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/cli/storybook-dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/cli/storybook-dist/sb-manager/globals-module-info.js +1052 -0
- package/cli/storybook-dist/sb-manager/globals-runtime.js +41775 -0
- package/cli/storybook-dist/sb-manager/globals.js +48 -0
- package/cli/storybook-dist/sb-manager/runtime.js +12048 -0
- package/cli/templates/common/.mcp.json +8 -0
- package/cli/templates/common/README.md +467 -53
- package/cli/templates/common/assets/icon.svg +44 -2
- package/cli/templates/common/package.json +4 -0
- package/cli/templates/common/ui/content.tsx +209 -26
- package/cli/templates/common/ui/style.css +6 -0
- package/cli/templates/common/vite.config.ts +6 -34
- package/cli/templates/cpp/cpp/main.cpp +1 -0
- package/cli/vite.d.mts +25 -0
- package/cli/vite.mjs +271 -0
- package/package.json +31 -4
|
@@ -18,7 +18,8 @@ muscat-pk build # build + distributable ZIP
|
|
|
18
18
|
```
|
|
19
19
|
__PLUGIN_DIR__/
|
|
20
20
|
├─ ui/
|
|
21
|
-
│
|
|
21
|
+
│ ├─ content.tsx # plugin UI entry point
|
|
22
|
+
│ └─ style.css # plugin styles auto-loaded by muscat()
|
|
22
23
|
├─ py/
|
|
23
24
|
│ └─ main.py # Python backend entry point
|
|
24
25
|
├─ assets/
|
|
@@ -34,6 +35,153 @@ __PLUGIN_DIR__/
|
|
|
34
35
|
|
|
35
36
|
## Frontend (`ui/content.tsx`)
|
|
36
37
|
|
|
38
|
+
### JavaScript dependencies
|
|
39
|
+
|
|
40
|
+
`muscat-pk build` runs this plugin project's own Vite build. Vite resolves
|
|
41
|
+
imports from installed `node_modules`; it does not care whether a package is
|
|
42
|
+
listed under `dependencies` or `devDependencies`, but the package must be
|
|
43
|
+
installed.
|
|
44
|
+
|
|
45
|
+
Do not run a production-only install such as `npm install --omit=dev` before
|
|
46
|
+
building the plugin UI, because build tools like `vite`, `typescript`,
|
|
47
|
+
`tailwindcss`, `@tailwindcss/vite`, `sass`, or `less` are usually
|
|
48
|
+
`devDependencies`.
|
|
49
|
+
|
|
50
|
+
The scaffold keeps this split:
|
|
51
|
+
|
|
52
|
+
| package kind | examples | why |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `dependencies` | `@rainbow-robotics/plugin-ui`, UI libraries imported by plugin source | Author-facing APIs used by `ui/*.tsx` |
|
|
55
|
+
| `devDependencies` | `vite`, `typescript`, `tailwindcss`, `@tailwindcss/vite`, `sass`, `less` | Build/dev tools needed before `dist/*.js` is produced |
|
|
56
|
+
|
|
57
|
+
The built plugin ZIP does not include `package.json` or `node_modules`. For
|
|
58
|
+
production, Muscat provides `@rainbow-robotics/plugin-ui`, React, and ReactDOM
|
|
59
|
+
through the host import map; plugin UI build output imports those as host
|
|
60
|
+
externals.
|
|
61
|
+
|
|
62
|
+
### Styles
|
|
63
|
+
|
|
64
|
+
`muscat()` automatically loads `ui/style.{css,scss,sass,less}` (or
|
|
65
|
+
`ui/styles.{css,scss,sass,less}`) for every UI entry, plus
|
|
66
|
+
`ui/{entry}.{css,scss,sass,less}` for a matching entry-specific stylesheet. You
|
|
67
|
+
do not need to import CSS from every `.tsx` file.
|
|
68
|
+
|
|
69
|
+
The scaffold uses Tailwind's theme/utilities layers only, so plugin utilities
|
|
70
|
+
are generated from files under `ui/` without applying Tailwind preflight resets
|
|
71
|
+
to the host page.
|
|
72
|
+
|
|
73
|
+
Built CSS selectors are scoped under the current plugin id
|
|
74
|
+
(`[data-muscat-plugin-id="..."]`). CSS-in-JS libraries such as Emotion work
|
|
75
|
+
normally, but global styles should be scoped by the author.
|
|
76
|
+
|
|
77
|
+
#### Tailwind
|
|
78
|
+
|
|
79
|
+
This template enables Tailwind in `vite.config.ts`:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { defineConfig } from "vite";
|
|
83
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
84
|
+
import { muscat } from "@rainbow-robotics/muscat-plugin-kit/vite";
|
|
85
|
+
|
|
86
|
+
export default defineConfig({
|
|
87
|
+
plugins: [tailwindcss(), muscat()],
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The default `ui/style.css` uses Tailwind theme/utilities only, not preflight:
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
@layer theme, utilities;
|
|
95
|
+
|
|
96
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
97
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
98
|
+
|
|
99
|
+
@source "./**/*.{ts,tsx}";
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### SCSS, Sass, and Less
|
|
103
|
+
|
|
104
|
+
Install the preprocessor package, then create one of the auto-loaded style files.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm i -D sass
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
```scss
|
|
111
|
+
/* ui/style.scss */
|
|
112
|
+
$accent: #3b82f6;
|
|
113
|
+
|
|
114
|
+
.panel {
|
|
115
|
+
border: 1px solid color-mix(in srgb, $accent 40%, transparent);
|
|
116
|
+
|
|
117
|
+
&__title {
|
|
118
|
+
color: $accent;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For Less, install `less` and use `ui/style.less`.
|
|
124
|
+
|
|
125
|
+
#### Emotion
|
|
126
|
+
|
|
127
|
+
Emotion dependencies may be in `dependencies` or `devDependencies`; Vite can
|
|
128
|
+
bundle them when they are installed and imported by the plugin.
|
|
129
|
+
|
|
130
|
+
For `styled`, no Vite config change is needed:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npm i @emotion/react @emotion/styled
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import styled from "@emotion/styled";
|
|
138
|
+
|
|
139
|
+
const Panel = styled.div({
|
|
140
|
+
display: "grid",
|
|
141
|
+
gap: 12,
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
For Emotion's `css` prop, pass React plugin options through `muscat()` and add
|
|
146
|
+
`jsxImportSource` to `tsconfig.json`:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npm i @emotion/react @emotion/styled
|
|
150
|
+
npm i -D @emotion/babel-plugin
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
// vite.config.ts
|
|
155
|
+
import { defineConfig } from "vite";
|
|
156
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
157
|
+
import { muscat } from "@rainbow-robotics/muscat-plugin-kit/vite";
|
|
158
|
+
|
|
159
|
+
export default defineConfig({
|
|
160
|
+
plugins: [
|
|
161
|
+
tailwindcss(),
|
|
162
|
+
muscat({
|
|
163
|
+
react: {
|
|
164
|
+
jsxImportSource: "@emotion/react",
|
|
165
|
+
babel: {
|
|
166
|
+
plugins: ["@emotion/babel-plugin"],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"compilerOptions": {
|
|
177
|
+
"jsxImportSource": "@emotion/react"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Emotion `Global` writes global CSS at runtime, so scope it manually or avoid it
|
|
183
|
+
inside plugins.
|
|
184
|
+
|
|
37
185
|
### useRb() hook
|
|
38
186
|
|
|
39
187
|
Access the communication API between the plugin module and UI from any plugin component.
|
|
@@ -48,13 +196,19 @@ function App() {
|
|
|
48
196
|
|
|
49
197
|
### rb API
|
|
50
198
|
|
|
51
|
-
| Method
|
|
52
|
-
|
|
53
|
-
| `rb.pub(topic, payload)`
|
|
54
|
-
| `rb.sub(topic, handler)`
|
|
55
|
-
| `rb.action(topic, payload?)`
|
|
56
|
-
| `rb.serve(topic, handler)`
|
|
57
|
-
| `rb.toast(message, type?)` |
|
|
199
|
+
| Method | Description |
|
|
200
|
+
| ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
201
|
+
| `rb.pub(topic, payload)` | Publish a message to a topic |
|
|
202
|
+
| `rb.sub(topic, handler)` | Subscribe to a topic — returns `{ undeclare() }` |
|
|
203
|
+
| `rb.action(topic, payload?)` | Send a request and await a reply |
|
|
204
|
+
| `rb.serve(topic, handler)` | Handle incoming requests from the backend |
|
|
205
|
+
| `rb.toast({ title?, message, type?, actionLabel?, handleActionClick?, closeOnActionClick?, duration?, onClose? })` | Show a host toast notification. `message` accepts a string or `ReactElement`. `type` can be `"info"`, `"danger"`, `"warning"`, `"caution"`, or `"success"` |
|
|
206
|
+
| `rb.alert({ title?, message, buttonText? })` | Show a host alert dialog. Resolves when the dialog is closed |
|
|
207
|
+
| `rb.confirm({ title?, message, buttonText? })` | Show a host confirmation dialog. `buttonText` accepts `{ yes, no }`. Resolves to `true` or `false` |
|
|
208
|
+
| `rb.prompt({ title?, message, value?, placeholder?, buttonText? })` | Show a host prompt dialog. `buttonText` accepts `{ yes, no }`. Resolves to the entered string or `undefined` |
|
|
209
|
+
|
|
210
|
+
Topic names passed to `pub`, `sub`, `action`, and `serve` are isolated per plugin.
|
|
211
|
+
|
|
58
212
|
|
|
59
213
|
All methods support Generic Types:
|
|
60
214
|
|
|
@@ -68,33 +222,85 @@ const sub = await rb.sub<{ value: number }>("sensor/data", (data) => {
|
|
|
68
222
|
console.log(data.value);
|
|
69
223
|
});
|
|
70
224
|
sub.undeclare(); // cleanup
|
|
225
|
+
|
|
226
|
+
const ok = await rb.confirm({
|
|
227
|
+
title: "Run",
|
|
228
|
+
message: "Start the backend action?",
|
|
229
|
+
});
|
|
230
|
+
if (ok) {
|
|
231
|
+
await rb.action("run");
|
|
232
|
+
}
|
|
71
233
|
```
|
|
72
234
|
|
|
73
|
-
###
|
|
235
|
+
### Saving and restoring form data (`useRbFormData` / `useRbSave`)
|
|
74
236
|
|
|
75
|
-
|
|
237
|
+
If the host embeds your plugin in a form it owns (e.g. a program step editor
|
|
238
|
+
with its own Save button), it can hand your plugin previously-saved values and
|
|
239
|
+
pull the current values back out when the user saves. The host — not the
|
|
240
|
+
plugin — persists the data (IndexedDB, backend, etc.).
|
|
76
241
|
|
|
77
|
-
```
|
|
78
|
-
"
|
|
79
|
-
"/
|
|
242
|
+
```tsx
|
|
243
|
+
import { useState } from "react";
|
|
244
|
+
import { useRbFormData, useRbSave } from "@rainbow-robotics/plugin-ui/react";
|
|
245
|
+
|
|
246
|
+
type GripArgs = { targetName: string; width: number };
|
|
247
|
+
const DEFAULTS: GripArgs = { targetName: "", width: 20 };
|
|
248
|
+
|
|
249
|
+
export default function App() {
|
|
250
|
+
// Previously-saved values, or undefined for a brand-new instance.
|
|
251
|
+
const saved = useRbFormData<GripArgs>();
|
|
252
|
+
const [args, setArgs] = useState<GripArgs>({ ...DEFAULTS, ...saved });
|
|
253
|
+
|
|
254
|
+
// Registers a getter the host calls when its Save button is clicked.
|
|
255
|
+
// Always returns the CURRENT values — re-registering on every render keeps
|
|
256
|
+
// the closure fresh, which useRbSave already handles for you.
|
|
257
|
+
useRbSave(() => ({
|
|
258
|
+
args,
|
|
259
|
+
summary: `${args.targetName || "target"} · ${args.width}mm`,
|
|
260
|
+
}));
|
|
261
|
+
|
|
262
|
+
return (/* ...form UI reading/writing `args`... */);
|
|
263
|
+
}
|
|
80
264
|
```
|
|
81
265
|
|
|
266
|
+
The value returned from `useRbSave` must be JSON-serialisable — the host
|
|
267
|
+
persists it as-is. Not every host embeds plugins in a save/restore form; if
|
|
268
|
+
yours doesn't, you can skip these hooks entirely.
|
|
269
|
+
|
|
82
270
|
### UI components
|
|
83
271
|
|
|
84
|
-
Import Muscat components from `@rainbow-robotics/plugin-ui/react
|
|
85
|
-
|
|
272
|
+
Import Muscat components from `@rainbow-robotics/plugin-ui/react` and export a
|
|
273
|
+
React component as the default export. The host mounts that component directly
|
|
274
|
+
and provides `useRb()` through context.
|
|
86
275
|
|
|
87
276
|
```tsx
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
277
|
+
import { useState } from "react";
|
|
278
|
+
import { RBLabelButton, RBSlider, RBSwitch } from "@rainbow-robotics/plugin-ui/react";
|
|
90
279
|
import { useRb } from "@rainbow-robotics/plugin-ui/sdk";
|
|
91
280
|
|
|
92
|
-
function App() {
|
|
281
|
+
export default function App() {
|
|
93
282
|
const rb = useRb();
|
|
94
|
-
|
|
283
|
+
const [width, setWidth] = useState(20);
|
|
284
|
+
const [enabled, setEnabled] = useState(true);
|
|
285
|
+
|
|
286
|
+
return (
|
|
287
|
+
<div className="flex flex-col gap-4">
|
|
288
|
+
<RBSlider
|
|
289
|
+
value={[width]}
|
|
290
|
+
min={0}
|
|
291
|
+
max={100}
|
|
292
|
+
onValueChange={(values: number[]) => setWidth(values[0] ?? 0)}
|
|
293
|
+
/>
|
|
294
|
+
<RBSwitch checked={enabled} onCheckedChange={setEnabled} />
|
|
295
|
+
<RBLabelButton
|
|
296
|
+
disabled={!enabled}
|
|
297
|
+
onClick={() => rb.action("grip", { width })}
|
|
298
|
+
>
|
|
299
|
+
Grip
|
|
300
|
+
</RBLabelButton>
|
|
301
|
+
</div>
|
|
302
|
+
);
|
|
95
303
|
}
|
|
96
|
-
|
|
97
|
-
connect(App);
|
|
98
304
|
```
|
|
99
305
|
|
|
100
306
|
---
|
|
@@ -119,14 +325,39 @@ robot.
|
|
|
119
325
|
|
|
120
326
|
---
|
|
121
327
|
|
|
122
|
-
## Backend
|
|
328
|
+
## Backend runtimes
|
|
329
|
+
|
|
330
|
+
`manifest.json` chooses one backend runtime. `muscat-pk dev` runs backend code in
|
|
331
|
+
a Docker container matching the robot environment. Backend code should contain
|
|
332
|
+
plugin logic only; it should not start the Muscat bridge or its own copy of the
|
|
333
|
+
plugin gateway.
|
|
334
|
+
|
|
335
|
+
### Which backend pattern? (depends on the contribution point)
|
|
336
|
+
|
|
337
|
+
**How you control the robot depends on what your plugin contributes** (see
|
|
338
|
+
`manifest.json` → `contributes[].point`). Don't mix these up:
|
|
123
339
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
`py/main.py`
|
|
340
|
+
| Contribution point | What it is | Backend pattern |
|
|
341
|
+
| --- | --- | --- |
|
|
342
|
+
| `program.panel` (with `commandInfo`) | Defines a **custom command** the plugin adds to the Program page's rule-based sequence builder. The operator places it into the program tree like any built-in command (Move J, Point, Wait, …); it runs when the program reaches that step. | **`PluginProgramContext`** — integrated with the program's stop/pause and variables. See _Program command backend_ below. |
|
|
343
|
+
| `toolbar` / `lnb` / `move.panel` | A live UI panel/popover the operator interacts with directly | Call the robot **SDK directly** (`RBManipulateSDK`, `RBAmrSDK`) from `py/main.py`, or `rb.action(...)` → your backend → SDK. **Not** a program step — there is no stop/pause/variable context. |
|
|
128
344
|
|
|
129
|
-
|
|
345
|
+
Rule of thumb: use `PluginProgramContext` **only** for a `program.panel` command
|
|
346
|
+
that runs as part of a program. To move the robot live from a toolbar/move panel,
|
|
347
|
+
use the SDK — a program-step context does not apply.
|
|
348
|
+
|
|
349
|
+
### Frontend-only (`none`)
|
|
350
|
+
|
|
351
|
+
Use this when the plugin only has UI and calls host services:
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
{ "runtime": { "type": "none" } }
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Python
|
|
358
|
+
|
|
359
|
+
Python plugins use `py/main.py` and can communicate with the UI through
|
|
360
|
+
`rainbow.rb_sdk.RBPluginCall`.
|
|
130
361
|
|
|
131
362
|
```python
|
|
132
363
|
import time
|
|
@@ -167,25 +398,130 @@ if __name__ == "__main__":
|
|
|
167
398
|
time.sleep(1)
|
|
168
399
|
```
|
|
169
400
|
|
|
170
|
-
|
|
401
|
+
#### Program command backend (`program.panel`)
|
|
402
|
+
|
|
403
|
+
A `program.panel` contribution defines a **custom command** your plugin adds to
|
|
404
|
+
the Muscat **Program page**, where the operator builds a robot program as a
|
|
405
|
+
rule-based sequence (a program tree). Your command appears alongside the
|
|
406
|
+
built-ins (Move J, Point, Wait, …); the operator places it into the tree, and
|
|
407
|
+
each time the program executes that step the host calls your backend through
|
|
408
|
+
`PluginProgramContext` — receiving the step args, checking for stop/pause,
|
|
409
|
+
reading/writing program variables, and signalling completion. This pattern is
|
|
410
|
+
**only** for `program.panel`; a toolbar/move-panel plugin uses the SDK directly
|
|
411
|
+
instead (see the table above).
|
|
412
|
+
|
|
413
|
+
```python
|
|
414
|
+
"""
|
|
415
|
+
Plugin backend main.py example (program.panel command).
|
|
416
|
+
|
|
417
|
+
manifest.json:
|
|
418
|
+
"runtime": {"type": "python", "entry": "main.py"},
|
|
419
|
+
"contributes": [{
|
|
420
|
+
"point": "program.panel",
|
|
421
|
+
"ui": "program",
|
|
422
|
+
"label": {"en": "My Plugin Step"},
|
|
423
|
+
"commandInfo": {
|
|
424
|
+
"name": "My Plugin Step",
|
|
425
|
+
"icon": "assets/icon.svg",
|
|
426
|
+
"funcName": "rb_program_sdk.plugin_execute",
|
|
427
|
+
"args": {"message": "hello"} # plugin-author-defined args
|
|
428
|
+
}
|
|
429
|
+
}]
|
|
430
|
+
|
|
431
|
+
The host invokes commandInfo.funcName (rb_program_sdk.plugin_execute) with
|
|
432
|
+
args.plugin_id + your args when the program reaches this step.
|
|
433
|
+
"""
|
|
434
|
+
import asyncio
|
|
435
|
+
from rainbow.rb_sdk import PluginProgramContext
|
|
436
|
+
|
|
437
|
+
ctx = PluginProgramContext(plugin_id="my-plugin")
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
@ctx.on_execute
|
|
441
|
+
async def handle(args: dict) -> None:
|
|
442
|
+
message = args.get("message", "")
|
|
443
|
+
print(f"[my-plugin] execute called: message={message}", flush=True)
|
|
444
|
+
|
|
445
|
+
# check stop/pause during long-running work
|
|
446
|
+
for _ in range(10):
|
|
447
|
+
await ctx.check_stop()
|
|
448
|
+
await asyncio.sleep(0.1)
|
|
449
|
+
|
|
450
|
+
# read a program variable
|
|
451
|
+
counter = await ctx.get_variable("counter")
|
|
452
|
+
print(f"[my-plugin] counter={counter}", flush=True)
|
|
453
|
+
|
|
454
|
+
# update a variable
|
|
455
|
+
await ctx.set_variable("result", f"done: {message}")
|
|
456
|
+
|
|
457
|
+
# finish the step
|
|
458
|
+
await ctx.done()
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
if __name__ == "__main__":
|
|
462
|
+
asyncio.run(ctx.start())
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### C++
|
|
466
|
+
|
|
467
|
+
C++ plugins use `cpp/` and are built with CMake inside Docker. The current C++
|
|
468
|
+
template is a build/run skeleton; wire it to the plugin gateway when the C++ SDK
|
|
469
|
+
is available.
|
|
470
|
+
|
|
471
|
+
```cpp
|
|
472
|
+
#include <chrono>
|
|
473
|
+
#include <cstdlib>
|
|
474
|
+
#include <iostream>
|
|
475
|
+
#include <string>
|
|
476
|
+
#include <thread>
|
|
477
|
+
|
|
478
|
+
int main() {
|
|
479
|
+
const char* plugin_id = std::getenv("RB_PLUGIN_ID");
|
|
480
|
+
std::cout << "[__PLUGIN_NAME__] backend ready"
|
|
481
|
+
<< (plugin_id ? std::string(" (id=") + plugin_id + ")" : "")
|
|
482
|
+
<< std::endl;
|
|
483
|
+
|
|
484
|
+
while (true) {
|
|
485
|
+
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
486
|
+
}
|
|
487
|
+
return 0;
|
|
488
|
+
}
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### ROS2 (rclpy)
|
|
171
492
|
|
|
172
|
-
|
|
493
|
+
ROS2 Python plugins use `ros2_ws/` with `runtime.rosClient: "rclpy"`. The node
|
|
494
|
+
is launched with `--ros-args -r __ns:=/{slug}` automatically by `dev:back`.
|
|
173
495
|
|
|
174
496
|
```python
|
|
175
497
|
# ros2_ws/src/__PLUGIN_SLUG__/__PLUGIN_SLUG__/node.py
|
|
176
498
|
import rclpy
|
|
177
499
|
from rclpy.node import Node
|
|
178
|
-
from
|
|
500
|
+
from rainbow.rb_sdk import RBManipulateSDK
|
|
501
|
+
|
|
502
|
+
sdk = RBManipulateSDK()
|
|
503
|
+
|
|
179
504
|
|
|
180
505
|
class __PLUGIN_CLASS__Node(Node):
|
|
181
506
|
def __init__(self):
|
|
182
507
|
super().__init__("__PLUGIN_SLUG___node")
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
508
|
+
self.get_logger().info("__PLUGIN_NAME__ node started")
|
|
509
|
+
# use sdk alongside ROS2 publishers/subscribers/services as needed
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### ROS2 (rclcpp)
|
|
186
513
|
|
|
187
|
-
|
|
188
|
-
|
|
514
|
+
ROS2 C++ plugins use `ros2_ws/` with `runtime.rosClient: "rclcpp"`.
|
|
515
|
+
|
|
516
|
+
```cpp
|
|
517
|
+
#include "rclcpp/rclcpp.hpp"
|
|
518
|
+
|
|
519
|
+
class __PLUGIN_CLASS__Node : public rclcpp::Node {
|
|
520
|
+
public:
|
|
521
|
+
__PLUGIN_CLASS__Node() : Node("__PLUGIN_SLUG___node") {
|
|
522
|
+
RCLCPP_INFO(this->get_logger(), "__PLUGIN_NAME__ node started");
|
|
523
|
+
}
|
|
524
|
+
};
|
|
189
525
|
```
|
|
190
526
|
|
|
191
527
|
---
|
|
@@ -221,16 +557,17 @@ class __PLUGIN_CLASS__Node(Node):
|
|
|
221
557
|
// "targetCategorys": ["manipulate", "amr", "rby1", "vision"],
|
|
222
558
|
|
|
223
559
|
"contributes": [
|
|
224
|
-
// program.
|
|
560
|
+
// program.panel — defines a custom command for the Program page sequence
|
|
561
|
+
// builder; runs via PluginProgramContext when the program reaches it
|
|
225
562
|
{
|
|
226
|
-
"point": "program.
|
|
563
|
+
"point": "program.panel",
|
|
227
564
|
"icon": "assets/icon.svg",
|
|
228
565
|
"label": { "ko": "내 플러그인", "en": "My Plugin" },
|
|
229
|
-
"ui": "program
|
|
566
|
+
"ui": "program", // must be unique across all contributions
|
|
230
567
|
"commandInfo": {
|
|
231
568
|
"name": "My Plugin",
|
|
232
569
|
"icon": "assets/icon.svg",
|
|
233
|
-
"funcName": "
|
|
570
|
+
"funcName": "rb_program_sdk.plugin_execute",
|
|
234
571
|
"args": {}
|
|
235
572
|
}
|
|
236
573
|
},
|
|
@@ -240,14 +577,14 @@ class __PLUGIN_CLASS__Node(Node):
|
|
|
240
577
|
"icon": "assets/icon.svg",
|
|
241
578
|
"label": { "ko": "내 플러그인", "en": "My Plugin" },
|
|
242
579
|
"ui": "content", // must be unique across all contributions
|
|
243
|
-
"opens": "popover"
|
|
580
|
+
"opens": "popover" // popover | panel | page
|
|
244
581
|
},
|
|
245
|
-
// move.
|
|
582
|
+
// move.panel — adds a panel to the Move screen
|
|
246
583
|
{
|
|
247
|
-
"point": "move.
|
|
584
|
+
"point": "move.panel",
|
|
248
585
|
"icon": "assets/icon.svg",
|
|
249
586
|
"label": { "ko": "내 플러그인", "en": "My Plugin" },
|
|
250
|
-
"ui": "move
|
|
587
|
+
"ui": "move" // must be unique across all contributions
|
|
251
588
|
}
|
|
252
589
|
],
|
|
253
590
|
|
|
@@ -256,7 +593,12 @@ class __PLUGIN_CLASS__Node(Node):
|
|
|
256
593
|
// { "type": "python", "entry": "main.py" }
|
|
257
594
|
// { "type": "cpp", "entry": "<executable name>" }
|
|
258
595
|
// { "type": "ros2", "rosClient": "rclpy" | "rclcpp", "package": "...", "launch": "..._node" }
|
|
259
|
-
"runtime": { "type": "python", "entry": "main.py" }
|
|
596
|
+
"runtime": { "type": "python", "entry": "main.py" },
|
|
597
|
+
|
|
598
|
+
// optional: TCP ports opened by this plugin backend
|
|
599
|
+
// only number[] is allowed; ranges/objects are not accepted
|
|
600
|
+
// external plugin ports must be within 28600-28999
|
|
601
|
+
"ports": [28600]
|
|
260
602
|
}
|
|
261
603
|
```
|
|
262
604
|
|
|
@@ -273,17 +615,18 @@ class __PLUGIN_CLASS__Node(Node):
|
|
|
273
615
|
|
|
274
616
|
**Contribution points:**
|
|
275
617
|
|
|
276
|
-
| point | Where it appears | `commandInfo`
|
|
277
|
-
|
|
278
|
-
| `toolbar` | Top toolbar button (must have at least one) | — |
|
|
279
|
-
| `
|
|
280
|
-
| `move.
|
|
618
|
+
| point | Where it appears | Backend | `commandInfo` |
|
|
619
|
+
|---|---|---|:---:|
|
|
620
|
+
| `toolbar` | Top toolbar button (must have at least one) | SDK / `rb.action` | — |
|
|
621
|
+
| `lnb` | Left navigation entry | SDK / `rb.action` | — |
|
|
622
|
+
| `move.panel` | Move screen panel | SDK / `rb.action` | — |
|
|
623
|
+
| `program.panel` | Custom command in the Program page sequence builder | `PluginProgramContext` | ✓ |
|
|
281
624
|
|
|
282
|
-
**`commandInfo` fields** (for `program.
|
|
625
|
+
**`commandInfo` fields** (for `program.panel`):
|
|
283
626
|
|
|
284
627
|
| field | type | description |
|
|
285
628
|
|---|---|---|
|
|
286
|
-
| `name` | `string` | Display name of the
|
|
629
|
+
| `name` | `string` | Display name of the command in the program tree |
|
|
287
630
|
| `icon` | `string` | Icon path |
|
|
288
631
|
| `iconClassName` | `string?` | Optional CSS class for the icon |
|
|
289
632
|
| `funcName` | `string?` | Backend function name to call |
|
|
@@ -308,10 +651,19 @@ class __PLUGIN_CLASS__Node(Node):
|
|
|
308
651
|
- `targetCategorys` — `"all"` or a non-empty array of `"manipulate" | "amr" | "rby1" | "vision"` (at least one of `targetModels` / `targetCategorys` required)
|
|
309
652
|
- `contributes` — required array; must contain at least one `toolbar` entry
|
|
310
653
|
- `ui` — each contribution must have a unique value
|
|
311
|
-
- `commandInfo` — required when `point` is `"program.
|
|
654
|
+
- `commandInfo` — required when `point` is `"program.panel"`
|
|
655
|
+
- `ports` — optional `number[]`; every port must be within `28600-28999`
|
|
656
|
+
and must not be a reserved robot/industrial/internal port
|
|
312
657
|
|
|
313
658
|
`muscat-pk build` throws on any validation error. `muscat-pk dev` prints warnings.
|
|
314
659
|
|
|
660
|
+
**Backend port rules:**
|
|
661
|
+
- Declare a port only if your backend opens a TCP server/listener.
|
|
662
|
+
- `muscat-pk dev` and `muscat-pk dev:back` stop the backend if it opens an
|
|
663
|
+
undeclared managed port.
|
|
664
|
+
- Reserved ports include `502`, `2222`, `4840`, `5170-5179`, `8000-8999`,
|
|
665
|
+
`10000`, `30004`, `34964`, `44818`, `50000-50005`, and `50051`.
|
|
666
|
+
|
|
315
667
|
---
|
|
316
668
|
|
|
317
669
|
## Localized documentation
|
|
@@ -342,7 +694,19 @@ numpy==1.26.4
|
|
|
342
694
|
opencv-python
|
|
343
695
|
```
|
|
344
696
|
|
|
345
|
-
Run `muscat-pk dev` or `muscat-pk dev:back` — dependencies are installed automatically
|
|
697
|
+
Run `muscat-pk dev` or `muscat-pk dev:back` — dependencies are installed automatically
|
|
698
|
+
inside the dev container (`pip install -r requirements.txt`) on every startup. No
|
|
699
|
+
local Python is required for this.
|
|
700
|
+
|
|
701
|
+
`muscat-pk dev:back` also best-effort creates/refreshes a local `.venv` in the
|
|
702
|
+
background (via `uv` if available, else your system Python) with the same deps —
|
|
703
|
+
purely so your editor (pylint, pyright, mypy, ...) can resolve imports and lint
|
|
704
|
+
correctly. It's not used to run the backend; Docker is the actual execution
|
|
705
|
+
environment, so this step is silently skipped if no local Python toolchain is
|
|
706
|
+
available. Point your editor's Python interpreter at `.venv`.
|
|
707
|
+
|
|
708
|
+
`muscat-pk sdk update` also refreshes `.venv` in place if one already exists, so
|
|
709
|
+
your editor picks up the new `rainbow-rb-sdk` version immediately.
|
|
346
710
|
|
|
347
711
|
> `muscat-pk build` only **pins** versions in `requirements.txt` — it does not run `pip install` (the robot installs them at load time).
|
|
348
712
|
|
|
@@ -362,6 +726,54 @@ muscat-pk type change --to python # → Python
|
|
|
362
726
|
|
|
363
727
|
---
|
|
364
728
|
|
|
729
|
+
## AI coding assistants (MCP)
|
|
730
|
+
|
|
731
|
+
If you build your plugin with an AI assistant (Claude Code, Codex, …), give it
|
|
732
|
+
grounded knowledge of the Muscat UI components, design tokens, and SDK instead of
|
|
733
|
+
letting it guess. `muscat-pk mcp` is an MCP server exposing:
|
|
734
|
+
|
|
735
|
+
- `list_components` / `get_component_props` / `get_component_example` — every
|
|
736
|
+
`@rainbow-robotics/plugin-ui/react` component with its real props and a working
|
|
737
|
+
Storybook example.
|
|
738
|
+
- `list_design_tokens` / `search_design_tokens` — the Tailwind classes to use
|
|
739
|
+
(`bg-bg-*`, `text-fg-*`, `typo-*`, …) so your UI matches the host theme.
|
|
740
|
+
- `search_rb_sdk` — how to use `useRb()`, `rb.*`, `useRbFormData`/`useRbSave`, and
|
|
741
|
+
the backend runtimes.
|
|
742
|
+
- `list_rb_sdk` / `get_rb_sdk_api` — the installed `rainbow-rb-sdk` (Python
|
|
743
|
+
backend) classes and signatures.
|
|
744
|
+
|
|
745
|
+
**Browse the components live** with `muscat-pk storybook`.
|
|
746
|
+
|
|
747
|
+
### Register the server
|
|
748
|
+
|
|
749
|
+
**Claude Code** — a `.mcp.json` is already scaffolded at your plugin root, so
|
|
750
|
+
it works out of the box:
|
|
751
|
+
|
|
752
|
+
```json
|
|
753
|
+
{
|
|
754
|
+
"mcpServers": {
|
|
755
|
+
"muscat": {
|
|
756
|
+
"command": "muscat-pk",
|
|
757
|
+
"args": ["mcp"]
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
**Codex** — add to `~/.codex/config.toml`:
|
|
764
|
+
|
|
765
|
+
```toml
|
|
766
|
+
[mcp_servers.muscat]
|
|
767
|
+
command = "muscat-pk"
|
|
768
|
+
args = ["mcp"]
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
Any other MCP client works too — it's a standard stdio MCP server started with
|
|
772
|
+
`muscat-pk mcp`. If `muscat-pk` isn't on the client's PATH, use its absolute path
|
|
773
|
+
(`which muscat-pk`) as `command`.
|
|
774
|
+
|
|
775
|
+
---
|
|
776
|
+
|
|
365
777
|
## Shipping
|
|
366
778
|
|
|
367
779
|
```bash
|
|
@@ -399,6 +811,8 @@ muscat-pk dev # UI + backend
|
|
|
399
811
|
muscat-pk dev:ui # UI preview only (preview-host)
|
|
400
812
|
muscat-pk dev:back # backend only (Python: watchfiles / ROS2: Docker)
|
|
401
813
|
muscat-pk build # build → dist/ + distributable ZIP (--no-zip to skip)
|
|
814
|
+
muscat-pk storybook # browse the rb-components UI library in a browser
|
|
815
|
+
muscat-pk mcp # MCP server for AI assistants (components/tokens/SDK docs)
|
|
402
816
|
```
|
|
403
817
|
|
|
404
818
|
```bash
|