推进 SDK API surface exports and smoke

This commit is contained in:
2026-06-15 22:24:17 +08:00
parent b771ee4141
commit f3d8955fd7
7 changed files with 425 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ turn-by-turn continuation notes and next-batch execution records.
## Current Status ## Current Status
- Active continuation file: `text14.txt` - Active continuation file: `text14.txt`
- Latest completed batch: workflow overview embedding mount DOM mount wrapper - Latest completed batch: SDK/API surface exports and smoke
- Latest relevant commit: use `git log -1 --oneline` after each committed batch - Latest relevant commit: use `git log -1 --oneline` after each committed batch
- Working tree at tracker creation: clean - Working tree at tracker creation: clean
- Required policy: LinuxCNC remains the only CNC semantic source - Required policy: LinuxCNC remains the only CNC semantic source
@@ -41,9 +41,9 @@ The project is complete for the current scope when all of the following are true
| Sim config inventory | Stable with skips | `executed=28`, `passed=28`, `skipped=131`, `unexpected_fail=0`. | | Sim config inventory | Stable with skips | `executed=28`, `passed=28`, `skipped=131`, `unexpected_fail=0`. |
| Native nc_files baseline | Stable | Last recorded Layer 1: `total 107`, `pass 101`, `expected_fail 6`, `unexpected_fail 0`. | | Native nc_files baseline | Stable | Last recorded Layer 1: `total 107`, `pass 101`, `expected_fail 6`, `unexpected_fail 0`. |
| Native sim configs baseline | Stable | Last recorded Layer 2: `total 159`, `pass 151`, `expected_fail 8`, `unexpected_fail 0`. | | Native sim configs baseline | Stable | Last recorded Layer 2: `total 159`, `pass 151`, `expected_fail 8`, `unexpected_fail 0`. |
| OPFS/session persistence | In progress | Browser smoke passes; final project needs explicit project-level summary/report. | | OPFS/session persistence | In progress | Browser smoke passes and SDK re-exports OPFS/session helpers; final project needs explicit project-level summary/report. |
| SDK/API surface | In progress | Many UI helpers exist; final project needs SDK export/readme consolidation. | | SDK/API surface | In progress | SDK re-exports core, OPFS/session, sim-config staging, and INI panel shell/workflow overview helpers with a Node surface smoke. |
| Browser/UI workflow | In progress | Current focus: workflow overview embedding mount DOM closure and SDK/API handoff. | | Browser/UI workflow | In progress | Workflow overview embedding mount DOM closure is complete; current focus is SDK/docs/release gate consolidation. |
| Workflow overview embedding | In progress | Report/display/render, DOM contract/readiness/renderer, mount result/display/render, mount DOM contract/readiness/renderer/wrapper exist. | | Workflow overview embedding | In progress | Report/display/render, DOM contract/readiness/renderer, mount result/display/render, mount DOM contract/readiness/renderer/wrapper exist. |
| Host/runtime boundary proof | In progress | Host smoke passes; runtime families below remain blocked. | | Host/runtime boundary proof | In progress | Host smoke passes; runtime families below remain blocked. |
| Documentation/release gate | In progress | `text14.txt` has roadmap; README/docs final pass still pending. | | Documentation/release gate | In progress | `text14.txt` has roadmap; README/docs final pass still pending. |
@@ -74,7 +74,7 @@ Execute these in order unless a later user request explicitly changes priority.
Current next task: Current next task:
- Audit and consolidate SDK/API exports for stable external callers. - Add project-level OPFS/session persistence summary and release-gate documentation.
Then complete the closure: Then complete the closure:
@@ -106,10 +106,10 @@ Completion criteria:
Work items: Work items:
- Audit `runtime/sdk/src/index.js`. - Audit `runtime/sdk/src/index.js`. Done.
- Export stable helpers that external callers should use. - Export stable helpers that external callers should use. Done for core, OPFS/session, sim-config staging, and INI panel shell/workflow overview helpers.
- Add or update SDK smoke for export shape and manifest compatibility. - Add or update SDK smoke for export shape and manifest compatibility. Done via `tests/sdk/node/verify_sdk_surface.sh`.
- Update `runtime/sdk/README.md` with usage examples and unsupported areas. - Update `runtime/sdk/README.md` with usage examples and unsupported areas. Initial SDK surface update done; final docs pass still pending.
Completion criteria: Completion criteria:

