推进 INI 面板 launch API schema 暴露
This commit is contained in:
69
text12.txt
69
text12.txt
@@ -1341,3 +1341,72 @@ host_wasm_opfs_browser_smokes=ok
|
|||||||
继续推进 browser/UI workflow。下一批建议把 launch manifest 的 schema/version 信息暴露到
|
继续推进 browser/UI workflow。下一批建议把 launch manifest 的 schema/version 信息暴露到
|
||||||
`linuxCncIniPanelLaunchApi` 的独立 `getLaunchApiSchema()` 方法,并由 browser launch smoke 与
|
`linuxCncIniPanelLaunchApi` 的独立 `getLaunchApiSchema()` 方法,并由 browser launch smoke 与
|
||||||
focused Node gate 双向校验;仍保持只读,不新增控制按钮,不解析 G-code。
|
focused Node gate 双向校验;仍保持只读,不新增控制按钮,不解析 G-code。
|
||||||
|
|
||||||
|
十七、2026-06-15 继续执行记录:INI panel launch API schema exposure
|
||||||
|
|
||||||
|
本轮按“第一原则:加快实质性推进”继续推进 browser/UI workflow,把 launch manifest 的
|
||||||
|
schema/version 信息通过真实 browser launch API 独立暴露,方便外部 shell 在读取完整 manifest
|
||||||
|
前先做兼容性判断。
|
||||||
|
|
||||||
|
完成内容:
|
||||||
|
|
||||||
|
- `createIniPanelShellViewModel()` 新增 `launchApiSchema`;
|
||||||
|
- `launch.html` 的 `window.linuxCncIniPanelLaunchApi` 新增 `getLaunchApiSchema()`;
|
||||||
|
- `createIniPanelLaunchApiManifest().methods` 新增 `getLaunchApiSchema`;
|
||||||
|
- `ini_panel_launch_smoke.html` 在真实 launch iframe 中校验:
|
||||||
|
- `getLaunchApiSchema()` 存在;
|
||||||
|
- schema `manifestVersion`;
|
||||||
|
- schema fields 包含 `persistenceCapabilities`;
|
||||||
|
- manifest methods 包含 `getLaunchApiSchema`;
|
||||||
|
- `verify_ini_panel_launch_api_manifest.mjs` 覆盖 shell view-model 的 `launchApiSchema`;
|
||||||
|
- `verify_ini_panel_ui_shell.mjs` 覆盖 `launchApiSchema`;
|
||||||
|
- `verify_ini_panel_entry_docs.mjs` 与 `docs/panel-entry.md` 记录并校验
|
||||||
|
`linuxCncIniPanelLaunchApi.getLaunchApiSchema()`;
|
||||||
|
- 未新增控制按钮;
|
||||||
|
- 未解析 G-code;
|
||||||
|
- 未解释 canonical events;
|
||||||
|
- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或
|
||||||
|
LinuxCNC-owned runtime semantics。
|
||||||
|
|
||||||
|
验证已通过:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
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_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
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
下一步建议:
|
||||||
|
|
||||||
|
继续推进 SDK/API surface。下一批建议为 `createIniPanelLaunchApiSchema()` 增加 focused schema
|
||||||
|
compatibility helper(例如 `isSupportedIniPanelLaunchApiManifest()` 或等价只读 predicate),让外部
|
||||||
|
shell 可以用 schema/version 判断 manifest 是否可消费,并由 Node/browser gate 校验;仍保持只读,
|
||||||
|
不新增控制按钮,不解析 G-code。
|
||||||
|
|||||||
@@ -88,8 +88,10 @@ Use `createIniPanelLaunchApiManifest()` or
|
|||||||
single read-only description of launch methods, visible entries, target pages,
|
single read-only description of launch methods, visible entries, target pages,
|
||||||
the control-page browser API methods, and OPFS/session persistence capabilities
|
the control-page browser API methods, and OPFS/session persistence capabilities
|
||||||
for machine files, session snapshots, and read-only status.
|
for machine files, session snapshots, and read-only status.
|
||||||
Use `createIniPanelLaunchApiSchema()` or `manifestVersion` when an outer shell
|
Use `createIniPanelLaunchApiSchema()`,
|
||||||
needs to check launch manifest compatibility before consuming these fields.
|
`linuxCncIniPanelLaunchApi.getLaunchApiSchema()`, or `manifestVersion` when an
|
||||||
|
outer shell needs to check launch manifest compatibility before consuming these
|
||||||
|
fields.
|
||||||
|
|
||||||
The control-page refresh workflow lives in
|
The control-page refresh workflow lives in
|
||||||
`runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use
|
`runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use
|
||||||
|
|||||||
@@ -90,6 +90,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.linuxCncIniPanelLaunchApi = {
|
window.linuxCncIniPanelLaunchApi = {
|
||||||
|
getLaunchApiSchema: () => shellViewModel.launchApiSchema,
|
||||||
getLaunchApiManifest: () => shellViewModel.launchApiManifest,
|
getLaunchApiManifest: () => shellViewModel.launchApiManifest,
|
||||||
getLauncherLinks: () => shellViewModel.launcherLinks,
|
getLauncherLinks: () => shellViewModel.launcherLinks,
|
||||||
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,
|
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
|
|||||||
apiName: schema.apiName,
|
apiName: schema.apiName,
|
||||||
manifestVersion: schema.manifestVersion,
|
manifestVersion: schema.manifestVersion,
|
||||||
methods: [
|
methods: [
|
||||||
|
"getLaunchApiSchema",
|
||||||
"getLaunchApiManifest",
|
"getLaunchApiManifest",
|
||||||
"getLauncherLinks",
|
"getLauncherLinks",
|
||||||
"getControlPageApiMethods",
|
"getControlPageApiMethods",
|
||||||
@@ -155,6 +156,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
|
|||||||
title,
|
title,
|
||||||
})),
|
})),
|
||||||
launcherLinks: createIniPanelLauncherLinkViewModel(entries),
|
launcherLinks: createIniPanelLauncherLinkViewModel(entries),
|
||||||
|
launchApiSchema: createIniPanelLaunchApiSchema(),
|
||||||
launchApiManifest: createIniPanelLaunchApiManifest(entries),
|
launchApiManifest: createIniPanelLaunchApiManifest(entries),
|
||||||
controlPage: {
|
controlPage: {
|
||||||
browserApiMethods: createControlPageBrowserApiMethods(),
|
browserApiMethods: createControlPageBrowserApiMethods(),
|
||||||
|
|||||||
@@ -65,9 +65,25 @@
|
|||||||
|
|
||||||
const launchDoc = await loadLaunchFrame();
|
const launchDoc = await loadLaunchFrame();
|
||||||
const launchApi = launchDoc.defaultView.linuxCncIniPanelLaunchApi;
|
const launchApi = launchDoc.defaultView.linuxCncIniPanelLaunchApi;
|
||||||
if (!launchApi?.getLaunchApiManifest || !launchApi?.getLauncherLinks || !launchApi?.getControlPageApiMethods) {
|
if (
|
||||||
|
!launchApi?.getLaunchApiSchema ||
|
||||||
|
!launchApi?.getLaunchApiManifest ||
|
||||||
|
!launchApi?.getLauncherLinks ||
|
||||||
|
!launchApi?.getControlPageApiMethods
|
||||||
|
) {
|
||||||
throw new Error("launch API namespace did not expose shell helpers");
|
throw new Error("launch API namespace did not expose shell helpers");
|
||||||
}
|
}
|
||||||
|
const launchApiSchema = launchApi.getLaunchApiSchema();
|
||||||
|
assertEqual(
|
||||||
|
launchApiSchema.manifestVersion,
|
||||||
|
1,
|
||||||
|
"launch API schema manifest version",
|
||||||
|
);
|
||||||
|
assertEqual(
|
||||||
|
launchApiSchema.fields.includes("persistenceCapabilities"),
|
||||||
|
true,
|
||||||
|
"launch API schema persistence field",
|
||||||
|
);
|
||||||
const launchApiManifest = launchApi.getLaunchApiManifest();
|
const launchApiManifest = launchApi.getLaunchApiManifest();
|
||||||
assertEqual(
|
assertEqual(
|
||||||
launchApiManifest.apiName,
|
launchApiManifest.apiName,
|
||||||
@@ -81,7 +97,7 @@
|
|||||||
);
|
);
|
||||||
assertEqual(
|
assertEqual(
|
||||||
launchApiManifest.methods.join(","),
|
launchApiManifest.methods.join(","),
|
||||||
"getLaunchApiManifest,getLauncherLinks,getControlPageApiMethods",
|
"getLaunchApiSchema,getLaunchApiManifest,getLauncherLinks,getControlPageApiMethods",
|
||||||
"launch API manifest methods",
|
"launch API manifest methods",
|
||||||
);
|
);
|
||||||
assertEqual(
|
assertEqual(
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ assert.deepEqual(
|
|||||||
);
|
);
|
||||||
assert.deepEqual(createIniPanelShellViewModel().pages, getVisibleIniPanelEntries());
|
assert.deepEqual(createIniPanelShellViewModel().pages, getVisibleIniPanelEntries());
|
||||||
assert.deepEqual(createIniPanelShellViewModel().launcherLinks, createIniPanelLauncherLinkViewModel());
|
assert.deepEqual(createIniPanelShellViewModel().launcherLinks, createIniPanelLauncherLinkViewModel());
|
||||||
|
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
|
||||||
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
|
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
|
||||||
assert.equal(createIniPanelShellViewModel().launchApiManifest.manifestVersion, createIniPanelLaunchApiSchema().manifestVersion);
|
assert.equal(createIniPanelShellViewModel().launchApiManifest.manifestVersion, createIniPanelLaunchApiSchema().manifestVersion);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
@@ -138,6 +139,7 @@ assert.match(shellText, /\bexport function createIniPanelLaunchApiSchema\b/);
|
|||||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiManifest\b/);
|
assert.match(shellText, /\bexport function createIniPanelLaunchApiManifest\b/);
|
||||||
assert.match(controlPageText, /\bgetControlPageApiMethods\b/);
|
assert.match(controlPageText, /\bgetControlPageApiMethods\b/);
|
||||||
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
||||||
|
assert.match(launchText, /\bgetLaunchApiSchema\b/);
|
||||||
assert.match(launchText, /\bgetLaunchApiManifest\b/);
|
assert.match(launchText, /\bgetLaunchApiManifest\b/);
|
||||||
assert.match(launchText, /\bgetControlPageApiMethods\b/);
|
assert.match(launchText, /\bgetControlPageApiMethods\b/);
|
||||||
assert.match(controlPageText, /\bgetControlPageContract\b/);
|
assert.match(controlPageText, /\bgetControlPageContract\b/);
|
||||||
@@ -148,6 +150,7 @@ assert.match(docText, /\blinuxCncIniPanelControlPageApi\.getControlPageContract\
|
|||||||
assert.match(docText, /\blinuxCncIniPanelControlPageApi\.readControlPageStatus\b/);
|
assert.match(docText, /\blinuxCncIniPanelControlPageApi\.readControlPageStatus\b/);
|
||||||
assert.match(docText, /\bcreateIniPanelLaunchApiManifest\b/);
|
assert.match(docText, /\bcreateIniPanelLaunchApiManifest\b/);
|
||||||
assert.match(docText, /\bcreateIniPanelLaunchApiSchema\b/);
|
assert.match(docText, /\bcreateIniPanelLaunchApiSchema\b/);
|
||||||
|
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiSchema\b/);
|
||||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
|
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
|
||||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
|
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
|
||||||
assert.match(docText, /\bOPFS\/session persistence capabilities\b/);
|
assert.match(docText, /\bOPFS\/session persistence capabilities\b/);
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ assert.deepEqual(manifest, {
|
|||||||
apiName: "ini-panel-launch",
|
apiName: "ini-panel-launch",
|
||||||
manifestVersion: 1,
|
manifestVersion: 1,
|
||||||
methods: [
|
methods: [
|
||||||
|
"getLaunchApiSchema",
|
||||||
"getLaunchApiManifest",
|
"getLaunchApiManifest",
|
||||||
"getLauncherLinks",
|
"getLauncherLinks",
|
||||||
"getControlPageApiMethods",
|
"getControlPageApiMethods",
|
||||||
@@ -85,6 +86,7 @@ assert.deepEqual(manifest, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, manifest);
|
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, manifest);
|
||||||
|
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, schema);
|
||||||
assert.equal(createIniPanelShellViewModel().launchApiManifest.manifestVersion, schema.manifestVersion);
|
assert.equal(createIniPanelShellViewModel().launchApiManifest.manifestVersion, schema.manifestVersion);
|
||||||
assert.deepEqual(getVisibleIniPanelEntries(), INI_PANEL_ENTRIES);
|
assert.deepEqual(getVisibleIniPanelEntries(), INI_PANEL_ENTRIES);
|
||||||
|
|
||||||
@@ -120,6 +122,7 @@ assert.deepEqual(customManifest.targetPages, [
|
|||||||
|
|
||||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiManifest\b/);
|
assert.match(shellText, /\bexport function createIniPanelLaunchApiManifest\b/);
|
||||||
assert.match(shellText, /\bexport function createIniPanelLaunchApiSchema\b/);
|
assert.match(shellText, /\bexport function createIniPanelLaunchApiSchema\b/);
|
||||||
|
assert.match(launchText, /\bgetLaunchApiSchema\b/);
|
||||||
assert.match(launchText, /\bgetLaunchApiManifest\b/);
|
assert.match(launchText, /\bgetLaunchApiManifest\b/);
|
||||||
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ assert.deepEqual(shellViewModel.pages, [
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
assert.deepEqual(shellViewModel.launcherLinks, createIniPanelLauncherLinkViewModel());
|
assert.deepEqual(shellViewModel.launcherLinks, createIniPanelLauncherLinkViewModel());
|
||||||
|
assert.deepEqual(shellViewModel.launchApiSchema, createIniPanelLaunchApiSchema());
|
||||||
assert.deepEqual(shellViewModel.launchApiManifest, createIniPanelLaunchApiManifest());
|
assert.deepEqual(shellViewModel.launchApiManifest, createIniPanelLaunchApiManifest());
|
||||||
assert.equal(shellViewModel.launchApiManifest.manifestVersion, createIniPanelLaunchApiSchema().manifestVersion);
|
assert.equal(shellViewModel.launchApiManifest.manifestVersion, createIniPanelLaunchApiSchema().manifestVersion);
|
||||||
assert.deepEqual(shellViewModel.controlPage.browserApiMethods, createControlPageBrowserApiMethods());
|
assert.deepEqual(shellViewModel.controlPage.browserApiMethods, createControlPageBrowserApiMethods());
|
||||||
|
|||||||
Reference in New Issue
Block a user