Panelize icon indicating copy to clipboard operation
Panelize copied to clipboard

Support Meta Muse (muse.ai) as an optional provider

Open Manho opened this issue 3 weeks ago • 1 comments

Summary

Add support for Meta Muse (https://muse.ai/) as an optional AI provider in Panelize so users can compare Muse responses side-by-side alongside existing providers.

Feasibility & Technical Notes (Probed 2026-11-11)

1. Entry URLs & Routing

  • Base / Login-safe URL: https://muse.ai/ (topLevelUrl: https://muse.ai/)
    • Unauthenticated GET https://muse.ai/ returns HTTP/2 200 with the login UI, whereas unauthenticated GET https://muse.ai/thread/new returns raw HTTP/2 401 {"error":"Authentication required"}. Keep https://muse.ai/ as the default panel url.
  • Conversation Semantics:
    • / (alias /thread/main) is a persistent singleton Main Chat stream backed by the user's Muse Secure VM.
    • /thread/new (-> /thread/:sessionId) opens a fresh Side Chat thread when authenticated; use /thread/new (or the in-page New Thread control) when triggering New Chat in an authenticated session.
  • Query Prefill: https://muse.ai/?prompt=<encoded> is natively recognized.

2. Permissions & declarativeNetRequest Framing Headers

  • Register as an Optional Provider (optional_host_permissions + OPTIONAL_PROVIDER_CONFIGS in modules/optional-provider-access.js) so existing Chrome Web Store installations are not disabled on update.
  • Recommended optionalOrigins:
    • https://muse.ai/*
    • https://auth.muse.ai/* (OIDC callback / session refresh subdomain)
    • Verify whether https://agent.meta.ai/* (SSO broker origin) is also required during live testing.
  • Framing Headers: https://muse.ai/ responds with x-frame-options: SAMEORIGIN and content-security-policy: ... frame-ancestors 'self'. Stripping X-Frame-Options and Content-Security-Policy on sub_frame via createFrameRule enables panel embedding. Trusted Types are not enforced.

3. Authentication & Streaming Transport

  • Top-Level Login Required: Meta OIDC (https://muse.ai/api/oidc/start -> https://auth.meta.com/oidc) sets SameSite=Lax cookies and auth.meta.com sends x-frame-options: DENY, so initial SSO login must be completed in a top-level browser tab via Panelize's "Open in new tab" button.
  • Passkey Note: muse.ai sends permissions-policy: publickey-credentials-get=(self); if in-panel passkey login is desired, <iframe allow="..."> in multi-panel/multi-panel.js would need publickey-credentials-get.
  • WebSocket Streaming: CSP connect-src lists wss://gateway.meta.ai, wss://edge-chat-latest.meta.ai, wss://edge-chat.meta.ai, and wss://shortwave.meta.ai. Verify live in an authenticated session whether WS connections authenticate via explicit token or cookies inside an extension subframe.

4. Composer, Submit & Privacy Mode

  • Composer: Next.js (React 19) app supporting Lexical (div[contenteditable="true"][data-lexical-editor="true"] via document.execCommand('insertText')) and <textarea data-slot="textarea"> (via prototype value setter + input event); verify exact authenticated composer DOM priority during implementation.
  • Submit & Stop Guard: Supports Enter key submit and Send button click; exclude [aria-label*="Stop" i] / [aria-label*="Cancel" i] in ButtonFinderUtils so streaming responses are not cancelled on send.
  • Privacy / Temporary Chat: Not supported by muse.ai (all interactions run in the persistent Muse Secure VM without an incognito/temporary mode), so omit from TEMP_CHAT_SUPPORTED_PROVIDERS.

Manho avatar Nov 11 '26 11:11 Manho

Closing as completed via #106 (shipped in v2.2.0), which added custom Web UI provider support with runtime origin permissions, dynamic framing header rules, and the generic custom provider driver (including Lexical editor support). https://muse.ai/ can now be added directly as a custom AI website in Options.

Manho avatar Nov 15 '26 03:11 Manho