@hanzo/browser-extension 1.9.46 → 1.9.49

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 (70) hide show
  1. package/README.md +43 -0
  2. package/cli.js +233 -0
  3. package/content-script.js +550 -0
  4. package/manifest.json +57 -7
  5. package/package.json +33 -49
  6. package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.pbxproj +0 -1059
  7. package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  8. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
  9. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  10. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@1x.png +0 -0
  11. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@2x.png +0 -0
  12. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@1x.png +0 -0
  13. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@2x.png +0 -0
  14. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@1x.png +0 -0
  15. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@2x.png +0 -0
  16. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@1x.png +0 -0
  17. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@2x.png +0 -0
  18. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@1x.png +0 -0
  19. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@2x.png +0 -0
  20. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/universal-icon-1024@1x.png +0 -0
  21. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/Contents.json +0 -6
  22. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +0 -21
  23. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/icon128.png +0 -0
  24. package/dist/safari/Hanzo AI/Shared (App)/Resources/Base.lproj/Main.html +0 -20
  25. package/dist/safari/Hanzo AI/Shared (App)/Resources/Icon.png +0 -0
  26. package/dist/safari/Hanzo AI/Shared (App)/Resources/Script.js +0 -24
  27. package/dist/safari/Hanzo AI/Shared (App)/Resources/Style.css +0 -61
  28. package/dist/safari/Hanzo AI/Shared (App)/ViewController.swift +0 -81
  29. package/dist/safari/Hanzo AI/Shared (Extension)/SafariWebExtensionHandler.swift +0 -42
  30. package/dist/safari/Hanzo AI/iOS (App)/AppDelegate.swift +0 -24
  31. package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/LaunchScreen.storyboard +0 -36
  32. package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/Main.storyboard +0 -38
  33. package/dist/safari/Hanzo AI/iOS (App)/Info.plist +0 -27
  34. package/dist/safari/Hanzo AI/iOS (App)/SceneDelegate.swift +0 -18
  35. package/dist/safari/Hanzo AI/iOS (Extension)/Info.plist +0 -13
  36. package/dist/safari/Hanzo AI/macOS (App)/AppDelegate.swift +0 -21
  37. package/dist/safari/Hanzo AI/macOS (App)/Base.lproj/Main.storyboard +0 -124
  38. package/dist/safari/Hanzo AI/macOS (App)/Info.plist +0 -8
  39. package/dist/safari/Hanzo AI/macOS (Extension)/Info.plist +0 -13
  40. package/images/icon128.png +0 -0
  41. package/images/icon16.png +0 -0
  42. package/images/icon48.png +0 -0
  43. package/src/ai-worker.js +0 -571
  44. package/src/answer/AnswerEngine.tsx +0 -385
  45. package/src/answer/Composer.tsx +0 -147
  46. package/src/answer/Mark.tsx +0 -14
  47. package/src/answer/Models.tsx +0 -118
  48. package/src/answer/Rail.tsx +0 -69
  49. package/src/answer/Source.tsx +0 -26
  50. package/src/answer/Stories.tsx +0 -27
  51. package/src/answer/WidgetView.tsx +0 -136
  52. package/src/callback.html +0 -17
  53. package/src/icon128.png +0 -0
  54. package/src/icon16.png +0 -0
  55. package/src/icon32.png +0 -0
  56. package/src/icon48.png +0 -0
  57. package/src/manifest-firefox.json +0 -85
  58. package/src/manifest.json +0 -84
  59. package/src/newtab.css +0 -429
  60. package/src/newtab.html +0 -13
  61. package/src/onboarding.css +0 -78
  62. package/src/onboarding.html +0 -45
  63. package/src/package.json +0 -41
  64. package/src/popup.css +0 -761
  65. package/src/popup.html +0 -409
  66. package/src/popup.js +0 -196
  67. package/src/sidebar.css +0 -1752
  68. package/src/sidebar.html +0 -457
  69. package/src/sidebar.js +0 -885
  70. package/src/webgpu.d.ts +0 -131
