新增 INI 面板 shell API surface inventory

This commit is contained in:
2026-06-16 07:19:49 +08:00
parent 2615e5bc57
commit 65e95327b3
17 changed files with 286 additions and 7 deletions

View File

@@ -25,6 +25,7 @@ Use `src/index.js` for stable imports:
import {
analyzeIniRuntimeBoundaries,
createIniPanelLaunchApiManifest,
createIniPanelShellApiSurfaceInventory,
createIniPanelShellSessionReadinessWorkflowReport,
createIniPanelShellViewModel,
createIniPanelShellWorkflowOverviewEmbeddingMountDomContract,
@@ -192,6 +193,9 @@ for external browser shells:
`isSupportedIniPanelLaunchApiManifest()` for launch API negotiation.
- `createIniPanelShellViewModel()` for a complete read-only shell integration
bundle.
- `createIniPanelShellApiSurfaceInventory()` for a machine-readable inventory
of launch, control-page, workflow overview, persistence, and session
readiness report API counts.
- `createIniPanelShellSessionReadinessWorkflowReport()` for a machine-readable
session readiness workflow report with phase, missing reasons, status line,
and stable rows.

View File

@@ -69,6 +69,7 @@ export {
createIniPanelShellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionReadinessWorkflowReport,
createIniPanelShellApiSurfaceInventory,
createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema,
createIniPanelShellViewModel,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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)
),