新增 INI 面板 session readiness workflow report

This commit is contained in:
2026-06-16 07:04:04 +08:00
parent eb50e6b455
commit ce3d08ef61
12 changed files with 225 additions and 5 deletions

View File

@@ -41,6 +41,7 @@ import {
mountIniPanelShellSessionHandoff,
mountIniPanelShellSessionHandoffFromControlPage,
createIniPanelShellSessionHandoffWorkflowSummary,
createIniPanelShellSessionReadinessWorkflowReport,
createIniPanelShellSessionHandoffWorkflowDisplayViewModel,
createIniPanelShellSessionHandoffWorkflowRenderState,
createIniPanelShellSessionHandoffWorkflowDomContract,
@@ -295,6 +296,13 @@ the expected handoff status fields as a structured ready/blocked result. Use
outer shell needs one stable end-to-end summary that combines mount workflow,
control-page mount workflow, readonly status result, machine-session
ready/blocked state, and current blocking reasons into display rows. Use
`createIniPanelShellSessionReadinessWorkflowReport()` or
`linuxCncIniPanelLaunchApi.getShellSessionReadinessWorkflowReport()` when an
outer shell needs a machine-readable report for just the session readiness
phase, missing reasons, and stable rows. The workflow overview page exposes
the same report through
`linuxCncIniPanelWorkflowOverviewApi.getWorkflowOverviewSessionReadinessReport()`.
Use
`createIniPanelShellSessionHandoffWorkflowDisplayViewModel()` or
`linuxCncIniPanelLaunchApi.getShellSessionHandoffWorkflowDisplayViewModel()`
when an outer shell needs that end-to-end summary compressed into stable

View File

@@ -117,6 +117,7 @@
mountIniPanelShellSessionHandoffFromControlPage,
readIniPanelShellSessionHandoffStatusFromControlPage,
createIniPanelShellSessionHandoffWorkflowSummary,
createIniPanelShellSessionReadinessWorkflowReport,
createIniPanelShellSessionHandoffWorkflowDisplayViewModel,
createIniPanelShellSessionHandoffWorkflowRenderState,
createIniPanelShellSessionHandoffWorkflowDomContract,
@@ -245,6 +246,11 @@
}),
})
),
getShellSessionReadinessWorkflowReport: (options) => (
createIniPanelShellSessionReadinessWorkflowReport(options ?? {
workflowSummary: shellViewModel.shellSessionHandoffWorkflowSummary,
})
),
getShellSessionHandoffWorkflowDisplayViewModel: (options) => (
createIniPanelShellSessionHandoffWorkflowDisplayViewModel(
options ?? shellViewModel.shellSessionHandoffWorkflowSummary,

View File

@@ -160,6 +160,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
"mountShellSessionHandoffFromControlPage",
"readShellSessionHandoffStatusFromControlPage",
"getShellSessionHandoffWorkflowSummary",
"getShellSessionReadinessWorkflowReport",
"getShellSessionHandoffWorkflowDisplayViewModel",
"getShellSessionHandoffWorkflowRenderState",
"getShellSessionHandoffWorkflowDomContract",
@@ -1548,6 +1549,60 @@ export function createIniPanelShellSessionHandoffWorkflowDisplayViewModel(
};
}
export function createIniPanelShellSessionReadinessWorkflowReport({
workflowSummary = null,
readonlyStatusResult = null,
} = {}) {
const sessionReadiness = workflowSummary?.sessionReadiness
?? readonlyStatusResult?.readonlyStatus?.sessionReadiness
?? null;
const missing = Array.isArray(sessionReadiness?.missing)
? [...sessionReadiness.missing]
: [];
const ready = sessionReadiness?.ready === true;
const phase = sessionReadiness ? (ready ? "ready" : "blocked") : "blocked";
const statusLine = sessionReadiness
? (
ready
? "Ready: session readiness available"
: `Blocked: ${missing.length > 0 ? missing.join(", ") : "session readiness blocked"}`
)
: "Blocked: session readiness unavailable";
return {
apiName: "ini-panel-shell-session-readiness-workflow-report",
reportVersion: 1,
phase,
ready,
statusLine,
sessionReadiness: sessionReadiness
? {
phase: sessionReadiness.phase ?? phase,
ready,
missing,
}
: null,
missing,
rows: [
{
id: "session-readiness",
label: "Session readiness",
value: sessionReadiness ? (ready ? "ready" : "blocked") : "missing",
},
{
id: "session-readiness-phase",
label: "Session readiness phase",
value: sessionReadiness?.phase ?? "missing",
},
{
id: "session-readiness-missing",
label: "Session readiness missing",
value: missing.length > 0 ? missing.join(", ") : "none",
},
],
};
}
export function createIniPanelShellSessionHandoffWorkflowRenderState(
displayViewModel = createIniPanelShellSessionHandoffWorkflowDisplayViewModel(),
) {
@@ -1615,6 +1670,7 @@ export function createIniPanelShellWorkflowOverviewContract() {
"getWorkflowOverviewRenderState",
"getWorkflowOverviewDisplayViewModel",
"getWorkflowOverviewSummary",
"getWorkflowOverviewSessionReadinessReport",
"getWorkflowOverviewDomContract",
"getWorkflowOverviewDomReadiness",
"renderWorkflowOverview",
@@ -2521,6 +2577,9 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
handoffSummary: shellSessionHandoffSummary,
}),
});
const shellSessionReadinessWorkflowReport = createIniPanelShellSessionReadinessWorkflowReport({
workflowSummary: shellSessionHandoffWorkflowSummary,
});
const shellSessionHandoffWorkflowDisplayViewModel = createIniPanelShellSessionHandoffWorkflowDisplayViewModel(
shellSessionHandoffWorkflowSummary,
);
@@ -2558,6 +2617,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
shellSessionHandoffPackageMountRenderState,
shellSessionHandoffMountDomContract,
shellSessionHandoffWorkflowSummary,
shellSessionReadinessWorkflowReport,
shellSessionHandoffWorkflowDisplayViewModel,
shellSessionHandoffWorkflowRenderState,
shellSessionHandoffWorkflowDomContract,
@@ -2591,6 +2651,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
mountShellSessionHandoffFromControlPage: mountIniPanelShellSessionHandoffFromControlPage,
readShellSessionHandoffStatusFromControlPage: readIniPanelShellSessionHandoffStatusFromControlPage,
createShellSessionHandoffWorkflowSummary: createIniPanelShellSessionHandoffWorkflowSummary,
createShellSessionReadinessWorkflowReport: createIniPanelShellSessionReadinessWorkflowReport,
createShellSessionHandoffWorkflowDisplayViewModel: createIniPanelShellSessionHandoffWorkflowDisplayViewModel,
createShellSessionHandoffWorkflowRenderState: createIniPanelShellSessionHandoffWorkflowRenderState,
createShellSessionHandoffWorkflowDomContract: createIniPanelShellSessionHandoffWorkflowDomContract,

