Lines 3-43javascript
3 * Runtime SDK validation — run this INSIDE a gateway VM to verify
4 * our plugin's type guard matches the actual OpenClaw SDK exports.
7 * node /opt/extensions/gondolin/sdk-validate.mjs
9 * Exit 0 = compatible, Exit 1 = mismatch (lists missing exports)
11const SDK_PATH = '/opt/openclaw-sdk/sandbox.js';
13const REQUIRED_EXPORTS = [
14 'buildExecRemoteCommand',
16 'buildSshSandboxArgv',
17 'createSshSandboxSessionFromSettings',
18 'runSshSandboxCommand',
20 'registerSandboxBackend',
24 const sdk = await import(SDK_PATH);
25 const missing = REQUIRED_EXPORTS.filter((name) => typeof sdk[name] !== 'function');
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/sdk-validate.mjsView on unpkg · L23 27 if (missing.length > 0) {
28 process.stderr.write(`SDK MISMATCH - missing exports: ${missing.join(', ')}\n`);
29 process.stderr.write('Update assertSdkShape() and SshHelpers interface in plugin.ts\n');
34 `SDK COMPATIBLE - all ${String(REQUIRED_EXPORTS.length)} required exports found\n`,
38 const message = error instanceof Error ? error.message : JSON.stringify(error);
39 process.stderr.write(`SDK LOAD FAILED: ${message}\n`);
40 process.stderr.write(`Is OpenClaw installed? Expected at: ${SDK_PATH}\n`);