View File

@@ -894,3 +894,108 @@ host_wasm_opfs_browser_smokes=ok
`wasm-port/runtime/sdk/README.md`,确认外部调用方可复用的稳定 API 是否覆盖 INI panel shell `wasm-port/runtime/sdk/README.md`,确认外部调用方可复用的稳定 API 是否覆盖 INI panel shell
handoff、workflow overview embedding、OPFS/session persistence 与 sim-config staging优先补 handoff、workflow overview embedding、OPFS/session persistence 与 sim-config staging优先补
SDK export/README 说明和 Node smoke不扩大 CNC 语义边界,不新增解释器语义。 SDK export/README 说明和 Node smoke不扩大 CNC 语义边界,不新增解释器语义。
十二、2026-06-15 继续执行记录SDK/API surface exports and smoke
本轮按 `text14.txt` 执行,进入 SDK/API surface consolidation。审计并扩展
`wasm-port/runtime/sdk/src/index.js`,让外部调用方可以从 SDK stable entrypoint 直接使用核心
LinuxCNC WASM wrappers、sim-config staging、OPFS/session persistence以及 INI panel shell
handoff / workflow overview embedding helper。
完成内容:
- `runtime/sdk/src/index.js` 保留既有 core exports
- `createLinuxCncIniSdk()`
- `createLinuxCncInterpSdk()`
- `planIniFileContextStaging()`
- `planSimConfigStaging()`
- `analyzeIniRuntimeBoundaries()`
- SDK stable entrypoint 新增 OPFS/path/file/session exports
- `getOpfsRoot()`
- `saveTextFile()`
- `loadTextFile()`
- `machineIniPath()`
- `toolTablePath()`
- `parameterFilePath()`
- `gcodeProgramPath()`
- `sessionSnapshotPath()`
- `defaultMachinePaths()`
- `normalizeOpfsPath()`
- session snapshot helpers
- machine text/G-code file helpers
- parameter/tool-table OPFS bridge helpers
- `loadMachineSessionFromOpfs()`
- SDK stable entrypoint 新增 INI panel shell/workflow overview helper exports
- launch API manifest/schema helpers
- shell integration manifest/readiness/schema/workflow helpers
- shell session handoff summary/package/mount helpers
- workflow overview contract/readiness helpers
- workflow overview embedding report/display/render/DOM/mount helpers
- `mountIniPanelShellWorkflowOverviewEmbeddingMountState()`
- 新增 `wasm-port/tests/sdk/node/verify_sdk_surface.mjs`
- 新增 `wasm-port/tests/sdk/node/verify_sdk_surface.sh`
- SDK surface smoke 覆盖:
- core exports
- OPFS/session persistence exports
- workflow overview embedding mount wrapper exports
- path helper runtime shape
- launch manifest compatibility
- shell view-model method exposure
- README/tracker 文档记录;
- `wasm-port/tests/host/verify_host_smokes.sh` 纳入
`wasm-port/tests/sdk/node/verify_sdk_surface.sh`
- `wasm-port/runtime/sdk/README.md` 增补 stable imports、OPFS/session persistence exports、
INI panel shell handoff exports、workflow overview embedding helper说明与边界说明
- `PROJECT_COMPLETION_TRACKER.md` 同步当前完成批次与下一步 OPFS/session persistence
project-level summary / release-gate docs
- 未新增控制按钮;
- 未执行 action-plan
- 未解析 G-code
- 未解释 canonical events
- 未新增 JS CNC 语义;
- 未改变 LinuxCNC interpreter、tool、parameter、planner 或 LinuxCNC-owned runtime semantics。
验证已通过:
```bash
git diff --check
wasm-port/tests/sdk/node/verify_sdk_surface.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
sdk_surface_node_smoke=ok
ini_panel_ui_shell_node_smoke=ok
ini_panel_launch_api_manifest_node_smoke=ok
ini_panel_shell_integration_manifest_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_workflow_overview_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
```
下一步工作计划:
继续推进 OPFS/session persistence 与 release-gate 文档收口。下一批建议新增项目级
OPFS/session persistence summary 或 release workflow 文档,串联 SDK stable imports、browser
OPFS smoke、session snapshot/machine-file helpers、host gate 命令和 blocked runtime family 说明;
优先让新接手者能按文档复现支持面与验证入口,不扩大 CNC 语义边界。

