@hanzo/browser-extension 1.9.31 → 1.9.33

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.
Files changed (62) hide show
  1. package/package.json +2 -1
  2. package/src/answer/AnswerEngine.tsx +553 -0
  3. package/src/manifest-firefox.json +10 -2
  4. package/src/manifest.json +17 -2
  5. package/src/newtab.css +277 -0
  6. package/src/newtab.html +13 -0
  7. package/src/popup.html +28 -0
  8. package/dist/browser-extension/README.md +0 -43
  9. package/dist/browser-extension/background-firefox.js +0 -4556
  10. package/dist/browser-extension/background.js +0 -7245
  11. package/dist/browser-extension/browser-control.js +0 -1317
  12. package/dist/browser-extension/chrome/ai-worker.js +0 -571
  13. package/dist/browser-extension/chrome/background.js +0 -7245
  14. package/dist/browser-extension/chrome/callback.html +0 -17
  15. package/dist/browser-extension/chrome/content-script.js +0 -2789
  16. package/dist/browser-extension/chrome/icon128.png +0 -0
  17. package/dist/browser-extension/chrome/icon16.png +0 -0
  18. package/dist/browser-extension/chrome/icon48.png +0 -0
  19. package/dist/browser-extension/chrome/manifest.json +0 -66
  20. package/dist/browser-extension/chrome/popup.css +0 -761
  21. package/dist/browser-extension/chrome/popup.html +0 -353
  22. package/dist/browser-extension/chrome/popup.js +0 -1650
  23. package/dist/browser-extension/chrome/sidebar.css +0 -1792
  24. package/dist/browser-extension/chrome/sidebar.html +0 -463
  25. package/dist/browser-extension/chrome/sidebar.js +0 -26541
  26. package/dist/browser-extension/cli.js +0 -233
  27. package/dist/browser-extension/firefox/ai-worker.js +0 -571
  28. package/dist/browser-extension/firefox/background.js +0 -4556
  29. package/dist/browser-extension/firefox/callback.html +0 -17
  30. package/dist/browser-extension/firefox/content-script.js +0 -2789
  31. package/dist/browser-extension/firefox/icon128.png +0 -0
  32. package/dist/browser-extension/firefox/icon16.png +0 -0
  33. package/dist/browser-extension/firefox/icon48.png +0 -0
  34. package/dist/browser-extension/firefox/manifest.json +0 -77
  35. package/dist/browser-extension/firefox/popup.css +0 -761
  36. package/dist/browser-extension/firefox/popup.html +0 -353
  37. package/dist/browser-extension/firefox/popup.js +0 -1650
  38. package/dist/browser-extension/firefox/sidebar.css +0 -1792
  39. package/dist/browser-extension/firefox/sidebar.html +0 -463
  40. package/dist/browser-extension/firefox/sidebar.js +0 -26541
  41. package/dist/browser-extension/icon128.png +0 -0
  42. package/dist/browser-extension/icon16.png +0 -0
  43. package/dist/browser-extension/icon48.png +0 -0
  44. package/dist/browser-extension/manifest.json +0 -66
  45. package/dist/browser-extension/package.json +0 -41
  46. package/dist/browser-extension/popup.js +0 -1650
  47. package/dist/browser-extension/safari/Info.plist +0 -21
  48. package/dist/browser-extension/safari/ai-worker.js +0 -571
  49. package/dist/browser-extension/safari/background.js +0 -7245
  50. package/dist/browser-extension/safari/callback.html +0 -17
  51. package/dist/browser-extension/safari/content-script.js +0 -2789
  52. package/dist/browser-extension/safari/icon128.png +0 -0
  53. package/dist/browser-extension/safari/icon16.png +0 -0
  54. package/dist/browser-extension/safari/icon48.png +0 -0
  55. package/dist/browser-extension/safari/popup.css +0 -761
  56. package/dist/browser-extension/safari/popup.html +0 -353
  57. package/dist/browser-extension/safari/popup.js +0 -1650
  58. package/dist/browser-extension/safari/sidebar.css +0 -1792
  59. package/dist/browser-extension/safari/sidebar.html +0 -463
  60. package/dist/browser-extension/safari/sidebar.js +0 -26541
  61. package/dist/browser-extension/sidebar.js +0 -26541
  62. package/dist/browser-extension/webgpu-ai.js +0 -568
