[AAASM-2326] 🐛 (npm): Ship scripts/postinstall.mjs in published tarball#64
Conversation
v0.0.1-alpha.3 published successfully (AAASM-2190 access-public fix
worked) but the tarball was broken on consumer install:
npm error Cannot find module '.../scripts/postinstall.mjs'
Root cause: package.json declares
scripts.postinstall = "node ./scripts/postinstall.mjs"
but the files: array doesn't include scripts/ — only dist/, native/,
README, LICENSE. So npm pack ships package.json + dist/ + native/
but NOT the postinstall script it tries to run.
Fix: add scripts/postinstall.mjs to the files: array.
Verified locally:
$ pnpm pack
$ tar -tzf agent-assembly-sdk-0.0.1-alpha.3.tgz | grep postinstall
package/scripts/postinstall.mjs ← present
$ cd /tmp/fresh-dir
$ npm install /tmp/agent-assembly-sdk-0.0.1-alpha.3.tgz
added 36 packages, audited 37 packages in 5s
0 vulnerabilities ← no postinstall error
The existing @agent-assembly/sdk@0.0.1-alpha.{1,2,3} on the npm
registry are unusable by end users (same bug as alpha-3). After
this PR merges + a new tag publishes, consider deprecating the
3 broken pre-release versions on npm — `npm deprecate
@agent-assembly/sdk@<broken-ver> "broken postinstall, use newer"`.
Tracked: AAASM-2326
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Claude Code review — AAASM-2326CI state25/25 SUCCESS — Scope vs. acceptance criteria
Severity callout in PR body — agreeThe PR body flags this as High severity because Potential concern: are there OTHER missing-from-tarball files?The PR fixes only ["dist/", "scripts/postinstall.mjs", "native/aa-ffi-node/*.node", "native/aa-ffi-node/index.cjs", "native/aa-ffi-node/index.d.ts", "README.md", "LICENSE"]Worth a follow-up audit: does any code path inside Not blocking this PR — fixing the postinstall is necessary regardless. But the VerdictReady for human approval and merge. Fix is correct, locally end-to-end verified, severity is appropriately flagged. Recommend filing a follow-up "audit — Claude Code (Opus 4.7, 1M context) |



Description
v0.0.1-alpha.3 verified AAASM-2190's
--access publicfix unblocked the publish, but the published tarball is broken on install:Root cause:
package.jsondeclares"postinstall": "node ./scripts/postinstall.mjs"but the
files:array doesn't includescripts/— sopnpm packproduces a tarball without the postinstall script it tries to run.Severity
High. All currently-published
@agent-assembly/sdk@0.0.1-alpha.{1,2,3}versions are unusable by end users (npm installalways fails). After this PR merges + next tag publishes, considernpm deprecateon the 3 broken pre-release versions.Fix
Add
scripts/postinstall.mjsto thefiles:array.Local verification
Related
— Claude Code (Opus 4.7, 1M context)