推进 INI 面板 shell handoff workflow summary helper
This commit is contained in:
@@ -111,6 +111,7 @@
|
||||
mountIniPanelShellSessionHandoff,
|
||||
mountIniPanelShellSessionHandoffFromControlPage,
|
||||
readIniPanelShellSessionHandoffStatusFromControlPage,
|
||||
createIniPanelShellSessionHandoffWorkflowSummary,
|
||||
renderIniPanelShellSessionHandoffMountState,
|
||||
} from "./ui-shell.js";
|
||||
|
||||
@@ -214,6 +215,23 @@
|
||||
...(options ?? {}),
|
||||
})
|
||||
),
|
||||
getShellSessionHandoffWorkflowSummary: (options) => (
|
||||
createIniPanelShellSessionHandoffWorkflowSummary(options ?? {
|
||||
mountWorkflow: {
|
||||
phase: shellViewModel.shellSessionHandoffPackageMountRenderState.phase,
|
||||
ready: shellViewModel.shellSessionHandoffPackageMountRenderState.ready,
|
||||
statusLine: shellViewModel.shellSessionHandoffPackageMountRenderState.statusLine,
|
||||
},
|
||||
controlPageMountWorkflow: {
|
||||
phase: shellViewModel.shellSessionHandoffPackageMountState.phase,
|
||||
ready: shellViewModel.shellSessionHandoffPackageMountState.ready,
|
||||
statusLine: shellViewModel.shellSessionHandoffPackageMountState.statusLine,
|
||||
},
|
||||
readonlyStatusResult: shellViewModel.readShellSessionHandoffStatusFromControlPage({
|
||||
handoffSummary: shellViewModel.shellSessionHandoffSummary,
|
||||
}),
|
||||
})
|
||||
),
|
||||
isSupportedShellSessionHandoffPackage: shellViewModel.isSupportedShellSessionHandoffPackage,
|
||||
getLauncherLinks: () => shellViewModel.launcherLinks,
|
||||
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,
|
||||
|
||||
@@ -149,6 +149,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
|
||||
"mountShellSessionHandoff",
|
||||
"mountShellSessionHandoffFromControlPage",
|
||||
"readShellSessionHandoffStatusFromControlPage",
|
||||
"getShellSessionHandoffWorkflowSummary",
|
||||
"isSupportedShellSessionHandoffPackage",
|
||||
"getLauncherLinks",
|
||||
"getControlPageApiMethods",
|
||||
@@ -1376,6 +1377,103 @@ export function readIniPanelShellSessionHandoffStatusFromControlPage({
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellSessionHandoffWorkflowSummary({
|
||||
mountWorkflow = {
|
||||
phase: "blocked",
|
||||
ready: false,
|
||||
statusLine: "Blocked: mount workflow unavailable",
|
||||
},
|
||||
controlPageMountWorkflow = {
|
||||
phase: "blocked",
|
||||
ready: false,
|
||||
statusLine: "Blocked: control-page mount workflow unavailable",
|
||||
},
|
||||
readonlyStatusResult = {
|
||||
phase: "blocked",
|
||||
ready: false,
|
||||
statusLine: "Blocked: readonly status unavailable",
|
||||
missingStatusFields: [],
|
||||
},
|
||||
} = {}) {
|
||||
const blockingReasons = [];
|
||||
if (mountWorkflow?.ready !== true) {
|
||||
blockingReasons.push(`mount:${mountWorkflow?.phase ?? "blocked"}`);
|
||||
}
|
||||
if (controlPageMountWorkflow?.ready !== true) {
|
||||
blockingReasons.push(`control-page-mount:${controlPageMountWorkflow?.phase ?? "blocked"}`);
|
||||
}
|
||||
if (readonlyStatusResult?.ready !== true) {
|
||||
const readonlyDetail = readonlyStatusResult?.readError
|
||||
?? (
|
||||
Array.isArray(readonlyStatusResult?.missingStatusFields)
|
||||
&& readonlyStatusResult.missingStatusFields.length > 0
|
||||
? readonlyStatusResult.missingStatusFields.join(", ")
|
||||
: readonlyStatusResult?.phase ?? "blocked"
|
||||
);
|
||||
blockingReasons.push(`readonly-status:${readonlyDetail}`);
|
||||
}
|
||||
const ready = blockingReasons.length === 0;
|
||||
|
||||
return {
|
||||
apiName: "ini-panel-shell-session-handoff-workflow-summary",
|
||||
summaryVersion: 1,
|
||||
phase: ready ? "ready" : "blocked",
|
||||
ready,
|
||||
statusLine: ready
|
||||
? "Ready: shell handoff end-to-end workflow available"
|
||||
: `Blocked: ${blockingReasons.join("; ")}`,
|
||||
mountWorkflow: {
|
||||
phase: mountWorkflow?.phase ?? "blocked",
|
||||
ready: mountWorkflow?.ready === true,
|
||||
statusLine: mountWorkflow?.statusLine ?? null,
|
||||
},
|
||||
controlPageMountWorkflow: {
|
||||
phase: controlPageMountWorkflow?.phase ?? "blocked",
|
||||
ready: controlPageMountWorkflow?.ready === true,
|
||||
statusLine: controlPageMountWorkflow?.statusLine ?? null,
|
||||
},
|
||||
readonlyStatusResult: {
|
||||
phase: readonlyStatusResult?.phase ?? "blocked",
|
||||
ready: readonlyStatusResult?.ready === true,
|
||||
statusLine: readonlyStatusResult?.statusLine ?? null,
|
||||
missingStatusFields: Array.isArray(readonlyStatusResult?.missingStatusFields)
|
||||
? [...readonlyStatusResult.missingStatusFields]
|
||||
: [],
|
||||
},
|
||||
blockingReasons,
|
||||
rows: [
|
||||
{
|
||||
id: "mount-workflow",
|
||||
label: "Mount workflow",
|
||||
value: mountWorkflow?.statusLine ?? "missing",
|
||||
},
|
||||
{
|
||||
id: "control-page-mount-workflow",
|
||||
label: "Control-page mount workflow",
|
||||
value: controlPageMountWorkflow?.statusLine ?? "missing",
|
||||
},
|
||||
{
|
||||
id: "readonly-status-workflow",
|
||||
label: "Readonly status workflow",
|
||||
value: readonlyStatusResult?.statusLine ?? "missing",
|
||||
},
|
||||
{
|
||||
id: "readonly-status-missing-fields",
|
||||
label: "Readonly missing fields",
|
||||
value: Array.isArray(readonlyStatusResult?.missingStatusFields)
|
||||
&& readonlyStatusResult.missingStatusFields.length > 0
|
||||
? readonlyStatusResult.missingStatusFields.join(", ")
|
||||
: "none",
|
||||
},
|
||||
{
|
||||
id: "blocking-reasons",
|
||||
label: "Blocking reasons",
|
||||
value: blockingReasons.length > 0 ? blockingReasons.join("; ") : "none",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
|
||||
const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries);
|
||||
const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest);
|
||||
@@ -1496,6 +1594,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
mountShellSessionHandoff: mountIniPanelShellSessionHandoff,
|
||||
mountShellSessionHandoffFromControlPage: mountIniPanelShellSessionHandoffFromControlPage,
|
||||
readShellSessionHandoffStatusFromControlPage: readIniPanelShellSessionHandoffStatusFromControlPage,
|
||||
createShellSessionHandoffWorkflowSummary: createIniPanelShellSessionHandoffWorkflowSummary,
|
||||
isSupportedShellSessionHandoffPackage: isSupportedIniPanelShellSessionHandoffPackage,
|
||||
controlPage: {
|
||||
browserApiSchema: createControlPageBrowserApiSchema(),
|
||||
|
||||
Reference in New Issue
Block a user