新增 INI 面板 shell API surface inventory
This commit is contained in:
@@ -251,6 +251,14 @@
|
||||
workflowSummary: shellViewModel.shellSessionHandoffWorkflowSummary,
|
||||
})
|
||||
),
|
||||
getShellApiSurfaceInventory: (options) => (
|
||||
shellViewModel.createShellApiSurfaceInventory(options ?? {
|
||||
launchApiManifest: shellViewModel.launchApiManifest,
|
||||
controlPageApiManifest: shellViewModel.controlPage.browserApiManifest,
|
||||
workflowOverviewContract: shellViewModel.shellWorkflowOverviewContract,
|
||||
sessionReadinessWorkflowReport: shellViewModel.shellSessionReadinessWorkflowReport,
|
||||
})
|
||||
),
|
||||
getShellSessionHandoffWorkflowDisplayViewModel: (options) => (
|
||||
createIniPanelShellSessionHandoffWorkflowDisplayViewModel(
|
||||
options ?? shellViewModel.shellSessionHandoffWorkflowSummary,
|
||||
|
||||
@@ -161,6 +161,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
|
||||
"readShellSessionHandoffStatusFromControlPage",
|
||||
"getShellSessionHandoffWorkflowSummary",
|
||||
"getShellSessionReadinessWorkflowReport",
|
||||
"getShellApiSurfaceInventory",
|
||||
"getShellSessionHandoffWorkflowDisplayViewModel",
|
||||
"getShellSessionHandoffWorkflowRenderState",
|
||||
"getShellSessionHandoffWorkflowDomContract",
|
||||
@@ -1603,6 +1604,110 @@ export function createIniPanelShellSessionReadinessWorkflowReport({
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellApiSurfaceInventory({
|
||||
launchApiManifest = createIniPanelLaunchApiManifest(),
|
||||
controlPageApiManifest = createControlPageBrowserApiManifest(),
|
||||
workflowOverviewContract = createIniPanelShellWorkflowOverviewContract(),
|
||||
sessionReadinessWorkflowReport = createIniPanelShellSessionReadinessWorkflowReport(),
|
||||
} = {}) {
|
||||
const launchMethods = Array.isArray(launchApiManifest?.methods) ? launchApiManifest.methods : [];
|
||||
const controlPageMethods = Array.isArray(controlPageApiManifest?.methods) ? controlPageApiManifest.methods : [];
|
||||
const workflowOverviewMethods = Array.isArray(workflowOverviewContract?.methodNames)
|
||||
? workflowOverviewContract.methodNames
|
||||
: [];
|
||||
const persistenceCapabilities = Array.isArray(launchApiManifest?.persistenceCapabilities)
|
||||
? launchApiManifest.persistenceCapabilities
|
||||
: [];
|
||||
const sessionReadinessRows = Array.isArray(sessionReadinessWorkflowReport?.rows)
|
||||
? sessionReadinessWorkflowReport.rows
|
||||
: [];
|
||||
const ready = Boolean(
|
||||
launchApiManifest?.apiName
|
||||
&& controlPageApiManifest?.apiName
|
||||
&& workflowOverviewContract?.apiName
|
||||
&& sessionReadinessWorkflowReport?.apiName,
|
||||
);
|
||||
|
||||
return {
|
||||
apiName: "ini-panel-shell-api-surface-inventory",
|
||||
inventoryVersion: 1,
|
||||
phase: ready ? "ready" : "blocked",
|
||||
ready,
|
||||
counts: {
|
||||
launchMethods: launchMethods.length,
|
||||
controlPageMethods: controlPageMethods.length,
|
||||
workflowOverviewMethods: workflowOverviewMethods.length,
|
||||
persistenceCapabilities: persistenceCapabilities.length,
|
||||
sessionReadinessRows: sessionReadinessRows.length,
|
||||
},
|
||||
apiNames: {
|
||||
launch: launchApiManifest?.apiName ?? null,
|
||||
controlPage: controlPageApiManifest?.apiName ?? null,
|
||||
workflowOverview: workflowOverviewContract?.apiName ?? null,
|
||||
sessionReadinessReport: sessionReadinessWorkflowReport?.apiName ?? null,
|
||||
},
|
||||
entries: [
|
||||
{
|
||||
id: "launch-api",
|
||||
label: "Launch API",
|
||||
apiName: launchApiManifest?.apiName ?? null,
|
||||
count: launchMethods.length,
|
||||
},
|
||||
{
|
||||
id: "control-page-api",
|
||||
label: "Control-page API",
|
||||
apiName: controlPageApiManifest?.apiName ?? null,
|
||||
count: controlPageMethods.length,
|
||||
},
|
||||
{
|
||||
id: "workflow-overview-api",
|
||||
label: "Workflow overview API",
|
||||
apiName: workflowOverviewContract?.apiName ?? null,
|
||||
count: workflowOverviewMethods.length,
|
||||
},
|
||||
{
|
||||
id: "session-readiness-report",
|
||||
label: "Session readiness report",
|
||||
apiName: sessionReadinessWorkflowReport?.apiName ?? null,
|
||||
count: sessionReadinessRows.length,
|
||||
},
|
||||
{
|
||||
id: "persistence-capabilities",
|
||||
label: "Persistence capabilities",
|
||||
apiName: launchApiManifest?.apiName ?? null,
|
||||
count: persistenceCapabilities.length,
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
{
|
||||
id: "launch-methods",
|
||||
label: "Launch methods",
|
||||
value: String(launchMethods.length),
|
||||
},
|
||||
{
|
||||
id: "control-page-methods",
|
||||
label: "Control-page methods",
|
||||
value: String(controlPageMethods.length),
|
||||
},
|
||||
{
|
||||
id: "workflow-overview-methods",
|
||||
label: "Workflow overview methods",
|
||||
value: String(workflowOverviewMethods.length),
|
||||
},
|
||||
{
|
||||
id: "session-readiness-report",
|
||||
label: "Session readiness report",
|
||||
value: sessionReadinessWorkflowReport?.apiName ?? "missing",
|
||||
},
|
||||
{
|
||||
id: "persistence-capabilities",
|
||||
label: "Persistence capabilities",
|
||||
value: String(persistenceCapabilities.length),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellSessionHandoffWorkflowRenderState(
|
||||
displayViewModel = createIniPanelShellSessionHandoffWorkflowDisplayViewModel(),
|
||||
) {
|
||||
@@ -1671,6 +1776,7 @@ export function createIniPanelShellWorkflowOverviewContract() {
|
||||
"getWorkflowOverviewDisplayViewModel",
|
||||
"getWorkflowOverviewSummary",
|
||||
"getWorkflowOverviewSessionReadinessReport",
|
||||
"getWorkflowOverviewApiSurfaceInventory",
|
||||
"getWorkflowOverviewDomContract",
|
||||
"getWorkflowOverviewDomReadiness",
|
||||
"renderWorkflowOverview",
|
||||
@@ -2588,6 +2694,12 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
);
|
||||
const shellSessionHandoffWorkflowDomContract = createIniPanelShellSessionHandoffWorkflowDomContract();
|
||||
const shellWorkflowOverviewContract = createIniPanelShellWorkflowOverviewContract();
|
||||
const shellApiSurfaceInventory = createIniPanelShellApiSurfaceInventory({
|
||||
launchApiManifest: shellIntegrationManifest.launchApiManifest,
|
||||
controlPageApiManifest: shellIntegrationManifest.controlPageApiManifest,
|
||||
workflowOverviewContract: shellWorkflowOverviewContract,
|
||||
sessionReadinessWorkflowReport: shellSessionReadinessWorkflowReport,
|
||||
});
|
||||
return {
|
||||
pages: entries.map(({ id, href, title }) => ({
|
||||
id,
|
||||
@@ -2622,6 +2734,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
shellSessionHandoffWorkflowRenderState,
|
||||
shellSessionHandoffWorkflowDomContract,
|
||||
shellWorkflowOverviewContract,
|
||||
shellApiSurfaceInventory,
|
||||
launchApiSchema: createIniPanelLaunchApiSchema(),
|
||||
launchApiManifest: createIniPanelLaunchApiManifest(entries),
|
||||
isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest,
|
||||
@@ -2652,6 +2765,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
readShellSessionHandoffStatusFromControlPage: readIniPanelShellSessionHandoffStatusFromControlPage,
|
||||
createShellSessionHandoffWorkflowSummary: createIniPanelShellSessionHandoffWorkflowSummary,
|
||||
createShellSessionReadinessWorkflowReport: createIniPanelShellSessionReadinessWorkflowReport,
|
||||
createShellApiSurfaceInventory: createIniPanelShellApiSurfaceInventory,
|
||||
createShellSessionHandoffWorkflowDisplayViewModel: createIniPanelShellSessionHandoffWorkflowDisplayViewModel,
|
||||
createShellSessionHandoffWorkflowRenderState: createIniPanelShellSessionHandoffWorkflowRenderState,
|
||||
createShellSessionHandoffWorkflowDomContract: createIniPanelShellSessionHandoffWorkflowDomContract,
|
||||
|
||||
@@ -121,6 +121,14 @@
|
||||
workflowSummary: shellViewModel.shellSessionHandoffWorkflowSummary,
|
||||
})
|
||||
),
|
||||
getWorkflowOverviewApiSurfaceInventory: (options) => (
|
||||
shellViewModel.createShellApiSurfaceInventory(options ?? {
|
||||
launchApiManifest: shellViewModel.launchApiManifest,
|
||||
controlPageApiManifest: shellViewModel.controlPage.browserApiManifest,
|
||||
workflowOverviewContract: shellViewModel.shellWorkflowOverviewContract,
|
||||
sessionReadinessWorkflowReport: shellViewModel.shellSessionReadinessWorkflowReport,
|
||||
})
|
||||
),
|
||||
getWorkflowOverviewDomContract: (options) => (
|
||||
createIniPanelShellSessionHandoffWorkflowDomContract(options)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user