perf(plugins) refactor plugin SDK declarations for flat package types#87165
Conversation
Dependency Changes DetectedThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
|
Codex review: needs maintainer review before merge. Reviewed May 27, 2026, 10:18 PM ET / 02:18 UTC. Summary PR surface: Source -19, Tests +124, Config +10, Other +142. Total +257 across 14 files. Reproducibility: not applicable. This PR is a package-layout refactor, not a bug report with a failing current-main reproduction path. The relevant evidence is package/build proof from the PR body and CI/check-run state. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land only after maintainer signoff that the flat Plugin SDK package layout is the desired contract and the exact head keeps build, pack, release-check, inventory, and package-boundary proof green. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR is a package-layout refactor, not a bug report with a failing current-main reproduction path. The relevant evidence is package/build proof from the PR body and CI/check-run state. Is this the best way to solve the issue? Yes, conditionally; the implementation is a coherent narrow path for shipping flat public SDK declarations while preserving package-boundary proof. The remaining question is maintainer acceptance of dropping the deep dist internals from the packed package. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against d1577a2ff283. Label changesLabel justifications:
Evidence reviewedPR surface: Source -19, Tests +124, Config +10, Other +142. Total +257 across 14 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Velvet Lint Imp Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
d97def9 to
e319c16
Compare
1f67ce5 to
d55d2af
Compare
e319c16 to
10aebfb
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
d55d2af to
a907668
Compare
daac11c to
d465d76
Compare
ebf5194 to
3cb59da
Compare
|
@clawsweeper re-review Rebased onto current |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3cb59da to
b35824f
Compare
|
@clawsweeper re-review Rebased onto latest |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
This comment has been minimized.
This comment has been minimized.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Peter Steinberger <steipete@gmail.com>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
dist/plugin-sdk/*.d.tsinstead of shipping public declarations through the olddist/plugin-sdk/src/**tree.dist/plugin-sdk/src/**from the npm package, keepdist/postinstall-inventory.jsonaligned with that exclusion, and add installed-tarball TypeScript consumer proof torelease-check.#87120 already removed the public Vitest-backed test-helper SDK subpaths from
main; this PR is the follow-up package-layout refactor for the remaining public SDK declarations.Size Impact
Measured against current
origin/main(b01c6d4eaa) after:pnpm buildnode --import tsx scripts/write-package-dist-inventory.tsnpm --silent pack --json --ignore-scripts --pack-destination <tmp>Results:
main: tarball 17,763,047 bytes; unpacked 78,966,685 bytes; 12,513 files;dist/plugin-sdk4,623 files / 7,046,401 bytes.dist/plugin-sdk1,154 files / 3,823,484 bytes.dist/plugin-sdk-3,469 files / -3,222,917 bytes.The packed artifact now has 0
dist/plugin-sdk/src/**files, down from 3,908 on currentmain. The generateddist/postinstall-inventory.jsonalso has 0dist/plugin-sdk/src/**entries, down from 3,908. The removed deep tree is partially offset by 846 flat root declaration chunks totaling 3,383,030 bytes, which keep publicopenclaw/plugin-sdk/*TypeScript imports resolving from the installed package.Verification
pnpm buildnode --import tsx scripts/write-package-dist-inventory.tsnpm --silent pack --json --ignore-scripts --pack-destination <tmp>OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/openclaw-vitest-smoke-fixture node scripts/run-vitest.mjs test/release-check.test.ts test/scripts/check-openclaw-package-tarball.test.ts src/infra/package-dist-inventory.test.tsOPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/openclaw-vitest-conflict-fix node scripts/run-vitest.mjs src/infra/package-dist-inventory.test.ts test/release-check.test.ts test/scripts/check-openclaw-package-tarball.test.ts src/plugins/contracts/extension-package-project-boundaries.test.tsnode --import tsx scripts/release-check.tsnode scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox --blacksmith-org openclaw --blacksmith-workflow .github/workflows/ci-check-testbox.yml --blacksmith-job check --blacksmith-ref main --idle-timeout 90m --ttl 240m --timing-json -- corepack pnpm run test:extensions:package-boundary:compiletbx_01kskzc6gzwvnxa2zy0e4fbr90Real behavior proof
Behavior addressed: Installed package no longer ships the unnecessary deep
dist/plugin-sdk/src/**declaration tree while publicopenclaw/plugin-sdk/*TypeScript imports continue resolving, and package inventory no longer references omitted deep SDK declarations.Real environment tested: Local macOS Node 24 build/package checks plus Blacksmith Testbox Linux package-boundary compile through Crabbox.
Exact steps or command run after this patch: See Verification above.
Evidence after fix: npm pack measurement shows
dist/plugin-sdk/src/**count 0; generateddist/postinstall-inventory.jsonhas 0dist/plugin-sdk/src/**entries; release-check installs a packed tarball into temporary consumer projects and runs TypeScript against representative SDK imports; Testbox compiled 108 plugin package-boundary projects.Observed result after fix: Build, pack measurement, release-check, focused Vitest/tarball/inventory tests, and Testbox package-boundary compile passed.
What was not tested: Full
pnpm check/full test suite was not run locally; package-boundary broad proof was run remotely instead.