# Changelog

Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow [SemVer](https://semver.org/).

## [Unreleased]

## [1.1.0] - 2026-10-25

First public release on GitHub and npm.

### Added

- Startup warm-up: when a Cursor model is active at session start or gets selected, a throwaway Cursor agent pays the SDK's one-time process setup (key exchange, catalog, feature flags, ~8s) in the background. Its run is cancelled once accepted, so no model call is made, and the agent is deleted. First reply measured ~11s -> ~4.5s. Skipped in print / JSON mode; `PI_CURSOR_PREWARM=0` turns it off.

- `PI_CURSOR_CWD` sets the Cursor agent's working directory, for hosts whose process directory is not the workspace. Default stays `process.cwd()`.

### Fixed

- Tools added mid-session are announced to the model by name on the next send (`[Tool update: ...]`). Cursor only lists custom tools when a conversation starts, so the model often answered as if a new tool did not exist: with the tool unnamed in the prompt it was used 5/20 times before, 20/20 after (claude-haiku-5-5). Removed tools are dropped silently.

### Changed

- Default context tier is now the smallest offered (`PI_CURSOR_CONTEXT=min`); set `max` for the largest. Unknown values fall back to `min`.

- Published to npm as `cursor-to-pi`: install with `pi install npm:cursor-to-pi`, update with `pi update --extensions`. README adds a copy-paste line plus step-by-step guide for coding agents.
- `npm run check:public` guards releases against internal links, local paths and private identities; `npm publish` runs it with the type check and tests.

## [1.0.0] - 2026-10-13

First release of `cursor-to-pi`, written from scratch.

### Added

- One Cursor agent per pi session: later turns send only the new user text, and a pi tool call keeps the Cursor run open until pi returns the result. Measured cache hit rate went from 42% to 88%.
- Tools added or removed mid-session keep the agent; added system prompt lines are prepended to the next send, and a run waiting for tool results continues with the new tools.
- Calls without a pi session id (side-channel completions) get a short-lived session keyed by their opening.
- Context meter: exact for single-call runs, which also calibrate Cursor's own prompt overhead; otherwise a transcript estimate plus that overhead (CJK counted as about one token per character). Tool-call messages carry the estimate too.
- Usage: disjoint buckets (Cursor counts cache tokens inside `inputTokens`), per-call buckets that never exceed the reported context, cost from cumulative usage.
- Model params from Cursor's catalog: Claude `thinking` switch, effort mapped per model (`xhigh` <-> `extra-high`, `xhigh` / `max` offered when available), `fast=false`, largest context tier (`PI_CURSOR_CONTEXT=max|min|<value>`) with automatic step-down when a tier is rejected.
- pi 1.1 transcript contexts, `onPayload` and `onProviderStreamEvent` hooks, compat registry for `completeSimple()` callers.
- `PI_CURSOR_DEBUG=1` logs session decisions.

### Removed

- The one-agent-per-turn path and `PI_CURSOR_SESSION`; every call uses sessions.
- `/cursor-auth`; use pi's `/login` or `CURSOR_API_KEY`.