View File

@@ -24,10 +24,40 @@ Use `src/index.js` for stable imports:
```js ```js
import { import {
analyzeIniRuntimeBoundaries, analyzeIniRuntimeBoundaries,
createIniPanelLaunchApiManifest,
createIniPanelShellViewModel,
createIniPanelShellWorkflowOverviewEmbeddingMountDomContract,
createIniPanelShellWorkflowOverviewEmbeddingMountDomReadiness,
createLinuxCncIniSdk, createLinuxCncIniSdk,
createLinuxCncInterpSdk, createLinuxCncInterpSdk,
createMachineSessionSnapshotPayload,
createSessionSnapshot,
defaultMachinePaths,
gcodeFilenameFromProgramPath,
gcodeProgramPath,
getOpfsRoot,
isSupportedIniPanelLaunchApiManifest,
loadMachineSessionFromOpfs,
loadMachineSessionSnapshot,
loadMachineTextFiles,
loadMachineToolTableFromOpfs,
loadTextFile,
machineFilePaths,
machineIniPath,
mountIniPanelShellWorkflowOverviewEmbeddingMountState,
normalizeOpfsPath,
parameterFilePath,
planIniFileContextStaging, planIniFileContextStaging,
planSimConfigStaging, planSimConfigStaging,
renderIniPanelShellWorkflowOverviewEmbeddingMountState,
restoreMachineParametersFromOpfs,
saveMachineSessionSnapshot,
saveMachineTextFiles,
saveSessionSnapshot,
saveTextFile,
sessionSnapshotPath,
toolTablePath,
validateSessionSnapshot,
} from "./src/index.js"; } from "./src/index.js";
``` ```
@@ -123,3 +153,49 @@ change interpreter semantics.
path but keeps the runner loop going after LinuxCNC reports an error, matching path but keeps the runner loop going after LinuxCNC reports an error, matching
upstream `rs274 -n 0` regression tests such as `tests/interp/oword-unwind`. upstream `rs274 -n 0` regression tests such as `tests/interp/oword-unwind`.
It does not implement or reinterpret LinuxCNC error semantics. It does not implement or reinterpret LinuxCNC error semantics.
## OPFS/session persistence exports
The SDK entrypoint re-exports the OPFS/session persistence helpers used by the
browser panel so external callers can stage the same files without importing
private module paths:
- `getOpfsRoot()`, `saveTextFile()`, and `loadTextFile()` for browser OPFS text
persistence.
- `machineIniPath()`, `toolTablePath()`, `parameterFilePath()`,
`gcodeProgramPath()`, `sessionSnapshotPath()`, `defaultMachinePaths()`, and
`normalizeOpfsPath()` for stable OPFS path construction.
- `createMachineSessionSnapshotPayload()`, `createSessionSnapshot()`,
`saveSessionSnapshot()`, `saveMachineSessionSnapshot()`,
`loadMachineSessionSnapshot()`, and `validateSessionSnapshot()` for session
snapshot persistence.
- `machineFilePaths()`, `saveMachineTextFiles()`, `loadMachineTextFiles()`, and
`gcodeFilenameFromProgramPath()` for machine-file and G-code file helpers.
- `restoreMachineParametersFromOpfs()`, `loadMachineToolTableFromOpfs()`, and
`loadMachineSessionFromOpfs()` for loading OPFS machine state into the
LinuxCNC-backed interpreter SDK.
These helpers only move and validate host files. Parameter and tool-table
effects still come from the LinuxCNC-backed interpreter SDK methods they call.
## INI panel shell handoff exports
The SDK entrypoint also re-exports the stable INI panel shell handoff surface
for external browser shells:
- `createIniPanelLaunchApiManifest()` and
`isSupportedIniPanelLaunchApiManifest()` for launch API negotiation.
- `createIniPanelShellViewModel()` for a complete read-only shell integration
bundle.
- `createIniPanelShellWorkflowOverviewEmbeddingMountDomContract()` and
`createIniPanelShellWorkflowOverviewEmbeddingMountDomReadiness()` for
workflow overview embedding mount DOM checks.
- `renderIniPanelShellWorkflowOverviewEmbeddingMountState()` for rendering a
mount render-state into caller-owned DOM.
- `mountIniPanelShellWorkflowOverviewEmbeddingMountState()` for a non-throwing
workflow overview embedding mount wrapper that returns structured blocked
results when DOM nodes are missing.
The workflow overview embedding helpers are UI/runtime boundary helpers only.
They render status and rows already produced by the shell view-model; they do
not parse G-code, execute action plans, or implement CNC semantics.

