browserpilot-cdp 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,284 @@
1
+ <!doctype html>
2
+ <html lang="en" data-theme="dark">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>BrowserPilot</title>
6
+ <style>
7
+ :root {
8
+ color-scheme: dark;
9
+ --bg: #0b1120;
10
+ --surface: #0f172a;
11
+ --border: #1e293b;
12
+ --border-strong: #334155;
13
+ --text: #e2e8f0;
14
+ --text-strong: #f8fafc;
15
+ --muted: #64748b;
16
+ --muted-strong: #94a3b8;
17
+ --btn-bg: #1e293b;
18
+ --btn-hover: #273449;
19
+ --btn-border-hover: #475569;
20
+ --input-bg: #0f172a;
21
+ --input-text: #f1f5f9;
22
+ --badge-bg: #1e293b;
23
+ --badge-text: #94a3b8;
24
+ --badge-on-bg: rgba(16, 185, 129, 0.16);
25
+ --badge-on-text: #34d399;
26
+ --badge-paused-bg: rgba(245, 158, 11, 0.18);
27
+ --badge-paused-text: #fbbf24;
28
+ --switch-track: #334155;
29
+ --switch-knob: #f8fafc;
30
+ }
31
+ :root[data-theme="light"] {
32
+ color-scheme: light;
33
+ --bg: #f8fafc;
34
+ --surface: #ffffff;
35
+ --border: #e2e8f0;
36
+ --border-strong: #cbd5e1;
37
+ --text: #1e293b;
38
+ --text-strong: #0f172a;
39
+ --muted: #64748b;
40
+ --muted-strong: #475569;
41
+ --btn-bg: #ffffff;
42
+ --btn-hover: #f1f5f9;
43
+ --btn-border-hover: #94a3b8;
44
+ --input-bg: #ffffff;
45
+ --input-text: #0f172a;
46
+ --badge-bg: #e2e8f0;
47
+ --badge-text: #475569;
48
+ --badge-on-bg: #d1fae5;
49
+ --badge-on-text: #047857;
50
+ --badge-paused-bg: #fef3c7;
51
+ --badge-paused-text: #b45309;
52
+ --switch-track: #cbd5e1;
53
+ --switch-knob: #ffffff;
54
+ }
55
+ * { box-sizing: border-box; }
56
+ body {
57
+ margin: 0;
58
+ width: 340px;
59
+ background: var(--bg);
60
+ color: var(--text);
61
+ font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
62
+ transition: background 140ms ease, color 140ms ease;
63
+ }
64
+ .header {
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: space-between;
68
+ padding: 12px 14px;
69
+ border-bottom: 1px solid var(--border);
70
+ background: var(--surface);
71
+ }
72
+ .brand {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 8px;
76
+ font-weight: 650;
77
+ font-size: 14px;
78
+ color: var(--text-strong);
79
+ letter-spacing: -0.01em;
80
+ }
81
+ .dot {
82
+ width: 8px;
83
+ height: 8px;
84
+ border-radius: 999px;
85
+ background: var(--muted);
86
+ }
87
+ .dot.on { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.7); }
88
+ .dot.paused { background: #f59e0b; }
89
+ .badge {
90
+ font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
91
+ padding: 4px 8px;
92
+ border-radius: 999px;
93
+ background: var(--badge-bg);
94
+ color: var(--badge-text);
95
+ }
96
+ .badge.on { background: var(--badge-on-bg); color: var(--badge-on-text); }
97
+ .badge.paused { background: var(--badge-paused-bg); color: var(--badge-paused-text); }
98
+ .section {
99
+ padding: 12px 14px;
100
+ border-bottom: 1px solid var(--border);
101
+ }
102
+ .section-title {
103
+ font-size: 11px;
104
+ font-weight: 600;
105
+ text-transform: uppercase;
106
+ letter-spacing: 0.06em;
107
+ color: var(--muted);
108
+ margin: 0 0 8px;
109
+ }
110
+ .row {
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: space-between;
114
+ padding: 5px 0;
115
+ }
116
+ .btn-row {
117
+ display: flex;
118
+ gap: 8px;
119
+ }
120
+ button {
121
+ cursor: pointer;
122
+ border: 1px solid var(--border-strong);
123
+ background: var(--btn-bg);
124
+ color: var(--text-strong);
125
+ font: 500 12px/1 inherit;
126
+ padding: 8px 10px;
127
+ border-radius: 6px;
128
+ flex: 1;
129
+ transition: background 120ms ease, border-color 120ms ease;
130
+ }
131
+ button:hover { background: var(--btn-hover); border-color: var(--btn-border-hover); }
132
+ button.primary { background: #059669; border-color: #10b981; color: #fff; }
133
+ button.primary:hover { background: #10b981; border-color: #10b981; }
134
+ button.warn { background: #b45309; border-color: #f59e0b; color: #fff; }
135
+ button.warn:hover { background: #d97706; border-color: #f59e0b; }
136
+ button.sm { flex: 0; padding: 4px 8px; font-size: 11px; }
137
+ input[type="text"], input[type="password"] {
138
+ width: 100%;
139
+ background: var(--input-bg);
140
+ border: 1px solid var(--border-strong);
141
+ color: var(--input-text);
142
+ border-radius: 6px;
143
+ padding: 6px 8px;
144
+ font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
145
+ margin-bottom: 6px;
146
+ }
147
+ input[type="checkbox"]:not(.switch-input) {
148
+ accent-color: #10b981;
149
+ width: 15px;
150
+ height: 15px;
151
+ cursor: pointer;
152
+ }
153
+ .theme-control {
154
+ display: inline-flex;
155
+ align-items: center;
156
+ gap: 8px;
157
+ }
158
+ .theme-label {
159
+ font-size: 11px;
160
+ font-weight: 600;
161
+ color: var(--muted-strong);
162
+ min-width: 34px;
163
+ text-align: right;
164
+ }
165
+ .switch {
166
+ position: relative;
167
+ display: inline-block;
168
+ width: 38px;
169
+ height: 20px;
170
+ cursor: pointer;
171
+ }
172
+ .switch-input {
173
+ opacity: 0;
174
+ width: 0;
175
+ height: 0;
176
+ position: absolute;
177
+ }
178
+ .switch-slider {
179
+ position: absolute;
180
+ inset: 0;
181
+ border-radius: 999px;
182
+ background: var(--switch-track);
183
+ transition: background 150ms ease;
184
+ }
185
+ .switch-slider::before {
186
+ content: "";
187
+ position: absolute;
188
+ width: 16px;
189
+ height: 16px;
190
+ left: 2px;
191
+ top: 2px;
192
+ border-radius: 999px;
193
+ background: var(--switch-knob);
194
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
195
+ transition: transform 150ms ease;
196
+ }
197
+ .switch-input:checked + .switch-slider {
198
+ background: #10b981;
199
+ }
200
+ .switch-input:checked + .switch-slider::before {
201
+ transform: translateX(18px);
202
+ }
203
+ .tab-item {
204
+ display: flex;
205
+ align-items: center;
206
+ justify-content: space-between;
207
+ gap: 8px;
208
+ padding: 5px 8px;
209
+ background: var(--surface);
210
+ border: 1px solid var(--border);
211
+ border-radius: 6px;
212
+ margin-bottom: 5px;
213
+ }
214
+ .tab-meta {
215
+ overflow: hidden;
216
+ text-overflow: ellipsis;
217
+ white-space: nowrap;
218
+ font-size: 12px;
219
+ }
220
+ .muted { color: var(--muted); font-size: 11px; }
221
+ .ext-id {
222
+ font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
223
+ color: var(--muted-strong);
224
+ word-break: break-all;
225
+ }
226
+ </style>
227
+ </head>
228
+ <body>
229
+ <div class="header">
230
+ <div class="brand">
231
+ <span id="status-dot" class="dot"></span>
232
+ <span>BrowserPilot</span>
233
+ </div>
234
+ <span id="status-badge" class="badge">OFFLINE</span>
235
+ </div>
236
+
237
+ <div class="section">
238
+ <div class="btn-row">
239
+ <button id="btn-pause">Pause</button>
240
+ <button id="btn-sidepanel" class="primary">Side Panel</button>
241
+ <button id="btn-reconnect">Reconnect</button>
242
+ </div>
243
+ </div>
244
+
245
+ <div class="section">
246
+ <div class="section-title">Controls</div>
247
+ <div class="row">
248
+ <span>Appearance</span>
249
+ <label class="theme-control" title="Toggle Dark / Light Mode">
250
+ <span id="theme-mode-label" class="theme-label">Dark</span>
251
+ <span class="switch">
252
+ <input id="opt-dark-mode" class="switch-input" type="checkbox" checked />
253
+ <span class="switch-slider"></span>
254
+ </span>
255
+ </label>
256
+ </div>
257
+ <label class="row"><span>Zero-click Auto-Attach</span><input id="opt-auto-attach" type="checkbox" /></label>
258
+ <label class="row"><span>Action Highlight Box</span><input id="opt-highlights" type="checkbox" /></label>
259
+ <label class="row"><span>Ghost Cursor Overlay</span><input id="opt-cursor" type="checkbox" /></label>
260
+ <label class="row"><span>Group Controlled Tabs</span><input id="opt-groups" type="checkbox" /></label>
261
+ </div>
262
+
263
+ <div class="section">
264
+ <div class="row" style="padding-top:0">
265
+ <span class="section-title" style="margin:0">Attached Tabs (<span id="tab-count">0</span>)</span>
266
+ <button id="btn-detach-all" class="sm">Detach All</button>
267
+ </div>
268
+ <div id="tab-list"><div class="muted">No tabs currently attached.</div></div>
269
+ </div>
270
+
271
+ <div class="section">
272
+ <div class="section-title">Daemon &amp; Domain Safety</div>
273
+ <input id="inp-daemon-url" type="text" placeholder="ws://127.0.0.1:19888/extension" />
274
+ <input id="inp-auth-token" type="password" placeholder="Auth token (auto via Native Messaging)" />
275
+ <input id="inp-blocked-domains" type="text" placeholder="Blocked domains (comma-separated, e.g. *.bank.com)" />
276
+ <div class="btn-row">
277
+ <button id="btn-save-settings">Save Settings</button>
278
+ </div>
279
+ <div style="margin-top:8px" class="ext-id">Extension ID: <span id="ext-id">—</span></div>
280
+ </div>
281
+
282
+ <script type="module" src="popup.js"></script>
283
+ </body>
284
+ </html>
@@ -0,0 +1,130 @@
1
+ // src/popup.ts
2
+ var $ = (id) => document.getElementById(id);
3
+ var currentState = null;
4
+ function render(state) {
5
+ currentState = state;
6
+ const isDark = state.config.theme !== "light";
7
+ document.documentElement.dataset.theme = isDark ? "dark" : "light";
8
+ $("opt-dark-mode").checked = isDark;
9
+ $("theme-mode-label").textContent = isDark ? "Dark" : "Light";
10
+ const dot = $("status-dot");
11
+ const badge = $("status-badge");
12
+ const btnPause = $("btn-pause");
13
+ if (state.config.paused) {
14
+ dot.className = "dot paused";
15
+ badge.className = "badge paused";
16
+ badge.textContent = "PAUSED";
17
+ btnPause.textContent = "Resume";
18
+ btnPause.className = "warn";
19
+ } else if (state.connected) {
20
+ dot.className = "dot on";
21
+ badge.className = "badge on";
22
+ badge.textContent = state.transport === "native" ? "NATIVE" : "WS LIVE";
23
+ btnPause.textContent = "Pause";
24
+ btnPause.className = "";
25
+ } else {
26
+ dot.className = "dot";
27
+ badge.className = "badge";
28
+ badge.textContent = "OFFLINE";
29
+ btnPause.textContent = "Pause";
30
+ btnPause.className = "";
31
+ }
32
+ $("opt-auto-attach").checked = state.config.autoAttach;
33
+ $("opt-highlights").checked = state.config.showHighlights;
34
+ $("opt-cursor").checked = state.config.showGhostCursor;
35
+ $("opt-groups").checked = state.config.groupTabs;
36
+ const urlInput = $("inp-daemon-url");
37
+ const tokenInput = $("inp-auth-token");
38
+ const blockedInput = $("inp-blocked-domains");
39
+ if (document.activeElement !== urlInput) urlInput.value = state.config.daemonUrl;
40
+ if (document.activeElement !== tokenInput) tokenInput.value = state.config.authToken;
41
+ if (document.activeElement !== blockedInput) {
42
+ blockedInput.value = state.config.domainRules.blockedDomains.join(", ");
43
+ }
44
+ $("ext-id").textContent = state.extensionId;
45
+ $("tab-count").textContent = String(state.attachedTabs.length);
46
+ const list = $("tab-list");
47
+ list.innerHTML = "";
48
+ if (state.attachedTabs.length === 0) {
49
+ const empty = document.createElement("div");
50
+ empty.className = "muted";
51
+ empty.textContent = "No tabs attached yet \u2014 AI attaches automatically on demand.";
52
+ list.appendChild(empty);
53
+ } else {
54
+ for (const tab of state.attachedTabs) {
55
+ const item = document.createElement("div");
56
+ item.className = "tab-item";
57
+ const meta = document.createElement("div");
58
+ meta.className = "tab-meta";
59
+ meta.textContent = tab.title || tab.url || `Tab #${tab.tabId}`;
60
+ meta.title = tab.url;
61
+ const btn = document.createElement("button");
62
+ btn.className = "sm";
63
+ btn.textContent = "Detach";
64
+ btn.addEventListener("click", () => {
65
+ void chrome.runtime.sendMessage({ type: "browserpilot:detach-tab", tabId: tab.tabId });
66
+ });
67
+ item.appendChild(meta);
68
+ item.appendChild(btn);
69
+ list.appendChild(item);
70
+ }
71
+ }
72
+ }
73
+ async function refresh() {
74
+ const state = await chrome.runtime.sendMessage({ type: "browserpilot:get-state" });
75
+ if (state) render(state);
76
+ }
77
+ function updateConfig(patch) {
78
+ void chrome.runtime.sendMessage({ type: "browserpilot:update-config", patch }).then(() => refresh());
79
+ }
80
+ $("btn-pause").addEventListener("click", () => {
81
+ if (!currentState) return;
82
+ updateConfig({ paused: !currentState.config.paused });
83
+ });
84
+ $("btn-sidepanel").addEventListener("click", () => {
85
+ void chrome.runtime.sendMessage({ type: "browserpilot:open-sidepanel" });
86
+ });
87
+ $("btn-reconnect").addEventListener("click", () => {
88
+ void chrome.runtime.sendMessage({ type: "browserpilot:reconnect" }).then(() => setTimeout(refresh, 400));
89
+ });
90
+ $("btn-detach-all").addEventListener("click", () => {
91
+ void chrome.runtime.sendMessage({ type: "browserpilot:detach-all" }).then(() => refresh());
92
+ });
93
+ $("opt-dark-mode").addEventListener("change", (e) => {
94
+ const isDark = e.target.checked;
95
+ document.documentElement.dataset.theme = isDark ? "dark" : "light";
96
+ $("theme-mode-label").textContent = isDark ? "Dark" : "Light";
97
+ updateConfig({ theme: isDark ? "dark" : "light" });
98
+ });
99
+ $("opt-auto-attach").addEventListener("change", (e) => {
100
+ updateConfig({ autoAttach: e.target.checked });
101
+ });
102
+ $("opt-highlights").addEventListener("change", (e) => {
103
+ updateConfig({ showHighlights: e.target.checked });
104
+ });
105
+ $("opt-cursor").addEventListener("change", (e) => {
106
+ updateConfig({ showGhostCursor: e.target.checked });
107
+ });
108
+ $("opt-groups").addEventListener("change", (e) => {
109
+ updateConfig({ groupTabs: e.target.checked });
110
+ });
111
+ $("btn-save-settings").addEventListener("click", () => {
112
+ const daemonUrl = $("inp-daemon-url").value.trim();
113
+ const authToken = $("inp-auth-token").value.trim();
114
+ const blockedDomains = $("inp-blocked-domains").value.split(",").map((s) => s.trim()).filter(Boolean);
115
+ updateConfig({
116
+ daemonUrl,
117
+ authToken,
118
+ domainRules: {
119
+ blockedDomains,
120
+ allowedDomains: currentState?.config.domainRules.allowedDomains ?? []
121
+ }
122
+ });
123
+ });
124
+ chrome.runtime.onMessage.addListener((msg) => {
125
+ if (msg?.type === "browserpilot:state-update" && msg.state) {
126
+ render(msg.state);
127
+ }
128
+ });
129
+ void refresh();
130
+ //# sourceMappingURL=popup.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/popup.ts"],
4
+ "sourcesContent": ["import type { ExtensionState } from '@browserpilot/protocol'\n\nconst $ = <T extends HTMLElement>(id: string) => document.getElementById(id) as T\n\nlet currentState: ExtensionState | null = null\n\nfunction render(state: ExtensionState): void {\n currentState = state\n const isDark = state.config.theme !== 'light'\n document.documentElement.dataset.theme = isDark ? 'dark' : 'light'\n $<HTMLInputElement>('opt-dark-mode').checked = isDark\n $('theme-mode-label').textContent = isDark ? 'Dark' : 'Light'\n\n const dot = $('status-dot')\n const badge = $('status-badge')\n const btnPause = $<HTMLButtonElement>('btn-pause')\n\n if (state.config.paused) {\n dot.className = 'dot paused'\n badge.className = 'badge paused'\n badge.textContent = 'PAUSED'\n btnPause.textContent = 'Resume'\n btnPause.className = 'warn'\n } else if (state.connected) {\n dot.className = 'dot on'\n badge.className = 'badge on'\n badge.textContent = state.transport === 'native' ? 'NATIVE' : 'WS LIVE'\n btnPause.textContent = 'Pause'\n btnPause.className = ''\n } else {\n dot.className = 'dot'\n badge.className = 'badge'\n badge.textContent = 'OFFLINE'\n btnPause.textContent = 'Pause'\n btnPause.className = ''\n }\n\n $<HTMLInputElement>('opt-auto-attach').checked = state.config.autoAttach\n $<HTMLInputElement>('opt-highlights').checked = state.config.showHighlights\n $<HTMLInputElement>('opt-cursor').checked = state.config.showGhostCursor\n $<HTMLInputElement>('opt-groups').checked = state.config.groupTabs\n\n const urlInput = $<HTMLInputElement>('inp-daemon-url')\n const tokenInput = $<HTMLInputElement>('inp-auth-token')\n const blockedInput = $<HTMLInputElement>('inp-blocked-domains')\n if (document.activeElement !== urlInput) urlInput.value = state.config.daemonUrl\n if (document.activeElement !== tokenInput) tokenInput.value = state.config.authToken\n if (document.activeElement !== blockedInput) {\n blockedInput.value = state.config.domainRules.blockedDomains.join(', ')\n }\n\n $('ext-id').textContent = state.extensionId\n $('tab-count').textContent = String(state.attachedTabs.length)\n\n const list = $('tab-list')\n list.innerHTML = ''\n if (state.attachedTabs.length === 0) {\n const empty = document.createElement('div')\n empty.className = 'muted'\n empty.textContent = 'No tabs attached yet \u2014 AI attaches automatically on demand.'\n list.appendChild(empty)\n } else {\n for (const tab of state.attachedTabs) {\n const item = document.createElement('div')\n item.className = 'tab-item'\n const meta = document.createElement('div')\n meta.className = 'tab-meta'\n meta.textContent = tab.title || tab.url || `Tab #${tab.tabId}`\n meta.title = tab.url\n const btn = document.createElement('button')\n btn.className = 'sm'\n btn.textContent = 'Detach'\n btn.addEventListener('click', () => {\n void chrome.runtime.sendMessage({ type: 'browserpilot:detach-tab', tabId: tab.tabId })\n })\n item.appendChild(meta)\n item.appendChild(btn)\n list.appendChild(item)\n }\n }\n}\n\nasync function refresh(): Promise<void> {\n const state = (await chrome.runtime.sendMessage({ type: 'browserpilot:get-state' })) as ExtensionState\n if (state) render(state)\n}\n\nfunction updateConfig(patch: Record<string, unknown>): void {\n void chrome.runtime.sendMessage({ type: 'browserpilot:update-config', patch }).then(() => refresh())\n}\n\n$('btn-pause').addEventListener('click', () => {\n if (!currentState) return\n updateConfig({ paused: !currentState.config.paused })\n})\n$('btn-sidepanel').addEventListener('click', () => {\n void chrome.runtime.sendMessage({ type: 'browserpilot:open-sidepanel' })\n})\n$('btn-reconnect').addEventListener('click', () => {\n void chrome.runtime.sendMessage({ type: 'browserpilot:reconnect' }).then(() => setTimeout(refresh, 400))\n})\n$('btn-detach-all').addEventListener('click', () => {\n void chrome.runtime.sendMessage({ type: 'browserpilot:detach-all' }).then(() => refresh())\n})\n\n$('opt-dark-mode').addEventListener('change', (e) => {\n const isDark = (e.target as HTMLInputElement).checked\n document.documentElement.dataset.theme = isDark ? 'dark' : 'light'\n $('theme-mode-label').textContent = isDark ? 'Dark' : 'Light'\n updateConfig({ theme: isDark ? 'dark' : 'light' })\n})\n$('opt-auto-attach').addEventListener('change', (e) => {\n updateConfig({ autoAttach: (e.target as HTMLInputElement).checked })\n})\n$('opt-highlights').addEventListener('change', (e) => {\n updateConfig({ showHighlights: (e.target as HTMLInputElement).checked })\n})\n$('opt-cursor').addEventListener('change', (e) => {\n updateConfig({ showGhostCursor: (e.target as HTMLInputElement).checked })\n})\n$('opt-groups').addEventListener('change', (e) => {\n updateConfig({ groupTabs: (e.target as HTMLInputElement).checked })\n})\n\n$('btn-save-settings').addEventListener('click', () => {\n const daemonUrl = $<HTMLInputElement>('inp-daemon-url').value.trim()\n const authToken = $<HTMLInputElement>('inp-auth-token').value.trim()\n const blockedDomains = $<HTMLInputElement>('inp-blocked-domains')\n .value.split(',')\n .map((s) => s.trim())\n .filter(Boolean)\n updateConfig({\n daemonUrl,\n authToken,\n domainRules: {\n blockedDomains,\n allowedDomains: currentState?.config.domainRules.allowedDomains ?? [],\n },\n })\n})\n\nchrome.runtime.onMessage.addListener((msg) => {\n if (msg?.type === 'browserpilot:state-update' && msg.state) {\n render(msg.state as ExtensionState)\n }\n})\n\nvoid refresh()\n"],
5
+ "mappings": ";AAEA,IAAM,IAAI,CAAwB,OAAe,SAAS,eAAe,EAAE;AAE3E,IAAI,eAAsC;AAE1C,SAAS,OAAO,OAA6B;AAC3C,iBAAe;AACf,QAAM,SAAS,MAAM,OAAO,UAAU;AACtC,WAAS,gBAAgB,QAAQ,QAAQ,SAAS,SAAS;AAC3D,IAAoB,eAAe,EAAE,UAAU;AAC/C,IAAE,kBAAkB,EAAE,cAAc,SAAS,SAAS;AAEtD,QAAM,MAAM,EAAE,YAAY;AAC1B,QAAM,QAAQ,EAAE,cAAc;AAC9B,QAAM,WAAW,EAAqB,WAAW;AAEjD,MAAI,MAAM,OAAO,QAAQ;AACvB,QAAI,YAAY;AAChB,UAAM,YAAY;AAClB,UAAM,cAAc;AACpB,aAAS,cAAc;AACvB,aAAS,YAAY;AAAA,EACvB,WAAW,MAAM,WAAW;AAC1B,QAAI,YAAY;AAChB,UAAM,YAAY;AAClB,UAAM,c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+ <title>BrowserPilot Companion</title>
6
+ <style>
7
+ :root {
8
+ color-scheme: dark;
9
+ --bg: #0b1120;
10
+ --surface: #0f172a;
11
+ --border: #1e293b;
12
+ --border-strong: #334155;
13
+ --text: #e2e8f0;
14
+ --text-strong: #f8fafc;
15
+ --detail: #cbd5e1;
16
+ --muted: #64748b;
17
+ --muted-strong: #94a3b8;
18
+ --btn-bg: #1e293b;
19
+ --pill-bg: #1e293b;
20
+ --pill-text: #94a3b8;
21
+ --pill-on-bg: rgba(16, 185, 129, 0.18);
22
+ --pill-on-text: #34d399;
23
+ --accent: #34d399;
24
+ --ok: #34d399;
25
+ --err: #f87171;
26
+ --info: #38bdf8;
27
+ }
28
+ :root[data-theme="light"] {
29
+ color-scheme: light;
30
+ --bg: #f8fafc;
31
+ --surface: #ffffff;
32
+ --border: #e2e8f0;
33
+ --border-strong: #cbd5e1;
34
+ --text: #1e293b;
35
+ --text-strong: #0f172a;
36
+ --detail: #334155;
37
+ --muted: #64748b;
38
+ --muted-strong: #475569;
39
+ --btn-bg: #ffffff;
40
+ --pill-bg: #e2e8f0;
41
+ --pill-text: #475569;
42
+ --pill-on-bg: #d1fae5;
43
+ --pill-on-text: #047857;
44
+ --accent: #059669;
45
+ --ok: #059669;
46
+ --err: #dc2626;
47
+ --info: #0284c7;
48
+ }
49
+ * { box-sizing: border-box; }
50
+ body {
51
+ margin: 0;
52
+ background: var(--bg);
53
+ color: var(--text);
54
+ font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
55
+ display: flex;
56
+ flex-direction: column;
57
+ height: 100vh;
58
+ transition: background 140ms ease, color 140ms ease;
59
+ }
60
+ header {
61
+ padding: 12px 14px;
62
+ background: var(--surface);
63
+ border-bottom: 1px solid var(--border);
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: space-between;
67
+ gap: 8px;
68
+ }
69
+ .header-right {
70
+ display: flex;
71
+ align-items: center;
72
+ gap: 6px;
73
+ }
74
+ .title { font-weight: 650; font-size: 14px; color: var(--text-strong); }
75
+ .pill {
76
+ font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
77
+ padding: 4px 8px;
78
+ border-radius: 999px;
79
+ background: var(--pill-bg);
80
+ color: var(--pill-text);
81
+ }
82
+ .pill.on { background: var(--pill-on-bg); color: var(--pill-on-text); }
83
+ .toolbar {
84
+ padding: 10px 14px;
85
+ display: flex;
86
+ gap: 8px;
87
+ border-bottom: 1px solid var(--border);
88
+ }
89
+ .tabs {
90
+ display: flex;
91
+ border-bottom: 1px solid var(--border);
92
+ background: var(--surface);
93
+ padding: 0 10px;
94
+ gap: 4px;
95
+ }
96
+ .tab-btn {
97
+ background: transparent;
98
+ border: 0;
99
+ border-bottom: 2px solid transparent;
100
+ border-radius: 0;
101
+ color: var(--muted-strong);
102
+ padding: 8px 10px;
103
+ font-size: 12px;
104
+ font-weight: 600;
105
+ }
106
+ .tab-btn.active {
107
+ color: var(--accent);
108
+ border-bottom-color: var(--accent);
109
+ }
110
+ button {
111
+ cursor: pointer;
112
+ border: 1px solid var(--border-strong);
113
+ background: var(--btn-bg);
114
+ color: var(--text-strong);
115
+ font: 500 12px/1 inherit;
116
+ padding: 7px 10px;
117
+ border-radius: 6px;
118
+ }
119
+ button.theme-btn {
120
+ padding: 4px 8px;
121
+ font-size: 11px;
122
+ }
123
+ button.primary { background: #0284c7; border-color: #0284c7; color: #fff; }
124
+ button:hover { opacity: 0.9; }
125
+ main {
126
+ flex: 1;
127
+ overflow-y: auto;
128
+ padding: 12px 14px;
129
+ display: flex;
130
+ flex-direction: column;
131
+ gap: 14px;
132
+ }
133
+ h2 {
134
+ margin: 0 0 8px;
135
+ font-size: 11px;
136
+ font-weight: 600;
137
+ text-transform: uppercase;
138
+ letter-spacing: 0.06em;
139
+ color: var(--muted);
140
+ }
141
+ .card {
142
+ background: var(--surface);
143
+ border: 1px solid var(--border);
144
+ border-radius: 8px;
145
+ padding: 8px 10px;
146
+ margin-bottom: 6px;
147
+ }
148
+ .entry-head {
149
+ display: flex;
150
+ justify-content: space-between;
151
+ align-items: center;
152
+ gap: 8px;
153
+ font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
154
+ }
155
+ .ok { color: var(--ok); }
156
+ .error { color: var(--err); }
157
+ .info { color: var(--info); }
158
+ .time { color: var(--muted); font-weight: 400; font-size: 11px; }
159
+ .detail {
160
+ margin-top: 4px;
161
+ font-size: 12px;
162
+ color: var(--detail);
163
+ word-break: break-word;
164
+ }
165
+ .muted { color: var(--muted); font-size: 12px; }
166
+ </style>
167
+ </head>
168
+ <body>
169
+ <header>
170
+ <div class="title">BrowserPilot Companion</div>
171
+ <div class="header-right">
172
+ <button id="sp-theme" class="theme-btn" title="Switch Dark / Light Mode">Light</button>
173
+ <span id="sp-status" class="pill">OFFLINE</span>
174
+ </div>
175
+ </header>
176
+
177
+ <div class="toolbar">
178
+ <button id="sp-pick" class="primary">Pick Element</button>
179
+ <button id="sp-pause">Pause</button>
180
+ <button id="sp-detach-all">Detach All</button>
181
+ </div>
182
+
183
+ <div class="tabs">
184
+ <button id="tab-activity" class="tab-btn active">Activity</button>
185
+ <button id="tab-errors" class="tab-btn">Errors (<span id="err-count">0</span>)</button>
186
+ <button id="tab-network" class="tab-btn">Failed Net (<span id="net-count">0</span>)</button>
187
+ </div>
188
+
189
+ <main>
190
+ <section>
191
+ <h2>Active Controlled Tabs</h2>
192
+ <div id="sp-tabs" class="muted">None</div>
193
+ </section>
194
+
195
+ <section>
196
+ <h2 id="feed-heading">Live AI Activity Timeline</h2>
197
+ <div id="sp-feed" class="muted">Waiting for agent commands…</div>
198
+ </section>
199
+ </main>
200
+
201
+ <script type="module" src="sidepanel.js"></script>
202
+ </body>
203
+ </html>