@hanzo/browser-extension 1.7.5 → 1.9.31
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.
- package/LICENSE +9 -18
- package/dist/browser-extension/README.md +1 -1
- package/dist/browser-extension/background-firefox.js +4184 -491
- package/dist/browser-extension/background.js +6938 -2413
- package/dist/browser-extension/browser-control.js +652 -18
- package/dist/browser-extension/chrome/background.js +6938 -2413
- package/dist/browser-extension/chrome/content-script.js +1642 -123
- package/dist/browser-extension/chrome/icon128.png +0 -0
- package/dist/browser-extension/chrome/icon16.png +0 -0
- package/dist/browser-extension/chrome/icon48.png +0 -0
- package/dist/browser-extension/chrome/manifest.json +20 -11
- package/dist/browser-extension/chrome/popup.css +352 -110
- package/dist/browser-extension/chrome/popup.html +159 -48
- package/dist/browser-extension/chrome/popup.js +1418 -46
- package/dist/browser-extension/chrome/sidebar.css +772 -156
- package/dist/browser-extension/chrome/sidebar.html +268 -85
- package/dist/browser-extension/chrome/sidebar.js +25846 -84
- package/dist/browser-extension/cli.js +2 -2
- package/dist/browser-extension/content-script.js +1642 -123
- package/dist/browser-extension/firefox/background.js +4184 -491
- package/dist/browser-extension/firefox/content-script.js +1642 -123
- package/dist/browser-extension/firefox/icon128.png +0 -0
- package/dist/browser-extension/firefox/icon16.png +0 -0
- package/dist/browser-extension/firefox/icon48.png +0 -0
- package/dist/browser-extension/firefox/manifest.json +24 -13
- package/dist/browser-extension/firefox/popup.css +352 -110
- package/dist/browser-extension/firefox/popup.html +159 -48
- package/dist/browser-extension/firefox/popup.js +1418 -46
- package/dist/browser-extension/firefox/sidebar.css +772 -156
- package/dist/browser-extension/firefox/sidebar.html +268 -85
- package/dist/browser-extension/firefox/sidebar.js +25846 -84
- package/dist/browser-extension/icon128.png +0 -0
- package/dist/browser-extension/icon16.png +0 -0
- package/dist/browser-extension/icon48.png +0 -0
- package/dist/browser-extension/manifest.json +20 -11
- package/dist/browser-extension/package.json +1 -1
- package/dist/browser-extension/popup.js +1418 -46
- package/dist/browser-extension/safari/Info.plist +3 -3
- package/dist/browser-extension/safari/background.js +6938 -2413
- package/dist/browser-extension/safari/content-script.js +1642 -123
- package/dist/browser-extension/safari/icon128.png +0 -0
- package/dist/browser-extension/safari/icon16.png +0 -0
- package/dist/browser-extension/safari/icon48.png +0 -0
- package/dist/browser-extension/safari/popup.css +352 -110
- package/dist/browser-extension/safari/popup.html +159 -48
- package/dist/browser-extension/safari/popup.js +1418 -46
- package/dist/browser-extension/safari/sidebar.css +772 -156
- package/dist/browser-extension/safari/sidebar.html +268 -85
- package/dist/browser-extension/safari/sidebar.js +25846 -84
- package/dist/browser-extension/sidebar.js +25846 -84
- package/dist/browser-extension/webgpu-ai.js +78 -5
- package/images/icon128.png +0 -0
- package/images/icon16.png +0 -0
- package/images/icon48.png +0 -0
- package/manifest.json +7 -2
- package/package.json +27 -10
- package/src/chat-widget.tsx +96 -0
- package/src/gui-primitives.tsx +116 -0
- package/src/icon128.png +0 -0
- package/src/icon16.png +0 -0
- package/src/icon32.png +0 -0
- package/src/icon48.png +0 -0
- package/src/manifest-firefox.json +23 -12
- package/src/manifest.json +19 -10
- package/src/package.json +1 -1
- package/src/popup.css +352 -110
- package/src/popup.html +159 -48
- package/src/popup.js +196 -0
- package/src/sidebar.css +772 -156
- package/src/sidebar.html +268 -85
- package/src/sidebar.js +885 -0
- package/.github/workflows/docs.yml +0 -44
- package/.github/workflows/release.yml +0 -55
- package/README.md +0 -126
- package/dist/browser-extension/ai-worker.js +0 -30
- package/dist/browser-extension/cdp-bridge-server.js +0 -444
- package/dist/browser-extension/chrome/icon32.png +0 -0
- package/dist/browser-extension/firefox/icon32.png +0 -0
- package/dist/browser-extension/hanzo-browser-extension-firefox-1.1.0.zip +0 -0
- package/dist/browser-extension/icon32.png +0 -0
- package/dist/browser-extension/popup.css +0 -468
- package/dist/browser-extension/popup.html +0 -191
- package/dist/browser-extension/safari/icon32.png +0 -0
- package/dist/browser-extension/sidebar.css +0 -718
- package/dist/browser-extension/sidebar.html +0 -184
- package/dist/cdp-bridge-server.js +0 -411
- package/dist/hanzo-ai-chrome-1.7.2.zip +0 -0
- package/dist/hanzo-ai-chrome-1.7.3.zip +0 -0
- package/dist/hanzo-ai-firefox-1.7.2.zip +0 -0
- package/dist/hanzo-ai-firefox-1.7.3.zip +0 -0
- package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.pbxproj +0 -1047
- package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@2x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/universal-icon-1024@1x.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/Contents.json +0 -6
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +0 -21
- package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/icon128.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Base.lproj/Main.html +0 -20
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Icon.png +0 -0
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Script.js +0 -24
- package/dist/safari/Hanzo AI/Shared (App)/Resources/Style.css +0 -61
- package/dist/safari/Hanzo AI/Shared (App)/ViewController.swift +0 -81
- package/dist/safari/Hanzo AI/Shared (Extension)/SafariWebExtensionHandler.swift +0 -42
- package/dist/safari/Hanzo AI/iOS (App)/AppDelegate.swift +0 -24
- package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/LaunchScreen.storyboard +0 -36
- package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/Main.storyboard +0 -38
- package/dist/safari/Hanzo AI/iOS (App)/Info.plist +0 -27
- package/dist/safari/Hanzo AI/iOS (App)/SceneDelegate.swift +0 -18
- package/dist/safari/Hanzo AI/iOS (Extension)/Info.plist +0 -13
- package/dist/safari/Hanzo AI/macOS (App)/AppDelegate.swift +0 -21
- package/dist/safari/Hanzo AI/macOS (App)/Base.lproj/Main.storyboard +0 -124
- package/dist/safari/Hanzo AI/macOS (App)/Info.plist +0 -8
- package/dist/safari/Hanzo AI/macOS (Extension)/Info.plist +0 -13
- package/docs/_config.yml +0 -13
- package/docs/_layouts/default.html +0 -435
- package/docs/index.md +0 -54
- package/install-extension.sh +0 -75
- package/test/claude-integration.test.ts +0 -251
- package/test/server-frameworks-edge-cases.test.ts +0 -145
- package/test/server-frameworks.test.ts +0 -395
- package/test-cdp-connection.js +0 -140
- package/tsconfig.json +0 -19
|
@@ -193,11 +193,7 @@ var WebGPUAI = class {
|
|
|
193
193
|
throw new Error("WebGPU not initialized");
|
|
194
194
|
}
|
|
195
195
|
console.log(`[Hanzo AI] Loading model: ${config.name}`);
|
|
196
|
-
const
|
|
197
|
-
if (!response.ok) {
|
|
198
|
-
throw new Error(`Failed to fetch model ${config.name}: ${response.status}`);
|
|
199
|
-
}
|
|
200
|
-
const modelData = await response.arrayBuffer();
|
|
196
|
+
const modelData = await this._fetchWithCache(config.url, config.name);
|
|
201
197
|
const modelBuffer = this.device.createBuffer({
|
|
202
198
|
size: modelData.byteLength,
|
|
203
199
|
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
|
|
@@ -466,6 +462,83 @@ var WebGPUAI = class {
|
|
|
466
462
|
return embedding;
|
|
467
463
|
}
|
|
468
464
|
// ---------------------------------------------------------------------------
|
|
465
|
+
// Cached, progress-reporting fetch — used by loadModel().
|
|
466
|
+
// ---------------------------------------------------------------------------
|
|
467
|
+
/**
|
|
468
|
+
* Fetch a model blob with persistent caching. Backed by the service-worker
|
|
469
|
+
* Cache API so the bytes survive worker restarts and only download once
|
|
470
|
+
* per URL. Streams the body to log progress every ~5% so big artifacts
|
|
471
|
+
* (huggingface.co/<repo>/resolve/main/<file>) don't appear to hang.
|
|
472
|
+
*
|
|
473
|
+
* Cache invalidation: the URL is the key; bump the URL (e.g. point to a
|
|
474
|
+
* different revision sha) to force a re-fetch. Use ``WebGPUAI.evictCache``
|
|
475
|
+
* to wipe everything when models go bad.
|
|
476
|
+
*/
|
|
477
|
+
async _fetchWithCache(url, label) {
|
|
478
|
+
const cacheName = "hanzo-webgpu-models-v1";
|
|
479
|
+
const cache = typeof caches !== "undefined" ? await caches.open(cacheName) : null;
|
|
480
|
+
if (cache) {
|
|
481
|
+
const hit = await cache.match(url);
|
|
482
|
+
if (hit) {
|
|
483
|
+
console.log(`[Hanzo AI] Cache hit: ${label} (${url})`);
|
|
484
|
+
return await hit.arrayBuffer();
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
console.log(`[Hanzo AI] Fetching: ${label} (${url})`);
|
|
488
|
+
const response = await fetch(url);
|
|
489
|
+
if (!response.ok) {
|
|
490
|
+
throw new Error(`Failed to fetch ${label}: ${response.status} ${response.statusText}`);
|
|
491
|
+
}
|
|
492
|
+
const total = Number(response.headers.get("content-length") || 0);
|
|
493
|
+
let received = 0;
|
|
494
|
+
let nextLog = total > 0 ? Math.floor(total * 0.05) : Infinity;
|
|
495
|
+
const chunks = [];
|
|
496
|
+
if (response.body) {
|
|
497
|
+
const reader = response.body.getReader();
|
|
498
|
+
while (true) {
|
|
499
|
+
const { done, value } = await reader.read();
|
|
500
|
+
if (done) break;
|
|
501
|
+
chunks.push(value);
|
|
502
|
+
received += value.byteLength;
|
|
503
|
+
if (total > 0 && received >= nextLog) {
|
|
504
|
+
const pct = Math.floor(received / total * 100);
|
|
505
|
+
console.log(`[Hanzo AI] ${label}: ${pct}% (${received}/${total} bytes)`);
|
|
506
|
+
nextLog = received + Math.floor(total * 0.05);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
} else {
|
|
510
|
+
chunks.push(new Uint8Array(await response.arrayBuffer()));
|
|
511
|
+
}
|
|
512
|
+
const blob = new Uint8Array(received || chunks.reduce((n, c) => n + c.byteLength, 0));
|
|
513
|
+
let offset = 0;
|
|
514
|
+
for (const c of chunks) {
|
|
515
|
+
blob.set(c, offset);
|
|
516
|
+
offset += c.byteLength;
|
|
517
|
+
}
|
|
518
|
+
console.log(`[Hanzo AI] Fetched: ${label} (${blob.byteLength} bytes)`);
|
|
519
|
+
if (cache) {
|
|
520
|
+
try {
|
|
521
|
+
await cache.put(url, new Response(blob, {
|
|
522
|
+
headers: { "content-type": "application/octet-stream" }
|
|
523
|
+
}));
|
|
524
|
+
console.log(`[Hanzo AI] Cached: ${label}`);
|
|
525
|
+
} catch (e) {
|
|
526
|
+
console.warn(`[Hanzo AI] Cache write failed for ${label}:`, e);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return blob.buffer;
|
|
530
|
+
}
|
|
531
|
+
/** Build an HF resolve URL for a given repo / file / revision. */
|
|
532
|
+
static huggingFaceURL(repo, file, revision = "main") {
|
|
533
|
+
return `https://huggingface.co/${repo}/resolve/${revision}/${file}`;
|
|
534
|
+
}
|
|
535
|
+
/** Wipe every cached model blob. Useful when a model artifact is rotated. */
|
|
536
|
+
static async evictCache() {
|
|
537
|
+
if (typeof caches === "undefined") return;
|
|
538
|
+
await caches.delete("hanzo-webgpu-models-v1");
|
|
539
|
+
console.log("[Hanzo AI] WebGPU model cache evicted");
|
|
540
|
+
}
|
|
541
|
+
// ---------------------------------------------------------------------------
|
|
469
542
|
// Status / Cleanup
|
|
470
543
|
// ---------------------------------------------------------------------------
|
|
471
544
|
getStatus() {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/manifest.json
CHANGED
|
@@ -5,11 +5,16 @@
|
|
|
5
5
|
"description": "Click-to-code navigation with source-map support",
|
|
6
6
|
"permissions": [
|
|
7
7
|
"activeTab",
|
|
8
|
-
"storage"
|
|
8
|
+
"storage",
|
|
9
|
+
"tabs",
|
|
10
|
+
"webNavigation",
|
|
11
|
+
"debugger",
|
|
12
|
+
"scripting"
|
|
9
13
|
],
|
|
10
14
|
"host_permissions": [
|
|
11
15
|
"http://localhost/*",
|
|
12
|
-
"https://localhost/*"
|
|
16
|
+
"https://localhost/*",
|
|
17
|
+
"<all_urls>"
|
|
13
18
|
],
|
|
14
19
|
"content_scripts": [
|
|
15
20
|
{
|
package/package.json
CHANGED
|
@@ -1,32 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/browser-extension",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.31",
|
|
4
4
|
"description": "Hanzo AI Browser Extension",
|
|
5
5
|
"main": "dist/background.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "node src/build.js",
|
|
8
|
-
"watch": "node src/build.js --watch",
|
|
9
|
-
"test": "vitest run",
|
|
10
|
-
"test:watch": "vitest"
|
|
11
|
-
},
|
|
12
6
|
"dependencies": {
|
|
7
|
+
"@supabase/supabase-js": "^2.50.3",
|
|
8
|
+
"axios": "^1.10.0",
|
|
13
9
|
"chalk": "^4.1.2",
|
|
14
10
|
"commander": "^11.1.0",
|
|
11
|
+
"webextension-polyfill": "0.12.0",
|
|
15
12
|
"ws": "^8.18.3"
|
|
16
13
|
},
|
|
17
14
|
"devDependencies": {
|
|
15
|
+
"@playwright/test": "^1.52.0",
|
|
18
16
|
"@types/chrome": "^0.0.270",
|
|
19
17
|
"@types/firefox-webext-browser": "^120.0.0",
|
|
20
18
|
"@types/jsdom": "^21.1.7",
|
|
21
19
|
"@types/ws": "^8.18.1",
|
|
22
|
-
"esbuild": "^0.25.
|
|
20
|
+
"esbuild": "^0.25.8",
|
|
23
21
|
"jsdom": "^26.1.0",
|
|
22
|
+
"react": "^18.3.1",
|
|
23
|
+
"react-dom": "^18.3.1",
|
|
24
24
|
"typescript": "^5.8.3",
|
|
25
|
-
"vitest": "^
|
|
25
|
+
"vitest": "^3.2.6",
|
|
26
26
|
"ws": "^8.18.3"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=18.0.0"
|
|
30
30
|
},
|
|
31
|
-
"license": "MIT"
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"src",
|
|
38
|
+
"images",
|
|
39
|
+
"manifest.json"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "node src/build.js",
|
|
43
|
+
"watch": "node src/build.js --watch",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"test:watch": "vitest",
|
|
46
|
+
"test:e2e": "playwright test --config=e2e/playwright.config.ts",
|
|
47
|
+
"check:bundle-budget": "node scripts/check-bundle-budgets.mjs"
|
|
48
|
+
}
|
|
32
49
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { flushSync } from 'react-dom';
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardHeader,
|
|
10
|
+
CardTitle,
|
|
11
|
+
Textarea,
|
|
12
|
+
} from '@hanzo/gui';
|
|
13
|
+
|
|
14
|
+
function LoginPrompt() {
|
|
15
|
+
return (
|
|
16
|
+
<Card className="chat-modern-login-card">
|
|
17
|
+
<CardHeader>
|
|
18
|
+
<CardTitle>Chat with Zen AI models</CardTitle>
|
|
19
|
+
<CardDescription>Models enabled in Hanzo Cloud are loaded automatically.</CardDescription>
|
|
20
|
+
</CardHeader>
|
|
21
|
+
<CardContent>
|
|
22
|
+
<Button id="auth-btn" className="chat-modern-auth-btn" type="button">
|
|
23
|
+
Sign in
|
|
24
|
+
</Button>
|
|
25
|
+
<Button id="signup-btn" className="secondary-btn" type="button">
|
|
26
|
+
Create account
|
|
27
|
+
</Button>
|
|
28
|
+
<p className="auth-note">
|
|
29
|
+
Browser tools work without sign-in.{' '}
|
|
30
|
+
<a href="https://docs.hanzo.ai" target="_blank" rel="noreferrer">
|
|
31
|
+
Learn more
|
|
32
|
+
</a>
|
|
33
|
+
</p>
|
|
34
|
+
</CardContent>
|
|
35
|
+
</Card>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function ChatComposer() {
|
|
40
|
+
return (
|
|
41
|
+
<div className="chat-modern-composer">
|
|
42
|
+
<div className="model-selector">
|
|
43
|
+
<select id="model-select">
|
|
44
|
+
<option value="claude-sonnet-4-20250514">Claude Sonnet 4</option>
|
|
45
|
+
<option value="claude-opus-4-20250514">Claude Opus 4</option>
|
|
46
|
+
<option value="gpt-4o">GPT-4o</option>
|
|
47
|
+
<option value="zen-coder-flash">Zen Coder Flash</option>
|
|
48
|
+
<option value="zen-max">Zen Max</option>
|
|
49
|
+
</select>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div className="chat-flags">
|
|
53
|
+
<label className="flag-toggle">
|
|
54
|
+
<input type="checkbox" id="rag-enabled" defaultChecked />
|
|
55
|
+
<span>RAG</span>
|
|
56
|
+
</label>
|
|
57
|
+
<label className="flag-toggle">
|
|
58
|
+
<input type="checkbox" id="tab-context-enabled" defaultChecked />
|
|
59
|
+
<span>Tab Context</span>
|
|
60
|
+
</label>
|
|
61
|
+
<span id="rag-status" className="rag-status">
|
|
62
|
+
Ready
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div className="input-row">
|
|
67
|
+
<Textarea id="chat-input" className="chat-modern-input" placeholder="Ask anything..." rows={1} />
|
|
68
|
+
<Button id="send-btn" className="send-btn chat-modern-send" title="Send" type="button">
|
|
69
|
+
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" aria-hidden="true">
|
|
70
|
+
<path d="M4 10l12-6-6 12-2-6-4-2z" strokeWidth="1.5" fill="currentColor" />
|
|
71
|
+
</svg>
|
|
72
|
+
</Button>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function mountModernChatWidget() {
|
|
79
|
+
const loginTarget = document.getElementById('chat-login-prompt');
|
|
80
|
+
if (loginTarget) {
|
|
81
|
+
loginTarget.innerHTML = '';
|
|
82
|
+
const loginRoot = createRoot(loginTarget);
|
|
83
|
+
flushSync(() => {
|
|
84
|
+
loginRoot.render(<LoginPrompt />);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const composerTarget = document.getElementById('chat-composer');
|
|
89
|
+
if (composerTarget) {
|
|
90
|
+
composerTarget.innerHTML = '';
|
|
91
|
+
const composerRoot = createRoot(composerTarget);
|
|
92
|
+
flushSync(() => {
|
|
93
|
+
composerRoot.render(<ChatComposer />);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local @hanzo/gui primitives shim for the extension.
|
|
3
|
+
*
|
|
4
|
+
* This is the canonical surface the extension's React components import via
|
|
5
|
+
* `@hanzo/gui`. It deliberately does NOT pull in the upstream tamagui-based
|
|
6
|
+
* `@hanzo/gui` package because:
|
|
7
|
+
*
|
|
8
|
+
* 1. content-script + background bundles target the smallest possible
|
|
9
|
+
* payload — RNW + tamagui's runtime is far too heavy for a script
|
|
10
|
+
* injected into every page;
|
|
11
|
+
* 2. Hanzo brand is strict monochrome (see ~/work/hanzo/brand/brand.json,
|
|
12
|
+
* primaryColor #FFFFFF), so no color tokens travel with primitives
|
|
13
|
+
* anyway — pure structural elements styled by sibling CSS;
|
|
14
|
+
* 3. The full tamagui adoption ships in a future feature branch with the
|
|
15
|
+
* compiler + RNW peer dep wired correctly.
|
|
16
|
+
*
|
|
17
|
+
* The build aliases `@hanzo/gui` → this file. When the tamagui adoption
|
|
18
|
+
* lands, swap the alias target to the published `@hanzo/gui` package.
|
|
19
|
+
*
|
|
20
|
+
* Each primitive renders a plain DOM element with a stable, monochrome
|
|
21
|
+
* class hook. All visuals come from sidebar.css / popup.css using the
|
|
22
|
+
* brand token scale (white luminance ladder, no chromatic accents).
|
|
23
|
+
*/
|
|
24
|
+
import React from 'react';
|
|
25
|
+
|
|
26
|
+
type Classy = { className?: string; children?: React.ReactNode };
|
|
27
|
+
|
|
28
|
+
function cx(base: string, extra?: string): string {
|
|
29
|
+
return extra ? `${base} ${extra}` : base;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function Button(props: React.ButtonHTMLAttributes<HTMLButtonElement>) {
|
|
33
|
+
const { className, children, ...rest } = props;
|
|
34
|
+
return (
|
|
35
|
+
<button {...rest} className={cx('hanzo-gui-btn', className)}>
|
|
36
|
+
{children}
|
|
37
|
+
</button>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function Textarea(props: React.TextareaHTMLAttributes<HTMLTextAreaElement>) {
|
|
42
|
+
const { className, children, ...rest } = props;
|
|
43
|
+
return (
|
|
44
|
+
<textarea {...rest} className={cx('hanzo-gui-textarea', className)}>
|
|
45
|
+
{children}
|
|
46
|
+
</textarea>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function Input(props: React.InputHTMLAttributes<HTMLInputElement>) {
|
|
51
|
+
const { className, ...rest } = props;
|
|
52
|
+
return <input {...rest} className={cx('hanzo-gui-input', className)} />;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function Card({ className, children }: Classy) {
|
|
56
|
+
return <div className={cx('hanzo-gui-card', className)}>{children}</div>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function CardHeader({ className, children }: Classy) {
|
|
60
|
+
return <div className={cx('hanzo-gui-card-header', className)}>{children}</div>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function CardTitle({ className, children }: Classy) {
|
|
64
|
+
return <h3 className={cx('hanzo-gui-card-title', className)}>{children}</h3>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function CardDescription({ className, children }: Classy) {
|
|
68
|
+
return <p className={cx('hanzo-gui-card-description', className)}>{children}</p>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function CardContent({ className, children }: Classy) {
|
|
72
|
+
return <div className={cx('hanzo-gui-card-content', className)}>{children}</div>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Layout primitives — mirror the names used by the upstream Tamagui-based
|
|
76
|
+
@hanzo/gui (XStack/YStack) so call-sites can be ported without churn
|
|
77
|
+
when the full adoption lands. Pure flexbox under the hood. */
|
|
78
|
+
type Stack = Classy & React.HTMLAttributes<HTMLDivElement> & {
|
|
79
|
+
gap?: number | string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export function XStack({ className, gap, style, children, ...rest }: Stack) {
|
|
83
|
+
const merged: React.CSSProperties = {
|
|
84
|
+
display: 'flex',
|
|
85
|
+
flexDirection: 'row',
|
|
86
|
+
gap,
|
|
87
|
+
...style,
|
|
88
|
+
};
|
|
89
|
+
return (
|
|
90
|
+
<div {...rest} style={merged} className={cx('hanzo-gui-xstack', className)}>
|
|
91
|
+
{children}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function YStack({ className, gap, style, children, ...rest }: Stack) {
|
|
97
|
+
const merged: React.CSSProperties = {
|
|
98
|
+
display: 'flex',
|
|
99
|
+
flexDirection: 'column',
|
|
100
|
+
gap,
|
|
101
|
+
...style,
|
|
102
|
+
};
|
|
103
|
+
return (
|
|
104
|
+
<div {...rest} style={merged} className={cx('hanzo-gui-ystack', className)}>
|
|
105
|
+
{children}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function Text({ className, children, ...rest }: Classy & React.HTMLAttributes<HTMLSpanElement>) {
|
|
111
|
+
return (
|
|
112
|
+
<span {...rest} className={cx('hanzo-gui-text', className)}>
|
|
113
|
+
{children}
|
|
114
|
+
</span>
|
|
115
|
+
);
|
|
116
|
+
}
|
package/src/icon128.png
CHANGED
|
Binary file
|
package/src/icon16.png
CHANGED
|
Binary file
|
package/src/icon32.png
CHANGED
|
Binary file
|
package/src/icon48.png
CHANGED
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "Hanzo AI",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.22",
|
|
5
5
|
"description": "AI-powered dev assistant — click-to-code navigation, source maps, WebGPU AI, and MCP integration for Claude Code.",
|
|
6
6
|
"permissions": [
|
|
7
7
|
"activeTab",
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
"storage",
|
|
10
10
|
"tabs",
|
|
11
11
|
"webNavigation",
|
|
12
|
-
"scripting"
|
|
12
|
+
"scripting",
|
|
13
|
+
"cookies",
|
|
14
|
+
"nativeMessaging",
|
|
15
|
+
"alarms"
|
|
13
16
|
],
|
|
14
17
|
"host_permissions": [
|
|
15
18
|
"http://localhost/*",
|
|
@@ -21,13 +24,19 @@
|
|
|
21
24
|
},
|
|
22
25
|
"content_scripts": [
|
|
23
26
|
{
|
|
24
|
-
"matches": [
|
|
25
|
-
|
|
27
|
+
"matches": [
|
|
28
|
+
"<all_urls>"
|
|
29
|
+
],
|
|
30
|
+
"js": [
|
|
31
|
+
"content-script.js"
|
|
32
|
+
],
|
|
26
33
|
"run_at": "document_idle"
|
|
27
34
|
}
|
|
28
35
|
],
|
|
29
36
|
"background": {
|
|
30
|
-
"scripts": [
|
|
37
|
+
"scripts": [
|
|
38
|
+
"background.js"
|
|
39
|
+
],
|
|
31
40
|
"type": "module"
|
|
32
41
|
},
|
|
33
42
|
"action": {
|
|
@@ -44,12 +53,18 @@
|
|
|
44
53
|
"default_icon": {
|
|
45
54
|
"16": "icon16.png",
|
|
46
55
|
"48": "icon48.png"
|
|
47
|
-
}
|
|
56
|
+
},
|
|
57
|
+
"open_at_install": false
|
|
48
58
|
},
|
|
49
59
|
"web_accessible_resources": [
|
|
50
60
|
{
|
|
51
|
-
"resources": [
|
|
52
|
-
|
|
61
|
+
"resources": [
|
|
62
|
+
"ai-worker.js",
|
|
63
|
+
"models/*"
|
|
64
|
+
],
|
|
65
|
+
"matches": [
|
|
66
|
+
"<all_urls>"
|
|
67
|
+
]
|
|
53
68
|
}
|
|
54
69
|
],
|
|
55
70
|
"browser_specific_settings": {
|
|
@@ -58,9 +73,5 @@
|
|
|
58
73
|
"strict_min_version": "109.0"
|
|
59
74
|
},
|
|
60
75
|
"gecko_android": {}
|
|
61
|
-
},
|
|
62
|
-
"data_collection_permissions": {
|
|
63
|
-
"purposes": ["functionality"],
|
|
64
|
-
"data_categories": ["technical_data"]
|
|
65
76
|
}
|
|
66
77
|
}
|
package/src/manifest.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "Hanzo AI",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.25",
|
|
5
5
|
"description": "AI-powered dev assistant — click-to-code navigation, source maps, WebGPU AI, and MCP integration for Claude Code.",
|
|
6
|
+
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxfXGh0lPUT5m04GKfjUwrLsV6pLaK3VcZuFRPogqAir2tzyLYnQPRtHynue9yvDyguIVnlkwvcwfDOYZrvH76zbw4s6onPBG8HqTKO6LQ9K3kdO1qBBkMMjdOgULQ1MrWThEbpU7NSTiwLYpEta/jAvrKRCAeKIlQE8p6htZmPy9aRUZuae66JgLcAlzD2vviX9sVB1asFABJVswL1RgZ55/8IzZaUrFjzOo9OHK4hmEOtudzkML+5silsAYdC+1BZugph2x94ai17YmZTCL1XyUa5Ke4q80cj+i9rOTgzhZs+mruyhL/AvNVOXilsgqCdNqSz77naWzC3pVGbxOewIDAQAB",
|
|
6
7
|
"permissions": [
|
|
7
8
|
"activeTab",
|
|
8
9
|
"identity",
|
|
9
|
-
"sidePanel",
|
|
10
10
|
"storage",
|
|
11
11
|
"tabs",
|
|
12
12
|
"webNavigation",
|
|
13
13
|
"scripting",
|
|
14
|
-
"
|
|
14
|
+
"cookies",
|
|
15
|
+
"debugger",
|
|
16
|
+
"alarms",
|
|
17
|
+
"nativeMessaging"
|
|
15
18
|
],
|
|
16
19
|
"host_permissions": [
|
|
17
20
|
"http://localhost/*",
|
|
@@ -23,8 +26,12 @@
|
|
|
23
26
|
},
|
|
24
27
|
"content_scripts": [
|
|
25
28
|
{
|
|
26
|
-
"matches": [
|
|
27
|
-
|
|
29
|
+
"matches": [
|
|
30
|
+
"<all_urls>"
|
|
31
|
+
],
|
|
32
|
+
"js": [
|
|
33
|
+
"content-script.js"
|
|
34
|
+
],
|
|
28
35
|
"run_at": "document_idle"
|
|
29
36
|
}
|
|
30
37
|
],
|
|
@@ -40,9 +47,6 @@
|
|
|
40
47
|
"128": "icon128.png"
|
|
41
48
|
}
|
|
42
49
|
},
|
|
43
|
-
"side_panel": {
|
|
44
|
-
"default_path": "sidebar.html"
|
|
45
|
-
},
|
|
46
50
|
"icons": {
|
|
47
51
|
"16": "icon16.png",
|
|
48
52
|
"48": "icon48.png",
|
|
@@ -50,8 +54,13 @@
|
|
|
50
54
|
},
|
|
51
55
|
"web_accessible_resources": [
|
|
52
56
|
{
|
|
53
|
-
"resources": [
|
|
54
|
-
|
|
57
|
+
"resources": [
|
|
58
|
+
"ai-worker.js",
|
|
59
|
+
"models/*"
|
|
60
|
+
],
|
|
61
|
+
"matches": [
|
|
62
|
+
"<all_urls>"
|
|
63
|
+
]
|
|
55
64
|
}
|
|
56
65
|
]
|
|
57
66
|
}
|