@rainbow-robotics/muscat-plugin-kit 1.10.1-dev.1 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +282 -282
- package/cli/README.md +274 -274
- package/cli/bin/create-muscat-plugin.mjs +8 -8
- package/cli/bin/muscat-pk.mjs +155 -155
- package/cli/bundle-templates.mjs +31 -31
- package/cli/docker/Dockerfile.cpp +28 -28
- package/cli/docker/Dockerfile.dev +30 -30
- package/cli/docker/Dockerfile.python +21 -21
- package/cli/m5-e2e.mjs +69 -69
- package/cli/prepack.mjs +10 -10
- package/cli/src/ai-rules.mjs +70 -70
- package/cli/src/build.mjs +447 -447
- package/cli/src/check-package.mjs +13 -13
- package/cli/src/completion.mjs +166 -166
- package/cli/src/cpp.mjs +78 -78
- package/cli/src/cppIde.mjs +75 -75
- package/cli/src/dev.mjs +165 -165
- package/cli/src/devBack.mjs +734 -727
- package/cli/src/devUi.mjs +247 -243
- package/cli/src/esbuild.mjs +56 -56
- package/cli/src/host_agent.py +223 -223
- package/cli/src/manifest.mjs +287 -287
- package/cli/src/mcp.mjs +1071 -1071
- package/cli/src/muscatLocal.mjs +209 -209
- package/cli/src/new.mjs +343 -343
- package/cli/src/pluginDevServer.mjs +111 -111
- package/cli/src/ports.mjs +193 -193
- package/cli/src/python.mjs +112 -112
- package/cli/src/ros2.mjs +109 -109
- package/cli/src/sdk.mjs +117 -117
- package/cli/src/storybook.mjs +168 -168
- package/cli/src/type.mjs +141 -141
- package/cli/src/uninstall.mjs +81 -81
- package/cli/src/update.mjs +295 -295
- package/cli/src/util.mjs +441 -441
- package/cli/src/zenohDev.mjs +83 -81
- package/cli/storybook-dist/_design-tokens.css +4957 -4957
- package/cli/storybook-dist/_stories-src/NxAvatar.stories.tsx +27 -27
- package/cli/storybook-dist/_stories-src/NxPagination.stories.tsx +28 -28
- package/cli/storybook-dist/_stories-src/RBAccordion/RBAccordion.stories.tsx +46 -46
- package/cli/storybook-dist/_stories-src/RBAccordion/RBAccordionGroup.stories.tsx +73 -73
- package/cli/storybook-dist/_stories-src/RBBadge/RBBadge.stories.tsx +93 -93
- package/cli/storybook-dist/_stories-src/RBBattery/RBBattery.stories.tsx +74 -74
- package/cli/storybook-dist/_stories-src/RBButton/RBCheckIconButton.stories.tsx +28 -28
- package/cli/storybook-dist/_stories-src/RBButton/RBCheckLabelButton.stories.tsx +84 -84
- package/cli/storybook-dist/_stories-src/RBButton/RBIconButton.stories.tsx +57 -57
- package/cli/storybook-dist/_stories-src/RBButton/RBInlineLabelButton.stories.tsx +41 -41
- package/cli/storybook-dist/_stories-src/RBButton/RBLabelButton.stories.tsx +60 -60
- package/cli/storybook-dist/_stories-src/RBDatePicker/RBDateInput.stories.tsx +44 -44
- package/cli/storybook-dist/_stories-src/RBDatePicker/RBRangeDateInput.stories.tsx +56 -56
- package/cli/storybook-dist/_stories-src/RBDialog/RBAlert.stories.tsx +51 -51
- package/cli/storybook-dist/_stories-src/RBDialog/RBConfirm.stories.tsx +55 -55
- package/cli/storybook-dist/_stories-src/RBDialog/RBPrompt.stories.tsx +52 -52
- package/cli/storybook-dist/_stories-src/RBDivider/RBDivider.stories.tsx +93 -93
- package/cli/storybook-dist/_stories-src/RBEmptyView/RBEmptyView.stories.tsx +49 -49
- package/cli/storybook-dist/_stories-src/RBIcons/RBColorIcons.stories.tsx +108 -108
- package/cli/storybook-dist/_stories-src/RBIcons/RBIcons.stories.tsx +106 -106
- package/cli/storybook-dist/_stories-src/RBInput/RBCheckBox.stories.tsx +89 -89
- package/cli/storybook-dist/_stories-src/RBInput/RBMultiRangeInput.stories.tsx +64 -64
- package/cli/storybook-dist/_stories-src/RBInput/RBRadioBox.stories.tsx +65 -65
- package/cli/storybook-dist/_stories-src/RBInput/RBRadioButton.stories.tsx +68 -68
- package/cli/storybook-dist/_stories-src/RBInput/RBSelectBox.stories.tsx +216 -216
- package/cli/storybook-dist/_stories-src/RBInput/RBSideNumberInput.stories.tsx +90 -90
- package/cli/storybook-dist/_stories-src/RBInput/RBText/RBTextArea.stories.tsx +45 -45
- package/cli/storybook-dist/_stories-src/RBInput/RBText/RBTextInput.stories.tsx +50 -50
- package/cli/storybook-dist/_stories-src/RBInput/RBTextField.stories.tsx +102 -102
- package/cli/storybook-dist/_stories-src/RBJoyStick/RBJoyStick.stories.tsx +31 -31
- package/cli/storybook-dist/_stories-src/RBLight/RBLight.stories.tsx +36 -36
- package/cli/storybook-dist/_stories-src/RBPagination/RBPagination.stories.tsx +49 -49
- package/cli/storybook-dist/_stories-src/RBShadcn/RBCard/RBCard.stories.tsx +89 -89
- package/cli/storybook-dist/_stories-src/RBShadcn/RBCommand/RBCommand.stories.tsx +116 -116
- package/cli/storybook-dist/_stories-src/RBShadcn/RBDialog/RBDialog.stories.tsx +74 -74
- package/cli/storybook-dist/_stories-src/RBShadcn/RBDrawer/RBDrawer.stories.tsx +99 -99
- package/cli/storybook-dist/_stories-src/RBShadcn/RBDropdownMenu/RBDropdownMenu.stories.tsx +123 -123
- package/cli/storybook-dist/_stories-src/RBShadcn/RBMenubar/RBMenubar.stories.tsx +135 -135
- package/cli/storybook-dist/_stories-src/RBShadcn/RBPopover/RBPopover.stories.tsx +69 -69
- package/cli/storybook-dist/_stories-src/RBShadcn/RBResizable/RBResizable.stories.tsx +49 -49
- package/cli/storybook-dist/_stories-src/RBShadcn/RBSheet/RBSheet.stories.tsx +91 -91
- package/cli/storybook-dist/_stories-src/RBShadcn/RBSlider/RBSlider.stories.tsx +38 -38
- package/cli/storybook-dist/_stories-src/RBShadcn/RBSwitch/RBSwitch.stories.tsx +112 -112
- package/cli/storybook-dist/_stories-src/RBShadcn/RBTabs/RBTabs.stories.tsx +75 -75
- package/cli/storybook-dist/_stories-src/RBShadcn/RBToggle/RBToggle.stories.tsx +51 -51
- package/cli/storybook-dist/_stories-src/RBShadcn/RBToggleGroup/RBToggleGroup.stories.tsx +84 -84
- package/cli/storybook-dist/_stories-src/RBTab/RBChipTab.stories.tsx +102 -102
- package/cli/storybook-dist/_stories-src/RBTab/RBChipsBoxTab.stories.tsx +78 -78
- package/cli/storybook-dist/_stories-src/RBTab/RBTab.stories.tsx +57 -57
- package/cli/storybook-dist/_stories-src/RBTable/RBTable.stories.tsx +177 -177
- package/cli/storybook-dist/_stories-src/RBTable/RBTableRow.stories.tsx +64 -64
- package/cli/storybook-dist/_stories-src/RBToast/RBToast.stories.tsx +117 -117
- package/cli/storybook-dist/_stories-src/RBTooltip/RBTooltip.stories.tsx +50 -50
- package/cli/storybook-dist/_stories-src/loading/RBSpinner.stories.tsx +30 -30
- package/cli/storybook-dist/_stories-src/nx-button/NxButton.stories.tsx +54 -54
- package/cli/storybook-dist/_stories-src/nx-button/NxPointerHoldButton.stories.tsx +57 -57
- package/cli/storybook-dist/_stories-src/nx-icons/NxIcons.stories.tsx +48 -48
- package/cli/storybook-dist/_stories-src/nx-inputs/NxNumberInput.stories.tsx +103 -103
- package/cli/storybook-dist/_stories-src/nx-inputs/NxRangeInput.stories.tsx +27 -27
- package/cli/storybook-dist/_stories-src/nx-inputs/NxSelectBox.stories.tsx +67 -67
- package/cli/storybook-dist/_stories-src/nx-inputs/NxSlideRange.stories.tsx +45 -45
- package/cli/storybook-dist/_stories-src/nx-inputs/NxSwitch.stories.tsx +27 -27
- package/cli/storybook-dist/_stories-src/nx-inputs/NxTextArea.stories.tsx +48 -48
- package/cli/storybook-dist/_stories-src/nx-inputs/NxTextInput.stories.tsx +46 -46
- package/cli/storybook-dist/assets/{Color-YHDXOIA2-D6JqZzDJ.js → Color-YHDXOIA2-B4IER17l.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-ESb7JAHg.js → Docs-C8GCHFtK.js} +3 -3
- package/cli/storybook-dist/assets/{Docs-6gD2kUo1.js → Docs-CgdEMPQP.js} +2 -2
- package/cli/storybook-dist/assets/{Docs-B9wd8Ok7.js → Docs-Ck3WHvk6.js} +3 -3
- package/cli/storybook-dist/assets/{Docs-CgFbWWXM.js → Docs-D9NHsoeZ.js} +2 -2
- package/cli/storybook-dist/assets/{Docs-DBQup8Bu.js → Docs-DNYQC7nl.js} +3 -3
- package/cli/storybook-dist/assets/{Docs-CMjovnSY.js → Docs-DUfeiM4I.js} +4 -4
- package/cli/storybook-dist/assets/{DocsRenderer-CFRXHY34-BOUI1AHi.js → DocsRenderer-CFRXHY34-C0WhyDoR.js} +1 -1
- package/cli/storybook-dist/assets/{NxAvatar.stories-DsYFMUh3.js → NxAvatar.stories-CwnK8AUF.js} +1 -1
- package/cli/storybook-dist/assets/{NxButton.stories-CHfNcqsc.js → NxButton.stories-ueYdosfQ.js} +8 -8
- package/cli/storybook-dist/assets/{NxNumberInput.stories-BFw_4vFE.js → NxNumberInput.stories-M5ZCLbrK.js} +1 -1
- package/cli/storybook-dist/assets/{NxPagination.stories-DVfxyw4M.js → NxPagination.stories-bxxUnHEL.js} +1 -1
- package/cli/storybook-dist/assets/{NxPointerHoldButton.stories-BzyxUWoZ.js → NxPointerHoldButton.stories-BHxB2kr5.js} +1 -1
- package/cli/storybook-dist/assets/{NxRangeInput.stories-DmRdzBc1.js → NxRangeInput.stories-BKfr-fp4.js} +6 -6
- package/cli/storybook-dist/assets/{NxSelectBox.stories-B1KkNUOf.js → NxSelectBox.stories-CG8FuTBq.js} +1 -1
- package/cli/storybook-dist/assets/{NxSlideRange.stories-CyOdvfQ6.js → NxSlideRange.stories-BRTFtMTL.js} +1 -1
- package/cli/storybook-dist/assets/{NxSwitch.stories-DrDBw0qp.js → NxSwitch.stories-Bwuyzn-R.js} +1 -1
- package/cli/storybook-dist/assets/{NxTextArea.stories-DTB2aqNS.js → NxTextArea.stories-COq2sGqu.js} +1 -1
- package/cli/storybook-dist/assets/{NxTextInput.stories-DU0rucmM.js → NxTextInput.stories-CjsBLz05.js} +1 -1
- package/cli/storybook-dist/assets/{RBAccordion.stories-DTfOtXtp.js → RBAccordion.stories-BARwuZ0Q.js} +3 -3
- package/cli/storybook-dist/assets/{RBAccordionGroup.stories-9y9BjrUe.js → RBAccordionGroup.stories-COrPxETW.js} +10 -10
- package/cli/storybook-dist/assets/{RBAlert.stories-DLTAv9fT.js → RBAlert.stories-BQrkjZPt.js} +3 -3
- package/cli/storybook-dist/assets/{RBBadge.stories-BNMACewA.js → RBBadge.stories-BTsLL-lK.js} +1 -1
- package/cli/storybook-dist/assets/{RBBattery.stories-B3kXMAt5.js → RBBattery.stories-DAeQdJbc.js} +1 -1
- package/cli/storybook-dist/assets/{RBCard.stories-Y-s8R2n7.js → RBCard.stories-HyhOE80R.js} +39 -39
- package/cli/storybook-dist/assets/{RBCheckBox.stories-DBuT9tL4.js → RBCheckBox.stories-KFk0WqX_.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckIconButton.stories-CWu1TL56.js → RBCheckIconButton.stories-CXbbktF5.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckLabelButton.stories-sCu2MGCX.js → RBCheckLabelButton.stories-DWfYz_9Z.js} +17 -17
- package/cli/storybook-dist/assets/{RBChipTab.stories-BX9qLJkR.js → RBChipTab.stories-JPEgVFAS.js} +5 -5
- package/cli/storybook-dist/assets/{RBChipsBoxTab.stories-35u1aJ-P.js → RBChipsBoxTab.stories-CTPuWXrQ.js} +1 -1
- package/cli/storybook-dist/assets/{RBColorIcons.stories-DAOZ5Ies.js → RBColorIcons.stories-DiFRZ5jk.js} +1 -1
- package/cli/storybook-dist/assets/RBCommand.stories-Pf1HAVIR.js +73 -0
- package/cli/storybook-dist/assets/{RBConfirm.stories-iMXcUh7Z.js → RBConfirm.stories-D1cEPUXk.js} +3 -3
- package/cli/storybook-dist/assets/{RBDateInput.stories-hK5rXECf.js → RBDateInput.stories-RPYpCjig.js} +1 -1
- package/cli/storybook-dist/assets/RBDialog.stories-DJH-0XSR.js +38 -0
- package/cli/storybook-dist/assets/{RBDivider.stories-BAK-iZ1Z.js → RBDivider.stories-uEj1vOgK.js} +1 -1
- package/cli/storybook-dist/assets/{RBDrawer.stories-B2nqf2Nh.js → RBDrawer.stories-BiMzElb2.js} +12 -12
- package/cli/storybook-dist/assets/RBDropdownMenu.stories-Da_TBkla.js +86 -0
- package/cli/storybook-dist/assets/{RBEmptyView.stories-nCenrgBh.js → RBEmptyView.stories-BHeKGfPS.js} +1 -1
- package/cli/storybook-dist/assets/{RBIconButton.stories-DRH7O3sp.js → RBIconButton.stories-NEsRFoYp.js} +1 -1
- package/cli/storybook-dist/assets/{RBIcons.stories-D3PyJXG8.js → RBIcons.stories-CcZ-TTLS.js} +1 -1
- package/cli/storybook-dist/assets/{RBInlineLabelButton.stories-modQbt10.js → RBInlineLabelButton.stories-B0wpdQyR.js} +1 -1
- package/cli/storybook-dist/assets/{RBJoyStick.stories-BY14qVgR.js → RBJoyStick.stories-DEgBou3K.js} +1 -1
- package/cli/storybook-dist/assets/{RBLabelButton.stories-DzF7vGwm.js → RBLabelButton.stories-DT8drIsF.js} +1 -1
- package/cli/storybook-dist/assets/{RBLight.stories-lF4FRmVh.js → RBLight.stories-Dh-aoeyG.js} +1 -1
- package/cli/storybook-dist/assets/{RBMenubar.stories-XhrI7bsV.js → RBMenubar.stories-D-H7UqVh.js} +1 -1
- package/cli/storybook-dist/assets/{RBMultiRangeInput.stories-DprllQDl.js → RBMultiRangeInput.stories-hlclv6jI.js} +1 -1
- package/cli/storybook-dist/assets/{RBPagination.stories-2v2gBJfC.js → RBPagination.stories-DWCeoZ_S.js} +1 -1
- package/cli/storybook-dist/assets/{RBPopover.stories-C8iLIZpv.js → RBPopover.stories-C514M09_.js} +1 -1
- package/cli/storybook-dist/assets/{RBPrompt.stories-Th_HrWHI.js → RBPrompt.stories-BSItvfiT.js} +1 -1
- package/cli/storybook-dist/assets/{RBRadioBox.stories-CoHuLaN3.js → RBRadioBox.stories-BBb4YbFU.js} +1 -1
- package/cli/storybook-dist/assets/{RBRadioButton.stories-DULxE_ff.js → RBRadioButton.stories-CXyOGJCv.js} +1 -1
- package/cli/storybook-dist/assets/{RBRangeDateInput.stories-D8A9KBSS.js → RBRangeDateInput.stories-qvhubu0e.js} +1 -1
- package/cli/storybook-dist/assets/{RBResizable.stories-C41QfrQ3.js → RBResizable.stories-CZKeyGjH.js} +14 -14
- package/cli/storybook-dist/assets/{RBSelectBox.stories-C1gNmwzw.js → RBSelectBox.stories-CRKP3ybf.js} +1 -1
- package/cli/storybook-dist/assets/RBSheet.stories-sCM3ZJUa.js +39 -0
- package/cli/storybook-dist/assets/{RBSideNumberInput.stories-9LlgQ8nh.js → RBSideNumberInput.stories-Bb7gw8RF.js} +3 -3
- package/cli/storybook-dist/assets/{RBSlider.stories-oUgo5K9d.js → RBSlider.stories-23OAQU5z.js} +3 -3
- package/cli/storybook-dist/assets/{RBSpinner.stories-DDpohbY2.js → RBSpinner.stories-2xcQdcmt.js} +1 -1
- package/cli/storybook-dist/assets/{RBSwitch.stories-gW-GN7QO.js → RBSwitch.stories-BACUaJm_.js} +7 -7
- package/cli/storybook-dist/assets/{RBTab.stories-CN-PV3HH.js → RBTab.stories-CDHE3sVs.js} +1 -1
- package/cli/storybook-dist/assets/{RBTable.stories-BAZLpxtM.js → RBTable.stories-C0Cfhfl7.js} +29 -29
- package/cli/storybook-dist/assets/{RBTableRow.stories-CwjVrszB.js → RBTableRow.stories-BF8kIkpp.js} +1 -1
- package/cli/storybook-dist/assets/{RBTabs.stories-JuEo2sUL.js → RBTabs.stories-BdJWRq1o.js} +7 -7
- package/cli/storybook-dist/assets/{RBTextArea.stories-D0_Pv4qZ.js → RBTextArea.stories-CGy2xeYH.js} +3 -3
- package/cli/storybook-dist/assets/{RBTextField.stories-CCsOvZqV.js → RBTextField.stories-IfUOzxCM.js} +15 -15
- package/cli/storybook-dist/assets/{RBTextInput.stories-Cccn3VNm.js → RBTextInput.stories-VjXNFo4R.js} +3 -3
- package/cli/storybook-dist/assets/{RBToast.stories-I5617t0K.js → RBToast.stories-BzcobblV.js} +1 -1
- package/cli/storybook-dist/assets/{RBToggle.stories-DsgKjGsJ.js → RBToggle.stories-DuLE5mKv.js} +4 -4
- package/cli/storybook-dist/assets/{RBToggleGroup.stories-BZEzSDuz.js → RBToggleGroup.stories-CuR0N0GJ.js} +5 -5
- package/cli/storybook-dist/assets/{RBTooltip.stories-4oSyAWsA.js → RBTooltip.stories--aAgNC8_.js} +1 -1
- package/cli/storybook-dist/assets/{SideNumberInput-DSKbd0bG.js → SideNumberInput-DyWQxYUj.js} +743 -743
- package/cli/storybook-dist/assets/{entry-preview-B35XREGs.js → entry-preview-D7IHsza_.js} +1 -1
- package/cli/storybook-dist/assets/{iframe-BB797lmL.js → iframe-CbaIp5I-.js} +2 -2
- package/cli/storybook-dist/assets/{index-BU2567EP.js → index-C6CBgMuG.js} +3 -3
- package/cli/storybook-dist/assets/{preview-C7DaSWyc.js → preview-B-iYLDuW.js} +2 -2
- package/cli/storybook-dist/assets/{preview-CbuRHit4.js → preview-CRWqc9DH.js} +1 -1
- package/cli/storybook-dist/assets/{react-resizable-panels.browser-ChIvlwo7.js → react-resizable-panels.browser-8hC8dr-6.js} +8 -8
- package/cli/storybook-dist/iframe.html +2 -2
- package/cli/storybook-dist/index.html +1 -1
- package/cli/storybook-dist/project.json +1 -1
- package/cli/templates/common/.mcp.json +8 -8
- package/cli/templates/common/README.md +1231 -1231
- package/cli/templates/common/assets/icon.svg +45 -45
- package/cli/templates/common/manifest.json +26 -26
- package/cli/templates/common/package.json +22 -22
- package/cli/templates/common/py/main.py +125 -125
- package/cli/templates/common/tsconfig.json +13 -13
- package/cli/templates/common/ui/content.tsx +216 -216
- package/cli/templates/common/ui/style.css +6 -6
- package/cli/templates/common/vite.config.ts +10 -10
- package/cli/templates/cpp/cpp/main.cpp +73 -73
- package/cli/templates/ros2/ros2_ws/src/__PLUGIN_SLUG__/__PLUGIN_SLUG__/node.py +25 -25
- package/cli/templates/ros2/ros2_ws/src/__PLUGIN_SLUG__/package.xml +10 -10
- package/cli/templates/ros2/ros2_ws/src/__PLUGIN_SLUG__/setup.py +18 -18
- package/cli/templates/ros2-cpp/ros2_ws/src/__PLUGIN_SLUG__/package.xml +11 -11
- package/cli/templates/ros2-cpp/ros2_ws/src/__PLUGIN_SLUG__/src/node.cpp +23 -23
- package/cli/vite.d.mts +25 -25
- package/cli/vite.mjs +292 -292
- package/package.json +3 -3
- package/cli/storybook-dist/assets/RBCommand.stories-BSqXDkKw.js +0 -73
- package/cli/storybook-dist/assets/RBDialog.stories-BAktz-ku.js +0 -38
- package/cli/storybook-dist/assets/RBDropdownMenu.stories-DbW2fWAj.js +0 -86
- package/cli/storybook-dist/assets/RBSheet.stories-_6VH-RUm.js +0 -39
package/cli/README.md
CHANGED
|
@@ -1,274 +1,274 @@
|
|
|
1
|
-
# @rainbow-robotics/muscat-plugin-kit (`muscat-pk`)
|
|
2
|
-
|
|
3
|
-
CLI to scaffold, build, and preview Muscat plugins.
|
|
4
|
-
|
|
5
|
-
Install/use it the same way an external plugin author will:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm i -g @rainbow-robotics/muscat-plugin-kit
|
|
9
|
-
muscat-pk new my-plugin
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
muscat-pk new my-plugin [--type python|cpp|ros2|ros2-cpp] [--pm npm|yarn|pnpm|bun] [--yes]
|
|
14
|
-
muscat-pk build # ui/content.tsx -> dist/ (minified) + distributable ZIP (--no-zip to skip)
|
|
15
|
-
muscat-pk dev:ui # preview the plugin in a mini-Muscat (preview-host)
|
|
16
|
-
muscat-pk dev:back # run the back end in a Docker container (python / cpp / ros2)
|
|
17
|
-
muscat-pk dev # dev:ui + dev:back
|
|
18
|
-
muscat-pk storybook # browse the bundled rb-components Storybook subset
|
|
19
|
-
muscat-pk mcp # start an MCP server (stdio) exposing rb-components/design-token/SDK docs to AI agents
|
|
20
|
-
muscat-pk update # update @rainbow-robotics/muscat-plugin-kit and @rainbow-robotics/plugin-ui
|
|
21
|
-
muscat-pk uninstall # remove muscat-pk itself (npm global or S3 binary)
|
|
22
|
-
muscat-pk sdk list | sdk update [version] # manage rainbow-rb-sdk (python)
|
|
23
|
-
muscat-pk version # print the installed CLI version (-v / --version too)
|
|
24
|
-
muscat-pk completion zsh # print a shell completion script (bash | zsh | fish | powershell)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Backend ports
|
|
28
|
-
|
|
29
|
-
If a plugin backend opens a TCP server, declare it in `manifest.json`:
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"ports": [28600, 28601]
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
`ports` is optional and accepts only `number[]`; ranges or objects are not
|
|
38
|
-
accepted. External plugin backend ports are reserved for `28600-28999`.
|
|
39
|
-
`muscat-pk dev` and `muscat-pk dev:back` validate the manifest before start and
|
|
40
|
-
then watch the container: **any listening TCP port that is not declared stops
|
|
41
|
-
the backend**, whatever its number. Since a port outside `28600-28999` cannot be
|
|
42
|
-
declared, it cannot be opened either — otherwise it would slip past both this
|
|
43
|
-
check and the robot's install-time conflict check.
|
|
44
|
-
|
|
45
|
-
The kit's own dev ports (plugin gateway `10000`, the Zenoh dev peer port) are
|
|
46
|
-
excluded from that check.
|
|
47
|
-
|
|
48
|
-
Under `muscat-pk dev` the backend shares the local Muscat container's network, so
|
|
49
|
-
declared ports are published to `127.0.0.1` from that container. A declared port
|
|
50
|
-
that is already busy on the host is skipped with a warning.
|
|
51
|
-
|
|
52
|
-
Known robot/industrial/internal ports such as `502`, `4840`, `5170-5179`,
|
|
53
|
-
`8000-8999`, `10000`, `2222`, `30004`, `34964`, `44818`, `50000-50005`,
|
|
54
|
-
and `50051` are reserved and must not be used by external plugins.
|
|
55
|
-
|
|
56
|
-
## Backend runtimes
|
|
57
|
-
|
|
58
|
-
`manifest.json` selects one runtime:
|
|
59
|
-
|
|
60
|
-
| runtime | source | notes |
|
|
61
|
-
|---|---|---|
|
|
62
|
-
| `{ "type": "none" }` | — | UI-only plugin; no backend container |
|
|
63
|
-
| `{ "type": "python", "entry": "main.py" }` | `py/` | Uses `rainbow.rb_sdk.RBPluginCall` for UI/backend messaging; `plugin.router` exposes external endpoints (`common/plugin/{id}/{path}`, needs sdk ≥ 0.0.9.dev5 on the robot; the dev bridge only registers routes — external calls need a running `common`) |
|
|
64
|
-
| `{ "type": "cpp", "entry": "<executable name>" }` | `cpp/` | Built with CMake in Docker against the C++ SDK (apt `rainbow-rb-sdk-dev`, `find_package(rb_sdk)`, dynamic link) |
|
|
65
|
-
| `{ "type": "ros2", "rosClient": "rclpy", ... }` | `ros2_ws/` | ROS2 Python node; may use Python SDK alongside ROS2 APIs |
|
|
66
|
-
| `{ "type": "ros2", "rosClient": "rclcpp", ... }` | `ros2_ws/` | ROS2 C++ node built with colcon/CMake, links the C++ SDK like `cpp` |
|
|
67
|
-
|
|
68
|
-
All non-`none` runtimes run in Docker during `muscat-pk dev:back`, `muscat-pk
|
|
69
|
-
dev`, and build/export flows so development matches the robot environment.
|
|
70
|
-
|
|
71
|
-
## JavaScript dependencies
|
|
72
|
-
|
|
73
|
-
`muscat-pk build` runs the plugin project's own Vite build. Vite resolves imports
|
|
74
|
-
from installed `node_modules`; it does not care whether a package is listed under
|
|
75
|
-
`dependencies` or `devDependencies`, but the package must be installed.
|
|
76
|
-
|
|
77
|
-
Do not run a production-only install such as `npm install --omit=dev` before
|
|
78
|
-
building a plugin UI, because build tools like `vite`, `typescript`,
|
|
79
|
-
`tailwindcss`, `@tailwindcss/vite`, `sass`, or `less` are usually
|
|
80
|
-
`devDependencies`.
|
|
81
|
-
|
|
82
|
-
The scaffold keeps this split:
|
|
83
|
-
|
|
84
|
-
| package kind | examples | why |
|
|
85
|
-
|---|---|---|
|
|
86
|
-
| `dependencies` | `@rainbow-robotics/plugin-ui`, UI libraries imported by plugin source | Author-facing APIs used by `ui/*.tsx` |
|
|
87
|
-
| `devDependencies` | `vite`, `typescript`, `tailwindcss`, `@tailwindcss/vite`, `sass`, `less` | Build/dev tools needed before `dist/*.js` is produced |
|
|
88
|
-
|
|
89
|
-
The built plugin ZIP does not include `package.json` or `node_modules`. For
|
|
90
|
-
production, Muscat provides `@rainbow-robotics/plugin-ui`, React, and ReactDOM
|
|
91
|
-
through the host import map; plugin UI build output imports those as host
|
|
92
|
-
externals.
|
|
93
|
-
|
|
94
|
-
## Plugin styles
|
|
95
|
-
|
|
96
|
-
`muscat()` auto-loads plugin styles from `ui/style.{css,scss,sass,less}` or
|
|
97
|
-
`ui/styles.{css,scss,sass,less}` for every UI entry, and from
|
|
98
|
-
`ui/{entry}.{css,scss,sass,less}` for a matching entry-specific file. Authors do
|
|
99
|
-
not need to import CSS from every `.tsx` entry.
|
|
100
|
-
|
|
101
|
-
The scaffold enables Tailwind in the plugin's own `vite.config.ts`; those
|
|
102
|
-
Tailwind dependencies live in the plugin package, while `muscat()` injects the
|
|
103
|
-
generated CSS into the plugin JS bundle so dynamic host imports do not need a
|
|
104
|
-
separate CSS file.
|
|
105
|
-
|
|
106
|
-
Built CSS selectors are scoped under the current plugin id
|
|
107
|
-
(`[data-muscat-plugin-id="..."]`), so Tailwind utilities or plugin styles do not
|
|
108
|
-
rewrite the host page or another plugin. CSS-in-JS libraries are allowed too,
|
|
109
|
-
but global styles (for example Emotion `Global`) remain the author's
|
|
110
|
-
responsibility to scope.
|
|
111
|
-
|
|
112
|
-
### Tailwind
|
|
113
|
-
|
|
114
|
-
New plugins include Tailwind by default:
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
import { defineConfig } from "vite";
|
|
118
|
-
import tailwindcss from "@tailwindcss/vite";
|
|
119
|
-
import { muscat } from "@rainbow-robotics/muscat-plugin-kit/vite";
|
|
120
|
-
|
|
121
|
-
export default defineConfig({
|
|
122
|
-
plugins: [tailwindcss(), muscat()],
|
|
123
|
-
});
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
The default `ui/style.css` uses Tailwind theme/utilities only, not preflight:
|
|
127
|
-
|
|
128
|
-
```css
|
|
129
|
-
@layer theme, utilities;
|
|
130
|
-
|
|
131
|
-
@import "tailwindcss/theme.css" layer(theme);
|
|
132
|
-
@import "tailwindcss/utilities.css" layer(utilities);
|
|
133
|
-
|
|
134
|
-
@source "./**/*.{ts,tsx}";
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### SCSS, Sass, and Less
|
|
138
|
-
|
|
139
|
-
Install the preprocessor package in the plugin project, then create one of the
|
|
140
|
-
auto-loaded style files.
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
npm i -D sass
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
```scss
|
|
147
|
-
/* ui/style.scss */
|
|
148
|
-
$accent: #3b82f6;
|
|
149
|
-
|
|
150
|
-
.panel {
|
|
151
|
-
border: 1px solid color-mix(in srgb, $accent 40%, transparent);
|
|
152
|
-
|
|
153
|
-
&__title {
|
|
154
|
-
color: $accent;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
For Less, install `less` and use `ui/style.less`.
|
|
160
|
-
|
|
161
|
-
### Emotion
|
|
162
|
-
|
|
163
|
-
Emotion dependencies may be in `dependencies` or `devDependencies`; Vite can
|
|
164
|
-
bundle them when they are installed and imported by the plugin.
|
|
165
|
-
|
|
166
|
-
For `styled`, no Vite config change is needed:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
npm i @emotion/react @emotion/styled
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
```tsx
|
|
173
|
-
import styled from "@emotion/styled";
|
|
174
|
-
|
|
175
|
-
const Panel = styled.div({
|
|
176
|
-
display: "grid",
|
|
177
|
-
gap: 12,
|
|
178
|
-
});
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
For Emotion's `css` prop, pass React plugin options through `muscat()` and add
|
|
182
|
-
`jsxImportSource` to `tsconfig.json`:
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
npm i @emotion/react @emotion/styled
|
|
186
|
-
npm i -D @emotion/babel-plugin
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
```ts
|
|
190
|
-
// vite.config.ts
|
|
191
|
-
import { defineConfig } from "vite";
|
|
192
|
-
import tailwindcss from "@tailwindcss/vite";
|
|
193
|
-
import { muscat } from "@rainbow-robotics/muscat-plugin-kit/vite";
|
|
194
|
-
|
|
195
|
-
export default defineConfig({
|
|
196
|
-
plugins: [
|
|
197
|
-
tailwindcss(),
|
|
198
|
-
muscat({
|
|
199
|
-
react: {
|
|
200
|
-
jsxImportSource: "@emotion/react",
|
|
201
|
-
babel: {
|
|
202
|
-
plugins: ["@emotion/babel-plugin"],
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
}),
|
|
206
|
-
],
|
|
207
|
-
});
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
```json
|
|
211
|
-
{
|
|
212
|
-
"compilerOptions": {
|
|
213
|
-
"jsxImportSource": "@emotion/react"
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
Emotion `Global` writes global CSS at runtime, so scope it manually or avoid it
|
|
219
|
-
inside plugins.
|
|
220
|
-
|
|
221
|
-
## How it fits together
|
|
222
|
-
|
|
223
|
-
- **Install/CLI package** is `@rainbow-robotics/muscat-plugin-kit`.
|
|
224
|
-
- **Author API** comes from `@rainbow-robotics/plugin-ui`. `build` keeps that package
|
|
225
|
-
external so robot/preview-host can provide the runtime.
|
|
226
|
-
- **`build`** bundles plugin code into ESM while externalizing
|
|
227
|
-
`@rainbow-robotics/plugin-ui`, React, and ReactDOM.
|
|
228
|
-
- **`dev:ui`** builds the plugin then serves it inside the bundled preview host
|
|
229
|
-
at `/plugin-dev` — a real mini-Muscat shell. Without a robot IP it needs a Muscat
|
|
230
|
-
on `localhost:3000` for program preview: `dev` / `dev:ui` reuse any container that
|
|
231
|
-
already publishes `:10000` (`muscat`, `muscat-dev`, …) and otherwise start
|
|
232
|
-
`muscat-pk-muscat` — the S3 runtime image (`muscat/main/muscat.zip`) running only the
|
|
233
|
-
`common` service from `muscat/main/version.json`, cached under `~/.muscat-pk/muscat/`.
|
|
234
|
-
It keeps running between runs (`docker rm -f muscat-pk-muscat` to stop);
|
|
235
|
-
`MUSCAT_PK_NO_LOCAL_MUSCAT=1` disables it.
|
|
236
|
-
|
|
237
|
-
`create-muscat-plugin <dir>` is the bin alias for `muscat-pk new`.
|
|
238
|
-
|
|
239
|
-
## Update check
|
|
240
|
-
|
|
241
|
-
On `dev` / `dev:ui` the kit checks the registry for a newer published version and,
|
|
242
|
-
if found, suggests `muscat-pk update`. It is non-blocking (≤2s) and silent when
|
|
243
|
-
offline.
|
|
244
|
-
|
|
245
|
-
- `RB_REGISTRY` — registry base URL (default `https://registry.npmjs.org`).
|
|
246
|
-
- `MUSCAT_PK_NO_UPDATE_CHECK=1` — skip the check.
|
|
247
|
-
|
|
248
|
-
## Local vs global install
|
|
249
|
-
|
|
250
|
-
If the plugin project has its own `muscat-plugin-kit` in `node_modules`, the CLI
|
|
251
|
-
delegates to it — so the CLI, the `vite` preset, and `preview-host` are always
|
|
252
|
-
the one version the project pinned, no matter which `muscat-pk` you typed.
|
|
253
|
-
|
|
254
|
-
`muscat-pk update` follows the same rule: run from a project's local install it
|
|
255
|
-
updates only that project; add `--global` to also update the machine-wide CLI.
|
|
256
|
-
`muscat-pk version` prints whichever copy actually ran.
|
|
257
|
-
|
|
258
|
-
## Docker images
|
|
259
|
-
|
|
260
|
-
Images are built only when missing, because `docker build` resolves the base
|
|
261
|
-
image tag over the network on every run — even with all layers cached — which
|
|
262
|
-
would break `dev` offline. Pre-seed an air-gapped machine with
|
|
263
|
-
`docker save … | gzip` + `docker load`, or force a rebuild with
|
|
264
|
-
`MUSCAT_PK_REBUILD_IMAGE=1`.
|
|
265
|
-
|
|
266
|
-
The C++ images (`Dockerfile.cpp`, `Dockerfile.dev`) install `rainbow-rb-sdk-dev`
|
|
267
|
-
from `https://rainbowrobotics.github.io/rb-sdk` (suite `dev`), pinned by the
|
|
268
|
-
`RB_SDK_VERSION` build arg. Set `MUSCAT_PK_RB_SDK_VERSION=<version>` (with
|
|
269
|
-
`MUSCAT_PK_REBUILD_IMAGE=1`) to match a robot running a different SDK version.
|
|
270
|
-
|
|
271
|
-
On Linux the dev containers run as the invoking user (`--user`), so build output
|
|
272
|
-
under `dist/` and `cpp/build-*` is not left root-owned.
|
|
273
|
-
|
|
274
|
-
Full spec: [`docs/plugin-system/CREATE-CLI.md`](../../docs/plugin-system/CREATE-CLI.md).
|
|
1
|
+
# @rainbow-robotics/muscat-plugin-kit (`muscat-pk`)
|
|
2
|
+
|
|
3
|
+
CLI to scaffold, build, and preview Muscat plugins.
|
|
4
|
+
|
|
5
|
+
Install/use it the same way an external plugin author will:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @rainbow-robotics/muscat-plugin-kit
|
|
9
|
+
muscat-pk new my-plugin
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
muscat-pk new my-plugin [--type python|cpp|ros2|ros2-cpp] [--pm npm|yarn|pnpm|bun] [--yes]
|
|
14
|
+
muscat-pk build # ui/content.tsx -> dist/ (minified) + distributable ZIP (--no-zip to skip)
|
|
15
|
+
muscat-pk dev:ui # preview the plugin in a mini-Muscat (preview-host)
|
|
16
|
+
muscat-pk dev:back # run the back end in a Docker container (python / cpp / ros2)
|
|
17
|
+
muscat-pk dev # dev:ui + dev:back
|
|
18
|
+
muscat-pk storybook # browse the bundled rb-components Storybook subset
|
|
19
|
+
muscat-pk mcp # start an MCP server (stdio) exposing rb-components/design-token/SDK docs to AI agents
|
|
20
|
+
muscat-pk update # update @rainbow-robotics/muscat-plugin-kit and @rainbow-robotics/plugin-ui
|
|
21
|
+
muscat-pk uninstall # remove muscat-pk itself (npm global or S3 binary)
|
|
22
|
+
muscat-pk sdk list | sdk update [version] # manage rainbow-rb-sdk (python)
|
|
23
|
+
muscat-pk version # print the installed CLI version (-v / --version too)
|
|
24
|
+
muscat-pk completion zsh # print a shell completion script (bash | zsh | fish | powershell)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Backend ports
|
|
28
|
+
|
|
29
|
+
If a plugin backend opens a TCP server, declare it in `manifest.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"ports": [28600, 28601]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`ports` is optional and accepts only `number[]`; ranges or objects are not
|
|
38
|
+
accepted. External plugin backend ports are reserved for `28600-28999`.
|
|
39
|
+
`muscat-pk dev` and `muscat-pk dev:back` validate the manifest before start and
|
|
40
|
+
then watch the container: **any listening TCP port that is not declared stops
|
|
41
|
+
the backend**, whatever its number. Since a port outside `28600-28999` cannot be
|
|
42
|
+
declared, it cannot be opened either — otherwise it would slip past both this
|
|
43
|
+
check and the robot's install-time conflict check.
|
|
44
|
+
|
|
45
|
+
The kit's own dev ports (plugin gateway `10000`, the Zenoh dev peer port) are
|
|
46
|
+
excluded from that check.
|
|
47
|
+
|
|
48
|
+
Under `muscat-pk dev` the backend shares the local Muscat container's network, so
|
|
49
|
+
declared ports are published to `127.0.0.1` from that container. A declared port
|
|
50
|
+
that is already busy on the host is skipped with a warning.
|
|
51
|
+
|
|
52
|
+
Known robot/industrial/internal ports such as `502`, `4840`, `5170-5179`,
|
|
53
|
+
`8000-8999`, `10000`, `2222`, `30004`, `34964`, `44818`, `50000-50005`,
|
|
54
|
+
and `50051` are reserved and must not be used by external plugins.
|
|
55
|
+
|
|
56
|
+
## Backend runtimes
|
|
57
|
+
|
|
58
|
+
`manifest.json` selects one runtime:
|
|
59
|
+
|
|
60
|
+
| runtime | source | notes |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `{ "type": "none" }` | — | UI-only plugin; no backend container |
|
|
63
|
+
| `{ "type": "python", "entry": "main.py" }` | `py/` | Uses `rainbow.rb_sdk.RBPluginCall` for UI/backend messaging; `plugin.router` exposes external endpoints (`common/plugin/{id}/{path}`, needs sdk ≥ 0.0.9.dev5 on the robot; the dev bridge only registers routes — external calls need a running `common`) |
|
|
64
|
+
| `{ "type": "cpp", "entry": "<executable name>" }` | `cpp/` | Built with CMake in Docker against the C++ SDK (apt `rainbow-rb-sdk-dev`, `find_package(rb_sdk)`, dynamic link) |
|
|
65
|
+
| `{ "type": "ros2", "rosClient": "rclpy", ... }` | `ros2_ws/` | ROS2 Python node; may use Python SDK alongside ROS2 APIs |
|
|
66
|
+
| `{ "type": "ros2", "rosClient": "rclcpp", ... }` | `ros2_ws/` | ROS2 C++ node built with colcon/CMake, links the C++ SDK like `cpp` |
|
|
67
|
+
|
|
68
|
+
All non-`none` runtimes run in Docker during `muscat-pk dev:back`, `muscat-pk
|
|
69
|
+
dev`, and build/export flows so development matches the robot environment.
|
|
70
|
+
|
|
71
|
+
## JavaScript dependencies
|
|
72
|
+
|
|
73
|
+
`muscat-pk build` runs the plugin project's own Vite build. Vite resolves imports
|
|
74
|
+
from installed `node_modules`; it does not care whether a package is listed under
|
|
75
|
+
`dependencies` or `devDependencies`, but the package must be installed.
|
|
76
|
+
|
|
77
|
+
Do not run a production-only install such as `npm install --omit=dev` before
|
|
78
|
+
building a plugin UI, because build tools like `vite`, `typescript`,
|
|
79
|
+
`tailwindcss`, `@tailwindcss/vite`, `sass`, or `less` are usually
|
|
80
|
+
`devDependencies`.
|
|
81
|
+
|
|
82
|
+
The scaffold keeps this split:
|
|
83
|
+
|
|
84
|
+
| package kind | examples | why |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `dependencies` | `@rainbow-robotics/plugin-ui`, UI libraries imported by plugin source | Author-facing APIs used by `ui/*.tsx` |
|
|
87
|
+
| `devDependencies` | `vite`, `typescript`, `tailwindcss`, `@tailwindcss/vite`, `sass`, `less` | Build/dev tools needed before `dist/*.js` is produced |
|
|
88
|
+
|
|
89
|
+
The built plugin ZIP does not include `package.json` or `node_modules`. For
|
|
90
|
+
production, Muscat provides `@rainbow-robotics/plugin-ui`, React, and ReactDOM
|
|
91
|
+
through the host import map; plugin UI build output imports those as host
|
|
92
|
+
externals.
|
|
93
|
+
|
|
94
|
+
## Plugin styles
|
|
95
|
+
|
|
96
|
+
`muscat()` auto-loads plugin styles from `ui/style.{css,scss,sass,less}` or
|
|
97
|
+
`ui/styles.{css,scss,sass,less}` for every UI entry, and from
|
|
98
|
+
`ui/{entry}.{css,scss,sass,less}` for a matching entry-specific file. Authors do
|
|
99
|
+
not need to import CSS from every `.tsx` entry.
|
|
100
|
+
|
|
101
|
+
The scaffold enables Tailwind in the plugin's own `vite.config.ts`; those
|
|
102
|
+
Tailwind dependencies live in the plugin package, while `muscat()` injects the
|
|
103
|
+
generated CSS into the plugin JS bundle so dynamic host imports do not need a
|
|
104
|
+
separate CSS file.
|
|
105
|
+
|
|
106
|
+
Built CSS selectors are scoped under the current plugin id
|
|
107
|
+
(`[data-muscat-plugin-id="..."]`), so Tailwind utilities or plugin styles do not
|
|
108
|
+
rewrite the host page or another plugin. CSS-in-JS libraries are allowed too,
|
|
109
|
+
but global styles (for example Emotion `Global`) remain the author's
|
|
110
|
+
responsibility to scope.
|
|
111
|
+
|
|
112
|
+
### Tailwind
|
|
113
|
+
|
|
114
|
+
New plugins include Tailwind by default:
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
import { defineConfig } from "vite";
|
|
118
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
119
|
+
import { muscat } from "@rainbow-robotics/muscat-plugin-kit/vite";
|
|
120
|
+
|
|
121
|
+
export default defineConfig({
|
|
122
|
+
plugins: [tailwindcss(), muscat()],
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The default `ui/style.css` uses Tailwind theme/utilities only, not preflight:
|
|
127
|
+
|
|
128
|
+
```css
|
|
129
|
+
@layer theme, utilities;
|
|
130
|
+
|
|
131
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
132
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
133
|
+
|
|
134
|
+
@source "./**/*.{ts,tsx}";
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### SCSS, Sass, and Less
|
|
138
|
+
|
|
139
|
+
Install the preprocessor package in the plugin project, then create one of the
|
|
140
|
+
auto-loaded style files.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npm i -D sass
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```scss
|
|
147
|
+
/* ui/style.scss */
|
|
148
|
+
$accent: #3b82f6;
|
|
149
|
+
|
|
150
|
+
.panel {
|
|
151
|
+
border: 1px solid color-mix(in srgb, $accent 40%, transparent);
|
|
152
|
+
|
|
153
|
+
&__title {
|
|
154
|
+
color: $accent;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
For Less, install `less` and use `ui/style.less`.
|
|
160
|
+
|
|
161
|
+
### Emotion
|
|
162
|
+
|
|
163
|
+
Emotion dependencies may be in `dependencies` or `devDependencies`; Vite can
|
|
164
|
+
bundle them when they are installed and imported by the plugin.
|
|
165
|
+
|
|
166
|
+
For `styled`, no Vite config change is needed:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
npm i @emotion/react @emotion/styled
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
import styled from "@emotion/styled";
|
|
174
|
+
|
|
175
|
+
const Panel = styled.div({
|
|
176
|
+
display: "grid",
|
|
177
|
+
gap: 12,
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
For Emotion's `css` prop, pass React plugin options through `muscat()` and add
|
|
182
|
+
`jsxImportSource` to `tsconfig.json`:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
npm i @emotion/react @emotion/styled
|
|
186
|
+
npm i -D @emotion/babel-plugin
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
// vite.config.ts
|
|
191
|
+
import { defineConfig } from "vite";
|
|
192
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
193
|
+
import { muscat } from "@rainbow-robotics/muscat-plugin-kit/vite";
|
|
194
|
+
|
|
195
|
+
export default defineConfig({
|
|
196
|
+
plugins: [
|
|
197
|
+
tailwindcss(),
|
|
198
|
+
muscat({
|
|
199
|
+
react: {
|
|
200
|
+
jsxImportSource: "@emotion/react",
|
|
201
|
+
babel: {
|
|
202
|
+
plugins: ["@emotion/babel-plugin"],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
}),
|
|
206
|
+
],
|
|
207
|
+
});
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"compilerOptions": {
|
|
213
|
+
"jsxImportSource": "@emotion/react"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Emotion `Global` writes global CSS at runtime, so scope it manually or avoid it
|
|
219
|
+
inside plugins.
|
|
220
|
+
|
|
221
|
+
## How it fits together
|
|
222
|
+
|
|
223
|
+
- **Install/CLI package** is `@rainbow-robotics/muscat-plugin-kit`.
|
|
224
|
+
- **Author API** comes from `@rainbow-robotics/plugin-ui`. `build` keeps that package
|
|
225
|
+
external so robot/preview-host can provide the runtime.
|
|
226
|
+
- **`build`** bundles plugin code into ESM while externalizing
|
|
227
|
+
`@rainbow-robotics/plugin-ui`, React, and ReactDOM.
|
|
228
|
+
- **`dev:ui`** builds the plugin then serves it inside the bundled preview host
|
|
229
|
+
at `/plugin-dev` — a real mini-Muscat shell. Without a robot IP it needs a Muscat
|
|
230
|
+
on `localhost:3000` for program preview: `dev` / `dev:ui` reuse any container that
|
|
231
|
+
already publishes `:10000` (`muscat`, `muscat-dev`, …) and otherwise start
|
|
232
|
+
`muscat-pk-muscat` — the S3 runtime image (`muscat/main/muscat.zip`) running only the
|
|
233
|
+
`common` service from `muscat/main/version.json`, cached under `~/.muscat-pk/muscat/`.
|
|
234
|
+
It keeps running between runs (`docker rm -f muscat-pk-muscat` to stop);
|
|
235
|
+
`MUSCAT_PK_NO_LOCAL_MUSCAT=1` disables it.
|
|
236
|
+
|
|
237
|
+
`create-muscat-plugin <dir>` is the bin alias for `muscat-pk new`.
|
|
238
|
+
|
|
239
|
+
## Update check
|
|
240
|
+
|
|
241
|
+
On `dev` / `dev:ui` the kit checks the registry for a newer published version and,
|
|
242
|
+
if found, suggests `muscat-pk update`. It is non-blocking (≤2s) and silent when
|
|
243
|
+
offline.
|
|
244
|
+
|
|
245
|
+
- `RB_REGISTRY` — registry base URL (default `https://registry.npmjs.org`).
|
|
246
|
+
- `MUSCAT_PK_NO_UPDATE_CHECK=1` — skip the check.
|
|
247
|
+
|
|
248
|
+
## Local vs global install
|
|
249
|
+
|
|
250
|
+
If the plugin project has its own `muscat-plugin-kit` in `node_modules`, the CLI
|
|
251
|
+
delegates to it — so the CLI, the `vite` preset, and `preview-host` are always
|
|
252
|
+
the one version the project pinned, no matter which `muscat-pk` you typed.
|
|
253
|
+
|
|
254
|
+
`muscat-pk update` follows the same rule: run from a project's local install it
|
|
255
|
+
updates only that project; add `--global` to also update the machine-wide CLI.
|
|
256
|
+
`muscat-pk version` prints whichever copy actually ran.
|
|
257
|
+
|
|
258
|
+
## Docker images
|
|
259
|
+
|
|
260
|
+
Images are built only when missing, because `docker build` resolves the base
|
|
261
|
+
image tag over the network on every run — even with all layers cached — which
|
|
262
|
+
would break `dev` offline. Pre-seed an air-gapped machine with
|
|
263
|
+
`docker save … | gzip` + `docker load`, or force a rebuild with
|
|
264
|
+
`MUSCAT_PK_REBUILD_IMAGE=1`.
|
|
265
|
+
|
|
266
|
+
The C++ images (`Dockerfile.cpp`, `Dockerfile.dev`) install `rainbow-rb-sdk-dev`
|
|
267
|
+
from `https://rainbowrobotics.github.io/rb-sdk` (suite `dev`), pinned by the
|
|
268
|
+
`RB_SDK_VERSION` build arg. Set `MUSCAT_PK_RB_SDK_VERSION=<version>` (with
|
|
269
|
+
`MUSCAT_PK_REBUILD_IMAGE=1`) to match a robot running a different SDK version.
|
|
270
|
+
|
|
271
|
+
On Linux the dev containers run as the invoking user (`--user`), so build output
|
|
272
|
+
under `dist/` and `cpp/build-*` is not left root-owned.
|
|
273
|
+
|
|
274
|
+
Full spec: [`docs/plugin-system/CREATE-CLI.md`](../../docs/plugin-system/CREATE-CLI.md).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Thin alias: `npm create @rainbow/muscat-plugin <dir>` → `muscat-pk new <dir>`.
|
|
3
|
-
import { runNew } from "../src/new.mjs";
|
|
4
|
-
|
|
5
|
-
runNew(process.argv.slice(2)).catch((err) => {
|
|
6
|
-
console.error(`\n ✖ ${err?.message || err}`);
|
|
7
|
-
process.exit(1);
|
|
8
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin alias: `npm create @rainbow/muscat-plugin <dir>` → `muscat-pk new <dir>`.
|
|
3
|
+
import { runNew } from "../src/new.mjs";
|
|
4
|
+
|
|
5
|
+
runNew(process.argv.slice(2)).catch((err) => {
|
|
6
|
+
console.error(`\n ✖ ${err?.message || err}`);
|
|
7
|
+
process.exit(1);
|
|
8
|
+
});
|