推进 INI 面板 shell handoff package report

This commit is contained in:
2026-06-15 10:40:37 +08:00
parent f1d10fc317
commit e1029ede0f
10 changed files with 389 additions and 4 deletions

View File

@@ -1007,3 +1007,109 @@ host_wasm_opfs_browser_smokes=ok
missing package fields、missing manifest fields、version/apiName mismatch 和 checklist blocking
reasons 合并成 display-ready report便于外部 shell 在拒绝 package 时显示原因;仍保持只读,
不新增控制按钮,不解析 G-code。
九、2026-06-15 继续执行记录INI panel shell handoff package report
本轮按“第一原则:加快实质性推进”继续推进 browser/UI workflow 与文档化可执行工作流,
新增只读 shell handoff package report把 package schema support、缺失字段、版本/API mismatch
和 checklist blocking reasons 合并成外部 shell 可直接显示的诊断。
完成内容:
- `ui-shell.js` 新增 `createIniPanelShellSessionHandoffPackageReport()`
- package report 输出:
- `apiName: "ini-panel-shell-session-handoff-package-report"`
- `reportVersion: 1`
- `phase`
- `ready`
- `packageSupported`
- `packageReady`
- `statusLine`
- `schema`
- `package`
- `missingPackageFields`
- `missingManifestFields`
- `mismatchFields`
- `blockingReasons`
- `rows`
- report rows 固定覆盖:
- `package-supported`
- `package-ready`
- `missing-package-fields`
- `missing-manifest-fields`
- `mismatch-fields`
- `blocking-reasons`
- `createIniPanelShellViewModel()` 新增:
- `shellSessionHandoffPackageReport`
- `createShellSessionHandoffPackageReport`
- `createIniPanelLaunchApiManifest().methods` 新增
`getShellSessionHandoffPackageReport`
- `launch.html` 的 `window.linuxCncIniPanelLaunchApi` 新增真实 browser 入口
`getShellSessionHandoffPackageReport()`
- `ini_panel_launch_smoke.html` 校验真实 launch iframe
- package report `ready === true`
- report rows 数量为 6
- 当前 report 无 missing package fields
- `ini_panel_shell_integration_workflow_smoke.html` 校验外部 shell workflow 能读取
package report并确认 package supported 与 report rows
- `verify_ini_panel_shell_integration_manifest.mjs` 覆盖:
- ready package report 完整 shape
- version mismatch 输出 `mismatchFields`
- 缺 manifest field 输出 `missingManifestFields`
- null package 输出全部 missing package fields
- `verify_ini_panel_ui_shell.mjs` 覆盖 shell view-model 的 package report 聚合关系;
- `verify_ini_panel_launch_api_manifest.mjs`、`verify_ini_panel_entry_docs.mjs` 与
`docs/panel-entry.md` 同步记录和校验新 helper/API
- 未新增控制按钮;
- 未执行 action-plan
- 未解析 G-code
- 未解释 canonical events
- 未新增 JS CNC 语义;
- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或
LinuxCNC-owned runtime semantics。
验证已通过:
```bash
git diff --check
wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.sh
wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.sh
wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh
wasm-port/tests/ui/node/verify_ini_panel_entry_docs.sh
wasm-port/tests/ui/node/verify_ui_node_smokes.sh
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_ini_panel_browser.sh
wasm-port/tools/verify_vendor_sync.sh
wasm-port/tools/verify_no_standalone_cnc_semantics.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh
wasm-port/tests/host/verify_host_smokes.sh
```
关键输出:
```text
ini_panel_shell_integration_manifest_node_smoke=ok
ini_panel_launch_api_manifest_node_smoke=ok
ini_panel_ui_shell_node_smoke=ok
ini_panel_entry_docs_node_smoke=ok
ui_node_smokes=ok
browser_ini_opfs_smoke=ok
browser_ini_control_page_smoke=ok
browser_ini_launch_smoke=ok
browser_ini_shell_integration_workflow_smoke=ok
vendor sync up to date
standalone CNC semantics guard complete
interp_wasm_node_smoke=ok
sim_configs_wasm_node_inventory_executed=28
sim_configs_wasm_node_inventory_passed=28
sim_configs_wasm_node_inventory_skipped=131
sim_configs_wasm_node_inventory_unexpected_fail=0
host_wasm_opfs_browser_smokes=ok
```
下一步建议:
继续推进 browser/UI workflow。下一批建议新增一个只读
`createIniPanelShellSessionHandoffPackageDisplayViewModel()` 或等价 helper把 package report
压成稳定 label/value rows 与 status text供 launch 页面或外部 shell 直接渲染 package report
仍保持只读,不新增控制按钮,不解析 G-code。

