fix: harden M3 simulator identities and wiring

This commit is contained in:
Code Queue Review
2026-05-23 04:30:01 +00:00
parent 82b1f9491e
commit c095d4d943
14 changed files with 416 additions and 18 deletions
+13 -3
View File
@@ -8,12 +8,22 @@ import {
import { createHealth, createBoxState, selectInstanceValue } from "../../internal/sim/model.mjs";
import { createJsonServer, listen, parsePort, readJson } from "../../internal/sim/http.mjs";
const boxId = selectInstanceValue(process.env.HWLAB_BOX_ID, "boxsim_alpha");
const boxId = selectInstanceValue(process.env.HWLAB_BOX_ID, "boxsim_alpha", {
requireIndexForMultiple: true,
label: "HWLAB_BOX_ID"
});
const gatewaySessionId = selectInstanceValue(
process.env.HWLAB_GATEWAY_SESSION_ID,
"gws_mvp_simu"
"gws_mvp_simu",
{
requireIndexForMultiple: true,
label: "HWLAB_GATEWAY_SESSION_ID"
}
);
const resourceId = selectInstanceValue(process.env.HWLAB_BOX_RESOURCE_ID, "");
const resourceId = selectInstanceValue(process.env.HWLAB_BOX_RESOURCE_ID, "", {
requireIndexForMultiple: true,
label: "HWLAB_BOX_RESOURCE_ID"
});
const port = parsePort(process.env.PORT, 7201);
const state = createBoxState({ boxId, gatewaySessionId });
if (resourceId) {