Repository navigation
v0.2.2 — fix stale dist (postmortem)
Republish of 0.2.0 / 0.2.1 with the actual compiled runtime files. 0.2.1 shipped a tarball missing `dist/runtime/`, `dist/models.js`, `dist/cost.js`, `dist/windows.js` — barbeiro hit module-resolution errors at build time and disabled the v2 chat route as a hotfix.
What happened
`pnpm publish` zips whatever's on disk under `dist/`. The P4 source slices (1, 2, 3, 4, 5) were each built and tested inside their own worktree (`maestro-p4`). When those worktrees merged into main + got removed, main's own `dist/` stayed at its pre-P4 state. The 0.2.0 and 0.2.1 publishes ran from main, so they shipped that stale dist.
The published tarball reports 70 files. 0.2.2 reports 106 files — same source, complete compilation.
What's in 0.2.2
Exactly what 0.2.0 + 0.2.1 advertised:
- `maestro-core/runtime` — `runChatTurn`, `AiQuotaDeniedError`, `enforceQuotaOrThrow`, `checkAndEnforce`, `loadMemoryBlock`, `formatMemoryBlock`, `decideEmptyRecovery`, `shouldFallback`, `mapModelIdToOpenAI`
- Root: `selectChatModel`, `estimateCost`, `MODEL_PRICING`, `dailyTokensWindow` + window helpers
- 0.2.1 addition: `turnId?: string` arg in `RunChatTurnArgs`
Process guard
Added `prepublishOnly` script to `packages/maestro-core/package.json`:
```json
"prepublishOnly": "rm -rf dist .turbo *.tsbuildinfo && tsc -p tsconfig.build.json"
```
Fires on `npm publish` (NOT `npm pack` or `install`). Forces a clean rebuild before publish. Stale dist can never ship again.
Migration
- Already on 0.2.0 or 0.2.1? Bump to `^0.2.2`. No code changes needed.
- The 0.2.0 / 0.2.1 versions are immutable on npm but functionally broken — please move off them.