# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.1] - 2026-04-01

### Fixed
- **ENOENT schema crash** (`#bug-1`): The bundled `export.schema.json` asset is now resolved relative to the module file via a static ES import, not `process.cwd()`. The server now starts correctly when run via `npx sfdmu-mcp` from any directory.
- **VS Code install prompts** (`#bug-2`): Added `contributes.mcpServers` to `package.json` so VS Code pre-configures the server automatically. Users installing via **MCP: Install Server** are no longer prompted for command, arguments, or environment variables.

### Added
- `postbuild` script: copies `src/assets/export.schema.json` → `dist/assets/` so the asset is bundled in every published tarball.
- `prepack` guard: fails fast if `README.md` is missing or too short, preventing accidental publishes without documentation.
- **Configuration** section in README with env-var override examples for VS Code, Cursor, and Claude Desktop.
- VS Code auto-install instructions in README (uses the new `contributes.mcpServers` field — no prompts).

### Changed
- `tsconfig.json`: upgraded `module`/`moduleResolution` from `Node16` → `NodeNext` to support JSON import attributes (`with { type: 'json' }`).
- `tsconfig.test.json`: removed `isolatedModules: true` diagnostic flag (no behavioral change for tests).

## [0.2.0] - 2026-04-01

### Added
- `sfdmu_get_org_context` — new read-only tool that resolves the SF CLI default org's alias, username, instance URL, API version, connection status, and sandbox/production classification without any user prompting
- `resolveOrgContext()` utility in `credential-resolver.ts` — extends the existing credential resolution flow with `isSandbox` detection via `SELECT IsSandbox FROM Organization LIMIT 1` Salesforce REST API query
- `OrgContext` interface in `types.ts`
- `ORG_AUTH_EXPIRED` and `ORG_CONTEXT_UNAVAILABLE` structured error factories in `error-types.ts`

### Changed
- All optional `sourceOrg` and `targetOrg` parameter descriptions updated to use imperative "**Omit to auto-detect from SF CLI default org**" phrasing, suppressing unnecessary AI clarification prompts

### Fixed
- `SfOrgDisplayResult` internal interface now captures `alias`, `username`, and `connectedStatus` fields from `sf org display --json` output

## [0.1.0] - 2026-03-31

### Added
- Initial implementation of 8 MCP tools for SFDMU-based Salesforce data migrations
- `sfdmu_check_prerequisites` — environment gate tool
- `sfdmu_generate_export_config` — natural language → export.json generation
- `sfdmu_validate_export_config` — AJV schema validation tool
- `sfdmu_dry_run_preview` — pre-flight row estimate and safety check
- `sfdmu_analyze_dependencies` — sObject dependency topological sort
- `sfdmu_detect_conflicts` — cross-org field metadata diff
- `sfdmu_compare_orgs` — post-migration record count diff
- `sfdmu_execute_migration` — gated sf sfdmu run execution (requires confirm: true)
- `GET /health` endpoint on `--http` transport for deterministic Docker smoke-test (SC-010)
- Docker image with node:20-slim, sf CLI, and sfdmu plugin pre-installed
- GitHub Actions CI pipeline (lint + test + build on every PR)

### Changed
- CONTRIBUTING.md removed; contributor instructions consolidated into README.md (FR-024 dropped)
- SC-010 Docker smoke-test criterion redefined to `GET /health` response within 10 s (automatable without live MCP client)
