Execute these phases in strict order to achieve architectural supremacy.

1. ๐Ÿ RPC Bridge

Goal: Establish secure, bi-directional communication.

  • Edit agent-bubble.inline.ts.
  • Implement window.addEventListener("message", ...) to parse structured JSON-RPC.
  • Hook into Quartzโ€™s SPA router (nav event).
  • Broadcast HOST_NAVIGATE to the iframe.contentWindow on every route change.

2. ๐Ÿง  Context RAG

Goal: Make the agent infinitely aware without reloading.

  • Update the OMP frontend logic inside the iframe to listen for HOST_NAVIGATE.
  • Dynamically update the system promptโ€™s URL/Title context upon message receipt.
  • Verify that chat history persists across SPA route changes while context updates flawlessly.

3. ๐Ÿช„ Live Editing

Goal: Grant the agent god-mode over the host DOM (with permissions).

  • Define the AGENT_DOM_EXECUTE schema.
  • Implement secure executors in agent-bubble.inline.ts (e.g., highlightNode(selector), scrollTo(selector)).
  • Expose an OMP Tool to the LLM: mutate_host_dom(action, payload).

4. ๐Ÿค Remark42 Symbiosis

Goal: Feed community context into the AI.

  • Implement a fetchRemark42Context() function in the host script.
  • Piggyback comment data onto the HOST_NAVIGATE payload.
  • (Future) Build the backend webhooks to allow the agent to reply directly into Remark42 threads.