推进 INI 面板 shell handoff snapshot API

This commit is contained in:
2026-06-15 09:42:43 +08:00
parent 01817f6493
commit 5c951ab9bc
11 changed files with 1272 additions and 10 deletions

View File

@@ -73,7 +73,12 @@
!launchApi?.getShellIntegrationSchema ||
!launchApi?.getShellIntegrationManifest ||
!launchApi?.getShellIntegrationReadiness ||
!launchApi?.getShellSessionHandoffSummarySchema ||
!launchApi?.getShellSessionHandoffSummary ||
!launchApi?.isSupportedShellSessionHandoffSummary ||
!launchApi?.getShellSessionHandoffCompatibilityReport ||
!launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getLauncherLinks ||
!launchApi?.getControlPageApiMethods
) {
@@ -113,13 +118,17 @@
);
assertEqual(
launchApiManifest.methods.join(","),
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummary,getLauncherLinks,getControlPageApiMethods",
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getLauncherLinks,getControlPageApiMethods",
"launch API manifest methods",
);
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
const shellIntegrationManifest = launchApi.getShellIntegrationManifest();
const shellIntegrationReadiness = launchApi.getShellIntegrationReadiness();
const shellSessionHandoffSummarySchema = launchApi.getShellSessionHandoffSummarySchema();
const shellSessionHandoffSummary = launchApi.getShellSessionHandoffSummary();
const shellSessionHandoffCompatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
const shellSessionHandoffDisplayViewModel = launchApi.getShellSessionHandoffDisplayViewModel();
const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
assertEqual(
shellIntegrationSchema.manifestVersion,
1,
@@ -165,6 +174,86 @@
true,
"shell session handoff summary readiness",
);
assertEqual(
shellSessionHandoffSummarySchema.summaryVersion,
1,
"shell session handoff summary schema version",
);
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(shellSessionHandoffSummary),
true,
"shell session handoff summary supported",
);
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary({ ...shellSessionHandoffSummary, summaryVersion: 2 }),
false,
"shell session handoff summary rejects version",
);
assertEqual(
shellSessionHandoffCompatibilityReport.compatible,
true,
"shell session handoff compatibility report",
);
assertEqual(
shellSessionHandoffCompatibilityReport.summarySupported,
true,
"shell session handoff summary support report",
);
assertEqual(
shellSessionHandoffCompatibilityReport.missingFields.join(","),
"",
"shell session handoff compatibility missing fields",
);
assertEqual(
shellSessionHandoffDisplayViewModel.statusText,
"Ready",
"shell session handoff display status",
);
assertEqual(
shellSessionHandoffDisplayViewModel.rows.length,
5,
"shell session handoff display rows",
);
assertEqual(
shellSessionHandoffSnapshot.snapshotVersion,
1,
"shell session handoff snapshot version",
);
assertEqual(
shellSessionHandoffSnapshot.ready,
true,
"shell session handoff snapshot readiness",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.readiness),
JSON.stringify(shellIntegrationReadiness),
"shell session handoff snapshot readiness object",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.summary),
JSON.stringify(shellSessionHandoffSummary),
"shell session handoff snapshot summary object",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.displayViewModel),
JSON.stringify(shellSessionHandoffDisplayViewModel),
"shell session handoff snapshot display object",
);
assertEqual(
launchDoc.querySelector("[data-handoff-status]").textContent,
"Ready: No blocking reasons",
"shell session handoff DOM status",
);
assertEqual(
launchDoc.querySelector('[data-handoff-value="missing-fields"]').textContent,
"none",
"shell session handoff DOM missing fields",
);
assertEqual(
launchDoc.querySelector('[data-handoff-value="blocking-reasons"]').textContent,
"none",
"shell session handoff DOM blocking reasons",
);
assertEqual(
shellSessionHandoffSummary.targetPage.href,
"./control-page.html",

View File

@@ -64,14 +64,36 @@ TOOL_TABLE = browser-shell-tool.tbl
if (
!launchApi?.getShellIntegrationManifest ||
!launchApi?.getShellIntegrationReadiness ||
!launchApi?.getShellSessionHandoffSummary
!launchApi?.getShellSessionHandoffSummarySchema ||
!launchApi?.getShellSessionHandoffSummary ||
!launchApi?.isSupportedShellSessionHandoffSummary ||
!launchApi?.getShellSessionHandoffCompatibilityReport ||
!launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot
) {
throw new Error("launch API namespace did not expose shell integration helpers");
}
const integrationManifest = launchApi.getShellIntegrationManifest();
const readiness = launchApi.getShellIntegrationReadiness();
const handoffSummarySchema = launchApi.getShellSessionHandoffSummarySchema();
const handoffSummary = launchApi.getShellSessionHandoffSummary();
const compatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
const handoffDisplay = launchApi.getShellSessionHandoffDisplayViewModel();
const handoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
true,
"shell handoff summary supported",
);
assertEqual(compatibilityReport.compatible, true, "shell handoff compatibility report");
assertEqual(compatibilityReport.summarySupported, true, "shell handoff summary report support");
assertEqual(compatibilityReport.blockingReasons.join(","), "", "shell handoff report blocking reasons");
assertEqual(handoffDisplay.statusText, "Ready", "shell handoff display status");
assertEqual(handoffDisplay.detailText, "No blocking reasons", "shell handoff display detail");
assertEqual(handoffSnapshot.ready, true, "shell handoff snapshot readiness");
assertEqual(handoffSnapshot.displayViewModel.statusText, "Ready", "shell handoff snapshot display status");
assertEqual(readiness.phase, "ready", "shell integration readiness phase");
assertEqual(readiness.ready, true, "shell integration readiness");
assertEqual(readiness.missing.join(","), "", "shell integration readiness missing checks");

