Skip to content

v1.5.14

@sbroenne sbroenne tagged this 01 Feb 19:46
* feat(cli): improve agent experience with session close --save, version check, quiet mode

- Replace dead session save with session close --save flag

- Add version --check to detect updates from NuGet

- Add -q/--quiet flag for agent-friendly output

- Fix ServiceProvider disposal in TypeRegistrar

- Add excel-cli skill documentation

- Update README and SKILL.md

- Fix pre-existing test using wrong JSON property names

* feat(cli): add Slicer command and complete Chart config actions

Slicer command (8 actions):

- create-slicer, list-slicers, set-slicer-selection, delete-slicer (PivotTable)

- create-table-slicer, list-table-slicers, set-table-slicer-selection, delete-table-slicer (Table)

Chart config actions (14 new):

- get/set-axis-number-format, set-data-labels

- get/set-axis-scale, get/set-gridlines

- set-series-format, list/add/delete/set-trendline

- set-placement, fit-to-range

Updated SKILL.md and README.md with new commands

* Phase 3-6: SessionCommandBase, ExitCodes, PathValidator, CLI tests

Phase 3: SessionCommandBase<TSettings>
- Abstract base class for session-aware commands
- RequireParameter()/RequireParameters() for validation
- WriteResult()/ExecuteVoidAction() helpers
- Refactored SlicerCommand to extend base class

Phase 4: ExitCodes standardization
- Success=0, OperationFailed=1, MissingSession=2
- MissingAction=3, UnknownAction=4, MissingParameter=5

Phase 5: PathValidator utilities
- ValidateExcelPath() with extension and existence checks
- NormalizePath() for relative-to-absolute conversion
- GetUniqueFilePath() for avoiding overwrites
- HasInvalidPathCharacters() and IsWithinAllowedDirectory()

Phase 6: CLI integration tests
- SlicerCommandIntegrationTests (4 tests)
- VersionCommandIntegrationTests (2 tests)
- PathValidatorTests (18 unit tests)

* Sync CLI help with MCP tool descriptions and update skill references

CLI Help Updates:
- Session: Added workflow hint (open -> sessionId -> close)
- PowerQuery: Added action list (list, view, create, update, refresh, load-to, delete)
- Range: Emphasized core operations and formatting
- Sheet: Clarified lifecycle operations
- NamedRange: Added action list
- ConditionalFormat: Added rule types info
- Table: Added Data Model integration note
- PivotTable: Added calculated fields and layout
- Chart: Added series, axis, trendlines
- Connection: Clarified use excel_powerquery for Text/Web/CSV
- DataModel: Added prerequisite note (tables must be in Data Model first)
- VBA: Added .xlsm and trust requirement
- Slicer: Clarified PivotTable and Table slicer support

Skill Updates:
- Added excel_slicer.md reference (PivotTable and Table slicers)
- Added excel_conditionalformat.md reference (cell-value and expression rules)
- Added Chart Positioning section (CRITICAL: never place at 0,0)
- Added Slicers for Visual Filtering section
- Added CLI Usage section with example workflow
- Expanded Power Query quirks (create vs update, validation timing)
- Version bump to 1.3.0

* feat(cli): expose all Core commands in daemon

- Add all Range command handlers (45+ ops: formulas, clear, copy, insert/delete, find/replace, sort, hyperlinks, number formats, styles, validation, autofit, merge, cell lock)
- Add Sheet command handlers (tab color, visibility, cross-file operations)
- Add Table get-structured-reference handler
- Add PivotTable handlers (set-field-function/name/format, group-by-date/numeric, calculated members)
- Add parsing helpers for DateGroupingInterval, CalculatedMemberType, TableRegion
- Update SKILL.md v1.3.0 with all new commands
- Remove command aliases (use canonical names only)

* feat: replace CreateEmpty with CreateAndOpen for 50% faster file creation

BREAKING CHANGE: Removed create-empty action from excel_file tool

- Remove FileCommands.CreateEmpty() and related STA thread code
- Add ExcelBatch.CreateNewWorkbook() factory method
- Add SessionManager.CreateSessionForNewFile() for optimized path
- CreateAndOpen combines file creation + session in single Excel start
- Performance: ~3.8s vs ~7-8s (50% faster for new workbooks)

Directory validation:
- Now throws DirectoryNotFoundException if directory doesn't exist
- Previously auto-created directories (removed for explicit control)

Test fixtures updated (12+ files):
- All fixtures now use SessionManager.CreateSessionForNewFile()
- Deleted 3 obsolete CreateEmpty test files

Documentation:
- Updated skills (excel-mcp, excel-cli) with CreateAndOpen guidance
- Updated CHANGELOG with performance improvements
- Updated tool descriptions in ExcelFileTool.cs