View File

@@ -87,6 +87,7 @@
createIniPanelShellSessionHandoffWorkflowDomContract,
createIniPanelShellSessionHandoffWorkflowDomReadiness,
createIniPanelShellSessionHandoffWorkflowRenderState,
createIniPanelShellSessionReadinessWorkflowReport,
createIniPanelShellWorkflowOverviewContract,
createIniPanelShellWorkflowOverviewReadiness,
createIniPanelShellWorkflowOverviewEmbeddingReport,
@@ -115,6 +116,11 @@
getWorkflowOverviewRenderState: () => shellViewModel.shellSessionHandoffWorkflowRenderState,
getWorkflowOverviewDisplayViewModel: () => shellViewModel.shellSessionHandoffWorkflowDisplayViewModel,
getWorkflowOverviewSummary: () => shellViewModel.shellSessionHandoffWorkflowSummary,
getWorkflowOverviewSessionReadinessReport: (options) => (
createIniPanelShellSessionReadinessWorkflowReport(options ?? {
workflowSummary: shellViewModel.shellSessionHandoffWorkflowSummary,
})
),
getWorkflowOverviewDomContract: (options) => (
createIniPanelShellSessionHandoffWorkflowDomContract(options)
),

View File

@@ -99,6 +99,7 @@
!launchApi?.getShellSessionHandoffPackageMountState ||
!launchApi?.getShellSessionHandoffPackageMountDisplayViewModel ||
!launchApi?.getShellSessionHandoffPackageMountRenderState ||
!launchApi?.getShellSessionReadinessWorkflowReport ||
!launchApi?.renderShellSessionHandoffMountState ||
!launchApi?.getWorkflowOverviewContract ||
!launchApi?.getWorkflowOverviewReadiness ||
@@ -178,6 +179,7 @@
const shellSessionHandoffPackageMountState = launchApi.getShellSessionHandoffPackageMountState();
const shellSessionHandoffPackageMountDisplayViewModel = launchApi.getShellSessionHandoffPackageMountDisplayViewModel();
const shellSessionHandoffPackageMountRenderState = launchApi.getShellSessionHandoffPackageMountRenderState();
const shellSessionReadinessWorkflowReport = launchApi.getShellSessionReadinessWorkflowReport();
const workflowOverviewContract = launchApi.getWorkflowOverviewContract();
assertEqual(
shellIntegrationSchema.manifestVersion,
@@ -424,6 +426,16 @@
"Blocked: session-load-state",
"shell session handoff package mount render-state status",
);
assertEqual(
shellSessionReadinessWorkflowReport.apiName,
"ini-panel-shell-session-readiness-workflow-report",
"shell session readiness workflow report API",
);
assertEqual(
shellSessionReadinessWorkflowReport.rows.length,
3,
"shell session readiness workflow report rows",
);
assertEqual(
workflowOverviewContract.pageHref,
"./workflow-overview.html",

View File

@@ -100,6 +100,7 @@ TOOL_TABLE = browser-shell-tool.tbl
!launchApi?.mountShellSessionHandoffFromControlPage ||
!launchApi?.readShellSessionHandoffStatusFromControlPage ||
!launchApi?.getShellSessionHandoffWorkflowSummary ||
!launchApi?.getShellSessionReadinessWorkflowReport ||
!launchApi?.getShellSessionHandoffWorkflowDisplayViewModel ||
!launchApi?.getShellSessionHandoffWorkflowRenderState ||
!launchApi?.getShellSessionHandoffWorkflowDomContract ||
@@ -511,6 +512,9 @@ TOOL_TABLE = browser-shell-tool.tbl
controlPageMountWorkflow: readyControlPageMountWorkflow,
readonlyStatusResult,
});
const sessionReadinessWorkflowReport = launchApi.getShellSessionReadinessWorkflowReport({
workflowSummary: workflowSummaryResult,
});
const workflowDisplayResult = launchApi.getShellSessionHandoffWorkflowDisplayViewModel(
workflowSummaryResult,
);
@@ -548,6 +552,16 @@ TOOL_TABLE = browser-shell-tool.tbl
);
assertEqual(workflowSummaryResult.phase, "ready", "shell handoff workflow summary phase");
assertEqual(workflowSummaryResult.ready, true, "shell handoff workflow summary readiness");
assertEqual(
sessionReadinessWorkflowReport.ready,
true,
"shell handoff session readiness workflow report",
);
assertEqual(
sessionReadinessWorkflowReport.rows.length,
3,
"shell handoff session readiness workflow report rows",
);
assertEqual(
workflowSummaryResult.sessionReadiness.ready,
true,

View File

@@ -31,6 +31,7 @@
!workflowApi?.getWorkflowOverviewRenderState ||
!workflowApi?.getWorkflowOverviewDisplayViewModel ||
!workflowApi?.getWorkflowOverviewSummary ||
!workflowApi?.getWorkflowOverviewSessionReadinessReport ||
!workflowApi?.getWorkflowOverviewDomContract ||
!workflowApi?.getWorkflowOverviewDomReadiness ||
!workflowApi?.renderWorkflowOverview ||
@@ -56,6 +57,7 @@
const renderState = workflowApi.getWorkflowOverviewRenderState();
const displayViewModel = workflowApi.getWorkflowOverviewDisplayViewModel();
const summary = workflowApi.getWorkflowOverviewSummary();
const sessionReadinessReport = workflowApi.getWorkflowOverviewSessionReadinessReport();
const domContract = workflowApi.getWorkflowOverviewDomContract();
const domReadiness = workflowApi.getWorkflowOverviewDomReadiness();
const renderResult = workflowApi.renderWorkflowOverview();
@@ -78,6 +80,12 @@
const embeddingDomReadiness = workflowApi.getWorkflowOverviewEmbeddingDomReadiness();
assertEqual(summary.summaryVersion, 1, "workflow overview summary version");
assertEqual(
sessionReadinessReport.apiName,
"ini-panel-shell-session-readiness-workflow-report",
"workflow overview session readiness report API name",
);
assertEqual(sessionReadinessReport.rows.length, 3, "workflow overview session readiness report rows");
assertEqual(displayViewModel.title, "Shell handoff workflow", "workflow overview display title");
assertEqual(renderState.renderStateVersion, 1, "workflow overview render-state version");
assertEqual(renderState.dataset.handoffScope, "workflow", "workflow overview render-state scope");

View File

@@ -70,6 +70,7 @@ assert.deepEqual(manifest, {
"mountShellSessionHandoffFromControlPage",
"readShellSessionHandoffStatusFromControlPage",
"getShellSessionHandoffWorkflowSummary",
"getShellSessionReadinessWorkflowReport",
"getShellSessionHandoffWorkflowDisplayViewModel",
"getShellSessionHandoffWorkflowRenderState",
"getShellSessionHandoffWorkflowDomContract",
@@ -226,6 +227,7 @@ assert.match(launchText, /\bmountShellSessionHandoff\b/);
assert.match(launchText, /\bmountShellSessionHandoffFromControlPage\b/);
assert.match(launchText, /\breadShellSessionHandoffStatusFromControlPage\b/);
assert.match(launchText, /\bgetShellSessionHandoffWorkflowSummary\b/);
assert.match(launchText, /\bgetShellSessionReadinessWorkflowReport\b/);
assert.match(launchText, /\bgetShellSessionHandoffWorkflowDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffWorkflowRenderState\b/);
assert.match(launchText, /\bgetShellSessionHandoffWorkflowDomContract\b/);

View File

@@ -29,6 +29,7 @@ import {
mountIniPanelShellSessionHandoffFromControlPage,
readIniPanelShellSessionHandoffStatusFromControlPage,
createIniPanelShellSessionHandoffWorkflowSummary,
createIniPanelShellSessionReadinessWorkflowReport,
createIniPanelShellSessionHandoffWorkflowDisplayViewModel,
createIniPanelShellSessionHandoffWorkflowRenderState,
createIniPanelShellSessionHandoffWorkflowDomContract,
@@ -177,7 +178,7 @@ assert.deepEqual(readiness, {
counts: {
pages: 3,
launcherLinks: 3,
launchMethods: 55,
launchMethods: 56,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -240,7 +241,7 @@ assert.deepEqual(handoffSummary, {
counts: {
pages: 3,
launcherLinks: 3,
launchMethods: 55,
launchMethods: 56,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -745,6 +746,7 @@ assert.equal(
createIniPanelShellSessionHandoffWorkflowSummary().phase,
"blocked",
);
assert.equal(createIniPanelShellSessionReadinessWorkflowReport().phase, "blocked");
assert.equal(
createIniPanelShellSessionHandoffWorkflowDisplayViewModel().phase,
"blocked",
@@ -773,6 +775,7 @@ assert.deepEqual(createIniPanelShellWorkflowOverviewContract(), {
"getWorkflowOverviewRenderState",
"getWorkflowOverviewDisplayViewModel",
"getWorkflowOverviewSummary",
"getWorkflowOverviewSessionReadinessReport",
"getWorkflowOverviewDomContract",
"getWorkflowOverviewDomReadiness",
"renderWorkflowOverview",
@@ -814,6 +817,7 @@ assert.deepEqual(
createIniPanelShellWorkflowOverviewReadiness({
overviewApi: {
getWorkflowOverviewRenderState: () => handoffPackageRenderState,
getWorkflowOverviewSessionReadinessReport: () => createIniPanelShellSessionReadinessWorkflowReport(),
},
}).missing,
[
@@ -1238,7 +1242,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
counts: {
pages: 3,
launcherLinks: 3,
launchMethods: 55,
launchMethods: 56,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -1413,6 +1417,7 @@ assert.match(shellText, /\bexport function mountIniPanelShellSessionHandoff\b/);
assert.match(shellText, /\bexport function mountIniPanelShellSessionHandoffFromControlPage\b/);
assert.match(shellText, /\bexport function readIniPanelShellSessionHandoffStatusFromControlPage\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffWorkflowSummary\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionReadinessWorkflowReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffWorkflowDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffWorkflowRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffWorkflowDomContract\b/);

View File

@@ -29,6 +29,7 @@ import {
mountIniPanelShellSessionHandoffFromControlPage,
readIniPanelShellSessionHandoffStatusFromControlPage,
createIniPanelShellSessionHandoffWorkflowSummary,
createIniPanelShellSessionReadinessWorkflowReport,
createIniPanelShellSessionHandoffWorkflowDisplayViewModel,
createIniPanelShellSessionHandoffWorkflowRenderState,
createIniPanelShellSessionHandoffWorkflowDomContract,
@@ -662,6 +663,7 @@ assert.deepEqual(shellViewModel.shellWorkflowOverviewContract, {
"getWorkflowOverviewRenderState",
"getWorkflowOverviewDisplayViewModel",
"getWorkflowOverviewSummary",
"getWorkflowOverviewSessionReadinessReport",
"getWorkflowOverviewDomContract",
"getWorkflowOverviewDomReadiness",
"renderWorkflowOverview",
@@ -790,6 +792,10 @@ assert.equal(
shellViewModel.createShellSessionHandoffWorkflowSummary,
createIniPanelShellSessionHandoffWorkflowSummary,
);
assert.equal(
shellViewModel.createShellSessionReadinessWorkflowReport,
createIniPanelShellSessionReadinessWorkflowReport,
);
assert.equal(
shellViewModel.createShellSessionHandoffWorkflowDisplayViewModel,
createIniPanelShellSessionHandoffWorkflowDisplayViewModel,
@@ -1111,6 +1117,19 @@ assert.deepEqual(workflowSummaryResult.sessionReadiness, {
assert.equal(workflowSummaryResult.rows.find(({ id }) => id === "session-readiness")?.value, "ready");
assert.equal(workflowSummaryResult.rows.length, 6);
assert.equal(workflowSummaryResult.blockingReasons[0], "mount:blocked");
const sessionReadinessWorkflowReport = createIniPanelShellSessionReadinessWorkflowReport({
workflowSummary: workflowSummaryResult,
});
assert.equal(sessionReadinessWorkflowReport.apiName, "ini-panel-shell-session-readiness-workflow-report");
assert.equal(sessionReadinessWorkflowReport.reportVersion, 1);
assert.equal(sessionReadinessWorkflowReport.phase, "ready");
assert.equal(sessionReadinessWorkflowReport.ready, true);
assert.equal(sessionReadinessWorkflowReport.statusLine, "Ready: session readiness available");
assert.deepEqual(sessionReadinessWorkflowReport.missing, []);
assert.equal(sessionReadinessWorkflowReport.rows.length, 3);
assert.equal(sessionReadinessWorkflowReport.rows[0].value, "ready");
assert.equal(shellViewModel.shellSessionReadinessWorkflowReport.ready, false);
assert.equal(shellViewModel.shellSessionReadinessWorkflowReport.rows.length, 3);
const readyWorkflowSummaryResult = createIniPanelShellSessionHandoffWorkflowSummary({
mountWorkflow: {
phase: "ready",
@@ -1230,6 +1249,7 @@ const workflowOverviewApi = {
getWorkflowOverviewRenderState: () => workflowRenderState,
getWorkflowOverviewDisplayViewModel: () => workflowDisplayViewModel,
getWorkflowOverviewSummary: () => workflowSummaryResult,
getWorkflowOverviewSessionReadinessReport: () => sessionReadinessWorkflowReport,
getWorkflowOverviewDomContract: createIniPanelShellSessionHandoffWorkflowDomContract,
getWorkflowOverviewDomReadiness: createIniPanelShellSessionHandoffWorkflowDomReadiness,
renderWorkflowOverview: renderIniPanelShellSessionHandoffWorkflowState,