View File

@@ -5,3 +5,91 @@ export {
planIniFileContextStaging, planIniFileContextStaging,
planSimConfigStaging, planSimConfigStaging,
} from "./sim-config-staging.js"; } from "./sim-config-staging.js";
export {
defaultMachinePaths,
gcodeProgramPath,
machineIniPath,
machineRoot,
normalizeOpfsPath,
opfsPath,
parameterFilePath,
previewCachePath,
sessionSnapshotPath,
splitOpfsPath,
toolTablePath,
} from "../../opfs/path-model.js";
export {
ensureParentDir,
getOpfsRoot,
loadTextFile,
saveTextFile,
} from "../../opfs/file-service.js";
export {
createMachineSessionSnapshotPayload,
createSessionSnapshot,
loadMachineSessionSnapshot,
loadSessionSnapshot,
saveMachineSessionSnapshot,
saveSessionSnapshot,
validateSessionSnapshot,
} from "../../opfs/snapshot-store.js";
export {
gcodeFilenameFromProgramPath,
loadGcodeProgram,
loadMachineTextFiles,
machineFilePaths,
saveGcodeProgram,
saveMachineTextFiles,
} from "../../opfs/machine-file-store.js";
export {
restoreMachineParametersFromOpfs,
saveMachineParametersToOpfs,
} from "../../opfs/linuxcnc-parameter-bridge.js";
export {
loadMachineToolTableFromOpfs,
saveMachineToolTableToOpfs,
} from "../../opfs/linuxcnc-tool-table-bridge.js";
export { loadMachineSessionFromOpfs } from "../../opfs/linuxcnc-machine-session-bridge.js";
export {
createIniPanelLaunchApiManifest,
createIniPanelLaunchApiSchema,
createIniPanelShellIntegrationManifest,
createIniPanelShellIntegrationReadiness,
createIniPanelShellIntegrationSchema,
createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageMountDisplayViewModel,
createIniPanelShellSessionHandoffPackageMountRenderState,
createIniPanelShellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageSchema,
createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema,
createIniPanelShellViewModel,
createIniPanelShellWorkflowOverviewContract,
createIniPanelShellWorkflowOverviewEmbeddingDisplayViewModel,
createIniPanelShellWorkflowOverviewEmbeddingDomContract,
createIniPanelShellWorkflowOverviewEmbeddingDomReadiness,
createIniPanelShellWorkflowOverviewEmbeddingMountDisplayViewModel,
createIniPanelShellWorkflowOverviewEmbeddingMountDomContract,
createIniPanelShellWorkflowOverviewEmbeddingMountDomReadiness,
createIniPanelShellWorkflowOverviewEmbeddingMountRenderState,
createIniPanelShellWorkflowOverviewEmbeddingRenderState,
createIniPanelShellWorkflowOverviewEmbeddingReport,
createIniPanelShellWorkflowOverviewReadiness,
isSupportedIniPanelLaunchApiManifest,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffPackage,
isSupportedIniPanelShellSessionHandoffSummary,
mountIniPanelShellSessionHandoff,
mountIniPanelShellWorkflowOverviewEmbedding,
mountIniPanelShellWorkflowOverviewEmbeddingMountState,
mountIniPanelShellWorkflowOverviewEmbeddingState,
renderIniPanelShellSessionHandoffMountState,
renderIniPanelShellWorkflowOverviewEmbeddingMountState,
renderIniPanelShellWorkflowOverviewEmbeddingState,
} from "../../ui/ini-panel/ui-shell.js";

