plugin-inspector/README.md
Vincent Koc e7747f74ca
feat: add OpenClaw target surface parser
Add reusable OpenClaw target checkout parsing for compatibility records, hooks, registrars, SDK exports, and manifest type fields.
2026-04-26 20:46:04 -07:00

2.5 KiB

plugin-inspector

plugin-inspector is the reusable OpenClaw plugin compatibility inspector. It wraps the static inspection, registration capture, and report model prototyped in crabpot into an npm-publishable package.

No npm package has been published yet.

Install

During development, use a local checkout or packed tarball:

npm install --save-dev ../plugin-inspector

Future package name:

npm install --save-dev @openclaw/plugin-inspector

CLI

Inspect a crabpot-compatible fixture config:

plugin-inspector report --config crabpot.config.json --out reports

Fail if expected hooks, registrations, or manifest contracts are missing:

plugin-inspector ci --config crabpot.config.json --out reports --check

Capture a plugin entrypoint in an explicitly isolated execution lane:

PLUGIN_INSPECTOR_EXECUTE_ISOLATED=1 plugin-inspector capture ./dist/index.js

API

import {
  buildCiSummary,
  buildColdImportReadiness,
  buildContractCapture,
  buildPlatformProbes,
  createCaptureApi,
  inspectFixtureSet,
  loadInspectorConfig,
  readOpenClawTargetSurface,
  renderColdImportReadinessMarkdown,
  renderContractCaptureMarkdown,
  renderPlatformProbesMarkdown,
  renderMarkdownReport,
  writeCiSummary,
  writeColdImportReadiness,
  writeContractCapture,
  writePlatformProbes,
  writeReport,
} from "@openclaw/plugin-inspector";

const config = await loadInspectorConfig("crabpot.config.json");
const report = await inspectFixtureSet(config);
await writeReport(report, { outDir: "reports" });

const summary = await buildCiSummary({ reportsDir: "reports" });
await writeCiSummary(summary);

const capture = buildContractCapture({ report });
await writeContractCapture(capture);

const readiness = buildColdImportReadiness({ report });
await writeColdImportReadiness(readiness);

const target = await readOpenClawTargetSurface({ manifest: config });

const platformProbes = buildPlatformProbes({ plan: existingWorkspacePlan });
await writePlatformProbes(platformProbes);

Scope

Default inspection is offline and credential-free. It reads manifests, package metadata, and source files, then reports observed api.on(...), api.register*, define*, SDK imports, and manifest contracts. OpenClaw target checkout parsing is limited to public compatibility registries, SDK package exports, manifest types, hooks, and captured registrar metadata.

Cold import capture and synthetic contract probes are explicit opt-in modes. Live lanes will stay credential-gated and must never run in default CI.