View File

@@ -26,6 +26,7 @@ import {
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot,
@@ -192,6 +193,11 @@ Use `createIniPanelShellSessionHandoffPackageSchema()` or
versioned package shape, and `isSupportedIniPanelShellSessionHandoffPackage()`
or `linuxCncIniPanelLaunchApi.isSupportedShellSessionHandoffPackage()` before
consuming a package from a browser shell.
Use `createIniPanelShellSessionHandoffPackageReport()` or
`linuxCncIniPanelLaunchApi.getShellSessionHandoffPackageReport()` when an outer
shell needs display-ready diagnostics for package schema support, missing
package fields, missing manifest fields, api/version mismatches, and checklist
blocking reasons.
The browser workflow smoke
`tests/browser/ini_panel_shell_integration_workflow_smoke.html` verifies the
same external shell handoff: read integration manifest, pass readiness gate,

View File

@@ -148,6 +148,7 @@
getShellSessionHandoffChecklist: () => shellViewModel.shellSessionHandoffChecklist,
getShellSessionHandoffPackageSchema: () => shellViewModel.shellSessionHandoffPackageSchema,
getShellSessionHandoffPackage: () => shellViewModel.shellSessionHandoffPackage,
getShellSessionHandoffPackageReport: () => shellViewModel.shellSessionHandoffPackageReport,
isSupportedShellSessionHandoffPackage: shellViewModel.isSupportedShellSessionHandoffPackage,
getLauncherLinks: () => shellViewModel.launcherLinks,
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,

View File

@@ -137,6 +137,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
"getShellSessionHandoffChecklist",
"getShellSessionHandoffPackageSchema",
"getShellSessionHandoffPackage",
"getShellSessionHandoffPackageReport",
"isSupportedShellSessionHandoffPackage",
"getLauncherLinks",
"getControlPageApiMethods",
@@ -793,6 +794,87 @@ export function isSupportedIniPanelShellSessionHandoffPackage(
return schema.manifestFields.every((fieldName) => Object.hasOwn(manifests, fieldName));
}
export function createIniPanelShellSessionHandoffPackageReport(
handoffPackage = createIniPanelShellSessionHandoffPackage(),
schema = createIniPanelShellSessionHandoffPackageSchema(),
) {
const packageObject = handoffPackage && typeof handoffPackage === "object" ? handoffPackage : {};
const manifests = packageObject.manifests && typeof packageObject.manifests === "object"
? packageObject.manifests
: {};
const missingPackageFields = schema.fields.filter((fieldName) => !Object.hasOwn(packageObject, fieldName));
const missingManifestFields = schema.manifestFields.filter((fieldName) => !Object.hasOwn(manifests, fieldName));
const mismatchFields = [
...(packageObject.apiName === schema.apiName ? [] : ["apiName"]),
...(packageObject.packageVersion === schema.packageVersion ? [] : ["packageVersion"]),
];
const blockingReasons = Array.isArray(packageObject?.checklist?.blockingReasons)
? [...packageObject.checklist.blockingReasons]
: [];
const packageSupported = missingPackageFields.length === 0
&& missingManifestFields.length === 0
&& mismatchFields.length === 0;
const ready = packageSupported && packageObject.ready === true && blockingReasons.length === 0;
return {
apiName: "ini-panel-shell-session-handoff-package-report",
reportVersion: 1,
phase: ready ? "ready" : "blocked",
ready,
packageSupported,
packageReady: ready,
statusLine: packageObject.statusLine ?? (ready ? "Ready: No blocking reasons" : "Blocked: Package unsupported"),
schema: {
apiName: schema.apiName,
packageVersion: schema.packageVersion,
fields: [...schema.fields],
manifestFields: [...schema.manifestFields],
},
package: {
apiName: packageObject.apiName ?? null,
packageVersion: packageObject.packageVersion ?? null,
phase: packageObject.phase ?? null,
ready: packageObject.ready ?? false,
},
missingPackageFields,
missingManifestFields,
mismatchFields,
blockingReasons,
rows: [
{
id: "package-supported",
label: "Package schema",
value: packageSupported ? "supported" : "blocked",
},
{
id: "package-ready",
label: "Package readiness",
value: ready ? "ready" : "blocked",
},
{
id: "missing-package-fields",
label: "Missing package fields",
value: missingPackageFields.length === 0 ? "none" : missingPackageFields.join(", "),
},
{
id: "missing-manifest-fields",
label: "Missing manifest fields",
value: missingManifestFields.length === 0 ? "none" : missingManifestFields.join(", "),
},
{
id: "mismatch-fields",
label: "Mismatched fields",
value: mismatchFields.length === 0 ? "none" : mismatchFields.join(", "),
},
{
id: "blocking-reasons",
label: "Blocking reasons",
value: blockingReasons.length === 0 ? "none" : blockingReasons.join(", "),
},
],
};
}
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries);
const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest);
@@ -837,6 +919,9 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
actionPlan: shellSessionHandoffActionPlan,
checklist: shellSessionHandoffChecklist,
});
const shellSessionHandoffPackageReport = createIniPanelShellSessionHandoffPackageReport(
shellSessionHandoffPackage,
);
return {
pages: entries.map(({ id, href, title }) => ({
id,
@@ -858,6 +943,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
shellSessionHandoffChecklist,
shellSessionHandoffPackage,
shellSessionHandoffPackageSchema: createIniPanelShellSessionHandoffPackageSchema(),
shellSessionHandoffPackageReport,
launchApiSchema: createIniPanelLaunchApiSchema(),
launchApiManifest: createIniPanelLaunchApiManifest(entries),
isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest,
@@ -874,6 +960,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
createShellSessionHandoffChecklist: createIniPanelShellSessionHandoffChecklist,
createShellSessionHandoffPackage: createIniPanelShellSessionHandoffPackage,
createShellSessionHandoffPackageSchema: createIniPanelShellSessionHandoffPackageSchema,
createShellSessionHandoffPackageReport: createIniPanelShellSessionHandoffPackageReport,
isSupportedShellSessionHandoffPackage: isSupportedIniPanelShellSessionHandoffPackage,
controlPage: {
browserApiSchema: createControlPageBrowserApiSchema(),

View File

@@ -84,6 +84,7 @@
!launchApi?.getShellSessionHandoffChecklist ||
!launchApi?.getShellSessionHandoffPackageSchema ||
!launchApi?.getShellSessionHandoffPackage ||
!launchApi?.getShellSessionHandoffPackageReport ||
!launchApi?.isSupportedShellSessionHandoffPackage ||
!launchApi?.getLauncherLinks ||
!launchApi?.getControlPageApiMethods
@@ -124,7 +125,7 @@
);
assertEqual(
launchApiManifest.methods.join(","),
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods",
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,getShellSessionHandoffPackageReport,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods",
"launch API manifest methods",
);
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
@@ -140,6 +141,7 @@
const shellSessionHandoffChecklist = launchApi.getShellSessionHandoffChecklist();
const shellSessionHandoffPackageSchema = launchApi.getShellSessionHandoffPackageSchema();
const shellSessionHandoffPackage = launchApi.getShellSessionHandoffPackage();
const shellSessionHandoffPackageReport = launchApi.getShellSessionHandoffPackageReport();
assertEqual(
shellIntegrationSchema.manifestVersion,
1,
@@ -310,6 +312,21 @@
false,
"shell session handoff package rejects version",
);
assertEqual(
shellSessionHandoffPackageReport.ready,
true,
"shell session handoff package report readiness",
);
assertEqual(
shellSessionHandoffPackageReport.rows.length,
6,
"shell session handoff package report rows",
);
assertEqual(
shellSessionHandoffPackageReport.missingPackageFields.join(","),
"",
"shell session handoff package report missing fields",
);
assertEqual(
shellSessionHandoffPackage.ready,
true,

View File

@@ -75,6 +75,7 @@ TOOL_TABLE = browser-shell-tool.tbl
!launchApi?.getShellSessionHandoffChecklist ||
!launchApi?.getShellSessionHandoffPackageSchema ||
!launchApi?.getShellSessionHandoffPackage ||
!launchApi?.getShellSessionHandoffPackageReport ||
!launchApi?.isSupportedShellSessionHandoffPackage
) {
throw new Error("launch API namespace did not expose shell integration helpers");
@@ -92,6 +93,7 @@ TOOL_TABLE = browser-shell-tool.tbl
const handoffChecklist = launchApi.getShellSessionHandoffChecklist();
const handoffPackageSchema = launchApi.getShellSessionHandoffPackageSchema();
const handoffPackage = launchApi.getShellSessionHandoffPackage();
const handoffPackageReport = launchApi.getShellSessionHandoffPackageReport();
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
@@ -134,6 +136,9 @@ TOOL_TABLE = browser-shell-tool.tbl
true,
"shell handoff package supported",
);
assertEqual(handoffPackageReport.ready, true, "shell handoff package report readiness");
assertEqual(handoffPackageReport.packageSupported, true, "shell handoff package report support");
assertEqual(handoffPackageReport.rows.length, 6, "shell handoff package report rows");
assertEqual(handoffPackage.checklist.ready, handoffChecklist.ready, "shell handoff package checklist");
assertEqual(
handoffPackage.actionPlan.nextSteps.map(({ id }) => id).join(","),

View File

@@ -23,6 +23,7 @@ import {
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot,
@@ -82,6 +83,7 @@ const requiredShellExports = [
"createIniPanelShellSessionHandoffCompatibilityReport",
"createIniPanelShellSessionHandoffDisplayViewModel",
"createIniPanelShellSessionHandoffPackage",
"createIniPanelShellSessionHandoffPackageReport",
"createIniPanelShellSessionHandoffPackageSchema",
"createIniPanelShellSessionHandoffRenderState",
"createIniPanelShellSessionHandoffSnapshot",
@@ -230,6 +232,10 @@ assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffPackageSchema(),
);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageReport(createIniPanelShellViewModel().shellSessionHandoffPackage),
);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(createIniPanelShellViewModel().shellSessionHandoffPackage), true);
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
@@ -290,6 +296,7 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffChec
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackage\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/);
@@ -322,6 +329,7 @@ assert.match(launchText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(launchText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageSchema\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackage\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageReport\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(launchText, /\bdata-handoff-shell\b/);
assert.match(launchText, /\bdata-handoff-status\b/);
@@ -349,6 +357,7 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffChecklist\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackage\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);
@@ -376,6 +385,7 @@ assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffAction
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffChecklist\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffPackageSchema\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffPackage\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffPackageReport\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedShellSessionHandoffPackage\b/);
assert.match(docText, /\bdata-handoff-shell\b/);
assert.match(docText, /\bdata-handoff-status\b/);
@@ -394,6 +404,7 @@ assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffActionP
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackageSchema\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackage\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackageReport\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bhandoffSummary\.handoffMethods\.readStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\breadControlPageStatus\b/);

View File

@@ -57,6 +57,7 @@ assert.deepEqual(manifest, {
"getShellSessionHandoffChecklist",
"getShellSessionHandoffPackageSchema",
"getShellSessionHandoffPackage",
"getShellSessionHandoffPackageReport",
"isSupportedShellSessionHandoffPackage",
"getLauncherLinks",
"getControlPageApiMethods",
@@ -169,6 +170,7 @@ assert.match(launchText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(launchText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageSchema\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackage\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageReport\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);

View File

@@ -19,6 +19,7 @@ import {
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot,
@@ -69,6 +70,7 @@ const handoffPackage = createIniPanelShellSessionHandoffPackage({
checklist: handoffChecklist,
});
const handoffPackageSchema = createIniPanelShellSessionHandoffPackageSchema();
const handoffPackageReport = createIniPanelShellSessionHandoffPackageReport(handoffPackage);
assert.deepEqual(schema, {
apiName: "ini-panel-shell-integration",
@@ -124,7 +126,7 @@ assert.deepEqual(readiness, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 20,
launchMethods: 21,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -186,7 +188,7 @@ assert.deepEqual(handoffSummary, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 20,
launchMethods: 21,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -468,6 +470,80 @@ assert.deepEqual(handoffPackageSchema, {
"controlPageMethods",
],
});
assert.deepEqual(handoffPackageReport, {
apiName: "ini-panel-shell-session-handoff-package-report",
reportVersion: 1,
phase: "ready",
ready: true,
packageSupported: true,
packageReady: true,
statusLine: "Ready: No blocking reasons",
schema: {
apiName: "ini-panel-shell-session-handoff-package",
packageVersion: 1,
fields: [
"apiName",
"packageVersion",
"phase",
"ready",
"statusLine",
"manifests",
"snapshot",
"renderState",
"actionPlan",
"checklist",
],
manifestFields: [
"shellIntegration",
"launchApi",
"controlPageApi",
"launchMethods",
"controlPageMethods",
],
},
package: {
apiName: "ini-panel-shell-session-handoff-package",
packageVersion: 1,
phase: "ready",
ready: true,
},
missingPackageFields: [],
missingManifestFields: [],
mismatchFields: [],
blockingReasons: [],
rows: [
{
id: "package-supported",
label: "Package schema",
value: "supported",
},
{
id: "package-ready",
label: "Package readiness",
value: "ready",
},
{
id: "missing-package-fields",
label: "Missing package fields",
value: "none",
},
{
id: "missing-manifest-fields",
label: "Missing manifest fields",
value: "none",
},
{
id: "mismatch-fields",
label: "Mismatched fields",
value: "none",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
value: "none",
},
],
});
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(handoffPackage), true);
assert.equal(
isSupportedIniPanelShellSessionHandoffPackage({ ...handoffPackage, packageVersion: 2 }),
@@ -494,12 +570,25 @@ const missingManifestField = {
delete missingManifestField.manifests.controlPageMethods;
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(missingManifestField), false);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(null), false);
assert.deepEqual(
createIniPanelShellSessionHandoffPackageReport({ ...handoffPackage, packageVersion: 2 }).mismatchFields,
["packageVersion"],
);
assert.deepEqual(
createIniPanelShellSessionHandoffPackageReport(missingManifestField).missingManifestFields,
["controlPageMethods"],
);
assert.deepEqual(
createIniPanelShellSessionHandoffPackageReport(null).missingPackageFields,
handoffPackageSchema.fields,
);
assert.equal(createIniPanelShellSessionHandoffSnapshot().displayViewModel.rows.length, 5);
assert.equal(createIniPanelShellSessionHandoffRenderState().statusLine, "Ready: No blocking reasons");
assert.equal(createIniPanelShellSessionHandoffActionPlan().nextSteps.length, 2);
assert.equal(createIniPanelShellSessionHandoffChecklist().checks.length, 5);
assert.equal(createIniPanelShellSessionHandoffPackage().manifests.launchMethods.includes("getShellSessionHandoffPackage"), true);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(createIniPanelShellSessionHandoffPackage()), true);
assert.equal(createIniPanelShellSessionHandoffPackageReport().rows.length, 6);
assert.deepEqual(
createIniPanelShellSessionHandoffDisplayViewModel(
createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }),
@@ -716,7 +805,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 20,
launchMethods: 21,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -881,6 +970,7 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffChec
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackage\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/);
@@ -900,6 +990,7 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffChecklist\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackage\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageSchema\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);

View File

@@ -19,6 +19,7 @@ import {
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot,
@@ -83,6 +84,7 @@ assert.equal(typeof createIniPanelShellSessionHandoffChecklist, "function");
assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function");
assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackage, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageReport, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageSchema, "function");
assert.equal(typeof createIniPanelShellSessionHandoffRenderState, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSnapshot, "function");
@@ -204,6 +206,10 @@ assert.deepEqual(
}),
);
assert.deepEqual(shellViewModel.shellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema());
assert.deepEqual(
shellViewModel.shellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageReport(shellViewModel.shellSessionHandoffPackage),
);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(shellViewModel.shellSessionHandoffPackage), true);
assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
phase: "ready",
@@ -371,6 +377,58 @@ assert.deepEqual(shellViewModel.shellSessionHandoffPackageSchema, {
"controlPageMethods",
],
});
assert.deepEqual(shellViewModel.shellSessionHandoffPackageReport, {
apiName: "ini-panel-shell-session-handoff-package-report",
reportVersion: 1,
phase: "ready",
ready: true,
packageSupported: true,
packageReady: true,
statusLine: "Ready: No blocking reasons",
schema: shellViewModel.shellSessionHandoffPackageSchema,
package: {
apiName: "ini-panel-shell-session-handoff-package",
packageVersion: 1,
phase: "ready",
ready: true,
},
missingPackageFields: [],
missingManifestFields: [],
mismatchFields: [],
blockingReasons: [],
rows: [
{
id: "package-supported",
label: "Package schema",
value: "supported",
},
{
id: "package-ready",
label: "Package readiness",
value: "ready",
},
{
id: "missing-package-fields",
label: "Missing package fields",
value: "none",
},
{
id: "missing-manifest-fields",
label: "Missing manifest fields",
value: "none",
},
{
id: "mismatch-fields",
label: "Mismatched fields",
value: "none",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
value: "none",
},
],
});
assert.equal(
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
true,
@@ -419,6 +477,7 @@ assert.equal(shellViewModel.createShellSessionHandoffRenderState, createIniPanel
assert.equal(shellViewModel.createShellSessionHandoffActionPlan, createIniPanelShellSessionHandoffActionPlan);
assert.equal(shellViewModel.createShellSessionHandoffChecklist, createIniPanelShellSessionHandoffChecklist);
assert.equal(shellViewModel.createShellSessionHandoffPackage, createIniPanelShellSessionHandoffPackage);
assert.equal(shellViewModel.createShellSessionHandoffPackageReport, createIniPanelShellSessionHandoffPackageReport);
assert.equal(shellViewModel.createShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema);
assert.equal(shellViewModel.isSupportedShellSessionHandoffPackage, isSupportedIniPanelShellSessionHandoffPackage);
assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract());