Version Control
Commits, tags, diffs, and deployment targets
How Versioning Works
Every save creates an immutable version. Versions are numbered sequentially and can be referenced by number in API calls. You never overwrite history -- you always create a new version.
The Version Control Bar
The VersionControlBar sits at the top of the editor and lets you commit, publish, and deploy in one flow:
- Commit - Save a new version with a changelog message
- Publish - Mark a version as the latest published version, available via the SDK
- Deploy - Ship a specific version to a named target (dev, staging, production)
Deployment Targets
Use the VersionNamesManager to define named deployment targets. Each target points to a specific version number. When you fetch a prompt via the SDK, you can specify which target to resolve:
// Fetch the version deployed to staging
const prompt = await client.getPrompt("my-prompt", { environment: "staging" })
// Fetch a pinned version by number
const prompt = await client.getPrompt("my-prompt", { version: 5 })Comparing Versions
The DiffViewer shows side-by-side diffs powered by Monaco Editor. Select any two versions from the VersionHistoryPanel to see exactly what changed -- word-level highlighting makes regressions obvious.
Changelogs
Each version can carry a changelog message describing what changed and why. Changelogs appear in the version history timeline and make it easy to audit prompt evolution over time.
Version History Panel
The VersionHistoryPanel lists every version with its timestamp, author, changelog, and published/deployed status. From here you can:
- Compare any two versions side-by-side
- Publish a specific version
- Deploy a version to a named target
- View the full diff of changes