推进 INI 面板 workflow overview embedding report
This commit is contained in:
@@ -279,6 +279,9 @@
|
||||
mountWorkflowOverviewEmbedding: (options) => (
|
||||
shellViewModel.mountWorkflowOverviewEmbedding(options)
|
||||
),
|
||||
getWorkflowOverviewEmbeddingReport: (embeddingResult, contract) => (
|
||||
shellViewModel.createWorkflowOverviewEmbeddingReport(embeddingResult, contract)
|
||||
),
|
||||
isSupportedShellSessionHandoffPackage: shellViewModel.isSupportedShellSessionHandoffPackage,
|
||||
getLauncherLinks: () => shellViewModel.launcherLinks,
|
||||
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,
|
||||
|
||||
@@ -159,6 +159,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
|
||||
"getWorkflowOverviewContract",
|
||||
"getWorkflowOverviewReadiness",
|
||||
"mountWorkflowOverviewEmbedding",
|
||||
"getWorkflowOverviewEmbeddingReport",
|
||||
"isSupportedShellSessionHandoffPackage",
|
||||
"getLauncherLinks",
|
||||
"getControlPageApiMethods",
|
||||
@@ -1807,6 +1808,86 @@ export function mountIniPanelShellWorkflowOverviewEmbedding({
|
||||
}
|
||||
}
|
||||
|
||||
export function createIniPanelShellWorkflowOverviewEmbeddingReport(
|
||||
embeddingResult = mountIniPanelShellWorkflowOverviewEmbedding(),
|
||||
contract = createIniPanelShellWorkflowOverviewContract(),
|
||||
) {
|
||||
const result = embeddingResult && typeof embeddingResult === "object" ? embeddingResult : {};
|
||||
const readiness = result.readiness && typeof result.readiness === "object" ? result.readiness : {};
|
||||
const resultContract = result.contract && typeof result.contract === "object" ? result.contract : contract;
|
||||
const mountResult = result.mountResult && typeof result.mountResult === "object" ? result.mountResult : {};
|
||||
const renderResult = mountResult.renderResult && typeof mountResult.renderResult === "object"
|
||||
? mountResult.renderResult
|
||||
: {};
|
||||
const missingMethods = Array.isArray(readiness.missing) ? [...readiness.missing] : [];
|
||||
const error = result.error ?? mountResult.error ?? null;
|
||||
const overviewReady = readiness.ready === true;
|
||||
const embeddingReady = result.ready === true;
|
||||
const mountPhase = mountResult.phase ?? null;
|
||||
const mountReady = mountResult.ready === true;
|
||||
const renderRowCount = Number.isFinite(renderResult.rowCount) ? renderResult.rowCount : 0;
|
||||
const blockingReasons = [
|
||||
...missingMethods.map((methodName) => `missing:${methodName}`),
|
||||
...(embeddingReady ? [] : [`embedding:${result.phase ?? "blocked"}`]),
|
||||
...(mountPhase && !mountReady ? [`mount:${mountPhase}`] : []),
|
||||
...(error ? [`error:${error}`] : []),
|
||||
];
|
||||
const ready = overviewReady && embeddingReady && mountReady && !error && blockingReasons.length === 0;
|
||||
const statusLine = ready
|
||||
? "Ready: No blocking reasons"
|
||||
: `Blocked: ${blockingReasons.length > 0 ? blockingReasons.join(", ") : "workflow overview embedding unavailable"}`;
|
||||
|
||||
return {
|
||||
apiName: "ini-panel-shell-workflow-overview-embedding-report",
|
||||
reportVersion: 1,
|
||||
phase: ready ? "ready" : "blocked",
|
||||
ready,
|
||||
overviewReady,
|
||||
embeddingReady,
|
||||
mountReady,
|
||||
statusLine,
|
||||
pageHref: result.pageHref ?? resultContract.pageHref ?? null,
|
||||
contract: resultContract,
|
||||
missingMethods,
|
||||
mountPhase,
|
||||
renderRowCount,
|
||||
error,
|
||||
blockingReasons,
|
||||
rows: [
|
||||
{
|
||||
id: "overview-api",
|
||||
label: "Overview API",
|
||||
value: overviewReady ? "ready" : "blocked",
|
||||
},
|
||||
{
|
||||
id: "missing-methods",
|
||||
label: "Missing methods",
|
||||
value: missingMethods.length === 0 ? "none" : missingMethods.join(", "),
|
||||
},
|
||||
{
|
||||
id: "embedding-ready",
|
||||
label: "Embedding readiness",
|
||||
value: embeddingReady ? "ready" : "blocked",
|
||||
},
|
||||
{
|
||||
id: "mount-phase",
|
||||
label: "Mount phase",
|
||||
value: mountPhase ?? "missing",
|
||||
},
|
||||
{
|
||||
id: "render-row-count",
|
||||
label: "Render row count",
|
||||
value: String(renderRowCount),
|
||||
},
|
||||
{
|
||||
id: "error",
|
||||
label: "Error",
|
||||
value: error ?? "none",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
|
||||
const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries);
|
||||
const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest);
|
||||
@@ -1965,6 +2046,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
||||
createWorkflowOverviewContract: createIniPanelShellWorkflowOverviewContract,
|
||||
createWorkflowOverviewReadiness: createIniPanelShellWorkflowOverviewReadiness,
|
||||
mountWorkflowOverviewEmbedding: mountIniPanelShellWorkflowOverviewEmbedding,
|
||||
createWorkflowOverviewEmbeddingReport: createIniPanelShellWorkflowOverviewEmbeddingReport,
|
||||
isSupportedShellSessionHandoffPackage: isSupportedIniPanelShellSessionHandoffPackage,
|
||||
controlPage: {
|
||||
browserApiSchema: createControlPageBrowserApiSchema(),
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
createIniPanelShellSessionHandoffWorkflowRenderState,
|
||||
createIniPanelShellWorkflowOverviewContract,
|
||||
createIniPanelShellWorkflowOverviewReadiness,
|
||||
createIniPanelShellWorkflowOverviewEmbeddingReport,
|
||||
mountIniPanelShellWorkflowOverviewEmbedding,
|
||||
renderIniPanelShellSessionHandoffWorkflowState,
|
||||
mountIniPanelShellSessionHandoffWorkflow,
|
||||
@@ -131,6 +132,9 @@
|
||||
...(options ?? {}),
|
||||
})
|
||||
),
|
||||
getWorkflowOverviewEmbeddingReport: (embeddingResult, contract) => (
|
||||
createIniPanelShellWorkflowOverviewEmbeddingReport(embeddingResult, contract)
|
||||
),
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user