@rainbow-robotics/muscat-plugin-kit 0.1.2-dev.43 → 0.1.2-dev.45

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.
Files changed (238) hide show
  1. package/README.md +1 -1
  2. package/cli/README.md +184 -0
  3. package/cli/bin/muscat-pk.mjs +13 -0
  4. package/cli/prepack.mjs +10 -0
  5. package/cli/src/build.mjs +2 -29
  6. package/cli/src/dev.mjs +10 -2
  7. package/cli/src/devBack.mjs +72 -9
  8. package/cli/src/devUi.mjs +100 -34
  9. package/cli/src/manifest.mjs +15 -0
  10. package/cli/src/mcp.mjs +523 -0
  11. package/cli/src/pluginDevServer.mjs +113 -0
  12. package/cli/src/ports.mjs +160 -0
  13. package/cli/src/sdk.mjs +11 -9
  14. package/cli/src/storybook.mjs +168 -0
  15. package/cli/src/templates-embedded.mjs +1 -1
  16. package/cli/storybook-dist/_design-tokens.css +4957 -0
  17. package/cli/storybook-dist/_stories-src/NxAvatar.stories.tsx +27 -0
  18. package/cli/storybook-dist/_stories-src/NxPagination.stories.tsx +28 -0
  19. package/cli/storybook-dist/_stories-src/RBAccordion/RBAccordion.stories.tsx +46 -0
  20. package/cli/storybook-dist/_stories-src/RBAccordion/RBAccordionGroup.stories.tsx +73 -0
  21. package/cli/storybook-dist/_stories-src/RBBadge/RBBadge.stories.tsx +93 -0
  22. package/cli/storybook-dist/_stories-src/RBBattery/RBBattery.stories.tsx +74 -0
  23. package/cli/storybook-dist/_stories-src/RBButton/RBCheckIconButton.stories.tsx +28 -0
  24. package/cli/storybook-dist/_stories-src/RBButton/RBCheckLabelButton.stories.tsx +84 -0
  25. package/cli/storybook-dist/_stories-src/RBButton/RBIconButton.stories.tsx +57 -0
  26. package/cli/storybook-dist/_stories-src/RBButton/RBInlineLabelButton.stories.tsx +41 -0
  27. package/cli/storybook-dist/_stories-src/RBButton/RBLabelButton.stories.tsx +60 -0
  28. package/cli/storybook-dist/_stories-src/RBDatePicker/RBDateInput.stories.tsx +44 -0
  29. package/cli/storybook-dist/_stories-src/RBDatePicker/RBRangeDateInput.stories.tsx +44 -0
  30. package/cli/storybook-dist/_stories-src/RBDialog/RBAlert.stories.tsx +51 -0
  31. package/cli/storybook-dist/_stories-src/RBDialog/RBConfirm.stories.tsx +55 -0
  32. package/cli/storybook-dist/_stories-src/RBDialog/RBPrompt.stories.tsx +52 -0
  33. package/cli/storybook-dist/_stories-src/RBDivider/RBDivider.stories.tsx +93 -0
  34. package/cli/storybook-dist/_stories-src/RBEmptyView/RBEmptyView.stories.tsx +49 -0
  35. package/cli/storybook-dist/_stories-src/RBIcons/RBColorIcons.stories.tsx +108 -0
  36. package/cli/storybook-dist/_stories-src/RBIcons/RBIcons.stories.tsx +106 -0
  37. package/cli/storybook-dist/_stories-src/RBIcons/RBMenuTreeIcons.stories.tsx +108 -0
  38. package/cli/storybook-dist/_stories-src/RBIcons/RBProgramIcons.stories.tsx +116 -0
  39. package/cli/storybook-dist/_stories-src/RBInput/RBCheckBox.stories.tsx +89 -0
  40. package/cli/storybook-dist/_stories-src/RBInput/RBMultiRangeInput.stories.tsx +64 -0
  41. package/cli/storybook-dist/_stories-src/RBInput/RBRadioBox.stories.tsx +65 -0
  42. package/cli/storybook-dist/_stories-src/RBInput/RBRadioButton.stories.tsx +68 -0
  43. package/cli/storybook-dist/_stories-src/RBInput/RBSelectBox.stories.tsx +119 -0
  44. package/cli/storybook-dist/_stories-src/RBInput/RBSideNumberInput.stories.tsx +90 -0
  45. package/cli/storybook-dist/_stories-src/RBInput/RBText/RBTextArea.stories.tsx +45 -0
  46. package/cli/storybook-dist/_stories-src/RBInput/RBText/RBTextInput.stories.tsx +50 -0
  47. package/cli/storybook-dist/_stories-src/RBInput/RBTextField.stories.tsx +102 -0
  48. package/cli/storybook-dist/_stories-src/RBJoyStick/RBJoyStick.stories.tsx +31 -0
  49. package/cli/storybook-dist/_stories-src/RBLight/RBLight.stories.tsx +36 -0
  50. package/cli/storybook-dist/_stories-src/RBPagination/RBPagination.stories.tsx +49 -0
  51. package/cli/storybook-dist/_stories-src/RBShadcn/RBCard/RBCard.stories.tsx +89 -0
  52. package/cli/storybook-dist/_stories-src/RBShadcn/RBCommand/RBCommand.stories.tsx +116 -0
  53. package/cli/storybook-dist/_stories-src/RBShadcn/RBDialog/RBDialog.stories.tsx +74 -0
  54. package/cli/storybook-dist/_stories-src/RBShadcn/RBDrawer/RBDrawer.stories.tsx +99 -0
  55. package/cli/storybook-dist/_stories-src/RBShadcn/RBDropdownMenu/RBDropdownMenu.stories.tsx +123 -0
  56. package/cli/storybook-dist/_stories-src/RBShadcn/RBMenubar/RBMenubar.stories.tsx +135 -0
  57. package/cli/storybook-dist/_stories-src/RBShadcn/RBPopover/RBPopover.stories.tsx +69 -0
  58. package/cli/storybook-dist/_stories-src/RBShadcn/RBResizable/RBResizable.stories.tsx +49 -0
  59. package/cli/storybook-dist/_stories-src/RBShadcn/RBSheet/RBSheet.stories.tsx +91 -0
  60. package/cli/storybook-dist/_stories-src/RBShadcn/RBSlider/RBSlider.stories.tsx +38 -0
  61. package/cli/storybook-dist/_stories-src/RBShadcn/RBSwitch/RBSwitch.stories.tsx +112 -0
  62. package/cli/storybook-dist/_stories-src/RBShadcn/RBTabs/RBTabs.stories.tsx +75 -0
  63. package/cli/storybook-dist/_stories-src/RBShadcn/RBToggle/RBToggle.stories.tsx +51 -0
  64. package/cli/storybook-dist/_stories-src/RBShadcn/RBToggleGroup/RBToggleGroup.stories.tsx +84 -0
  65. package/cli/storybook-dist/_stories-src/RBTab/RBChipTab.stories.tsx +102 -0
  66. package/cli/storybook-dist/_stories-src/RBTab/RBChipsBoxTab.stories.tsx +78 -0
  67. package/cli/storybook-dist/_stories-src/RBTab/RBTab.stories.tsx +57 -0
  68. package/cli/storybook-dist/_stories-src/RBTable/RBTable.stories.tsx +177 -0
  69. package/cli/storybook-dist/_stories-src/RBTable/RBTableRow.stories.tsx +64 -0
  70. package/cli/storybook-dist/_stories-src/RBToast/RBToast.stories.tsx +117 -0
  71. package/cli/storybook-dist/_stories-src/RBTooltip/RBTooltip.stories.tsx +50 -0
  72. package/cli/storybook-dist/_stories-src/loading/RBSpinner.stories.tsx +30 -0
  73. package/cli/storybook-dist/_stories-src/nx-button/NxButton.stories.tsx +54 -0
  74. package/cli/storybook-dist/_stories-src/nx-button/NxPointerHoldButton.stories.tsx +57 -0
  75. package/cli/storybook-dist/_stories-src/nx-icons/NxIcons.stories.tsx +48 -0
  76. package/cli/storybook-dist/_stories-src/nx-inputs/NxNumberInput.stories.tsx +103 -0
  77. package/cli/storybook-dist/_stories-src/nx-inputs/NxRangeInput.stories.tsx +27 -0
  78. package/cli/storybook-dist/_stories-src/nx-inputs/NxSelectBox.stories.tsx +67 -0
  79. package/cli/storybook-dist/_stories-src/nx-inputs/NxSlideRange.stories.tsx +45 -0
  80. package/cli/storybook-dist/_stories-src/nx-inputs/NxSwitch.stories.tsx +27 -0
  81. package/cli/storybook-dist/_stories-src/nx-inputs/NxTextArea.stories.tsx +48 -0
  82. package/cli/storybook-dist/_stories-src/nx-inputs/NxTextInput.stories.tsx +46 -0
  83. package/cli/storybook-dist/assets/Color-YHDXOIA2-BjuzF3Je.js +1 -0
  84. package/cli/storybook-dist/assets/Docs-BAFZYTMR.js +12 -0
  85. package/cli/storybook-dist/assets/Docs-BQesYW-Q.js +8 -0
  86. package/cli/storybook-dist/assets/Docs-BsMEe093.js +7 -0
  87. package/cli/storybook-dist/assets/Docs-By6k6vcM.js +20 -0
  88. package/cli/storybook-dist/assets/Docs-D1J63cJc.js +7 -0
  89. package/cli/storybook-dist/assets/Docs-GoNbntAU.js +8 -0
  90. package/cli/storybook-dist/assets/DocsRenderer-CFRXHY34-BwY_WiM7.js +2 -0
  91. package/cli/storybook-dist/assets/NxAvatar.stories-CvzBHfYa.js +13 -0
  92. package/cli/storybook-dist/assets/NxButton.stories-B83PesgN.js +20 -0
  93. package/cli/storybook-dist/assets/NxIcons.stories-Ca7qpAaO.js +3 -0
  94. package/cli/storybook-dist/assets/NxNumberInput.stories-DpNcCG6B.js +26 -0
  95. package/cli/storybook-dist/assets/NxPagination.stories-Xnvd3xhH.js +11 -0
  96. package/cli/storybook-dist/assets/NxPointerHoldButton.stories-C3YSIpM0.js +14 -0
  97. package/cli/storybook-dist/assets/NxRangeInput.stories-DIhaNZig.js +17 -0
  98. package/cli/storybook-dist/assets/NxSelectBox.stories-BGwO2mYJ.js +17 -0
  99. package/cli/storybook-dist/assets/NxSlideRange.stories-BXlt5Bgt.js +14 -0
  100. package/cli/storybook-dist/assets/NxSwitch.stories-C5ZqIRtw.js +11 -0
  101. package/cli/storybook-dist/assets/NxTextArea.stories-hm_ycALo.js +11 -0
  102. package/cli/storybook-dist/assets/NxTextInput.stories-DkZAySr_.js +11 -0
  103. package/cli/storybook-dist/assets/PretendardVariable-CJuje-Rk.woff2 +0 -0
  104. package/cli/storybook-dist/assets/RBAccordion.stories--bY36GZY.js +17 -0
  105. package/cli/storybook-dist/assets/RBAccordionGroup.stories-BVr1ccI4.js +33 -0
  106. package/cli/storybook-dist/assets/RBAlert.stories-CkjFBEkv.js +17 -0
  107. package/cli/storybook-dist/assets/RBBadge.stories-CNXILDPh.js +1 -0
  108. package/cli/storybook-dist/assets/RBBattery.stories-AokMv8ZY.js +10 -0
  109. package/cli/storybook-dist/assets/RBCard.stories-CX1sLKB2.js +45 -0
  110. package/cli/storybook-dist/assets/RBCheckBox.stories-By3QHBFm.js +1 -0
  111. package/cli/storybook-dist/assets/RBCheckIconButton.stories-Dud1uK3X.js +1 -0
  112. package/cli/storybook-dist/assets/RBCheckLabelButton.stories-C8iBkZxY.js +24 -0
  113. package/cli/storybook-dist/assets/RBChipTab.stories-DsgbiS2U.js +21 -0
  114. package/cli/storybook-dist/assets/RBChipsBoxTab.stories-C3DZGmq0.js +1 -0
  115. package/cli/storybook-dist/assets/RBColorIcons.stories-CusR20qk.js +3 -0
  116. package/cli/storybook-dist/assets/RBCommand.stories-DhJNgaLZ.js +73 -0
  117. package/cli/storybook-dist/assets/RBConfirm.stories-B6LKpCDa.js +20 -0
  118. package/cli/storybook-dist/assets/RBDateInput.stories-PEEhQ1wJ.js +15 -0
  119. package/cli/storybook-dist/assets/RBDialog.stories-CAtOdRen.js +38 -0
  120. package/cli/storybook-dist/assets/RBDivider.stories-0zpIUlXT.js +1 -0
  121. package/cli/storybook-dist/assets/RBDrawer.stories-CWMG4glY.js +14 -0
  122. package/cli/storybook-dist/assets/RBDropdownMenu.stories-6fbEYZfk.js +86 -0
  123. package/cli/storybook-dist/assets/RBEmptyView.stories-BRDZHjn4.js +12 -0
  124. package/cli/storybook-dist/assets/RBIconButton.stories-sYrRLYob.js +1 -0
  125. package/cli/storybook-dist/assets/RBIcons.stories-DFe8O1_g.js +3 -0
  126. package/cli/storybook-dist/assets/RBInlineLabelButton.stories-DX4VdUfk.js +1 -0
  127. package/cli/storybook-dist/assets/RBJoyStick.stories-SA2Foelf.js +11 -0
  128. package/cli/storybook-dist/assets/RBLabelButton.stories-CicBns_Y.js +1 -0
  129. package/cli/storybook-dist/assets/RBLight.stories-WlP3oEmY.js +1 -0
  130. package/cli/storybook-dist/assets/RBMenuTreeIcons.stories-CrWjPfxj.js +3 -0
  131. package/cli/storybook-dist/assets/RBMenubar.stories-Di4phWw7.js +3 -0
  132. package/cli/storybook-dist/assets/RBMultiRangeInput.stories-DS3wrR3l.js +14 -0
  133. package/cli/storybook-dist/assets/RBPagination.stories-BDVPAUVD.js +17 -0
  134. package/cli/storybook-dist/assets/RBPopover.stories-DL9b_iX9.js +11 -0
  135. package/cli/storybook-dist/assets/RBProgramIcons.stories-ByRVx-on.js +3 -0
  136. package/cli/storybook-dist/assets/RBPrompt.stories-vTmKWyA5.js +20 -0
  137. package/cli/storybook-dist/assets/RBRadioBox.stories-C9WHt4jb.js +1 -0
  138. package/cli/storybook-dist/assets/RBRadioButton.stories-D8KYq63j.js +11 -0
  139. package/cli/storybook-dist/assets/RBRangeDateInput.stories-Bvcf4Su7.js +15 -0
  140. package/cli/storybook-dist/assets/RBResizable.stories-3O2OMuH_.js +20 -0
  141. package/cli/storybook-dist/assets/RBSelectBox.stories-CKZLmPzX.js +6 -0
  142. package/cli/storybook-dist/assets/RBSheet.stories-Dko0It1W.js +39 -0
  143. package/cli/storybook-dist/assets/RBSideNumberInput.stories-CUvqVtId.js +5 -0
  144. package/cli/storybook-dist/assets/RBSlider.stories-CcbaKRYo.js +5 -0
  145. package/cli/storybook-dist/assets/RBSpinner.stories-D15e_JlE.js +14 -0
  146. package/cli/storybook-dist/assets/RBSwitch.stories-C4JRsYJ6.js +65 -0
  147. package/cli/storybook-dist/assets/RBTab.stories-BPvzQSM-.js +1 -0
  148. package/cli/storybook-dist/assets/RBTable.stories-nr8OS1mV.js +62 -0
  149. package/cli/storybook-dist/assets/RBTableRow.stories-rI0rK8Ci.js +11 -0
  150. package/cli/storybook-dist/assets/RBTabs.stories-CxMtHGWA.js +21 -0
  151. package/cli/storybook-dist/assets/RBTextArea.stories-Bru4AhJ3.js +5 -0
  152. package/cli/storybook-dist/assets/RBTextField.stories-Ah3D9lto.js +45 -0
  153. package/cli/storybook-dist/assets/RBTextInput.stories-C3qAVngJ.js +5 -0
  154. package/cli/storybook-dist/assets/RBToast.stories-C1occsvf.js +11 -0
  155. package/cli/storybook-dist/assets/RBToggle.stories-BNrNERc7.js +12 -0
  156. package/cli/storybook-dist/assets/RBToggleGroup.stories-D_RRBwxY.js +17 -0
  157. package/cli/storybook-dist/assets/RBTooltip.stories-DuyOQqrB.js +9 -0
  158. package/cli/storybook-dist/assets/RainbowUiProvider-BYlbsa69.css +1 -0
  159. package/cli/storybook-dist/assets/RainbowUiProvider-B_piZBLb.js +31 -0
  160. package/cli/storybook-dist/assets/browserUtils-DeopUpDy.js +1 -0
  161. package/cli/storybook-dist/assets/chunk-XP5HYGXS-BHXC9YeQ.js +1 -0
  162. package/cli/storybook-dist/assets/client-DTf7SId2.js +1 -0
  163. package/cli/storybook-dist/assets/createConveyorBeltLayer-Cn41pFRH.js +6210 -0
  164. package/cli/storybook-dist/assets/createConveyorBeltLayer-Ds5AOper.css +21 -0
  165. package/cli/storybook-dist/assets/entry-preview-D-mLV0cS.js +2 -0
  166. package/cli/storybook-dist/assets/entry-preview-docs-b8bpVBXy.js +46 -0
  167. package/cli/storybook-dist/assets/iframe-DNru2eN7.js +211 -0
  168. package/cli/storybook-dist/assets/index-B4FGfHer.js +1 -0
  169. package/cli/storybook-dist/assets/index-BRq5TIsn.js +24 -0
  170. package/cli/storybook-dist/assets/index-C1OzuK6-.js +240 -0
  171. package/cli/storybook-dist/assets/index-CT3U1fyk.js +1 -0
  172. package/cli/storybook-dist/assets/index-ChsGqxH_.js +9 -0
  173. package/cli/storybook-dist/assets/index-Cwr2bQOB.js +575 -0
  174. package/cli/storybook-dist/assets/index-DKFBREX_.js +1 -0
  175. package/cli/storybook-dist/assets/index-DgH-xKnr.js +11 -0
  176. package/cli/storybook-dist/assets/index-Dmy2JGbm.js +1 -0
  177. package/cli/storybook-dist/assets/index-DrFu-skq.js +6 -0
  178. package/cli/storybook-dist/assets/jsx-runtime-BTJTZTIL.js +9 -0
  179. package/cli/storybook-dist/assets/keymapTileIndex.worker-BsNYNbqs.js +1 -0
  180. package/cli/storybook-dist/assets/preview-B8lJiyuQ.js +34 -0
  181. package/cli/storybook-dist/assets/preview-BBWR9nbA.js +1 -0
  182. package/cli/storybook-dist/assets/preview-BWzBA1C2.js +396 -0
  183. package/cli/storybook-dist/assets/preview-CILRoSnB.js +1 -0
  184. package/cli/storybook-dist/assets/preview-CVgpLj3b.js +1 -0
  185. package/cli/storybook-dist/assets/preview-CvbIS5ZJ.js +1 -0
  186. package/cli/storybook-dist/assets/preview-DD_OYowb.js +1 -0
  187. package/cli/storybook-dist/assets/preview-DGUiP6tS.js +7 -0
  188. package/cli/storybook-dist/assets/preview-DHQbi4pV.js +1 -0
  189. package/cli/storybook-dist/assets/preview-DUTcCPBe.css +1 -0
  190. package/cli/storybook-dist/assets/preview-QAsoD6Sa.js +2 -0
  191. package/cli/storybook-dist/assets/preview-rcRMbKPr.js +3 -0
  192. package/cli/storybook-dist/assets/react-18-hB3smqWJ.js +1 -0
  193. package/cli/storybook-dist/assets/react-resizable-panels.browser-CvAJUcrm.js +72 -0
  194. package/cli/storybook-dist/assets/test-utils-BQudk2xt.js +9 -0
  195. package/cli/storybook-dist/favicon.svg +1 -0
  196. package/cli/storybook-dist/iframe.html +666 -0
  197. package/cli/storybook-dist/index.html +190 -0
  198. package/cli/storybook-dist/index.json +1 -0
  199. package/cli/storybook-dist/nunito-sans-bold-italic.woff2 +0 -0
  200. package/cli/storybook-dist/nunito-sans-bold.woff2 +0 -0
  201. package/cli/storybook-dist/nunito-sans-italic.woff2 +0 -0
  202. package/cli/storybook-dist/nunito-sans-regular.woff2 +0 -0
  203. package/cli/storybook-dist/project.json +1 -0
  204. package/cli/storybook-dist/sb-addons/chromatic-com-storybook-10/manager-bundle.js +331 -0
  205. package/cli/storybook-dist/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +51 -0
  206. package/cli/storybook-dist/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
  207. package/cli/storybook-dist/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
  208. package/cli/storybook-dist/sb-addons/essentials-controls-2/manager-bundle.js +405 -0
  209. package/cli/storybook-dist/sb-addons/essentials-docs-4/manager-bundle.js +245 -0
  210. package/cli/storybook-dist/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
  211. package/cli/storybook-dist/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
  212. package/cli/storybook-dist/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
  213. package/cli/storybook-dist/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
  214. package/cli/storybook-dist/sb-addons/links-1/manager-bundle.js +3 -0
  215. package/cli/storybook-dist/sb-addons/storybook-13/manager-bundle.js +3 -0
  216. package/cli/storybook-dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  217. package/cli/storybook-dist/sb-addons/storybook-experimental-addon-test-12/manager-bundle.js +223 -0
  218. package/cli/storybook-dist/sb-addons/themes-11/manager-bundle.js +3 -0
  219. package/cli/storybook-dist/sb-common-assets/favicon.svg +1 -0
  220. package/cli/storybook-dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  221. package/cli/storybook-dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  222. package/cli/storybook-dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  223. package/cli/storybook-dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  224. package/cli/storybook-dist/sb-manager/globals-module-info.js +1052 -0
  225. package/cli/storybook-dist/sb-manager/globals-runtime.js +41775 -0
  226. package/cli/storybook-dist/sb-manager/globals.js +48 -0
  227. package/cli/storybook-dist/sb-manager/runtime.js +12048 -0
  228. package/cli/templates/common/.mcp.json +8 -0
  229. package/cli/templates/common/README.md +467 -53
  230. package/cli/templates/common/assets/icon.svg +44 -2
  231. package/cli/templates/common/package.json +2 -0
  232. package/cli/templates/common/ui/content.tsx +209 -26
  233. package/cli/templates/common/ui/style.css +6 -0
  234. package/cli/templates/common/vite.config.ts +6 -34
  235. package/cli/templates/cpp/cpp/main.cpp +1 -0
  236. package/cli/vite.d.mts +25 -0
  237. package/cli/vite.mjs +271 -0
  238. package/package.json +31 -4
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "muscat": {
4
+ "command": "muscat-pk",
5
+ "args": ["mcp"]
6
+ }
7
+ }
8
+ }
@@ -18,7 +18,8 @@ muscat-pk build # build + distributable ZIP
18
18
  ```
19
19
  __PLUGIN_DIR__/
20
20
  ├─ ui/
21
- │ └─ content.tsx # plugin UI entry point
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 | Description |
52
- |---|---|
53
- | `rb.pub(topic, payload)` | Publish a message to a topic |
54
- | `rb.sub(topic, handler)` | Subscribe to a topic — returns `{ undeclare() }` |
55
- | `rb.action(topic, payload?)` | Send a request and await a reply |
56
- | `rb.serve(topic, handler)` | Handle incoming requests from the backend |
57
- | `rb.toast(message, type?)` | Host toast notification (`"info" · "success" · "warning" · "error"`) |
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
- ### Topic namespace
235
+ ### Saving and restoring form data (`useRbFormData` / `useRbSave`)
74
236
 
75
- Topics are automatically namespaced by plugin ID to prevent collisions across plugins.
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
- "sensor/data" → plugin/{pluginId}/sensor/data (auto-namespaced)
79
- "/broadcast/x" → broadcast/x (leading / = absolute)
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`. The plugin emits
85
- `rb-*` tags; the host renders the actual components.
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 { connect } from "@rainbow-robotics/plugin-ui/connect";
89
- import { Button, Slider, Text, Switch } from "@rainbow-robotics/plugin-ui/react";
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
- return <Button label="Run" onPress={() => rb.action("run")} />;
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 (`py/main.py`)
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
- The backend communicates with the frontend using `rainbow.rb_sdk.RBPluginCall`.
125
- `muscat-pk dev` starts the Socket.IO bridge in Docker (published on port 10000) and
126
- runs the backend container sharing its network, so the SDK connects at localhost:10000.
127
- `py/main.py` should contain plugin logic only and must not start its own server.
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
- ### Python plugin
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
- ### ROS2 plugin
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
- The node is launched with `--ros-args -r __ns:=/{slug}` automatically by `dev:back`.
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 std_msgs.msg import Float32
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
- # relative topic name — __ns prefix applied automatically
184
- self.pub = self.create_publisher(Float32, "sensor_data", 10)
185
- self.create_timer(1.0, self.timer_cb)
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
- def timer_cb(self):
188
- self.pub.publish(Float32(data=42.0))
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.command — adds a step node to the program tree
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.command",
563
+ "point": "program.panel",
227
564
  "icon": "assets/icon.svg",
228
565
  "label": { "ko": "내 플러그인", "en": "My Plugin" },
229
- "ui": "program/content", // must be unique across all contributions
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": "plugin.run",
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.rnb — adds a panel to the Move screen right-side area
582
+ // move.panel — adds a panel to the Move screen
246
583
  {
247
- "point": "move.rnb",
584
+ "point": "move.panel",
248
585
  "icon": "assets/icon.svg",
249
586
  "label": { "ko": "내 플러그인", "en": "My Plugin" },
250
- "ui": "move/content" // must be unique across all contributions
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` required |
277
- |---|---|:---:|
278
- | `toolbar` | Top toolbar button (must have at least one) | — |
279
- | `program.command` | Program tree step node | ✓ |
280
- | `move.rnb` | Move screen right-side panel | — |
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.command`):
625
+ **`commandInfo` fields** (for `program.panel`):
283
626
 
284
627
  | field | type | description |
285
628
  |---|---|---|
286
- | `name` | `string` | Display name of the step node |
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.command"`
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 inside the dev container (`pip install -r requirements.txt`) on every startup. No local Python or venv needed.
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