Skip to content

Added windows local server API to help AI#682

Open
mahbd wants to merge 2 commits intodevfrom
windows-chatbot-integration
Open

Added windows local server API to help AI#682
mahbd wants to merge 2 commits intodevfrom
windows-chatbot-integration

Conversation

@mahbd
Copy link
Copy Markdown
Collaborator

@mahbd mahbd commented Mar 31, 2026

PR Type

  • Feature
  • Bugfix
  • Security Fix
  • Performance Improvement
  • Refactoring
  • Documentation
  • Other: ___________

Summary

What: Implemented a Windows local server API for UI inspection and added a background process to monitor and upload UI DOM dumps.
Why: To provide the AI engine with real-time visibility into the Windows UI tree, enabling automated interactions and intelligent agent support on desktop environments.
How: Created a new windows.py router leveraging pythonnet to interface with UIAutomation DLLs, and updated the server startup sequence to include background DOM synchronization.

ZeuZ Ticket

  • Link: TICKET-####
  • Branch: windows-chatbot-integration

Changes Made

Code Changes

  • New features added
  • Bug fixes implemented
  • Code refactored (Optimized imports in BuiltInFunctions.py from wildcard to explicit imports)
  • Dependencies updated

Bug Fix Requirements (if applicable)

  • Root cause documented: Replaced problematic * imports with specific System.Windows.Automation members to prevent namespace pollution and potential conflicts.

Database Changes

  • No schema/data changes

API Changes

  • No API changes
  • New endpoints added: /windows/inspect (DOM retrieval) and /windows/apps (active window enumeration).
  • Existing endpoints modified
  • Breaking changes: N/A

Security Review

  • No sensitive data exposed in logs/responses
  • Input validation implemented (app_name validation)
  • Secrets/credentials not hardcoded
  • Proper logging levels implemented

Testing

Automated Tests

  • Unit tests added/updated
  • Integration tests added/updated
  • API tests added/updated (Verified endpoint connectivity)

Manual Testing

  • Feature functionality verified (UI tree dumping)
  • Edge cases tested (Invalid app names, non-Windows environments)
  • Error handling validated

Quality Assurance

  • Code follows project standards
  • Self-review completed
  • No console errors/warnings

Deployment

Readiness

  • PR ready to ship
  • Sized appropriately

Environment Impact

  • No environment variables needed

Dependencies

  • No new dependencies

Documentation

  • Code comments added for complex logic (UIAutomation lazy-loading and tree recursion)

Rollback Plan

If deployment fails:

  • Feature flags available for quick disable (or simply remove the windows_router from main.py).

Performance & Monitoring

  • Structured logging implemented (Execution logs for successful/failed uploads)
  • Performance logging for critical paths (Threaded execution for IO-heavy uploads)

Review Checklist

  • Development Standards followed
  • REST API Guidelines followed
  • Security best practices implemented

@mahbd
Copy link
Copy Markdown
Collaborator Author

mahbd commented Mar 31, 2026

📚 $\text{Stack Overview}$

Pulls submitted in this stack:

This comment was automatically generated by st.

@mahbd mahbd marked this pull request as ready for review March 31, 2026 21:46
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