@@ -1,69 +0,0 @@
1
- import React from 'react';
2
- import { Mark } from './Mark.js';
3
-
4
- /**
5
- * The left rail: mark, new thread, links, sign-in.
6
- *
7
- * COLLAPSED IS AN ICON RAIL, NOT AN ABSENCE — the `collapsible="icon"` behaviour of
8
- * @hanzo/ui primitives/sidebar. A collapsed rail still shows the brand and the way
9
- * back; hiding it outright left the surface with no affordance at all.
10
- *
11
- * The labels are ALWAYS RENDERED and hidden in CSS, never branched on in JS. Opening
12
- * on hover is a CSS state (`.ae-root.collapsed:hover`), so markup that only appears
13
- * when `collapsed` is false could never be revealed by hovering — the rail would
14
- * widen to show nothing. Presentational: every action is injected.
15
- */
16
- export interface RailProps {
17
- collapsed: boolean;
18
- toggle: () => void;
19
- newThread: () => void;
20
- signIn: () => void;
21
- }
22
-
23
- export function Rail({ collapsed, toggle, newThread, signIn }: RailProps) {
24
- return (
25
- <aside className="ae-sidebar">
26
- <div className="ae-side-top">
27
- <button className="ae-brand" onClick={newThread} title="Hanzo">
28
- <Mark size={22} />
29
- <span>Hanzo</span>
30
- </button>
31
- <button
32
- className="ae-collapse"
33
- onClick={toggle}
34
- title={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
35
- aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
36
- aria-expanded={!collapsed}
37
- >
38
- <svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">
39
- <path d="M6 3v10M3 3h10v10H3z" fill="none" stroke="currentColor" strokeWidth="1.3" />
40
- </svg>
41
- </button>
42
- </div>
43
- <button className="ae-new" onClick={newThread} title="New thread">
44
- <svg viewBox="0 0 16 16" width="15" height="15" aria-hidden="true">
45
- <path d="M8 3v10M3 8h10" fill="none" stroke="currentColor" strokeWidth="1.5" />
46
- </svg>
47
- <span>New thread</span>
48
- </button>
49
- <nav className="ae-nav">
50
- <a href="https://hanzo.chat" target="_blank" rel="noreferrer">Threads</a>
51
- <a href="https://docs.hanzo.ai" target="_blank" rel="noreferrer">Docs</a>
52
- <a href="https://hanzo.ai" target="_blank" rel="noreferrer">About</a>
53
- </nav>
54
- <div className="ae-side-bottom">
55
- <button className="ae-signin" onClick={signIn} title="Sign in">
56
- <svg viewBox="0 0 16 16" width="15" height="15" aria-hidden="true">
57
- <path
58
- d="M6 3H3v10h3M10 5l3 3-3 3M13 8H6"
59
- fill="none"
60
- stroke="currentColor"
61
- strokeWidth="1.4"
62
- />
63
- </svg>
64
- <span className="ae-signin-label">Sign in — free to start</span>
65
- </button>
66
- </div>
67
- </aside>
68
- );
69
- }
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import type { SearchSource } from '@hanzo/ai';
3
-
4
- /**
5
- * One cited source, numbered to match its marker in the answer body.
6
- * Falls back to the raw URL when the host will not parse, and to a dot when the
7
- * site serves no favicon — a citation always renders.
8
- */
9
- export function Source({ source, index }: { source: SearchSource; index: number }) {
10
- let host: string;
11
- try {
12
- host = new URL(source.url).hostname.replace(/^www\./, '');
13
- } catch {
14
- host = source.url;
15
- }
16
- return (
17
- <a className="ae-source" href={source.url} target="_blank" rel="noreferrer" title={source.title}>
18
- <span className="ae-source-head">
19
- <span className="ae-source-idx">{index + 1}</span>
20
- {source.favicon ? <img src={source.favicon} alt="" width="14" height="14" /> : <span className="ae-dot" />}
21
- <span className="ae-source-host">{host}</span>
22
- </span>
23
- <span className="ae-source-title">{source.title}</span>
24
- </a>
25
- );
26
- }
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import type { NewsItem } from './news.js';
3
-
4
- /**
5
- * Top stories — the idle state of the answer surface. Renders nothing at all
6
- * when the feed is empty, so a failed fetch leaves a clean page rather than an
7
- * empty frame.
8
- */
9
- export function Stories({ items, limit = 6 }: { items: NewsItem[]; limit?: number }) {
10
- if (!items.length) return null;
11
- return (
12
- <div className="ae-news">
13
- <div className="ae-news-head">Top stories</div>
14
- <div className="ae-news-grid">
15
- {items.slice(0, limit).map((n) => (
16
- <a key={n.url} className="ae-news-item" href={n.url} target="_blank" rel="noreferrer">
17
- <span className="ae-news-title">{n.title}</span>
18
- <span className="ae-news-meta">
19
- {n.source}
20
- {typeof n.points === 'number' ? ` · ${n.points} pts` : ''}
21
- </span>
22
- </a>
23
- ))}
24
- </div>
25
- </div>
26
- );
27
- }
@@ -1,136 +0,0 @@
1
- import React from 'react';
2
- import type { Widget } from './widget.js';
3
-
4
- /**
5
- * Renders a generative result widget.
6
- *
7
- * NAMED WidgetView, not Widget, because widget.ts sits beside it and macOS is
8
- * case-insensitive: `./Widget.js` resolves to `widget.ts` there, so the schema
9
- * module shadowed this one and the build failed on a missing export. Two modules
10
- * in one directory differing only by case cannot both be imported.
11
- *
12
- * Presentational and total: every kind in the union has a branch, and every value
13
- * arrives as a React child, so it is ESCAPED by construction. There is no
14
- * dangerouslySetInnerHTML here and there must never be one — the content is written
15
- * by a model that reads the open web, so treating any of it as markup hands whoever
16
- * wrote that web page a path into this extension's origin.
17
- */
18
- export function WidgetView({ widget }: { widget: Widget }) {
19
- switch (widget.kind) {
20
- case 'comparison':
21
- return (
22
- <section className="ae-widget ae-widget-comparison">
23
- {widget.title && <h3 className="ae-widget-title">{widget.title}</h3>}
24
- {/* Its own scroll container: a wide table must never make the PAGE
25
- scroll sideways. */}
26
- <div className="ae-widget-scroll">
27
- <table className="ae-widget-table">
28
- <thead>
29
- <tr>
30
- {widget.columns.map((c, i) => (
31
- <th key={i} scope={i === 0 ? 'row' : 'col'}>
32
- {c}
33
- </th>
34
- ))}
35
- </tr>
36
- </thead>
37
- <tbody>
38
- {widget.rows.map((row, i) => (
39
- <tr key={i}>
40
- {row.map((cell, j) =>
41
- j === 0 ? (
42
- <th key={j} scope="row">
43
- {cell}
44
- </th>
45
- ) : (
46
- <td key={j}>{cell}</td>
47
- ),
48
- )}
49
- </tr>
50
- ))}
51
- </tbody>
52
- </table>
53
- </div>
54
- </section>
55
- );
56
-
57
- case 'steps':
58
- return (
59
- <section className="ae-widget ae-widget-steps">
60
- {widget.title && <h3 className="ae-widget-title">{widget.title}</h3>}
61
- <ol className="ae-widget-steplist">
62
- {widget.steps.map((s, i) => (
63
- <li key={i}>{s}</li>
64
- ))}
65
- </ol>
66
- </section>
67
- );
68
-
69
- case 'stats':
70
- return (
71
- <section className="ae-widget ae-widget-stats">
72
- {widget.title && <h3 className="ae-widget-title">{widget.title}</h3>}
73
- <div className="ae-widget-statgrid">
74
- {widget.stats.map((s, i) => (
75
- <div className="ae-widget-stat" key={i}>
76
- <span className="ae-widget-statvalue">{s.value}</span>
77
- <span className="ae-widget-statlabel">{s.label}</span>
78
- </div>
79
- ))}
80
- </div>
81
- </section>
82
- );
83
-
84
- case 'timeline':
85
- return (
86
- <section className="ae-widget ae-widget-timeline">
87
- {widget.title && <h3 className="ae-widget-title">{widget.title}</h3>}
88
- <ol className="ae-widget-events">
89
- {widget.events.map((e, i) => (
90
- <li key={i}>
91
- <span className="ae-widget-when">{e.when}</span>
92
- <span className="ae-widget-what">{e.what}</span>
93
- </li>
94
- ))}
95
- </ol>
96
- </section>
97
- );
98
-
99
- case 'entity':
100
- return (
101
- <section className="ae-widget ae-widget-entity">
102
- <h3 className="ae-widget-title">{widget.title}</h3>
103
- {widget.subtitle && <p className="ae-widget-subtitle">{widget.subtitle}</p>}
104
- <dl className="ae-widget-facts">
105
- {widget.facts.map((f, i) => (
106
- <React.Fragment key={i}>
107
- <dt>{f.label}</dt>
108
- <dd>{f.value}</dd>
109
- </React.Fragment>
110
- ))}
111
- </dl>
112
- </section>
113
- );
114
-
115
- case 'definition':
116
- return (
117
- <section className="ae-widget ae-widget-definition">
118
- <h3 className="ae-widget-title">{widget.term}</h3>
119
- <p className="ae-widget-meaning">{widget.meaning}</p>
120
- {widget.example && <pre className="ae-widget-example">{widget.example}</pre>}
121
- </section>
122
- );
123
- }
124
- }
125
-
126
- /** Renders every widget an answer produced, or nothing. */
127
- export function Widgets({ widgets }: { widgets: Widget[] }) {
128
- if (!widgets.length) return null;
129
- return (
130
- <div className="ae-widgets">
131
- {widgets.map((w, i) => (
132
- <WidgetView key={i} widget={w} />
133
- ))}
134
- </div>
135
- );
136
- }
package/src/callback.html DELETED
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Hanzo AI — Signing in...</title>
6
- <style>
7
- body { background: #000; color: #fff; font-family: system-ui, sans-serif; display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; }
8
- .msg { text-align: center; opacity: 0.7; }
9
- </style>
10
- </head>
11
- <body>
12
- <div class="msg">
13
- <p>Signing in to Hanzo AI...</p>
14
- <p><small>This tab will close automatically.</small></p>
15
- </div>
16
- </body>
17
- </html>
package/src/icon128.png DELETED
Binary file
package/src/icon16.png DELETED
Binary file
package/src/icon32.png DELETED
Binary file
package/src/icon48.png DELETED
Binary file
@@ -1,85 +0,0 @@
1
- {
2
- "manifest_version": 3,
3
- "name": "Hanzo AI",
4
- "version": "1.9.34",
5
- "description": "AI answer engine, search, and dev assistant — Hanzo AI in a new tab, address-bar search, source-cited answers, realtime news, WebGPU AI, and MCP.",
6
- "permissions": [
7
- "activeTab",
8
- "identity",
9
- "storage",
10
- "tabs",
11
- "webNavigation",
12
- "scripting",
13
- "cookies",
14
- "nativeMessaging",
15
- "alarms"
16
- ],
17
- "host_permissions": [
18
- "http://localhost/*",
19
- "https://localhost/*",
20
- "https://claude.ai/*",
21
- "https://chatgpt.com/*",
22
- "<all_urls>"
23
- ],
24
- "content_security_policy": {
25
- "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
26
- },
27
- "content_scripts": [
28
- {
29
- "matches": [
30
- "<all_urls>"
31
- ],
32
- "js": [
33
- "content-script.js"
34
- ],
35
- "run_at": "document_idle"
36
- }
37
- ],
38
- "background": {
39
- "scripts": [
40
- "background.js"
41
- ],
42
- "type": "module"
43
- },
44
- "action": {
45
- "default_popup": "popup.html",
46
- "default_icon": {
47
- "16": "icon16.png",
48
- "48": "icon48.png",
49
- "128": "icon128.png"
50
- }
51
- },
52
- "chrome_url_overrides": {
53
- "newtab": "newtab.html"
54
- },
55
- "omnibox": {
56
- "keyword": "hanzo"
57
- },
58
- "sidebar_action": {
59
- "default_title": "Hanzo AI",
60
- "default_panel": "sidebar.html",
61
- "default_icon": {
62
- "16": "icon16.png",
63
- "48": "icon48.png"
64
- },
65
- "open_at_install": false
66
- },
67
- "web_accessible_resources": [
68
- {
69
- "resources": [
70
- "ai-worker.js",
71
- "models/*"
72
- ],
73
- "matches": [
74
- "<all_urls>"
75
- ]
76
- }
77
- ],
78
- "browser_specific_settings": {
79
- "gecko": {
80
- "id": "hanzo-ai@hanzo.ai",
81
- "strict_min_version": "109.0"
82
- },
83
- "gecko_android": {}
84
- }
85
- }
package/src/manifest.json DELETED
@@ -1,84 +0,0 @@
1
- {
2
- "manifest_version": 3,
3
- "name": "Hanzo AI",
4
- "version": "1.9.34",
5
- "description": "AI answer engine, search, and dev assistant — Hanzo AI in a new tab, address-bar search, source-cited answers, realtime news, WebGPU AI, and MCP.",
6
- "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxfXGh0lPUT5m04GKfjUwrLsV6pLaK3VcZuFRPogqAir2tzyLYnQPRtHynue9yvDyguIVnlkwvcwfDOYZrvH76zbw4s6onPBG8HqTKO6LQ9K3kdO1qBBkMMjdOgULQ1MrWThEbpU7NSTiwLYpEta/jAvrKRCAeKIlQE8p6htZmPy9aRUZuae66JgLcAlzD2vviX9sVB1asFABJVswL1RgZ55/8IzZaUrFjzOo9OHK4hmEOtudzkML+5silsAYdC+1BZugph2x94ai17YmZTCL1XyUa5Ke4q80cj+i9rOTgzhZs+mruyhL/AvNVOXilsgqCdNqSz77naWzC3pVGbxOewIDAQAB",
7
- "permissions": [
8
- "activeTab",
9
- "identity",
10
- "storage",
11
- "tabs",
12
- "webNavigation",
13
- "scripting",
14
- "cookies",
15
- "debugger",
16
- "alarms",
17
- "nativeMessaging"
18
- ],
19
- "host_permissions": [
20
- "http://localhost/*",
21
- "https://localhost/*",
22
- "https://claude.ai/*",
23
- "https://chatgpt.com/*",
24
- "<all_urls>"
25
- ],
26
- "content_security_policy": {
27
- "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
28
- },
29
- "content_scripts": [
30
- {
31
- "matches": [
32
- "<all_urls>"
33
- ],
34
- "js": [
35
- "content-script.js"
36
- ],
37
- "run_at": "document_idle"
38
- }
39
- ],
40
- "background": {
41
- "service_worker": "background.js",
42
- "type": "module"
43
- },
44
- "action": {
45
- "default_popup": "popup.html",
46
- "default_icon": {
47
- "16": "icon16.png",
48
- "48": "icon48.png",
49
- "128": "icon128.png"
50
- }
51
- },
52
- "icons": {
53
- "16": "icon16.png",
54
- "48": "icon48.png",
55
- "128": "icon128.png"
56
- },
57
- "omnibox": {
58
- "keyword": "hanzo"
59
- },
60
- "chrome_url_overrides": {
61
- "newtab": "newtab.html"
62
- },
63
- "chrome_settings_overrides": {
64
- "search_provider": {
65
- "name": "Hanzo",
66
- "keyword": "hanzo",
67
- "search_url": "https://hanzo.chat/?q={searchTerms}",
68
- "favicon_url": "https://hanzo.ai/favicon.ico",
69
- "encoding": "UTF-8",
70
- "is_default": true
71
- }
72
- },
73
- "web_accessible_resources": [
74
- {
75
- "resources": [
76
- "ai-worker.js",
77
- "models/*"
78
- ],
79
- "matches": [
80
- "<all_urls>"
81
- ]
82
- }
83
- ]
84
- }