@rainbow-robotics/muscat-plugin-kit 1.10.4-dev.0 → 1.10.4
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.ko.md +2 -1
- package/README.md +2 -1
- package/cli/src/muscatLocal.mjs +8 -5
- package/cli/storybook-dist/project.json +1 -1
- package/package.json +3 -3
package/README.ko.md
CHANGED
|
@@ -577,6 +577,7 @@ if (await rb.confirm({ title: "실행", message: "백엔드 동작을 시작할
|
|
|
577
577
|
| `rb.program.getSteps(scope?)` | Program 페이지에 열린 프로그램의 메인 스텝 트리 |
|
|
578
578
|
| `rb.program.setSteps(steps, scope?)` | 메인 스텝 트리 교체. 저장되지 않은 편집으로 들어가고 사용자가 저장 |
|
|
579
579
|
| `rb.program.getCatalog(scope?)` | 로드된 로봇의 명령 카탈로그 (이름, 기본 인자, 중첩 규칙) |
|
|
580
|
+
| `rb.program.getCommandDefaults?(command, scope?)` | 기본값이 실제 로봇 상태를 읽는 명령(카탈로그 `rules.hasFactoryDataFn`)의 기본 step. 선택적이며 호스트에 따라 없을 수 있음 |
|
|
580
581
|
|
|
581
582
|
```ts
|
|
582
583
|
type PluginProgramStep = {
|
|
@@ -1028,7 +1029,7 @@ sudo apt update && sudo apt install rainbow-rb-sdk-dev
|
|
|
1028
1029
|
|
|
1029
1030
|
- 이미 `:10000`을 노출하는 컨테이너(`muscat`, `muscat-dev` 등)가 있으면 재사용합니다. kit이 띄우지 않은 컨테이너는 플러그인 포트를 노출하지 않습니다.
|
|
1030
1031
|
- 컨테이너 없이 그 포트를 이미 쓰는 Muscat(로봇 PC, host networking)이 있으면 그대로 씁니다.
|
|
1031
|
-
- 없으면 `muscat-pk-muscat`을 띄웁니다 — `common`(+ `--sim`에 필요한 서비스)과 MediaMTX(`8554`, `8889`, `8189`)를 돌리는 S3 런타임 이미지(`muscat-pk-runtime:<version>`, `version.json` 기준)이며 `~/.muscat-pk/muscat/`에 캐시됩니다. 노출할 플러그인 포트나 서비스가 바뀌면 다시 만들고, Muscat 새 버전이 나오면 이전 이미지를 교체합니다.
|
|
1032
|
+
- 없으면 `muscat-pk-muscat`을 띄웁니다 — `common`(+ `--sim`에 필요한 서비스)과 MediaMTX(`8554`, `8889`, `8189`)를 돌리는 S3 런타임 이미지(`muscat-pk-runtime:<version>`, `version.json` 기준)이며 `~/.muscat-pk/muscat/`에 캐시됩니다. 노출할 플러그인 포트나 서비스가 바뀌면 다시 만들고, Muscat 새 버전이 나오면 이전 이미지를 교체합니다. 데이터(DB, 로그, 프로그램)는 컨테이너 안에만 있어서 컨테이너를 새로 만들면 비어 있습니다.
|
|
1032
1033
|
- `dev`는 종료할 때 자신이 띄운 `muscat-pk-muscat`을 지웁니다. `dev:ui` 단독으로 띄운 것은 계속 떠 있습니다.
|
|
1033
1034
|
- 백엔드는 로컬 Muscat의 network namespace에 붙으므로 `execute`와 SDK가 로봇에서처럼 닿습니다.
|
|
1034
1035
|
|
package/README.md
CHANGED
|
@@ -577,6 +577,7 @@ if (await rb.confirm({ title: "Run", message: "Start the backend action?" })) {
|
|
|
577
577
|
| `rb.program.getSteps(scope?)` | main step tree of the program open on the Program page |
|
|
578
578
|
| `rb.program.setSteps(steps, scope?)` | replace it — an unsaved edit the user then saves |
|
|
579
579
|
| `rb.program.getCatalog(scope?)` | the loaded robot's command catalog (names, default args, nesting rules) |
|
|
580
|
+
| `rb.program.getCommandDefaults?(command, scope?)` | default step of a command whose defaults read the live robot (catalog `rules.hasFactoryDataFn`); optional, host-dependent |
|
|
580
581
|
|
|
581
582
|
```ts
|
|
582
583
|
type PluginProgramStep = {
|
|
@@ -1028,7 +1029,7 @@ Without a robot IP (or against a robot that runs no Muscat), `dev` / `dev:ui` ne
|
|
|
1028
1029
|
|
|
1029
1030
|
- reuses any container already publishing `:10000` (`muscat`, `muscat-dev`, …). A container not started by the kit does not publish the plugin's ports;
|
|
1030
1031
|
- uses a Muscat already listening on those ports without a container (robot PC, host networking);
|
|
1031
|
-
- otherwise starts `muscat-pk-muscat` — the S3 runtime image (`muscat-pk-runtime:<version>`, from `version.json`) running `common` (plus the services `--sim` needs) and MediaMTX (`8554`, `8889`, `8189`), cached in `~/.muscat-pk/muscat/`. It is recreated when the published plugin ports or services change, and a new Muscat version replaces the old image.
|
|
1032
|
+
- otherwise starts `muscat-pk-muscat` — the S3 runtime image (`muscat-pk-runtime:<version>`, from `version.json`) running `common` (plus the services `--sim` needs) and MediaMTX (`8554`, `8889`, `8189`), cached in `~/.muscat-pk/muscat/`. It is recreated when the published plugin ports or services change, and a new Muscat version replaces the old image. Its data (DB, logs, programs) lives in the container only, so a new container starts empty.
|
|
1032
1033
|
- `dev` removes its own `muscat-pk-muscat` on exit; started by `dev:ui` alone it keeps running.
|
|
1033
1034
|
- The backend joins the local Muscat's network namespace, so `execute` and the SDK reach it like on the robot.
|
|
1034
1035
|
|
package/cli/src/muscatLocal.mjs
CHANGED
|
@@ -140,11 +140,13 @@ function ensureNetwork() {
|
|
|
140
140
|
// listen-endpoints file opens both to the network. Sims reach common as muscat-pk-muscat:7447, and
|
|
141
141
|
// gossip has them dial each service back — on loopback only the sim that happened to connect first
|
|
142
142
|
// answers manipulate's receive_one.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (!open) return
|
|
143
|
+
// Mounted as the only file of /app/data; the rest of the runtime's data stays in the container.
|
|
144
|
+
function zenohListenMount(open) {
|
|
145
|
+
if (!open) return [];
|
|
146
|
+
const file = resolve(CACHE, "zenoh_listen_endpoints.json5");
|
|
146
147
|
mkdirSync(dirname(file), { recursive: true });
|
|
147
148
|
writeFileSync(file, `{\n common: ["tcp/0.0.0.0:7447"],\n service: ["tcp/0.0.0.0:0"],\n}\n`);
|
|
149
|
+
return ["-v", `${file}:/app/data/zenoh_listen_endpoints.json5:ro`];
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
async function waitForApi(timeoutMs = 180_000) {
|
|
@@ -249,7 +251,8 @@ export async function ensureLocalMuscat({ pluginPorts = [], zenohPort = null, se
|
|
|
249
251
|
const svcMounts = [];
|
|
250
252
|
for (const s of svcs) svcMounts.push("-v", `${await ensureServiceBinary(s, versions.services[s].version)}:/app/services/${s}`);
|
|
251
253
|
ensureNetwork();
|
|
252
|
-
|
|
254
|
+
// Earlier kits kept DB, logs and programs here across runs.
|
|
255
|
+
rmSync(resolve(CACHE, "data"), { recursive: true, force: true });
|
|
253
256
|
|
|
254
257
|
let media = true;
|
|
255
258
|
for (const port of MEDIA_PORTS) if (await isPortInUse(port)) media = false;
|
|
@@ -270,7 +273,7 @@ export async function ensureLocalMuscat({ pluginPorts = [], zenohPort = null, se
|
|
|
270
273
|
"-e", "RB_RUNTIME_ENABLE_ZENOH_BRIDGE=0",
|
|
271
274
|
...envFlags,
|
|
272
275
|
...svcMounts,
|
|
273
|
-
|
|
276
|
+
...zenohListenMount(services.length > 0),
|
|
274
277
|
"-p", `127.0.0.1:${API_PORT}:${API_PORT}`,
|
|
275
278
|
"-p", `127.0.0.1:${GATEWAY_PORT}:${GATEWAY_PORT}`,
|
|
276
279
|
...(media ? mediaPortFlags() : []),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1793188569222,"userSince":1750932757926,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@vitest/browser":"3.2.4","@vitest/coverage-v8":"3.2.4","playwright":"1.59.1","vitest":"3.2.4"},"hasRouterPackage":false,"monorepo":"Turborepo","packageManager":{"type":"yarn","version":"berry","agent":"yarn@berry"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":0,"storybookVersion":"8.6.18","storybookVersionSpecifier":"^8.6.4","language":"typescript","storybookPackages":{"@chromatic-com/storybook":{"version":"3.2.7"},"@storybook/addon-essentials":{"version":"8.6.18"},"@storybook/addon-links":{"version":"8.6.18"},"@storybook/addon-onboarding":{"version":"8.6.18"},"@storybook/addon-themes":{"version":"8.6.18"},"@storybook/blocks":{"version":"8.6.18"},"@storybook/experimental-addon-test":{"version":"8.6.18"},"@storybook/react":{"version":"8.6.18"},"@storybook/react-vite":{"version":"8.6.18"},"@storybook/test":{"version":"8.6.18"},"@storybook/theming":{"version":"8.6.18"},"eslint-plugin-storybook":{"version":"0.11.6"},"storybook":{"version":"8.6.18"},"storybook-addon-react-docgen":{"version":"1.2.44"}},"addons":{"$SNIP/node_modules/@storybook/addon-links":{"version":null},"$SNIP/node_modules/@storybook/addon-essentials":{"version":null},"$SNIP/node_modules/@chromatic-com/storybook":{"version":null},"$SNIP/node_modules/@storybook/addon-themes":{"version":null},"$SNIP/node_modules/@storybook/experimental-addon-test":{"version":null}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainbow-robotics/muscat-plugin-kit",
|
|
3
|
-
"version": "1.10.4
|
|
3
|
+
"version": "1.10.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
56
|
-
"@rainbow-robotics/plugin-ui": "1.10.4
|
|
57
|
-
"@rainbow-robotics/preview-host": "1.10.4
|
|
56
|
+
"@rainbow-robotics/plugin-ui": "1.10.4",
|
|
57
|
+
"@rainbow-robotics/preview-host": "1.10.4",
|
|
58
58
|
"@types/react": "^19.0.10",
|
|
59
59
|
"postcss": "^8.5.8",
|
|
60
60
|
"typescript": "^5.8.0",
|