推进 INI 面板 shell handoff package schema

This commit is contained in:
2026-06-15 10:32:45 +08:00
parent 542b139477
commit f1d10fc317
10 changed files with 303 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ import {
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary,
@@ -37,6 +38,7 @@ import {
isSupportedIniPanelControlPageApiManifest,
isSupportedIniPanelLaunchApiManifest,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffPackage,
isSupportedIniPanelShellSessionHandoffSummary,
} from "../../../runtime/ui/ini-panel/ui-shell.js";
@@ -80,6 +82,7 @@ const requiredShellExports = [
"createIniPanelShellSessionHandoffCompatibilityReport",
"createIniPanelShellSessionHandoffDisplayViewModel",
"createIniPanelShellSessionHandoffPackage",
"createIniPanelShellSessionHandoffPackageSchema",
"createIniPanelShellSessionHandoffRenderState",
"createIniPanelShellSessionHandoffSnapshot",
"createIniPanelShellSessionHandoffSummary",
@@ -90,6 +93,7 @@ const requiredShellExports = [
"isSupportedIniPanelControlPageApiManifest",
"isSupportedIniPanelLaunchApiManifest",
"isSupportedIniPanelShellIntegrationManifest",
"isSupportedIniPanelShellSessionHandoffPackage",
"isSupportedIniPanelShellSessionHandoffSummary",
"createMachineSessionControlPageController",
"createMachineSessionReadonlyStatus",
@@ -222,6 +226,11 @@ assert.deepEqual(
checklist: createIniPanelShellViewModel().shellSessionHandoffChecklist,
}),
);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffPackageSchema(),
);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(createIniPanelShellViewModel().shellSessionHandoffPackage), true);
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
@@ -281,6 +290,7 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffChec
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackage\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/);
@@ -288,6 +298,7 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSumm
assert.match(shellText, /\bexport function isSupportedIniPanelControlPageApiManifest\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelLaunchApiManifest\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellIntegrationManifest\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellSessionHandoffPackage\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellSessionHandoffSummary\b/);
assert.match(controlPageText, /\bisSupportedControlPageApiManifest\b/);
assert.match(controlPageText, /\bgetControlPageApiSchema\b/);
@@ -309,7 +320,9 @@ assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(launchText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(launchText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageSchema\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackage\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(launchText, /\bdata-handoff-shell\b/);
assert.match(launchText, /\bdata-handoff-status\b/);
assert.match(launchText, /\bdata-handoff-rows\b/);
@@ -336,6 +349,7 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffChecklist\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackage\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/);
@@ -343,6 +357,7 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/);
assert.match(docText, /\bisSupportedIniPanelControlPageApiManifest\b/);
assert.match(docText, /\bisSupportedIniPanelLaunchApiManifest\b/);
assert.match(docText, /\bisSupportedIniPanelShellIntegrationManifest\b/);
assert.match(docText, /\bisSupportedIniPanelShellSessionHandoffPackage\b/);
assert.match(docText, /\bisSupportedIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedLaunchApiManifest\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiSchema\b/);
@@ -359,7 +374,9 @@ assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSnapsh
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffRenderState\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffActionPlan\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffChecklist\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffPackageSchema\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffPackage\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedShellSessionHandoffPackage\b/);
assert.match(docText, /\bdata-handoff-shell\b/);
assert.match(docText, /\bdata-handoff-status\b/);
assert.match(docText, /\bdata-handoff-rows\b/);
@@ -375,7 +392,9 @@ assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffSnapsho
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackageSchema\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackage\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bhandoffSummary\.handoffMethods\.readStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\breadControlPageStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bbrowser_ini_shell_integration_workflow_smoke=ok\b/);

View File

