Split out of the review question on #705 ("Does this file interfere with the npm pack process?"). The answer for that PR is no — but investigating it surfaced a real, dormant condition worth recording before @endo/agent-tools ever goes public.
The condition
Every hand-authored declaration in @endo/agent-tools is matched by the root .gitignore catch-all and is therefore absent from an npm pack tarball, even though all eleven are tracked in git (force-added past the ignore rule).
.gitignore:93:*.d.ts* packages/agent-tools/pi.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/adapters/pi.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/json-tools/fs.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/json-tools/git-mount.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/json-tools/git-remote.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/json-tools/git.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/json-tools/http.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/json-tools/shell.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/src/tool.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/tool.d.ts
.gitignore:93:*.d.ts* packages/agent-tools/types-index.d.ts
npm-packlist honours that ignore rule, so a tarball built from this package contains zero .d.ts files while shipping all of the .js they describe:
$ cd packages/agent-tools && npm pack --dry-run --json | jq -r '.[0].files[].path' | grep -c '\.d\.ts$'
0
$ ... | grep -c 'src/json-tools/git-remote\.js'
1
The consequence, were the package published as-is: the top-level "types": "./types-index.d.ts" and every types condition in the exports map would dangle — a consumer would get untyped JS.
The correlation is exact, not incidental. @endo/exo is on the .gitignore negation allowlist for precisely two declarations, and its tarball ships precisely those two:
$ cd packages/exo && npm pack --dry-run --json | jq -r '.[0].files[].path' | grep '\.d\.ts$'
src/types.d.ts
types-index.d.ts
@endo/agent-tools has no allowlist entries and ships none.
Why it is dormant today
@endo/agent-tools is "private": true, and both scripts/pack-all.mjs and scripts/release-npm.mjs enumerate workspaces with yarn workspaces list --no-private. The package is never packed and never published, including by the viable-release CI job (yarn smoketest:publish → yarn release:npm → pack:all). Nothing is broken now; the hole opens the moment the private flag comes off.
Options
- Allowlist — add the eleven
!packages/agent-tools/... negations to .gitignore, alongside the existing entries the file labels "legacy exceptions to the above rule".
- Rename to the current convention — the
.gitignore comment states the going-forward convention is *.types.d.ts (!*.types.d.ts is already negated), which would make new declarations tracked without per-file edits. This is the cleaner fix but renames eleven files and their exports types targets.
- Do it at un-private time — fold either fix into whichever PR makes the package public, gated by a check.
Option 2 plus a guard (a check that every types target in every non-private package's exports map survives npm pack) would prevent the class rather than this instance. Recording rather than choosing here.
Split out of the review question on #705 ("Does this file interfere with the npm pack process?"). The answer for that PR is no — but investigating it surfaced a real, dormant condition worth recording before
@endo/agent-toolsever goes public.The condition
Every hand-authored declaration in
@endo/agent-toolsis matched by the root.gitignorecatch-all and is therefore absent from annpm packtarball, even though all eleven are tracked in git (force-added past the ignore rule).npm-packlisthonours that ignore rule, so a tarball built from this package contains zero.d.tsfiles while shipping all of the.jsthey describe:The consequence, were the package published as-is: the top-level
"types": "./types-index.d.ts"and everytypescondition in theexportsmap would dangle — a consumer would get untyped JS.The correlation is exact, not incidental.
@endo/exois on the.gitignorenegation allowlist for precisely two declarations, and its tarball ships precisely those two:@endo/agent-toolshas no allowlist entries and ships none.Why it is dormant today
@endo/agent-toolsis"private": true, and bothscripts/pack-all.mjsandscripts/release-npm.mjsenumerate workspaces withyarn workspaces list --no-private. The package is never packed and never published, including by theviable-releaseCI job (yarn smoketest:publish→yarn release:npm→pack:all). Nothing is broken now; the hole opens the moment theprivateflag comes off.Options
!packages/agent-tools/...negations to.gitignore, alongside the existing entries the file labels "legacy exceptions to the above rule"..gitignorecomment states the going-forward convention is*.types.d.ts(!*.types.d.tsis already negated), which would make new declarations tracked without per-file edits. This is the cleaner fix but renames eleven files and theirexportstypestargets.Option 2 plus a guard (a check that every
typestarget in every non-private package'sexportsmap survivesnpm pack) would prevent the class rather than this instance. Recording rather than choosing here.