@@ -1,353 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Hanzo AI</title>
7
- <link rel="stylesheet" href="popup.css">
8
- </head>
9
- <body>
10
- <div class="container">
11
- <header>
12
- <svg class="logo" viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg">
13
- <path d="M22.21 67V44.6369H0V67H22.21Z" fill="currentColor"/>
14
- <path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="currentColor"/>
15
- <path d="M22.21 0H0V22.3184H22.21V0Z" fill="currentColor"/>
16
- <path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="currentColor"/>
17
- <path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="currentColor"/>
18
- </svg>
19
- <h1>Hanzo AI</h1>
20
- </header>
21
-
22
- <!-- Login Section -->
23
- <div id="login-section" class="section login-section">
24
- <div class="login-card">
25
- <svg class="login-logo" viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg">
26
- <path d="M22.21 67V44.6369H0V67H22.21Z" fill="currentColor"/>
27
- <path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="currentColor"/>
28
- <path d="M22.21 0H0V22.3184H22.21V0Z" fill="currentColor"/>
29
- <path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="currentColor"/>
30
- <path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="currentColor"/>
31
- </svg>
32
- <h2 class="login-headline">Sign in to Hanzo AI</h2>
33
- <p class="login-sub">Chat with AI, use browser tools, and build with agents.</p>
34
- <button id="login-btn" class="login-signin-btn">Sign In</button>
35
- <button id="signup-btn-popup" class="login-create-btn">Create account</button>
36
- <p class="login-note">
37
- Browser tools work without sign-in. <a href="https://docs.hanzo.ai" target="_blank">Learn more</a>
38
- </p>
39
- </div>
40
- </div>
41
-
42
- <!-- Main Section (shown after login) -->
43
- <div id="main-section" class="section hidden">
44
- <div id="user-info-section" class="hidden">
45
- <div class="user-info">
46
- <img id="user-avatar" class="avatar" src="" alt="">
47
- <div>
48
- <div id="user-name" class="user-name"></div>
49
- <div id="user-email" class="user-email"></div>
50
- </div>
51
- <button id="logout-btn" class="btn-icon" title="Sign out">
52
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
53
- <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9"/>
54
- </svg>
55
- </button>
56
- </div>
57
- <div class="divider"></div>
58
- </div>
59
-
60
- <!-- Actions: single Open Chat button + on-page surface settings. -->
61
- <button id="open-panel" class="btn btn-secondary" style="margin-bottom: 8px;">
62
- <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
63
- <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
64
- </svg>
65
- Open Chat
66
- </button>
67
-
68
- <!-- On-page chat config -->
69
- <div class="onpage-config" style="display:flex;flex-direction:column;gap:6px;margin-bottom:12px;font-size:11px;">
70
- <div class="feature-toggle" style="display:flex;justify-content:space-between;align-items:center;">
71
- <label style="display:flex;align-items:center;gap:6px;cursor:pointer;">
72
- <input type="checkbox" id="overlay-enabled" checked>
73
- <span>On-page chat panel</span>
74
- </label>
75
- <span style="color:var(--text-muted,#888);font-size:10px;">overlay vs new tab</span>
76
- </div>
77
-
78
- <div id="overlay-side-row" class="side-picker" style="display:flex;gap:6px;align-items:center;">
79
- <span style="color:var(--text-muted,#888);">Pin:</span>
80
- <button id="pin-left" class="btn btn-ghost" style="flex:1;padding:4px 8px;font-size:11px;">Left</button>
81
- <button id="pin-right" class="btn btn-ghost" style="flex:1;padding:4px 8px;font-size:11px;" data-active="true">Right</button>
82
- </div>
83
-
84
- <div id="overlay-width-row" style="display:flex;gap:6px;align-items:center;">
85
- <span style="color:var(--text-muted,#888);">Width:</span>
86
- <button class="btn btn-ghost width-btn" data-width="compact" style="flex:1;padding:4px 8px;font-size:11px;">Compact</button>
87
- <button class="btn btn-ghost width-btn" data-width="default" style="flex:1;padding:4px 8px;font-size:11px;" data-active="true">Default</button>
88
- <button class="btn btn-ghost width-btn" data-width="wide" style="flex:1;padding:4px 8px;font-size:11px;">Wide</button>
89
- </div>
90
-
91
- <span style="color:var(--text-muted,#888);font-size:10px;line-height:1.4;">
92
- FF native sidebar: View → Sidebar → Hanzo AI.<br>
93
- Disable to fall back to a standalone tab — useful on sites with strict CSP.
94
- </span>
95
- </div>
96
-
97
- <div class="divider"></div>
98
-
99
- <!-- Tools -->
100
- <h3>Tools</h3>
101
- <div class="tools-grid">
102
- <button id="tool-picker" class="tool-btn" title="Pick an element on the page">
103
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
104
- <path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/>
105
- <path d="M13 13l6 6"/>
106
- </svg>
107
- <span>Selector</span>
108
- </button>
109
- <button id="tool-screenshot" class="tool-btn" title="Capture visible page">
110
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
111
- <path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/>
112
- <circle cx="12" cy="13" r="4"/>
113
- </svg>
114
- <span>Screenshot</span>
115
- </button>
116
- <button id="tool-pageinfo" class="tool-btn" title="Copy page info to clipboard">
117
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
118
- <circle cx="12" cy="12" r="10"/>
119
- <path d="M12 16v-4M12 8h.01"/>
120
- </svg>
121
- <span>Page Info</span>
122
- </button>
123
- <button id="tool-accessibility" class="tool-btn" title="Run accessibility audit">
124
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
125
- <circle cx="12" cy="4" r="2"/>
126
- <path d="M12 6v6M8 8l4 2 4-2M8 22l2-6h4l2 6"/>
127
- </svg>
128
- <span>A11y Audit</span>
129
- </button>
130
- <button id="tool-performance" class="tool-btn" title="Run performance audit">
131
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
132
- <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
133
- </svg>
134
- <span>Perf Audit</span>
135
- </button>
136
- <button id="tool-console" class="tool-btn" title="Evaluate JS in page context">
137
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
138
- <polyline points="4 17 10 11 4 5"/>
139
- <line x1="12" y1="19" x2="20" y2="19"/>
140
- </svg>
141
- <span>Console</span>
142
- </button>
143
- </div>
144
-
145
- <div class="divider"></div>
146
-
147
- <!-- Features -->
148
- <h3>Features</h3>
149
- <div class="features">
150
- <div class="feature-toggle">
151
- <label>
152
- <input type="checkbox" id="source-maps" checked>
153
- <span class="toggle"></span>
154
- <div class="feature-info">
155
- <strong>Source Maps</strong>
156
- <small>Click-to-code navigation</small>
157
- </div>
158
- </label>
159
- </div>
160
-
161
- <div class="feature-toggle">
162
- <label>
163
- <input type="checkbox" id="webgpu-ai" checked>
164
- <span class="toggle"></span>
165
- <div class="feature-info">
166
- <strong>WebGPU AI</strong>
167
- <small>Local AI inference</small>
168
- </div>
169
- </label>
170
- </div>
171
-
172
- <div class="feature-toggle">
173
- <label>
174
- <input type="checkbox" id="browser-control">
175
- <span class="toggle"></span>
176
- <div class="feature-info">
177
- <strong>Browser Control</strong>
178
- <small>AI browser automation</small>
179
- </div>
180
- </label>
181
- </div>
182
-
183
- <div class="feature-toggle">
184
- <label>
185
- <input type="checkbox" id="tab-filesystem">
186
- <span class="toggle"></span>
187
- <div class="feature-info">
188
- <strong>Tab Filesystem</strong>
189
- <small>Mount tabs as files</small>
190
- </div>
191
- </label>
192
- </div>
193
- </div>
194
-
195
- <div class="divider"></div>
196
-
197
- <!-- Browser Backend -->
198
- <div class="setting-group backend-picker">
199
- <h3>Backend</h3>
200
- <div class="backend-select-wrapper">
201
- <select id="browser-backend">
202
- <option value="auto">Auto (default)</option>
203
- <option value="this">This Browser</option>
204
- <option value="firefox">Firefox</option>
205
- <option value="chrome">Chrome</option>
206
- <option value="playwright">Playwright Only</option>
207
- </select>
208
- </div>
209
- <div class="backend-status">
210
- <span class="status-dot" id="bridge-status"></span>
211
- <span id="bridge-detail" class="status-detail">Checking bridge...</span>
212
- </div>
213
- </div>
214
-
215
- <div class="divider"></div>
216
-
217
- <!-- Connection Status -->
218
- <h3>Status</h3>
219
- <div class="status">
220
- <div class="status-item">
221
- <span class="status-dot" id="zap-status"></span>
222
- <span>ZAP Bridge</span>
223
- <span id="zap-detail" class="status-detail">Discovering...</span>
224
- </div>
225
- <div class="status-item">
226
- <span class="status-dot" id="cdp-status"></span>
227
- <span>CDP Bridge</span>
228
- <span id="cdp-detail" class="status-detail">Checking...</span>
229
- </div>
230
- <div class="status-item">
231
- <span class="status-dot" id="mcp-status"></span>
232
- <span>MCP Bridge</span>
233
- <span id="mcp-port" class="status-detail">:9224</span>
234
- </div>
235
- <div class="status-item">
236
- <span class="status-dot" id="gpu-status"></span>
237
- <span>WebGPU</span>
238
- <span id="gpu-detail" class="status-detail">Checking...</span>
239
- </div>
240
- </div>
241
-
242
- <div class="divider"></div>
243
-
244
- <!-- Actions -->
245
- <div class="actions">
246
- <button id="test-connection" class="btn btn-ghost">Test Connection</button>
247
- <button id="open-settings" class="btn btn-ghost">Settings</button>
248
- </div>
249
-
250
- <!-- Quick Guide -->
251
- <div class="guide" style="margin-top: 12px;">
252
- <h3 style="text-transform: none; letter-spacing: 0; color: var(--text);">Shortcuts</h3>
253
- <p>
254
- <kbd id="inspect-shortcut-display">Ctrl</kbd> + <kbd>Click</kbd>
255
- any element to jump to source
256
- <button id="record-inspect-shortcut" class="btn-link" style="margin-left:6px;font-size:11px;">edit</button>
257
- </p>
258
- <p><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>H</kbd> open Hanzo panel</p>
259
- </div>
260
- </div>
261
-
262
- <!-- Settings Section -->
263
- <div id="settings-section" class="section hidden">
264
- <div class="settings-header">
265
- <button id="back-btn" class="btn-icon">
266
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
267
- <path d="M19 12H5M12 19l-7-7 7-7"/>
268
- </svg>
269
- </button>
270
- <h2>Settings</h2>
271
- </div>
272
-
273
- <div class="settings-content">
274
- <div class="setting-group">
275
- <h3>Connection</h3>
276
- <label>
277
- MCP Port
278
- <input type="number" id="mcp-port-setting" value="3001" min="1024" max="65535">
279
- </label>
280
- <label>
281
- CDP Bridge Port
282
- <input type="number" id="cdp-port-setting" value="9223" min="1024" max="65535">
283
- </label>
284
- <label>
285
- ZAP Discovery Ports
286
- <input type="text" id="zap-ports-setting" value="9999,9998,9997,9996,9995" placeholder="Comma-separated ports">
287
- </label>
288
- </div>
289
-
290
- <div class="setting-group">
291
- <h3>AI Models</h3>
292
- <label>
293
- Local Model Path
294
- <input type="text" id="model-path" placeholder="/models/browser-control-4bit.bin">
295
- </label>
296
- <label>
297
- Model Quantization
298
- <select id="model-quant">
299
- <option value="4bit">4-bit (Fastest)</option>
300
- <option value="8bit">8-bit (Balanced)</option>
301
- <option value="fp16">FP16 (Best Quality)</option>
302
- </select>
303
- </label>
304
- </div>
305
-
306
- <div class="setting-group">
307
- <h3>Browser Control</h3>
308
- <label>
309
- <input type="checkbox" id="safe-mode" checked>
310
- Safe Mode (require confirmation for actions)
311
- </label>
312
- <label>
313
- Max Workers
314
- <input type="number" id="max-workers" value="3" min="1" max="10">
315
- </label>
316
- </div>
317
-
318
- <div class="setting-group">
319
- <h3>Keyboard</h3>
320
- <label>
321
- Inspect modifier
322
- <div style="display:flex;gap:8px;align-items:center;margin-top:4px;">
323
- <kbd id="inspect-shortcut-current" style="flex:1;font-family:monospace;padding:4px 8px;background:var(--surface-2,#222);border-radius:4px;font-size:12px;">Ctrl</kbd>
324
- <button id="inspect-shortcut-record" type="button" class="btn btn-ghost" style="padding:4px 10px;">Record</button>
325
- <button id="inspect-shortcut-reset" type="button" class="btn btn-ghost" style="padding:4px 10px;">Reset</button>
326
- </div>
327
- <small style="color:var(--text-muted,#888);font-size:11px;">
328
- Hold + click any element on a page to jump to its source. Default
329
- is Ctrl (or ⌘ on Mac). Click "Record" then press the chord you
330
- want — modifiers alone or modifier+letter both work.
331
- </small>
332
- </label>
333
- </div>
334
-
335
- <button id="save-settings" class="btn btn-primary">Save Settings</button>
336
- </div>
337
- </div>
338
-
339
- <!-- Footer: version + nav links -->
340
- <div class="footer-version" style="text-align:center;font-size:10px;color:var(--text-muted,#888);margin-top:14px;letter-spacing:0.04em;">
341
- Hanzo AI <span id="footer-version">…</span>
342
- </div>
343
- <div class="footer-links">
344
- <a href="https://docs.hanzo.ai" target="_blank">Docs</a>
345
- <a href="https://console.hanzo.ai" target="_blank">Console</a>
346
- <a href="https://github.com/hanzoai/extension" target="_blank">GitHub</a>
347
- <a href="https://hanzo.ai" target="_blank">hanzo.ai</a>
348
- </div>
349
- </div>
350
-
351
- <script src="popup.js"></script>
352
- </body>
353
- </html>