收口 INI 面板 persistence summary 发布门禁
This commit is contained in:
@@ -4,22 +4,41 @@ import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import {
|
||||
INI_PANEL_ENTRIES,
|
||||
analyzeIniRuntimeBoundaries,
|
||||
createControlPageBrowserApiManifest,
|
||||
createControlPageBrowserApiMethods,
|
||||
createControlPageBrowserApiSchema,
|
||||
createIniPanelLaunchApiManifest,
|
||||
createIniPanelLauncherLinkViewModel,
|
||||
createIniPanelShellApiSurfaceInventory,
|
||||
createIniPanelShellControlPageContract,
|
||||
createIniPanelShellIntegrationManifest,
|
||||
createIniPanelShellIntegrationReadiness,
|
||||
createIniPanelShellIntegrationSchema,
|
||||
createIniPanelShellIntegrationWorkflowPlan,
|
||||
createIniPanelShellSessionReadinessWorkflowReport,
|
||||
createIniPanelShellViewModel,
|
||||
createIniPanelShellWorkflowOverviewContract,
|
||||
createIniPanelShellWorkflowOverviewEmbeddingMountDomContract,
|
||||
createIniPanelShellWorkflowOverviewEmbeddingMountDomReadiness,
|
||||
createLinuxCncIniSdk,
|
||||
createLinuxCncInterpSdk,
|
||||
createMachineSessionSnapshotPayload,
|
||||
createMachineSessionPersistenceDisplayViewModel,
|
||||
createMachineSessionPersistenceRenderState,
|
||||
createMachineSessionPersistenceSummary,
|
||||
createSessionSnapshot,
|
||||
defaultMachinePaths,
|
||||
gcodeFilenameFromProgramPath,
|
||||
gcodeProgramPath,
|
||||
getIniPanelEntryByHref,
|
||||
getIniPanelEntryManifest,
|
||||
getOpfsRoot,
|
||||
getVisibleIniPanelEntries,
|
||||
isSupportedIniPanelControlPageApiManifest,
|
||||
isSupportedIniPanelLaunchApiManifest,
|
||||
isSupportedIniPanelShellIntegrationManifest,
|
||||
loadMachineSessionFromOpfs,
|
||||
loadMachineSessionSnapshot,
|
||||
loadMachineTextFiles,
|
||||
@@ -56,6 +75,13 @@ const requiredExports = [
|
||||
["planIniFileContextStaging", planIniFileContextStaging],
|
||||
["planSimConfigStaging", planSimConfigStaging],
|
||||
["analyzeIniRuntimeBoundaries", analyzeIniRuntimeBoundaries],
|
||||
["getIniPanelEntryManifest", getIniPanelEntryManifest],
|
||||
["getIniPanelEntryByHref", getIniPanelEntryByHref],
|
||||
["getVisibleIniPanelEntries", getVisibleIniPanelEntries],
|
||||
["createIniPanelLauncherLinkViewModel", createIniPanelLauncherLinkViewModel],
|
||||
["createMachineSessionPersistenceDisplayViewModel", createMachineSessionPersistenceDisplayViewModel],
|
||||
["createMachineSessionPersistenceRenderState", createMachineSessionPersistenceRenderState],
|
||||
["createMachineSessionPersistenceSummary", createMachineSessionPersistenceSummary],
|
||||
["getOpfsRoot", getOpfsRoot],
|
||||
["saveTextFile", saveTextFile],
|
||||
["loadTextFile", loadTextFile],
|
||||
@@ -80,11 +106,22 @@ const requiredExports = [
|
||||
["loadMachineToolTableFromOpfs", loadMachineToolTableFromOpfs],
|
||||
["loadMachineSessionFromOpfs", loadMachineSessionFromOpfs],
|
||||
["readMachineSessionReadiness", readMachineSessionReadiness],
|
||||
["createControlPageBrowserApiSchema", createControlPageBrowserApiSchema],
|
||||
["createControlPageBrowserApiManifest", createControlPageBrowserApiManifest],
|
||||
["createControlPageBrowserApiMethods", createControlPageBrowserApiMethods],
|
||||
["createIniPanelShellControlPageContract", createIniPanelShellControlPageContract],
|
||||
["isSupportedIniPanelControlPageApiManifest", isSupportedIniPanelControlPageApiManifest],
|
||||
["createIniPanelLaunchApiManifest", createIniPanelLaunchApiManifest],
|
||||
["isSupportedIniPanelLaunchApiManifest", isSupportedIniPanelLaunchApiManifest],
|
||||
["createIniPanelShellIntegrationSchema", createIniPanelShellIntegrationSchema],
|
||||
["createIniPanelShellIntegrationManifest", createIniPanelShellIntegrationManifest],
|
||||
["createIniPanelShellIntegrationReadiness", createIniPanelShellIntegrationReadiness],
|
||||
["createIniPanelShellIntegrationWorkflowPlan", createIniPanelShellIntegrationWorkflowPlan],
|
||||
["isSupportedIniPanelShellIntegrationManifest", isSupportedIniPanelShellIntegrationManifest],
|
||||
["createIniPanelShellViewModel", createIniPanelShellViewModel],
|
||||
["createIniPanelShellApiSurfaceInventory", createIniPanelShellApiSurfaceInventory],
|
||||
["createIniPanelShellSessionReadinessWorkflowReport", createIniPanelShellSessionReadinessWorkflowReport],
|
||||
["createIniPanelShellWorkflowOverviewContract", createIniPanelShellWorkflowOverviewContract],
|
||||
[
|
||||
"createIniPanelShellWorkflowOverviewEmbeddingMountDomContract",
|
||||
createIniPanelShellWorkflowOverviewEmbeddingMountDomContract,
|
||||
@@ -116,12 +153,80 @@ assert.equal(sessionSnapshotPath("sdk-session"), "linuxcnc/sessions/sdk-session/
|
||||
assert.equal(normalizeOpfsPath("linuxcnc/machines/sdk-mill/tool.tbl"), "linuxcnc/machines/sdk-mill/tool.tbl");
|
||||
assert.equal(gcodeFilenameFromProgramPath("linuxcnc/gcode/demo.ngc"), "demo.ngc");
|
||||
|
||||
assert.deepEqual(getIniPanelEntryManifest(), INI_PANEL_ENTRIES);
|
||||
assert.deepEqual(getVisibleIniPanelEntries(), INI_PANEL_ENTRIES);
|
||||
assert.deepEqual(getIniPanelEntryByHref("./control-page.html"), {
|
||||
id: "control-view",
|
||||
title: "Open read-only control view",
|
||||
href: "./control-page.html",
|
||||
});
|
||||
assert.deepEqual(createIniPanelLauncherLinkViewModel(), [
|
||||
{
|
||||
entryId: "edit-run",
|
||||
href: "./index.html",
|
||||
label: "Open edit and run panel",
|
||||
},
|
||||
{
|
||||
entryId: "control-view",
|
||||
href: "./control-page.html",
|
||||
label: "Open read-only control view",
|
||||
},
|
||||
{
|
||||
entryId: "workflow-overview",
|
||||
href: "./workflow-overview.html",
|
||||
label: "Open shell handoff overview",
|
||||
},
|
||||
]);
|
||||
assert.equal(
|
||||
createMachineSessionPersistenceSummary({
|
||||
state: {
|
||||
badges: { opfs: "OPFS: ready" },
|
||||
fields: { sessionSnapshot: "sdk-session/snapshot.json", sessionIni: "/work/session-machine.ini" },
|
||||
sessionLoad: { iniWasmPath: "/work/session-machine.ini" },
|
||||
sessionReadiness: { phase: "ready", ready: true, missing: [] },
|
||||
},
|
||||
}).rows.find(({ id }) => id === "session-load")?.value,
|
||||
"loaded: /work/session-machine.ini",
|
||||
);
|
||||
assert.equal(
|
||||
createMachineSessionPersistenceRenderState(
|
||||
createMachineSessionPersistenceDisplayViewModel(createMachineSessionPersistenceSummary()),
|
||||
).apiName,
|
||||
"machine-session-persistence-render-state",
|
||||
);
|
||||
|
||||
const controlPageApiSchema = createControlPageBrowserApiSchema();
|
||||
const controlPageApiManifest = createControlPageBrowserApiManifest();
|
||||
assert.equal(controlPageApiSchema.apiName, "ini-panel-control-page");
|
||||
assert.equal(isSupportedIniPanelControlPageApiManifest(controlPageApiManifest), true);
|
||||
assert.deepEqual(controlPageApiManifest.methods, createControlPageBrowserApiMethods());
|
||||
assert.equal(
|
||||
createIniPanelShellControlPageContract().readonlyStatusApiManifest.apiName,
|
||||
"machine-session-readonly-status",
|
||||
);
|
||||
|
||||
const launchManifest = createIniPanelLaunchApiManifest();
|
||||
assert.equal(isSupportedIniPanelLaunchApiManifest(launchManifest), true);
|
||||
assert.equal(
|
||||
launchManifest.methods.includes("mountWorkflowOverviewEmbeddingMountState"),
|
||||
true,
|
||||
);
|
||||
assert.deepEqual(
|
||||
launchManifest.visibleEntries,
|
||||
getVisibleIniPanelEntries().map(({ id, href, title }) => ({ id, href, title })),
|
||||
);
|
||||
|
||||
const shellIntegrationManifest = createIniPanelShellIntegrationManifest();
|
||||
assert.equal(createIniPanelShellIntegrationSchema().apiName, "ini-panel-shell-integration");
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest(shellIntegrationManifest), true);
|
||||
assert.equal(createIniPanelShellIntegrationReadiness(shellIntegrationManifest).ready, true);
|
||||
assert.equal(createIniPanelShellIntegrationWorkflowPlan({
|
||||
manifest: shellIntegrationManifest,
|
||||
}).ready, true);
|
||||
assert.equal(
|
||||
createIniPanelShellWorkflowOverviewContract().methodNames.includes("getWorkflowOverviewApiSurfaceInventory"),
|
||||
true,
|
||||
);
|
||||
|
||||
const shellViewModel = createIniPanelShellViewModel();
|
||||
assert.equal(
|
||||
@@ -140,6 +245,19 @@ assert.equal(
|
||||
createIniPanelShellApiSurfaceInventory().apiName,
|
||||
"ini-panel-shell-api-surface-inventory",
|
||||
);
|
||||
assert.equal(shellViewModel.shellApiSurfaceInventory.ready, true);
|
||||
assert.equal(
|
||||
shellViewModel.shellSessionHandoffWorkflowSummary.rows.find(
|
||||
({ id }) => id === "persistence-summary",
|
||||
)?.value,
|
||||
"waiting: 5 missing",
|
||||
);
|
||||
assert.equal(
|
||||
shellViewModel.shellSessionHandoffWorkflowSummary.rows.find(
|
||||
({ id }) => id === "api-surface-inventory",
|
||||
)?.value,
|
||||
"ready: 6 rows",
|
||||
);
|
||||
assert.equal(
|
||||
shellViewModel.mountWorkflowOverviewEmbeddingMountState,
|
||||
mountIniPanelShellWorkflowOverviewEmbeddingMountState,
|
||||
|
||||
Reference in New Issue
Block a user