View File

@@ -13,6 +13,7 @@ SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_sim_configs_inventory_wasm
SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_nc_files_wasm.sh" SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_nc_files_wasm.sh"
SKIP_TP_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_tp_wasm.sh" SKIP_TP_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_tp_wasm.sh"
"$ROOT_DIR/tests/opfs/node/verify_file_service.sh" "$ROOT_DIR/tests/opfs/node/verify_file_service.sh"
"$ROOT_DIR/tests/sdk/node/verify_sdk_surface.sh"
"$ROOT_DIR/tests/ui/node/verify_ui_node_smokes.sh" "$ROOT_DIR/tests/ui/node/verify_ui_node_smokes.sh"
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/browser/verify_ini_panel_browser.sh" SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/browser/verify_ini_panel_browser.sh"
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/browser/verify_interp_browser.sh" SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/browser/verify_interp_browser.sh"

View File

@@ -0,0 +1,140 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import {
analyzeIniRuntimeBoundaries,
createIniPanelLaunchApiManifest,
createIniPanelShellViewModel,
createIniPanelShellWorkflowOverviewEmbeddingMountDomContract,
createIniPanelShellWorkflowOverviewEmbeddingMountDomReadiness,
createLinuxCncIniSdk,
createLinuxCncInterpSdk,
createMachineSessionSnapshotPayload,
createSessionSnapshot,
defaultMachinePaths,
gcodeFilenameFromProgramPath,
gcodeProgramPath,
getOpfsRoot,
isSupportedIniPanelLaunchApiManifest,
loadMachineSessionFromOpfs,
loadMachineSessionSnapshot,
loadMachineTextFiles,
loadMachineToolTableFromOpfs,
loadTextFile,
machineFilePaths,
machineIniPath,
mountIniPanelShellWorkflowOverviewEmbeddingMountState,
normalizeOpfsPath,
parameterFilePath,
planIniFileContextStaging,
planSimConfigStaging,
renderIniPanelShellWorkflowOverviewEmbeddingMountState,
restoreMachineParametersFromOpfs,
saveMachineSessionSnapshot,
saveMachineTextFiles,
saveSessionSnapshot,
saveTextFile,
sessionSnapshotPath,
toolTablePath,
validateSessionSnapshot,
} from "../../../runtime/sdk/src/index.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = resolve(__dirname, "../../..");
const sdkIndexText = readFileSync(resolve(root, "runtime/sdk/src/index.js"), "utf8");
const sdkReadmeText = readFileSync(resolve(root, "runtime/sdk/README.md"), "utf8");
const trackerText = readFileSync(resolve(root, "../PROJECT_COMPLETION_TRACKER.md"), "utf8");
const requiredExports = [
["createLinuxCncIniSdk", createLinuxCncIniSdk],
["createLinuxCncInterpSdk", createLinuxCncInterpSdk],
["planIniFileContextStaging", planIniFileContextStaging],
["planSimConfigStaging", planSimConfigStaging],
["analyzeIniRuntimeBoundaries", analyzeIniRuntimeBoundaries],
["getOpfsRoot", getOpfsRoot],
["saveTextFile", saveTextFile],
["loadTextFile", loadTextFile],
["machineIniPath", machineIniPath],
["toolTablePath", toolTablePath],
["parameterFilePath", parameterFilePath],
["gcodeProgramPath", gcodeProgramPath],
["sessionSnapshotPath", sessionSnapshotPath],
["defaultMachinePaths", defaultMachinePaths],
["normalizeOpfsPath", normalizeOpfsPath],
["createMachineSessionSnapshotPayload", createMachineSessionSnapshotPayload],
["createSessionSnapshot", createSessionSnapshot],
["saveSessionSnapshot", saveSessionSnapshot],
["saveMachineSessionSnapshot", saveMachineSessionSnapshot],
["loadMachineSessionSnapshot", loadMachineSessionSnapshot],
["validateSessionSnapshot", validateSessionSnapshot],
["machineFilePaths", machineFilePaths],
["saveMachineTextFiles", saveMachineTextFiles],
["loadMachineTextFiles", loadMachineTextFiles],
["gcodeFilenameFromProgramPath", gcodeFilenameFromProgramPath],
["restoreMachineParametersFromOpfs", restoreMachineParametersFromOpfs],
["loadMachineToolTableFromOpfs", loadMachineToolTableFromOpfs],
["loadMachineSessionFromOpfs", loadMachineSessionFromOpfs],
["createIniPanelLaunchApiManifest", createIniPanelLaunchApiManifest],
["isSupportedIniPanelLaunchApiManifest", isSupportedIniPanelLaunchApiManifest],
["createIniPanelShellViewModel", createIniPanelShellViewModel],
[
"createIniPanelShellWorkflowOverviewEmbeddingMountDomContract",
createIniPanelShellWorkflowOverviewEmbeddingMountDomContract,
],
[
"createIniPanelShellWorkflowOverviewEmbeddingMountDomReadiness",
createIniPanelShellWorkflowOverviewEmbeddingMountDomReadiness,
],
[
"renderIniPanelShellWorkflowOverviewEmbeddingMountState",
renderIniPanelShellWorkflowOverviewEmbeddingMountState,
],
[
"mountIniPanelShellWorkflowOverviewEmbeddingMountState",
mountIniPanelShellWorkflowOverviewEmbeddingMountState,
],
];
for (const [name, value] of requiredExports) {
assert.equal(typeof value, "function", `${name} SDK export drift`);
assert.match(sdkIndexText, new RegExp(`\\b${name}\\b`));
assert.match(sdkReadmeText, new RegExp(`\\b${name}\\b`));
}
assert.equal(machineIniPath("sdk-mill"), "linuxcnc/machines/sdk-mill/machine.ini");
assert.deepEqual(defaultMachinePaths("sdk-mill"), machineFilePaths("sdk-mill"));
assert.equal(gcodeProgramPath("demo.ngc"), "linuxcnc/gcode/demo.ngc");
assert.equal(sessionSnapshotPath("sdk-session"), "linuxcnc/sessions/sdk-session/snapshot.json");
assert.equal(normalizeOpfsPath("linuxcnc/machines/sdk-mill/tool.tbl"), "linuxcnc/machines/sdk-mill/tool.tbl");
assert.equal(gcodeFilenameFromProgramPath("linuxcnc/gcode/demo.ngc"), "demo.ngc");
const launchManifest = createIniPanelLaunchApiManifest();
assert.equal(isSupportedIniPanelLaunchApiManifest(launchManifest), true);
assert.equal(
launchManifest.methods.includes("mountWorkflowOverviewEmbeddingMountState"),
true,
);
const shellViewModel = createIniPanelShellViewModel();
assert.equal(
shellViewModel.launchApiManifest.methods.includes("mountWorkflowOverviewEmbeddingMountState"),
true,
);
assert.equal(
shellViewModel.mountWorkflowOverviewEmbeddingMountState,
mountIniPanelShellWorkflowOverviewEmbeddingMountState,
);
const blockedMount = mountIniPanelShellWorkflowOverviewEmbeddingMountState({ documentRef: null });
assert.equal(blockedMount.apiName, "ini-panel-shell-workflow-overview-embedding-mount-dom-mount");
assert.equal(blockedMount.ready, false);
assert.deepEqual(blockedMount.domReadiness.missing, ["document", "mount", "status", "rows"]);
assert.match(sdkReadmeText, /OPFS\/session persistence/);
assert.match(sdkReadmeText, /INI panel shell handoff/);
assert.match(sdkReadmeText, /workflow overview embedding/);
assert.match(trackerText, /SDK\/API surface/);
console.log("sdk_surface_node_smoke=ok");

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
node "$ROOT_DIR/tests/sdk/node/verify_sdk_surface.mjs"