mirror of
https://github.com/blackboxprogramming/context-bridge.git
synced 2026-03-17 04:57:16 -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>
69 lines
1.9 KiB
JavaScript
69 lines
1.9 KiB
JavaScript
/**
|
|
* Context Bridge - Background Service Worker
|
|
* Handles extension state and context URL storage
|
|
*/
|
|
|
|
// Listen for installation
|
|
chrome.runtime.onInstalled.addListener(() => {
|
|
console.log('Context Bridge installed');
|
|
|
|
// Set default state
|
|
chrome.storage.sync.get(['contextUrl'], (result) => {
|
|
if (!result.contextUrl) {
|
|
console.log('No context URL set yet');
|
|
} else {
|
|
console.log('Context URL loaded:', result.contextUrl);
|
|
}
|
|
});
|
|
});
|
|
|
|
// Listen for messages from content scripts
|
|
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|
if (request.action === 'getContextUrl') {
|
|
chrome.storage.sync.get(['contextUrl', 'rawUrl'], (result) => {
|
|
sendResponse({
|
|
contextUrl: result.contextUrl,
|
|
rawUrl: result.rawUrl
|
|
});
|
|
});
|
|
return true; // Will respond asynchronously
|
|
}
|
|
|
|
if (request.action === 'setContextUrl') {
|
|
chrome.storage.sync.set({
|
|
contextUrl: request.contextUrl,
|
|
rawUrl: request.rawUrl
|
|
}, () => {
|
|
sendResponse({ success: true });
|
|
});
|
|
return true;
|
|
}
|
|
|
|
if (request.action === 'clearContext') {
|
|
chrome.storage.sync.remove(['contextUrl', 'rawUrl'], () => {
|
|
sendResponse({ success: true });
|
|
});
|
|
return true;
|
|
}
|
|
});
|
|
|
|
// Badge to show if context is set
|
|
chrome.storage.sync.get(['contextUrl'], (result) => {
|
|
if (result.contextUrl) {
|
|
chrome.action.setBadgeText({ text: '✓' });
|
|
chrome.action.setBadgeBackgroundColor({ color: '#10B981' });
|
|
}
|
|
});
|
|
|
|
// Listen for storage changes to update badge
|
|
chrome.storage.onChanged.addListener((changes, namespace) => {
|
|
if (namespace === 'sync' && changes.contextUrl) {
|
|
if (changes.contextUrl.newValue) {
|
|
chrome.action.setBadgeText({ text: '✓' });
|
|
chrome.action.setBadgeBackgroundColor({ color: '#10B981' });
|
|
} else {
|
|
chrome.action.setBadgeText({ text: '' });
|
|
}
|
|
}
|
|
});
|