Skip to content

Improve Python cel command set & tests#674

Merged
chrisgregan merged 4 commits into
mainfrom
markdown-scroll
Mar 30, 2026
Merged

Improve Python cel command set & tests#674
chrisgregan merged 4 commits into
mainfrom
markdown-scroll

Conversation

@chrisgregan
Copy link
Copy Markdown
Contributor

This pull request refactors and expands the application and document tool APIs, improves code organization, and enhances documentation for workspace context and Python scripting. The most significant changes include splitting up the original AppTools class into focused partial classes, introducing new and improved endpoints for application and document management, and updating documentation to clarify context prioritization and Python API discovery.

API Refactoring and Expansion

  • The original AppTools class was split into multiple partial classes, each in its own file, to improve maintainability and clarity. This includes moving methods for version info, logging, alerts, project status, and file refresh into separate files. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Added new endpoints to AppTools:
    • AppVersion: Returns the application version string.
    • GetProjectStatus: Returns project load state and name as JSON.
    • LogInfo, LogWarning, LogError: Log messages at different severity levels. [1] [2] [3]
    • RefreshFiles: Forces a refresh of the project file listing.
    • ShowAlert: Displays an alert dialog to the user.

Document Editing Tools

  • Introduced DocumentTools.ApplyEdits, which applies targeted text edits to a document and returns detailed information about affected line ranges and resulting line count, improving feedback for agent-driven edits.
  • Added DocumentTools.Activate to activate an open document in the editor.

Serialization and Utility Improvements

  • Centralized JSON serialization options in AgentToolBase with camelCase property naming and null value omission, ensuring consistent API responses. [1] [2]
  • Updated ExecuteCommandAsync to return a standardized success result.

Documentation Updates

  • Expanded AgentContext.md to clarify context prioritization when resolving file references, and added instructions for discovering the Python API and installed packages. [1] [2]

Python Environment Info

  • Added PythonEnvironmentInfo to store the list of installed Python packages as reported by the Python host, enabling tools to query available packages at runtime.

@chrisgregan chrisgregan merged commit 77decab into main Mar 30, 2026
7 checks passed
@chrisgregan chrisgregan deleted the markdown-scroll branch March 30, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant