@firstpick/pi-extension-cursor-composer
Pi extension and custom model provider for Cursor SDK Composer 2.5.
Package details
Install @firstpick/pi-extension-cursor-composer from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@firstpick/pi-extension-cursor-composer- Package
@firstpick/pi-extension-cursor-composer- Version
0.1.2- Published
- Jun 20, 2026
- Downloads
- 205/mo · 205/wk
- Author
- firstpick
- License
- MIT
- Types
- extension
- Size
- 68.9 KB
- Dependencies
- 2 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
Cursor Composer 2.5 Pi Extension
Delegates explicit tasks from Pi to Cursor SDK using composer-2.5.
It also registers a native Pi custom model provider:
cursor-composer/composer-2.5
This provider wraps Cursor SDK local-agent runs, so it behaves more like a delegated agent than a raw chat-completions model. While Cursor is doing long internal tool runs, the provider emits periodic thinking/progress heartbeats so Pi Web UI does not look silent.
Install
From npm after publish:
pi install npm:@firstpick/pi-extension-cursor-composer
For local development from this repository:
# Option A: install as a local package
pi install ./pi-extension-cursor-composer
# Option B: live-link all repo Pi packages for development
./dev/scripts/sync-pi-package-symlinks.sh
cd pi-extension-cursor-composer
npm install
The package depends on @cursor/sdk. Published/local pi install installs that dependency automatically; the repo symlink workflow needs the package-local npm install step because the sync script only creates symlinks. Then reload Pi with /reload.
Configure auth
Set CURSOR_API_KEY, or run:
/cursor-composer-setup
The setup command can save the key to Pi global .env, workspace .env, or only the current process. It then asks whether to add cursor-composer/composer-2.5 to Pi's enabledModels scoped-model list in ~/.pi/agent/settings.json.
If you already have a scoped model list, setup appends Composer 2.5. If you do not, adding it creates an explicit scoped list; use /scoped-models afterward if you want to include other models too.
Commands
/cursor-composer-status— check API key, SDK install status, native provider id, and scoped-model status./cursor-composer-add-scoped-model— addcursor-composer/composer-2.5to PienabledModels./cursor-composer-models— list Cursor models visible to the key and verifycomposer-2.5./cursor-composer [flags] <prompt>— run Composer 2.5 on a prompt.
Flags:
--plan/--agent--thinking=low|medium|high--sandbox--no-auto-review--cwd=subdiror--workspace-subdir=subdir
Example:
/cursor-composer --plan --thinking=high Review this repo and propose the safest migration plan.
Native Pi model
After setup and /reload, check:
CURSOR_API_KEY=crsr_... pi --list-models | grep cursor-composer
In Pi, it should appear as:
cursor-composer/composer-2.5
Use /model to select it, or add it through setup//cursor-composer-add-scoped-model for scoped Ctrl+P cycling. Changes to enabledModels are persisted, but the current session's scoped list may need /scoped-models, /reload, or a new session to refresh.
Provider usage/status behavior:
- The native provider forwards Cursor SDK
turn-endedusage into Pi assistant-message usage, sogit-footer-statuscan show input/output tokens, cache read/write tokens, cost, context, and speed. - If the installed Cursor SDK does not emit final usage, the provider estimates input/output tokens from prompt/output text and records a
cursor-composer.usage_estimateddiagnostic; cache tokens are not estimated. - Pricing defaults to Cursor's fast Composer 2.5 tier because Cursor documents Fast as the product default:
$3/Minput and$15/Moutput. Standard pricing is$0.50/Minput and$2.50/Moutput. - Set
CURSOR_COMPOSER_PRICE_TIER=standardto use standard pricing, or override individual rates withCURSOR_COMPOSER_INPUT_COST_PER_MILLION,CURSOR_COMPOSER_OUTPUT_COST_PER_MILLION,CURSOR_COMPOSER_CACHE_READ_COST_PER_MILLION, andCURSOR_COMPOSER_CACHE_WRITE_COST_PER_MILLION. - Cursor publishes input/output prices, not a separate cache discount; cache read/write rates default to the active input rate unless overridden.
- Default verbosity is
quiet: show one short working line, final assistant text, requests, and errors. - Set
CURSOR_COMPOSER_PROVIDER_VERBOSITY=normalto include tool/status progress. - Set
CURSOR_COMPOSER_PROVIDER_VERBOSITY=debugto include rawer Cursor stream details. CURSOR_COMPOSER_PROVIDER_HEARTBEAT_MS=15000controls quiet heartbeat checks; onlynormal/debugshow repeated heartbeat lines.- Set
CURSOR_COMPOSER_PROVIDER_HEARTBEAT_MS=0orfalseto disable heartbeats entirely. - Set
CURSOR_COMPOSER_PROVIDER_AUTO_REVIEW=falseto disable Cursor local auto-review. - Set
CURSOR_COMPOSER_PROVIDER_SANDBOX=trueto enable Cursor SDK sandboxing for native model runs. - Large Pi
toolResultmessages are truncated by default before they are replayed into the native provider prompt. This keeps previousread/bashdumps from being resent to Cursor on every turn while preserving the message header, head/tail previews, original size, content hash, and a deterministic Recovery ID. Truncation uses Pi's normal tool-output byte and line limits. - When a provider prompt contains truncated tool results, the local Cursor agent also receives an ephemeral
pi_get_truncated_tool_resultcustom tool. Composer can call it with the Recovery ID and an optional line range to fetch exact omitted historical content for that provider run without replaying every large output up front. Recovery IDs are deterministic for the same persisted tool result, but the recovery map itself is rebuilt per provider run rather than stored separately. - Set
CURSOR_COMPOSER_PROVIDER_TRUNCATE_TOOL_RESULTS=falseto restore the previous full tool-result replay behavior.
Tool
The extension registers cursor_composer_agent for Pi to call when you explicitly ask to use Cursor/Composer.
By default, tool use requires interactive confirmation because Cursor SDK local mode can run commands and edit files. To allow unattended runs, set:
export CURSOR_COMPOSER_REQUIRE_CONFIRMATION=false
Use that only if you accept unattended Cursor SDK tool execution.