View File

@@ -18,7 +18,11 @@ import {
createIniPanelShellIntegrationReadiness,
createIniPanelShellIntegrationSchema,
createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema,
createIniPanelShellViewModel,
createMachineSessionReadonlyStatus,
createMachineSessionReadonlyStatusApiManifest,
@@ -29,6 +33,7 @@ import {
isSupportedIniPanelControlPageApiManifest,
isSupportedIniPanelLaunchApiManifest,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffSummary,
} from "../../../runtime/ui/ini-panel/ui-shell.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -66,13 +71,18 @@ const requiredShellExports = [
"createIniPanelShellIntegrationReadiness",
"createIniPanelShellIntegrationSchema",
"createIniPanelShellIntegrationWorkflowPlan",
"createIniPanelShellSessionHandoffCompatibilityReport",
"createIniPanelShellSessionHandoffDisplayViewModel",
"createIniPanelShellSessionHandoffSnapshot",
"createIniPanelShellSessionHandoffSummary",
"createIniPanelShellSessionHandoffSummarySchema",
"createIniPanelShellViewModel",
"getIniPanelEntryByHref",
"getVisibleIniPanelEntries",
"isSupportedIniPanelControlPageApiManifest",
"isSupportedIniPanelLaunchApiManifest",
"isSupportedIniPanelShellIntegrationManifest",
"isSupportedIniPanelShellSessionHandoffSummary",
"createMachineSessionControlPageController",
"createMachineSessionReadonlyStatus",
"createMachineSessionReadonlyStatusApiManifest",
@@ -152,6 +162,28 @@ assert.deepEqual(
workflowPlan: createIniPanelShellViewModel().shellIntegrationWorkflowPlan,
}),
);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffSummarySchema,
createIniPanelShellSessionHandoffSummarySchema(),
);
assert.equal(isSupportedIniPanelShellSessionHandoffSummary(createIniPanelShellViewModel().shellSessionHandoffSummary), true);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffCompatibilityReport(createIniPanelShellViewModel().shellSessionHandoffSummary),
);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffDisplayViewModel(createIniPanelShellViewModel().shellSessionHandoffCompatibilityReport),
);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSnapshot({
readiness: createIniPanelShellViewModel().shellIntegrationReadiness,
summary: createIniPanelShellViewModel().shellSessionHandoffSummary,
compatibilityReport: createIniPanelShellViewModel().shellSessionHandoffCompatibilityReport,
displayViewModel: createIniPanelShellViewModel().shellSessionHandoffDisplayViewModel,
}),
);
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
@@ -206,10 +238,15 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationSchema\
assert.match(shellText, /\bexport function createIniPanelShellIntegrationManifest\b/);
assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadiness\b/);
assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\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 isSupportedIniPanelControlPageApiManifest\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelLaunchApiManifest\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellIntegrationManifest\b/);
assert.match(shellText, /\bexport function isSupportedIniPanelShellSessionHandoffSummary\b/);
assert.match(controlPageText, /\bisSupportedControlPageApiManifest\b/);
assert.match(controlPageText, /\bgetControlPageApiSchema\b/);
assert.match(controlPageText, /\bgetControlPageApiManifest\b/);
@@ -221,7 +258,14 @@ assert.match(launchText, /\bgetLaunchApiManifest\b/);
assert.match(launchText, /\bgetShellIntegrationSchema\b/);
assert.match(launchText, /\bgetShellIntegrationManifest\b/);
assert.match(launchText, /\bgetShellIntegrationReadiness\b/);
assert.match(launchText, /\bgetShellSessionHandoffSummarySchema\b/);
assert.match(launchText, /\bgetShellSessionHandoffSummary\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffSummary\b/);
assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/);
assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\bdata-handoff-status\b/);
assert.match(launchText, /\bdata-handoff-rows\b/);
assert.match(launchText, /\bgetControlPageApiMethods\b/);
assert.match(controlPageText, /\bgetControlPageContract\b/);
assert.match(controlPageText, /\breadControlPageStatus\b/);
@@ -240,22 +284,38 @@ assert.match(docText, /\bcreateIniPanelShellIntegrationManifest\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationReadiness\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationSchema\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/);
assert.match(docText, /\bisSupportedIniPanelControlPageApiManifest\b/);
assert.match(docText, /\bisSupportedIniPanelLaunchApiManifest\b/);
assert.match(docText, /\bisSupportedIniPanelShellIntegrationManifest\b/);
assert.match(docText, /\bisSupportedIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedLaunchApiManifest\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiSchema\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellIntegrationSchema\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellIntegrationManifest\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellIntegrationReadiness\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSummarySchema\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSummary\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedShellSessionHandoffSummary\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSnapshot\b/);
assert.match(docText, /\bdata-handoff-status\b/);
assert.match(docText, /\bdata-handoff-rows\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
assert.match(docText, /\bini_panel_shell_integration_workflow_smoke\.html\b/);
assert.match(browserIniPanelText, /\bini_panel_shell_integration_workflow_smoke\.html\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellIntegrationReadiness\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffSummary\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bisSupportedShellSessionHandoffSummary\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffCompatibilityReport\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffSnapshot\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

@@ -46,7 +46,12 @@ assert.deepEqual(manifest, {
"getShellIntegrationSchema",
"getShellIntegrationManifest",
"getShellIntegrationReadiness",
"getShellSessionHandoffSummarySchema",
"getShellSessionHandoffSummary",
"isSupportedShellSessionHandoffSummary",
"getShellSessionHandoffCompatibilityReport",
"getShellSessionHandoffDisplayViewModel",
"getShellSessionHandoffSnapshot",
"getLauncherLinks",
"getControlPageApiMethods",
],
@@ -147,7 +152,12 @@ assert.match(launchText, /\bgetLaunchApiManifest\b/);
assert.match(launchText, /\bgetShellIntegrationSchema\b/);
assert.match(launchText, /\bgetShellIntegrationManifest\b/);
assert.match(launchText, /\bgetShellIntegrationReadiness\b/);
assert.match(launchText, /\bgetShellSessionHandoffSummarySchema\b/);
assert.match(launchText, /\bgetShellSessionHandoffSummary\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffSummary\b/);
assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/);
assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
console.log("ini_panel_launch_api_manifest_node_smoke=ok");

View File

@@ -14,9 +14,14 @@ import {
createIniPanelShellIntegrationReadiness,
createIniPanelShellIntegrationSchema,
createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema,
getVisibleIniPanelEntries,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffSummary,
} from "../../../runtime/ui/ini-panel/ui-shell.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -30,6 +35,15 @@ const manifest = createIniPanelShellIntegrationManifest();
const readiness = createIniPanelShellIntegrationReadiness(manifest);
const workflowPlan = createIniPanelShellIntegrationWorkflowPlan({ manifest, readiness });
const handoffSummary = createIniPanelShellSessionHandoffSummary({ manifest, readiness, workflowPlan });
const handoffSummarySchema = createIniPanelShellSessionHandoffSummarySchema();
const handoffCompatibilityReport = createIniPanelShellSessionHandoffCompatibilityReport(handoffSummary);
const handoffDisplayViewModel = createIniPanelShellSessionHandoffDisplayViewModel(handoffCompatibilityReport);
const handoffSnapshot = createIniPanelShellSessionHandoffSnapshot({
readiness,
summary: handoffSummary,
compatibilityReport: handoffCompatibilityReport,
displayViewModel: handoffDisplayViewModel,
});
assert.deepEqual(schema, {
apiName: "ini-panel-shell-integration",
@@ -85,7 +99,7 @@ assert.deepEqual(readiness, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 9,
launchMethods: 14,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -133,6 +147,8 @@ assert.deepEqual(workflowPlan, {
},
});
assert.deepEqual(handoffSummary, {
apiName: "ini-panel-shell-session-handoff-summary",
summaryVersion: 1,
phase: "ready",
ready: true,
targetPage: {
@@ -145,7 +161,7 @@ assert.deepEqual(handoffSummary, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 9,
launchMethods: 14,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -189,6 +205,149 @@ assert.deepEqual(handoffSummary, {
},
blockingReasons: [],
});
assert.deepEqual(handoffSummarySchema, {
apiName: "ini-panel-shell-session-handoff-summary",
summaryVersion: 1,
fields: [
"apiName",
"summaryVersion",
"phase",
"ready",
"targetPage",
"readiness",
"persistenceCapabilities",
"readonlyStatusFields",
"handoffMethods",
"blockingReasons",
],
});
assert.equal(isSupportedIniPanelShellSessionHandoffSummary(handoffSummary), true);
assert.equal(
isSupportedIniPanelShellSessionHandoffSummary({ ...handoffSummary, summaryVersion: 2 }),
false,
);
assert.equal(
isSupportedIniPanelShellSessionHandoffSummary({ ...handoffSummary, apiName: "other" }),
false,
);
const missingSummaryField = { ...handoffSummary };
delete missingSummaryField.readonlyStatusFields;
assert.equal(isSupportedIniPanelShellSessionHandoffSummary(missingSummaryField), false);
assert.equal(isSupportedIniPanelShellSessionHandoffSummary(null), false);
assert.deepEqual(handoffCompatibilityReport, {
apiName: "ini-panel-shell-session-handoff-compatibility-report",
reportVersion: 1,
phase: "ready",
compatible: true,
summarySupported: true,
handoffReady: true,
schema: {
apiName: "ini-panel-shell-session-handoff-summary",
summaryVersion: 1,
fields: [
"apiName",
"summaryVersion",
"phase",
"ready",
"targetPage",
"readiness",
"persistenceCapabilities",
"readonlyStatusFields",
"handoffMethods",
"blockingReasons",
],
},
summary: {
apiName: "ini-panel-shell-session-handoff-summary",
summaryVersion: 1,
phase: "ready",
ready: true,
},
missingFields: [],
mismatchFields: [],
blockingReasons: [],
});
assert.deepEqual(handoffDisplayViewModel, {
phase: "ready",
title: "Shell handoff compatibility",
statusText: "Ready",
detailText: "No blocking reasons",
rows: [
{
id: "summary-supported",
label: "Summary schema",
value: "supported",
},
{
id: "handoff-ready",
label: "Handoff readiness",
value: "ready",
},
{
id: "missing-fields",
label: "Missing fields",
value: "none",
},
{
id: "mismatch-fields",
label: "Mismatched fields",
value: "none",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
value: "none",
},
],
});
assert.deepEqual(handoffSnapshot, {
apiName: "ini-panel-shell-session-handoff-snapshot",
snapshotVersion: 1,
phase: "ready",
ready: true,
readiness,
summary: handoffSummary,
compatibilityReport: handoffCompatibilityReport,
displayViewModel: handoffDisplayViewModel,
});
assert.equal(createIniPanelShellSessionHandoffSnapshot().displayViewModel.rows.length, 5);
assert.deepEqual(
createIniPanelShellSessionHandoffDisplayViewModel(
createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }),
).rows.find((row) => row.id === "mismatch-fields"),
{
id: "mismatch-fields",
label: "Mismatched fields",
value: "summaryVersion",
},
);
assert.deepEqual(
createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }),
{
...handoffCompatibilityReport,
phase: "blocked",
compatible: false,
summarySupported: false,
handoffReady: false,
summary: {
apiName: "ini-panel-shell-session-handoff-summary",
summaryVersion: 2,
phase: "ready",
ready: true,
},
mismatchFields: ["summaryVersion"],
},
);
const missingFieldReportInput = { ...handoffSummary };
delete missingFieldReportInput.readonlyStatusFields;
assert.deepEqual(
createIniPanelShellSessionHandoffCompatibilityReport(missingFieldReportInput).missingFields,
["readonlyStatusFields"],
);
assert.deepEqual(
createIniPanelShellSessionHandoffCompatibilityReport(null).missingFields,
handoffSummarySchema.fields,
);
const blockedManifest = {
...createIniPanelShellIntegrationManifest(),
compatibility: {
@@ -210,7 +369,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 9,
launchMethods: 14,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -239,6 +398,22 @@ assert.deepEqual(
}).blockingReasons,
["launchCompatibility"],
);
assert.deepEqual(
createIniPanelShellSessionHandoffCompatibilityReport(createIniPanelShellSessionHandoffSummary({
manifest: blockedManifest,
readiness: createIniPanelShellIntegrationReadiness(blockedManifest),
workflowPlan: blockedWorkflowPlan,
})).blockingReasons,
["launchCompatibility"],
);
assert.equal(
createIniPanelShellSessionHandoffCompatibilityReport(createIniPanelShellSessionHandoffSummary({
manifest: blockedManifest,
readiness: createIniPanelShellIntegrationReadiness(blockedManifest),
workflowPlan: blockedWorkflowPlan,
})).compatible,
false,
);
const missingTargetPlan = createIniPanelShellIntegrationWorkflowPlan({
manifest,
controlEntryId: "missing-entry",
@@ -337,7 +512,12 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationSchema\
assert.match(shellText, /\bexport function createIniPanelShellIntegrationManifest\b/);
assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadiness\b/);
assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\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 isSupportedIniPanelShellIntegrationManifest\b/);
assert.match(launchText, /\bgetShellIntegrationSchema\b/);
assert.match(launchText, /\bgetShellIntegrationManifest\b/);
@@ -345,7 +525,12 @@ assert.match(launchText, /\bgetShellIntegrationReadiness\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationManifest\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationReadiness\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/);
assert.match(docText, /\bisSupportedIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\bisSupportedIniPanelShellIntegrationManifest\b/);
assert.doesNotMatch(shellText, /\bparseGcode\b|\bcanonicalEvents\b|\btoolTable\b|\bplanner\b/);

View File

@@ -14,7 +14,11 @@ import {
createIniPanelShellIntegrationReadiness,
createIniPanelShellIntegrationSchema,
createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema,
createIniPanelShellViewModel,
createMachineSessionReadonlyStatus,
createMachineSessionReadonlyStatusApiManifest,
@@ -27,6 +31,7 @@ import {
isSupportedIniPanelControlPageApiManifest,
isSupportedIniPanelLaunchApiManifest,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffSummary,
loadMachineSessionForControlPageWorkflow,
readMachineSessionReadonlyStatus,
refreshMachineSessionControlPage,
@@ -67,7 +72,11 @@ assert.equal(typeof createIniPanelShellIntegrationManifest, "function");
assert.equal(typeof createIniPanelShellIntegrationReadiness, "function");
assert.equal(typeof createIniPanelShellIntegrationSchema, "function");
assert.equal(typeof createIniPanelShellIntegrationWorkflowPlan, "function");
assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function");
assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSnapshot, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSummary, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSummarySchema, "function");
assert.equal(typeof loadMachineSessionForControlPageWorkflow, "function");
assert.equal(typeof readMachineSessionReadonlyStatus, "function");
assert.equal(typeof refreshMachineSessionControlPage, "function");
@@ -75,6 +84,7 @@ assert.equal(typeof renderMachineSessionControlView, "function");
assert.equal(typeof isSupportedIniPanelControlPageApiManifest, "function");
assert.equal(typeof isSupportedIniPanelLaunchApiManifest, "function");
assert.equal(typeof isSupportedIniPanelShellIntegrationManifest, "function");
assert.equal(typeof isSupportedIniPanelShellSessionHandoffSummary, "function");
const shellManifest = getIniPanelEntryManifest();
shellManifest[0].title = "changed";
@@ -132,6 +142,58 @@ assert.deepEqual(
workflowPlan: shellViewModel.shellIntegrationWorkflowPlan,
}),
);
assert.deepEqual(shellViewModel.shellSessionHandoffSummarySchema, createIniPanelShellSessionHandoffSummarySchema());
assert.equal(isSupportedIniPanelShellSessionHandoffSummary(shellViewModel.shellSessionHandoffSummary), true);
assert.deepEqual(
shellViewModel.shellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffCompatibilityReport(shellViewModel.shellSessionHandoffSummary),
);
assert.deepEqual(
shellViewModel.shellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffDisplayViewModel(shellViewModel.shellSessionHandoffCompatibilityReport),
);
assert.deepEqual(
shellViewModel.shellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSnapshot({
readiness: shellViewModel.shellIntegrationReadiness,
summary: shellViewModel.shellSessionHandoffSummary,
compatibilityReport: shellViewModel.shellSessionHandoffCompatibilityReport,
displayViewModel: shellViewModel.shellSessionHandoffDisplayViewModel,
}),
);
assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
phase: "ready",
title: "Shell handoff compatibility",
statusText: "Ready",
detailText: "No blocking reasons",
rows: [
{
id: "summary-supported",
label: "Summary schema",
value: "supported",
},
{
id: "handoff-ready",
label: "Handoff readiness",
value: "ready",
},
{
id: "missing-fields",
label: "Missing fields",
value: "none",
},
{
id: "mismatch-fields",
label: "Mismatched fields",
value: "none",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
value: "none",
},
],
});
assert.equal(
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
true,
@@ -164,7 +226,18 @@ assert.equal(shellViewModel.controlPage.createController, createMachineSessionCo
assert.equal(shellViewModel.isSupportedShellIntegrationManifest, isSupportedIniPanelShellIntegrationManifest);
assert.equal(shellViewModel.createShellIntegrationReadiness, createIniPanelShellIntegrationReadiness);
assert.equal(shellViewModel.createShellIntegrationWorkflowPlan, createIniPanelShellIntegrationWorkflowPlan);
assert.equal(shellViewModel.isSupportedShellSessionHandoffSummary, isSupportedIniPanelShellSessionHandoffSummary);
assert.equal(shellViewModel.createShellSessionHandoffSummarySchema, createIniPanelShellSessionHandoffSummarySchema);
assert.equal(shellViewModel.createShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummary);
assert.equal(
shellViewModel.createShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffCompatibilityReport,
);
assert.equal(
shellViewModel.createShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffDisplayViewModel,
);
assert.equal(shellViewModel.createShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot);
assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract());
assert.equal(shellViewModel.controlPage.isSupportedBrowserApiManifest, isSupportedIniPanelControlPageApiManifest);
assert.equal(shellViewModel.controlPage.loadSessionState, loadMachineSessionForControlPageWorkflow);