* refactor: Remove obsolete test conversion scripts
* feat: Add Phase 2 Data Model operations and integration
- Introduced new helper methods for safe COM iteration and relationship finding.
- Created separate result type classes for Data Model operations, adhering to architectural guidelines.
- Implemented core interface methods for reading and writing Data Model entities, including measures and relationships.
- Added comprehensive integration tests for new operations, ensuring full coverage.
- Updated MCP server to integrate new Data Model actions and commands.
- Enhanced CLI with new commands for Data Model management, including create/update operations for measures and relationships.
- Revised README and server description to reflect new capabilities and tools.
* refactor: Remove obsolete temporary files related to data model and test analysis
* feat: Add CLI commands for Phase 2 TableCommands features
- Added GetStructuredReference command with region and optional column support
- Added Sort command for single-column sorting (asc/desc)
- Added SortMulti command for multi-level sorting (max 3 columns)
- All commands include Spectre.Console formatted output with tables
- Usage help messages with examples for all three commands
- Routing added to Program.cs for table-get-structured-reference, table-sort, table-sort-multi
- Fixed Spectre.Console markup escaping for optional parameters [[]]
- Commands follow existing CLI patterns with batch API and error handling
* test: Add comprehensive integration tests for Phase 2 TableCommands
- Created TableCommandsTests.cs with 17 integration tests
- Phase 1 lifecycle tests: List, Info (2 tests)
- Phase 2 structured reference tests: All regions, with/without columns, error handling (7 tests)
- Phase 2 sorting tests: Single/multi-column, validation, error handling (8 tests)
- All tests passing (17/17)
- Test data: SalesTable with Region, Product, Amount, Date columns
- Verifies Excel COM behavior: absolute references (\\), structured ref format
- Tests require Excel installation (integration tests with ExcelSession)
* feat: Phase 2 TableCommands - Structured References and Sorting
Phase 2 adds structured reference helper and table sorting capabilities.
NEW FEATURES:
- Structured References: GetStructuredReferenceAsync returns both range address and Excel structured reference formula
- Table Sorting: SortAsync with single-column and multi-column (max 3 levels) support
CORE IMPLEMENTATION (src/ExcelMcp.Core/):
- Added TableRegion enum (All, Data, Headers, Totals, ThisRow)
- Added TableStructuredReferenceResult class (9 properties)
- Added TableSortColumn class for multi-column sort specifications
- Created TableCommands.StructuredReferences.cs (~183 lines)
- GetStructuredReferenceAsync with BuildStructuredReference and GetRegionRange helpers
- Supports all 5 table regions with optional column filtering
- Created TableCommands.Sort.cs (~228 lines)
- SortAsync(single column) - simple ascending/descending sort
- SortAsync(multi-column) - up to 3 sort levels per Excel limitation
- Updated ITableCommands interface (21 total methods)
MCP SERVER INTEGRATION (src/ExcelMcp.McpServer/):
- Added 3 new actions to TableTool: get-structured-reference, sort, sort-multi
- Added handlers with full error handling and validation
- JSON deserialization for multi-column sort parameters
DOCUMENTATION (docs/COMMANDS.md):
- Added Structured Reference Operations section with examples
- Added Sort Operations section with single and multi-column examples
- Added workflow hints for both features
BUILD VERIFICATION:
- Full solution builds successfully (8 projects, 0 errors, 0 warnings)
- All async patterns use #pragma warning disable CS1998 for synchronous COM interop
INTEGRATION NOTES:
- Structured references bridge TableCommands (structure) and RangeCommands (data operations)
- Table sorting preserves headers and totals row
- CLI integration deferred (MCP Server is primary interface)
Phase 2 Status: COMPLETE - Production ready for MCP Server usage
* fix: Remove merge conflict markers from cherry-pick
---------
Co-authored-by: Stefan Broenner <stefan.broenner@microsoft.comm>