-
Notifications
You must be signed in to change notification settings - Fork 649
FEAT: add WebSocket-based prompt target for Microsoft Copilot #1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
FEAT: add WebSocket-based prompt target for Microsoft Copilot #1275
Conversation
- Rename _parse_message() to _parse_raw_message() - Split on record separator (\x1e) and processes all frames, not just first - Add FINAL_DATA_FRAME (type 3) enum value for completion signals - Extract bot message parsing logic into lambda for reusability - Fixes stop condition to handle FINAL_DATA_FRAME and remove flawed "is_user_input and PING" logic
…way because of `enterprise-prod-first-party-app-policy` This reverts commit 276290f.
This reverts commit ded56c6.
rlundeen2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulinek13 this is super cool! Thanks for tackling!
Before merging, I'd like to test, which I'm not setup to do as is :) But if you take the auth token change where I can paste tokens or a raw request or something without a headless browser, then I can check usage.
But looks good! No major concerns
|
@rlundeen2 Thank you for your review! I've updated the code and added a new manual authentication method that only requires an already acquired access token. The automated browser flow remains the default, but using the manual method is straightforward: target = WebSocketCopilotTarget(authenticator=ManualCopilotAuthenticator()) |
Description
Resolves #343
This PR introduces
WebSocketCopilotTarget, enabling sending prompts to Microsoft Copilot via WebSocket.Implementation reference: powerpwn/copilot/copilot_connector/copilot_connector.py
Authentication is handled automatically via
CopilotAuthenticator(also a new addition), which uses Playwright to automate browser login and obtain the required access tokens.Tests and Documentation
✅ both
WebSocketCopilotTargetandCopilotAuthenticatorare documented✅ unit tests are added for both
The following related items I'd like to address in separate PRs:
image_pathdata type (WebSocketCopilotTarget)CopilotAuthenticator)