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 (
navevent). - Broadcast
HOST_NAVIGATEto theiframe.contentWindowon 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_EXECUTEschema. - 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_NAVIGATEpayload. - (Future) Build the backend webhooks to allow the agent to reply directly into Remark42 threads.