推进 INI 面板 shell session handoff summary

This commit is contained in:
2026-06-15 08:06:00 +08:00
parent ee665c47be
commit b31b9a2f8a
6 changed files with 225 additions and 1 deletions

View File

@@ -380,9 +380,44 @@ export function createIniPanelShellIntegrationWorkflowPlan({
};
}
export function createIniPanelShellSessionHandoffSummary({
manifest = createIniPanelShellIntegrationManifest(),
readiness = createIniPanelShellIntegrationReadiness(manifest),
workflowPlan = createIniPanelShellIntegrationWorkflowPlan({ manifest, readiness }),
} = {}) {
const persistenceCapabilities = Array.isArray(manifest?.persistenceCapabilities)
? manifest.persistenceCapabilities.map(({ id, label, scope }) => ({ id, label, scope }))
: [];
const readonlyStatusFields = Array.isArray(workflowPlan?.readonlyStatusHandoff?.expectedStatusFields)
? [...workflowPlan.readonlyStatusHandoff.expectedStatusFields]
: [];
return {
phase: workflowPlan.ready ? "ready" : "blocked",
ready: Boolean(workflowPlan.ready),
targetPage: workflowPlan.targetPage,
readiness: {
phase: readiness.phase,
missing: [...readiness.missing],
counts: { ...readiness.counts },
apiNames: { ...readiness.apiNames },
},
persistenceCapabilities,
readonlyStatusFields,
handoffMethods: {
loadSessionState: workflowPlan.readonlyStatusHandoff.loadSessionStateMethod,
readStatus: workflowPlan.readonlyStatusHandoff.readStatusMethod,
},
blockingReasons: [...workflowPlan.missing],
};
}
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries);
const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest);
const shellIntegrationWorkflowPlan = createIniPanelShellIntegrationWorkflowPlan({
manifest: shellIntegrationManifest,
readiness: shellIntegrationReadiness,
});
return {
pages: entries.map(({ id, href, title }) => ({
id,
@@ -393,15 +428,18 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
shellIntegrationSchema: createIniPanelShellIntegrationSchema(),
shellIntegrationManifest,
shellIntegrationReadiness,
shellIntegrationWorkflowPlan: createIniPanelShellIntegrationWorkflowPlan({
shellIntegrationWorkflowPlan,
shellSessionHandoffSummary: createIniPanelShellSessionHandoffSummary({
manifest: shellIntegrationManifest,
readiness: shellIntegrationReadiness,
workflowPlan: shellIntegrationWorkflowPlan,
}),
launchApiSchema: createIniPanelLaunchApiSchema(),
launchApiManifest: createIniPanelLaunchApiManifest(entries),
isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest,
createShellIntegrationReadiness: createIniPanelShellIntegrationReadiness,
createShellIntegrationWorkflowPlan: createIniPanelShellIntegrationWorkflowPlan,
createShellSessionHandoffSummary: createIniPanelShellSessionHandoffSummary,
controlPage: {
browserApiSchema: createControlPageBrowserApiSchema(),
browserApiManifest: createControlPageBrowserApiManifest(),