@@ -55,7 +55,9 @@ assert.deepEqual(manifest, {
"getShellSessionHandoffRenderState",
"getShellSessionHandoffActionPlan",
"getShellSessionHandoffChecklist",
"getShellSessionHandoffPackageSchema",
"getShellSessionHandoffPackage",
"isSupportedShellSessionHandoffPackage",
"getLauncherLinks",
"getControlPageApiMethods",
],
@@ -165,7 +167,9 @@ assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(launchText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(launchText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageSchema\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackage\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
console.log("ini_panel_launch_api_manifest_node_smoke=ok");

View File

@@ -19,12 +19,14 @@ import {
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema,
getVisibleIniPanelEntries,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffPackage,
isSupportedIniPanelShellSessionHandoffSummary,
} from "../../../runtime/ui/ini-panel/ui-shell.js";
@@ -66,6 +68,7 @@ const handoffPackage = createIniPanelShellSessionHandoffPackage({
actionPlan: handoffActionPlan,
checklist: handoffChecklist,
});
const handoffPackageSchema = createIniPanelShellSessionHandoffPackageSchema();
assert.deepEqual(schema, {
apiName: "ini-panel-shell-integration",
@@ -121,7 +124,7 @@ assert.deepEqual(readiness, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 18,
launchMethods: 20,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -183,7 +186,7 @@ assert.deepEqual(handoffSummary, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 18,
launchMethods: 20,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -442,11 +445,61 @@ assert.deepEqual(handoffPackage, {
actionPlan: handoffActionPlan,
checklist: handoffChecklist,
});
assert.deepEqual(handoffPackageSchema, {
apiName: "ini-panel-shell-session-handoff-package",
packageVersion: 1,
fields: [
"apiName",
"packageVersion",
"phase",
"ready",
"statusLine",
"manifests",
"snapshot",
"renderState",
"actionPlan",
"checklist",
],
manifestFields: [
"shellIntegration",
"launchApi",
"controlPageApi",
"launchMethods",
"controlPageMethods",
],
});
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(handoffPackage), true);
assert.equal(
isSupportedIniPanelShellSessionHandoffPackage({ ...handoffPackage, packageVersion: 2 }),
false,
);
assert.equal(
isSupportedIniPanelShellSessionHandoffPackage({ ...handoffPackage, apiName: "other" }),
false,
);
const missingPackageField = { ...handoffPackage };
delete missingPackageField.checklist;
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(missingPackageField), false);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage({
...handoffPackage,
manifests: {
...handoffPackage.manifests,
controlPageMethods: undefined,
},
}), true);
const missingManifestField = {
...handoffPackage,
manifests: { ...handoffPackage.manifests },
};
delete missingManifestField.manifests.controlPageMethods;
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(missingManifestField), false);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(null), false);
assert.equal(createIniPanelShellSessionHandoffSnapshot().displayViewModel.rows.length, 5);
assert.equal(createIniPanelShellSessionHandoffRenderState().statusLine, "Ready: No blocking reasons");
assert.equal(createIniPanelShellSessionHandoffActionPlan().nextSteps.length, 2);
assert.equal(createIniPanelShellSessionHandoffChecklist().checks.length, 5);
assert.equal(createIniPanelShellSessionHandoffPackage().manifests.launchMethods.includes("getShellSessionHandoffPackage"), true);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(createIniPanelShellSessionHandoffPackage()), true);
assert.deepEqual(
createIniPanelShellSessionHandoffDisplayViewModel(
createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }),
@@ -663,7 +716,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 18,
launchMethods: 20,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -828,11 +881,13 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffChec
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackage\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummarySchema\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellSessionHandoffSummary\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellSessionHandoffPackage\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellIntegrationManifest\b/);
assert.match(launchText, /\bgetShellIntegrationSchema\b/);
assert.match(launchText, /\bgetShellIntegrationManifest\b/);
@@ -845,11 +900,13 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffChecklist\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackage\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/);
assert.match(docText, /\bisSupportedIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\bisSupportedIniPanelShellSessionHandoffPackage\b/);
assert.match(docText, /\bisSupportedIniPanelShellIntegrationManifest\b/);
assert.doesNotMatch(shellText, /\bparseGcode\b|\bcanonicalEvents\b|\btoolTable\b|\bplanner\b/);

View File

@@ -19,6 +19,7 @@ import {
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary,
@@ -35,6 +36,7 @@ import {
isSupportedIniPanelControlPageApiManifest,
isSupportedIniPanelLaunchApiManifest,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffPackage,
isSupportedIniPanelShellSessionHandoffSummary,
loadMachineSessionForControlPageWorkflow,
readMachineSessionReadonlyStatus,
@@ -81,6 +83,7 @@ assert.equal(typeof createIniPanelShellSessionHandoffChecklist, "function");
assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function");
assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackage, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageSchema, "function");
assert.equal(typeof createIniPanelShellSessionHandoffRenderState, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSnapshot, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSummary, "function");
@@ -92,6 +95,7 @@ assert.equal(typeof renderMachineSessionControlView, "function");
assert.equal(typeof isSupportedIniPanelControlPageApiManifest, "function");
assert.equal(typeof isSupportedIniPanelLaunchApiManifest, "function");
assert.equal(typeof isSupportedIniPanelShellIntegrationManifest, "function");
assert.equal(typeof isSupportedIniPanelShellSessionHandoffPackage, "function");
assert.equal(typeof isSupportedIniPanelShellSessionHandoffSummary, "function");
const shellManifest = getIniPanelEntryManifest();
@@ -199,6 +203,8 @@ assert.deepEqual(
checklist: shellViewModel.shellSessionHandoffChecklist,
}),
);
assert.deepEqual(shellViewModel.shellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema());
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(shellViewModel.shellSessionHandoffPackage), true);
assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
phase: "ready",
title: "Shell handoff compatibility",
@@ -342,6 +348,29 @@ assert.deepEqual(shellViewModel.shellSessionHandoffPackage, {
actionPlan: shellViewModel.shellSessionHandoffActionPlan,
checklist: shellViewModel.shellSessionHandoffChecklist,
});
assert.deepEqual(shellViewModel.shellSessionHandoffPackageSchema, {
apiName: "ini-panel-shell-session-handoff-package",
packageVersion: 1,
fields: [
"apiName",
"packageVersion",
"phase",
"ready",
"statusLine",
"manifests",
"snapshot",
"renderState",
"actionPlan",
"checklist",
],
manifestFields: [
"shellIntegration",
"launchApi",
"controlPageApi",
"launchMethods",
"controlPageMethods",
],
});
assert.equal(
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
true,
@@ -390,6 +419,8 @@ assert.equal(shellViewModel.createShellSessionHandoffRenderState, createIniPanel
assert.equal(shellViewModel.createShellSessionHandoffActionPlan, createIniPanelShellSessionHandoffActionPlan);
assert.equal(shellViewModel.createShellSessionHandoffChecklist, createIniPanelShellSessionHandoffChecklist);
assert.equal(shellViewModel.createShellSessionHandoffPackage, createIniPanelShellSessionHandoffPackage);
assert.equal(shellViewModel.createShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema);
assert.equal(shellViewModel.isSupportedShellSessionHandoffPackage, isSupportedIniPanelShellSessionHandoffPackage);
assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract());
assert.equal(shellViewModel.controlPage.isSupportedBrowserApiManifest, isSupportedIniPanelControlPageApiManifest);
assert.equal(shellViewModel.controlPage.loadSessionState, loadMachineSessionForControlPageWorkflow);