* feat: add session operation timeout to prevent infinite hangs (#388)

- Add timeoutSeconds parameter to MCP excel_file (open, create-and-open)
- Add --timeout option to CLI session create and session open commands
- Default: 300 seconds (5 min), range: 10-3600 seconds
- Timeout applies to ALL operations within the session
- Operations exceeding timeout throw TimeoutException and trigger cleanup

Implementation:
- ComInteropConstants: DefaultOperationTimeout constant
- IExcelBatch/ExcelBatch: OperationTimeout property, linked CancellationToken
- ExcelSession.BeginBatch: operationTimeout parameter
- SessionManager: operationTimeout on CreateSession/CreateSessionForNewFile
- ExcelFileTool: timeoutSeconds parameter with validation
- DaemonCommands: --timeout option for session commands
- ExcelDaemon: Pass timeout to SessionManager

Closes #388

* Remove SpecKit for the time being

* Refactor test namespaces and update README for diagnostics tests

- Updated namespaces in CoreCommandsCoverageTests, ActionEnumCompletenessTests, ExcelFileToolTests, and TelemetryIntegrationTests to use Sbroenne.ExcelMcp.Core.Models.Actions instead of Sbroenne.ExcelMcp.McpServer.Models.
- Added section in README.md for diagnostics tests, detailing their purpose, execution, and CI behavior.

* fix: update version check command in SKILL.md for clarity

* feat: add comprehensive financial report automation scenarios and enhance sales report workflow with detailed validation

* feat: expose PowerQuery Unload, fix docs, add Rule 24 for post-change sync

PowerQuery Unload:
- Add Unload to PowerQueryAction enum and ActionExtensions mapping
- Expose via IPowerQueryCommands interface (instance method)
- Add MCP Server handler in ExcelPowerQueryTool
- Add CLI handler in ExcelDaemon (was missing!)

Documentation fixes:
- Update operation counts: 209 → 210, Power Query 10 → 11 ops
- Fix slicer position format: cell address ('E1') not points format
- Add create-from-table to excel_chart.md prompt disambiguation

Rule 24 - Post-Change Sync Verification:
- New critical rule added to prevent missing CLI/SKILLs/READMEs
- Checklist of 9 sync points for any tool/action changes
- Added to Quick Reference tables in critical-rules.instructions.md

Tests:
- Add Chart CreateFromTable unit tests
- Add LLM test for chart create-from-table
- Fix PowerQuery test files (static → instance method)

* refactor: rename create-and-open to create for simpler LLM usage

BREAKING CHANGE: excel_file action renamed from 'create-and-open' to 'create'

Why:
- LLMs were confused by hyphenated name containing 'and' and 'open'
- They sometimes tried to chain separate create + open calls
- Simpler 'create' name matches standard file API expectations

Changes:
- FileAction enum: CreateAndOpen -> Create
- ActionExtensions: create-and-open -> create
- ExcelFileTool: Method renamed CreateSessionAsync
- Tests: All test names and action strings updated
- Skills: SKILL.md updated with new action name
- Scripts: Audit scripts updated

No functionality change - create still creates file AND starts session.

* feat: add COM diagnostics, fix calculated field bug, consolidate LLM tests

COM Diagnostics:

- Add exType, hr (HRESULT), inner fields to error responses

- Log COM exceptions to stderr for debugging

- Check IsExcelProcessAlive() in WithSession()

Bug Fixes:

- Fix calculated field bug in RegularPivotTableFieldStrategy

- Fix slicer test using non-existent 'SalesRep' column

LLM Test Improvements:

- Consolidate chart tests into single excel-chart-test.yaml

- Update skills and behavioral rules documentation

- Remove redundant test scenarios

* feat(cli): add help descriptions and file input options for all commands

- Add Description attributes to all CommandOption and CommandArgument properties
- Add --*-file options to read complex parameters from files instead of command line:
  - range: --values-file
  - vba: --code-file
  - powerquery: --mcode-file
  - datamodel: --expression-file, --dax-query-file, --dmv-query-file
  - table: --csv-file, --dax-query-file
  - connection: --connection-string-file, --command-text-file
  - conditionalformat: --formula-file
- Improves agent experience by providing clear option descriptions in help output
- Enables passing complex JSON/code content via files (avoids shell escaping issues)

* fix(cli): complete CLI action coverage and remove redundant test config

- Fix 82+ missing CLI action handlers across all commands
- Add check-cli-action-coverage.ps1 to pre-commit checks
- Add check-cli-coverage.ps1 for CLI enum coverage validation
- Add DataModelRelCommand for relationship operations
- Remove unnecessary help_command from 7 LLM test YAMLs
- Add test fixtures (CSV, JSON, M code files) for LLM tests
- Update CHANGELOG with branch features

* docs: update operation count to 210 across all documentation

* fix(codeql): replace empty catch blocks with COMException for chart commands

Changed catch { } and catch blocks to catch (COMException) in:
- RegularChartStrategy.cs (8 locations)
- PivotChartStrategy.cs (5 locations)
- ChartCommands.Appearance.cs (5 trendline properties)

These catches are intentional for optional COM property access -
not all chart types support all properties. COMException is more
specific than catch-all while maintaining the same behavior.

* fix(ci): correct CLI build path to net10.0-windows

CLI targets net10.0-windows (Window-specific COM interop), not net10.0.
Fixed build-cli.yml and release.yml to use correct output path.

* fix(codeql): address dispose and finally block warnings in daemon

- ExcelDaemon.cs: Use try-finally for tray disposal instead of try-catch
- DaemonSecurity.cs: Ensure mutex disposal on all exception paths

* fix(codeql): remove redundant null checks in finally block

_instanceMutex is guaranteed non-null at cleanup point (method throws if null)

* fix(codeql): use explicit null check instead of null-conditional for dynamic COM

Avoids CodeQL false positive about missing Quit() method on dynamic type

* fix(codeql): extract TryQuitExcel helper to isolate dynamic COM invocation

- Add ComUtilities.TryQuitExcel for fire-and-forget cleanup
- Use helper in ExcelSession.cs instead of inline dynamic call
- Centralizes dynamic COM quit pattern for easier maintenance

---------

Co-authored-by: Stefan Broenner <stefan.broenner@microsoft.comm>
Assets 2
Loading