@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.
- package/CHANGELOG.md +28 -0
- package/README.md +56 -8
- package/examples/github-actions-plugin-inspector.yml +1 -2
- package/examples/package-json-plugin-inspector.json +21 -0
- package/package.json +1 -1
- package/src/advanced.js +10 -0
- package/src/api.js +2 -1
- package/src/capture-api.js +20 -3
- package/src/capture-cli.js +61 -0
- package/src/ci-outputs.js +235 -0
- package/src/ci-summary.js +1 -1
- package/src/cli.js +157 -6
- package/src/config.js +30 -3
- package/src/contract-probes.js +5 -0
- package/src/fixture-summary.js +40 -16
- package/src/index.js +1 -0
- package/src/init.js +1 -2
- package/src/issues.js +8 -0
- package/src/openclaw-target.js +27 -0
- package/src/report.js +1 -0
- package/src/sdk-mock.js +50 -5
- package/src/synthetic-probes-cli.js +101 -0
- package/src/synthetic-probes.js +6 -5
- package/src/workspace-plan.js +16 -4
package/src/synthetic-probes.js
CHANGED
|
@@ -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 =
|
|
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
|
}
|
package/src/workspace-plan.js
CHANGED
|
@@ -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:
|
|
10
|
+
captureScript: null,
|
|
10
11
|
optInEnv: "PLUGIN_INSPECTOR_EXECUTE_ISOLATED=1",
|
|
11
12
|
resultsRoot: ".plugin-inspector/results",
|
|
12
|
-
syntheticProbeScript:
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|