@openclaw/plugin-inspector 0.1.2 → 0.2.0

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.
@@ -13,7 +13,7 @@ export const syntheticRegistrationExecutionProfiles = {
13
13
  },
14
14
  registerChannel: {
15
15
  mode: "channel-opt-in",
16
- callableProperties: ["send", "receive"],
16
+ callableProperties: ["send", "sendMessage", "receive", "handleMessage"],
17
17
  option: "includeChannelRuntime",
18
18
  },
19
19
  registerCli: {
@@ -31,7 +31,7 @@ export const syntheticRegistrationExecutionProfiles = {
31
31
  },
32
32
  registerGatewayMethod: {
33
33
  mode: "direct",
34
- callableProperties: ["handler", "run", "execute"],
34
+ callableProperties: ["handler", "run", "execute", "invoke"],
35
35
  },
36
36
  registerHttpRoute: {
37
37
  mode: "direct",
@@ -58,12 +58,12 @@ export const syntheticRegistrationExecutionProfiles = {
58
58
  },
59
59
  registerService: {
60
60
  mode: "lifecycle-opt-in",
61
- callableProperties: ["start", "stop"],
61
+ callableProperties: ["start", "stop", "dispose"],
62
62
  option: "includeLifecycle",
63
63
  },
64
64
  registerSpeechProvider: {
65
65
  mode: "provider-opt-in",
66
- callableProperties: ["speak", "synthesize"],
66
+ callableProperties: ["speak", "synthesize", "tts"],
67
67
  option: "includeProviderCapabilities",
68
68
  },
69
69
  registerTool: {
@@ -452,7 +452,8 @@ async function runRegistrationProbes(entry, retainedEntry, captureIndex, options
452
452
  return [metadataOnlyResult(entry, captureIndex, profile.reason)];
453
453
  }
454
454
 
455
- const descriptor = retainedEntry.arguments?.[0] ?? retainedEntry.returnValue;
455
+ const descriptor =
456
+ retainedEntry.arguments?.find((value) => value && typeof value === "object") ?? retainedEntry.returnValue;
456
457
  if (!descriptor || typeof descriptor !== "object") {
457
458
  return [blockedResult(entry, captureIndex, "captured registration has no object descriptor")];
458
459
  }
@@ -1,15 +1,16 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { mkdir, readFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
4
5
  import { renderPaddedMarkdownTable, writeJsonMarkdownArtifacts } from "./artifacts.js";
5
6
  import { buildColdImportReadiness } from "./cold-import-readiness.js";
6
7
  import { normalizeRepoPath, posixJoin, slugForArtifact } from "./path-utils.js";
7
8
 
8
9
  export const defaultWorkspacePlanOptions = {
9
- captureScript: "plugin-inspector-capture",
10
+ captureScript: null,
10
11
  optInEnv: "PLUGIN_INSPECTOR_EXECUTE_ISOLATED=1",
11
12
  resultsRoot: ".plugin-inspector/results",
12
- syntheticProbeScript: "plugin-inspector-synthetic-probes",
13
+ syntheticProbeScript: null,
13
14
  workspaceRoot: ".plugin-inspector/workspaces",
14
15
  };
15
16
 
@@ -450,12 +451,23 @@ function runCommand(packageManager, script) {
450
451
 
451
452
  function captureCommand(settings, fixtureId, entrypoint, workspacePath) {
452
453
  const loader = entrypoint.blockers.some((blocker) => blocker.code === "ts-loader-required") ? " --import tsx" : "";
453
- return `${settings.optInEnv} node${loader} ${settings.captureScript} ${entrypoint.specifier} --output ${workspaceArtifactPath(settings, fixtureId, entrypoint, workspacePath, "capture")}`;
454
+ const script = helperScript(settings, workspacePath, settings.captureScript, "capture-cli.js");
455
+ return `${settings.optInEnv} node${loader} ${script} ${entrypoint.specifier} --mock-sdk --output ${workspaceArtifactPath(settings, fixtureId, entrypoint, workspacePath, "capture")}`;
454
456
  }
455
457
 
456
458
  function syntheticProbeCommand(settings, fixtureId, entrypoint, workspacePath) {
457
459
  const loader = entrypoint.blockers.some((blocker) => blocker.code === "ts-loader-required") ? " --import tsx" : "";
458
- return `${settings.optInEnv} node${loader} ${settings.syntheticProbeScript} --entrypoint ${entrypoint.specifier} --output ${workspaceArtifactPath(settings, fixtureId, entrypoint, workspacePath, "synthetic")}`;
460
+ const script = helperScript(settings, workspacePath, settings.syntheticProbeScript, "synthetic-probes-cli.js");
461
+ return `${settings.optInEnv} node${loader} ${script} --entrypoint ${entrypoint.specifier} --mock-sdk --output ${workspaceArtifactPath(settings, fixtureId, entrypoint, workspacePath, "synthetic")}`;
462
+ }
463
+
464
+ function helperScript(settings, workspacePath, configuredScript, helperFileName) {
465
+ if (configuredScript) {
466
+ return configuredScript;
467
+ }
468
+ const helperPath = fileURLToPath(new URL(`./${helperFileName}`, import.meta.url));
469
+ const workspaceFsPath = path.join(settings.rootDir, workspacePath);
470
+ return repoRelative(path.relative(workspaceFsPath, helperPath));
459
471
  }
460
472
 
461
473
  function targetOpenClawWorkspacePath(settings, fixtureId, targetOpenClawPath) {