@openclaw/plugin-inspector 0.3.9 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.10 - 2026-05-03
6
+
7
+ ### Fixed
8
+
9
+ - Accept valid mocked capture output when plugin code leaves `process.exitCode` dirty.
10
+
5
11
  ## 0.3.9 - 2026-05-03
6
12
 
7
13
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/plugin-inspector",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "private": false,
5
5
  "description": "Offline compatibility inspector for OpenClaw plugins.",
6
6
  "type": "module",
package/src/inspector.js CHANGED
@@ -234,10 +234,34 @@ export async function captureEntrypointWithMockSdk(entrypoint, options = {}) {
234
234
  );
235
235
  return JSON.parse(stdout);
236
236
  } catch (error) {
237
+ const captured = parseCaptureResultFromStdout(error?.stdout);
238
+ if (captured) {
239
+ return captured;
240
+ }
237
241
  throw classifyMockSdkCaptureError(error);
238
242
  }
239
243
  }
240
244
 
245
+ function parseCaptureResultFromStdout(stdout) {
246
+ if (!stdout) {
247
+ return null;
248
+ }
249
+ try {
250
+ const parsed = JSON.parse(stdout);
251
+ if (
252
+ parsed &&
253
+ typeof parsed === "object" &&
254
+ typeof parsed.status === "string" &&
255
+ Array.isArray(parsed.captured)
256
+ ) {
257
+ return parsed;
258
+ }
259
+ } catch {
260
+ return null;
261
+ }
262
+ return null;
263
+ }
264
+
241
265
  export function classifyMockSdkCaptureError(error) {
242
266
  const rawMessage = [error?.stderr, error?.stdout, error?.message].filter(Boolean).join("\n");
243
267
  const missingExport = rawMessage.match(/does not provide an export named ['"]([^'"]+)['"]/)?.[1];