mirror of
https://github.com/blackboxprogramming/context-bridge.git
synced 2026-03-17 06:57:11 -05:00
Agent Coordination: - Epimetheus (Architect) identity assigned and registered - Connected to PS-SHA-∞ memory system (4,059 entries) - Task claimed from marketplace - Broadcasting to other agents Launch Documentation Created: - PUBLISH_TO_NPM.md - Complete npm publishing guide - STRIPE_LIVE_SETUP.md - Stripe live mode setup guide - AGENT_COORDINATION_REPORT.md - Full status and next steps - EPIMETHEUS_SESSION_COMPLETE.md - Session summary - Added all previous documentation to repo Launch Status: 98% Complete Blocked on: User actions (npm login + Stripe products) Ready: Screenshots, testing, submissions, announcements Next Steps: 1. User: npm login && npm publish (10 min) 2. User: Create Stripe products (5 min) 3. Capture 5 screenshots (15 min) 4. Manual testing on 4 platforms (20 min) 5. Submit to Chrome Web Store (30 min) 6. Launch announcements (10 min) Total time to launch: ~90 minutes Agent Body: qwen2.5-coder:7b (open source) Memory Hash: 4e3d2012 Collaboration: ACTIVE Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
72 lines
1.9 KiB
JavaScript
72 lines
1.9 KiB
JavaScript
/**
|
|
* Context Bridge - Microsoft Copilot Content Script
|
|
*/
|
|
|
|
console.log('Context Bridge: Loaded on Microsoft Copilot');
|
|
|
|
let contextUrl = null;
|
|
|
|
chrome.runtime.sendMessage({ action: 'getContextUrl' }, (response) => {
|
|
if (response && response.rawUrl) {
|
|
contextUrl = response.rawUrl;
|
|
injectButton();
|
|
}
|
|
});
|
|
|
|
chrome.storage.onChanged.addListener((changes, namespace) => {
|
|
if (namespace === 'sync' && changes.rawUrl) {
|
|
contextUrl = changes.rawUrl.newValue;
|
|
}
|
|
});
|
|
|
|
function injectButton() {
|
|
const textarea = document.querySelector('textarea') ||
|
|
document.querySelector('[contenteditable="true"]');
|
|
|
|
if (!textarea) {
|
|
setTimeout(injectButton, 500);
|
|
return;
|
|
}
|
|
|
|
if (document.querySelector('.context-bridge-button')) {
|
|
return;
|
|
}
|
|
|
|
const button = document.createElement('button');
|
|
button.type = 'button';
|
|
button.className = 'context-bridge-button';
|
|
button.innerHTML = `
|
|
<svg class="context-bridge-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/>
|
|
<polyline points="13 2 13 9 20 9"/>
|
|
</svg>
|
|
<span>Insert Context</span>
|
|
`;
|
|
|
|
button.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
if (!contextUrl) {
|
|
alert('No context URL set. Click the Context Bridge extension icon to configure.');
|
|
return;
|
|
}
|
|
const message = `Read ${contextUrl} first, then help me with: `;
|
|
textarea.value = message;
|
|
textarea.focus();
|
|
});
|
|
|
|
textarea.parentElement.appendChild(button);
|
|
console.log('Context Bridge: Button injected on Copilot');
|
|
}
|
|
|
|
const observer = new MutationObserver(() => {
|
|
if (!document.querySelector('.context-bridge-button') && contextUrl) {
|
|
injectButton();
|
|
}
|
|
});
|
|
|
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
|
|
if (contextUrl) {
|
|
injectButton();
|
|
}
|