gazesight 0.3.5
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 +37 -0
- package/README.md +102 -0
- package/dist/chrome/background-capture-offscreen.html +10 -0
- package/dist/chrome/background-capture-offscreen.js +1 -0
- package/dist/chrome/background.js +62 -0
- package/dist/chrome/content.js +62 -0
- package/dist/chrome/diagnostics-page.js +1 -0
- package/dist/chrome/fullpage-stitch-offscreen.html +10 -0
- package/dist/chrome/fullpage-stitch-offscreen.js +1 -0
- package/dist/chrome/icons/icon-128.png +0 -0
- package/dist/chrome/icons/icon-16.png +0 -0
- package/dist/chrome/icons/icon-32.png +0 -0
- package/dist/chrome/icons/icon-48.png +0 -0
- package/dist/chrome/icons/icon-64.png +0 -0
- package/dist/chrome/icons/icon-96.png +0 -0
- package/dist/chrome/logo_sans_background.png +0 -0
- package/dist/chrome/manifest.json +70 -0
- package/dist/chrome/options.css +66 -0
- package/dist/chrome/options.html +76 -0
- package/dist/chrome/options.js +82 -0
- package/dist/chrome/permission.css +13 -0
- package/dist/chrome/permission.html +15 -0
- package/dist/chrome/permission.js +1 -0
- package/dist/chrome/popup.css +446 -0
- package/dist/chrome/popup.html +191 -0
- package/dist/chrome/popup.js +1 -0
- package/dist/cli/index.js +320 -0
- package/dist/firefox/background.js +62 -0
- package/dist/firefox/content.js +62 -0
- package/dist/firefox/diagnostics-page.js +1 -0
- package/dist/firefox/icons/icon-128.png +0 -0
- package/dist/firefox/icons/icon-16.png +0 -0
- package/dist/firefox/icons/icon-32.png +0 -0
- package/dist/firefox/icons/icon-48.png +0 -0
- package/dist/firefox/icons/icon-64.png +0 -0
- package/dist/firefox/icons/icon-96.png +0 -0
- package/dist/firefox/logo_sans_background.png +0 -0
- package/dist/firefox/manifest.json +90 -0
- package/dist/firefox/options.css +66 -0
- package/dist/firefox/options.html +76 -0
- package/dist/firefox/options.js +82 -0
- package/dist/firefox/permission.css +13 -0
- package/dist/firefox/permission.html +15 -0
- package/dist/firefox/permission.js +1 -0
- package/dist/firefox/popup.css +446 -0
- package/dist/firefox/popup.html +191 -0
- package/dist/firefox/popup.js +1 -0
- package/dist/gazesight-firefox.xpi +0 -0
- package/dist/mcp/index.js +1428 -0
- package/dist/worker/visual-diff.js +642 -0
- package/docs/preview-matrix.csv +6 -0
- package/package.json +130 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{function a(e,s){return e.slice(0,4096).replace(/https?:\/\/[^\s"'<>]+/gi,o=>{try{let n=new URL(o);return n.origin+n.pathname}catch{return"[redacted URL]"}}).replace(/(?:bearer\s+)[\w.+/=-]+/gi,"[redacted]").replace(/\beyJ[\w-]+\.[\w-]+(?:\.[\w-]+)?/g,"[redacted]").replace(/\b[a-zA-Z0-9_+/-]{24,}={0,2}\b/g,"[redacted]").replace(/((?:password|passwd|token|secret|credential|api[-_]?key|authorization)["']?\s*[:=]\s*["']?)[^\s,;"']+/gi,"$1[redacted]").replace(/\s+/g," ").trim().slice(0,s)}function w(e,s){let o={warn:e.warn,error:e.error},n={},p=()=>{for(let t of["warn","error"])e[t]===n[t]&&(e[t]=o[t])};try{for(let t of["warn","error"]){let d=o[t],i=function(...l){try{return Reflect.apply(d,this,l)}finally{try{let u=l.slice(0,8).map(r=>typeof r=="string"?a(r,256):typeof r=="number"||typeof r=="boolean"||r===null||r===void 0?String(r):"[object omitted]").join(" ");s({level:t,message:a(u,512),timestamp:Date.now()})}catch{}}};if(n[t]=i,e[t]=i,e[t]!==i)throw new Error("Console method cannot be wrapped")}return p}catch{throw p(),new Error("Console capture unavailable")}}var c="gazesight-console-stop";window.dispatchEvent(new Event(c));try{let e=n=>window.postMessage(n,location.origin),s=w(console,n=>e({namespace:"gazesight-console",type:"entry",entry:n})),o=()=>{s(),window.removeEventListener(c,o),e({namespace:"gazesight-console",type:"stopped"})};window.addEventListener(c,o),e({namespace:"gazesight-console",type:"ready"})}catch{}})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function l(o){return new Promise((m,a)=>{let t=new Image;t.onload=()=>m(t),t.onerror=()=>a(new Error("Tile image failed to decode.")),t.src=o})}chrome.runtime.onMessage.addListener((o,m,a)=>{if(o?.type==="gazesight-fullpage-stitch-offscreen")return(async()=>{let{tiles:t,width:n,height:i,format:h,quality:c}=o;if(!Number.isFinite(n)||!Number.isFinite(i)||n<1||i<1||n>32768||i>32768||n*i>16e6||!Array.isArray(t)){a({ok:!1,error:"Invalid stitch dimensions."});return}let r=document.createElement("canvas");r.width=n,r.height=i;let d=r.getContext("2d");if(!d){a({ok:!1,error:"2D context unavailable."});return}try{let s=await Promise.all(t.map(e=>l(e.dataUrl)));t.forEach((e,g)=>{d.drawImage(s[g],e.sx,e.sy,e.sw,e.sh,e.dx,e.dy,e.dw,e.dh)});let u=h==="jpeg"?r.toDataURL("image/jpeg",c/100):r.toDataURL("image/png");a({ok:!0,dataUrl:u,width:r.width,height:r.height})}catch(s){a({ok:!1,error:String(s)})}finally{r.width=0,r.height=0}})(),!0});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "GazeSight",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Give coding agents visual access to the Chrome tab you're already using.",
|
|
6
|
+
"minimum_chrome_version": "102",
|
|
7
|
+
"icons": {
|
|
8
|
+
"16": "icons/icon-16.png",
|
|
9
|
+
"32": "icons/icon-32.png",
|
|
10
|
+
"48": "icons/icon-48.png",
|
|
11
|
+
"64": "icons/icon-64.png",
|
|
12
|
+
"96": "icons/icon-96.png",
|
|
13
|
+
"128": "icons/icon-128.png"
|
|
14
|
+
},
|
|
15
|
+
"permissions": ["activeTab", "tabs", "storage", "scripting", "webRequest", "alarms"],
|
|
16
|
+
"host_permissions": [
|
|
17
|
+
"http://localhost/*",
|
|
18
|
+
"https://localhost/*",
|
|
19
|
+
"http://127.0.0.1/*",
|
|
20
|
+
"https://127.0.0.1/*",
|
|
21
|
+
"http://[::1]/*",
|
|
22
|
+
"https://[::1]/*"
|
|
23
|
+
],
|
|
24
|
+
"optional_permissions": ["downloads", "tabCapture", "offscreen"],
|
|
25
|
+
"optional_host_permissions": ["<all_urls>"],
|
|
26
|
+
"background": {
|
|
27
|
+
"service_worker": "background.js"
|
|
28
|
+
},
|
|
29
|
+
"action": {
|
|
30
|
+
"default_title": "GazeSight — target and connection",
|
|
31
|
+
"default_popup": "popup.html",
|
|
32
|
+
"default_icon": {
|
|
33
|
+
"16": "icons/icon-16.png",
|
|
34
|
+
"32": "icons/icon-32.png",
|
|
35
|
+
"48": "icons/icon-48.png",
|
|
36
|
+
"64": "icons/icon-64.png",
|
|
37
|
+
"96": "icons/icon-96.png",
|
|
38
|
+
"128": "icons/icon-128.png"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"commands": {
|
|
42
|
+
"gazesight-select-target": {
|
|
43
|
+
"suggested_key": {
|
|
44
|
+
"default": "Ctrl+Shift+Y"
|
|
45
|
+
},
|
|
46
|
+
"description": "Select or reauthorize this tab with GazeSight"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"options_ui": {
|
|
50
|
+
"page": "options.html",
|
|
51
|
+
"open_in_tab": true
|
|
52
|
+
},
|
|
53
|
+
"content_security_policy": {
|
|
54
|
+
"extension_pages": "script-src 'self'; object-src 'none'; connect-src ws://127.0.0.1:* data:"
|
|
55
|
+
},
|
|
56
|
+
"content_scripts": [
|
|
57
|
+
{
|
|
58
|
+
"matches": [
|
|
59
|
+
"http://localhost/*",
|
|
60
|
+
"https://localhost/*",
|
|
61
|
+
"http://127.0.0.1/*",
|
|
62
|
+
"https://127.0.0.1/*",
|
|
63
|
+
"http://[::1]/*",
|
|
64
|
+
"https://[::1]/*"
|
|
65
|
+
],
|
|
66
|
+
"js": ["content.js"],
|
|
67
|
+
"run_at": "document_start"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: system-ui, sans-serif;
|
|
3
|
+
color: #142b52;
|
|
4
|
+
background: #edf3fc;
|
|
5
|
+
}
|
|
6
|
+
main {
|
|
7
|
+
max-width: 620px;
|
|
8
|
+
margin: 64px auto;
|
|
9
|
+
padding: 24px;
|
|
10
|
+
}
|
|
11
|
+
h1 {
|
|
12
|
+
font-size: 42px;
|
|
13
|
+
letter-spacing: -1.5px;
|
|
14
|
+
}
|
|
15
|
+
form {
|
|
16
|
+
display: grid;
|
|
17
|
+
gap: 12px;
|
|
18
|
+
}
|
|
19
|
+
input,
|
|
20
|
+
textarea,
|
|
21
|
+
button {
|
|
22
|
+
font: inherit;
|
|
23
|
+
padding: 12px;
|
|
24
|
+
border: 1px solid #83938c;
|
|
25
|
+
border-radius: 6px;
|
|
26
|
+
}
|
|
27
|
+
textarea {
|
|
28
|
+
min-height: 80px;
|
|
29
|
+
}
|
|
30
|
+
button {
|
|
31
|
+
background: #234fa3;
|
|
32
|
+
color: white;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
|
+
output {
|
|
36
|
+
min-height: 2em;
|
|
37
|
+
}
|
|
38
|
+
input:focus-visible,
|
|
39
|
+
textarea:focus-visible,
|
|
40
|
+
button:focus-visible {
|
|
41
|
+
outline: 3px solid #b86d23;
|
|
42
|
+
outline-offset: 3px;
|
|
43
|
+
}
|
|
44
|
+
#agent-guidance {
|
|
45
|
+
margin-top: 32px;
|
|
46
|
+
padding-top: 16px;
|
|
47
|
+
border-top: 1px solid #c8d3e6;
|
|
48
|
+
}
|
|
49
|
+
#agent-guidance h2 {
|
|
50
|
+
font-size: 20px;
|
|
51
|
+
margin-bottom: 8px;
|
|
52
|
+
}
|
|
53
|
+
.muted {
|
|
54
|
+
color: #4e5c78;
|
|
55
|
+
font-size: 13px;
|
|
56
|
+
}
|
|
57
|
+
#guidance-text {
|
|
58
|
+
white-space: pre-wrap;
|
|
59
|
+
background: #fff;
|
|
60
|
+
border: 1px solid #c8d3e6;
|
|
61
|
+
border-radius: 6px;
|
|
62
|
+
padding: 12px;
|
|
63
|
+
font-size: 13px;
|
|
64
|
+
max-height: 320px;
|
|
65
|
+
overflow: auto;
|
|
66
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="fr">
|
|
3
|
+
<meta charset="utf-8" /><title>GazeSight — connexion locale</title
|
|
4
|
+
><link rel="stylesheet" href="options.css" />
|
|
5
|
+
<main>
|
|
6
|
+
<p>GAZESIGHT / FIREFOX</p>
|
|
7
|
+
<h1>Connectez votre onglet.</h1>
|
|
8
|
+
<p>Le serveur MCP et Firefox échangent uniquement sur votre machine.</p>
|
|
9
|
+
<p>
|
|
10
|
+
GazeSight observe seulement la cible sélectionnée sur localhost ou les
|
|
11
|
+
origines que vous autorisez. La permission scripting sert à observer les
|
|
12
|
+
avertissements et erreurs console ; webRequest signale les requêtes
|
|
13
|
+
échouées sans collecter leurs headers, bodies ou cookies.
|
|
14
|
+
</p>
|
|
15
|
+
<p>
|
|
16
|
+
Le token de pairing est conservé dans le stockage local de Firefox, qui
|
|
17
|
+
n’est pas chiffré. Ne partagez pas votre fichier de configuration.
|
|
18
|
+
</p>
|
|
19
|
+
<form>
|
|
20
|
+
<label for="config-file"
|
|
21
|
+
>Importer la configuration GazeSight locale</label
|
|
22
|
+
>
|
|
23
|
+
<input id="config-file" type="file" accept="application/json,.json" />
|
|
24
|
+
<label for="token">Token de pairing</label
|
|
25
|
+
><input
|
|
26
|
+
id="token"
|
|
27
|
+
type="password"
|
|
28
|
+
required
|
|
29
|
+
autocomplete="off"
|
|
30
|
+
minlength="64"
|
|
31
|
+
maxlength="64"
|
|
32
|
+
/><label for="port">Port du bridge</label
|
|
33
|
+
><input
|
|
34
|
+
id="port"
|
|
35
|
+
type="number"
|
|
36
|
+
value="32147"
|
|
37
|
+
min="1024"
|
|
38
|
+
max="65535"
|
|
39
|
+
required
|
|
40
|
+
/><label for="origins"
|
|
41
|
+
>Origines externes autorisées (facultatif, une par ligne)</label
|
|
42
|
+
><textarea
|
|
43
|
+
id="origins"
|
|
44
|
+
placeholder="https://preview.example.com"
|
|
45
|
+
></textarea
|
|
46
|
+
><button>Enregistrer et connecter</button
|
|
47
|
+
><output aria-live="polite"></output>
|
|
48
|
+
</form>
|
|
49
|
+
<p>
|
|
50
|
+
Ouvrez ensuite votre application locale, puis GazeSight et « Use this tab
|
|
51
|
+
», ou utilisez Ctrl+Maj+Y. Gardez cet onglet actif pour les captures.
|
|
52
|
+
</p>
|
|
53
|
+
<section id="agent-guidance">
|
|
54
|
+
<h2>Agent Guidance</h2>
|
|
55
|
+
<p>
|
|
56
|
+
GazeSight fournit à votre agent de codage des instructions locales
|
|
57
|
+
pour utiliser efficacement ses outils visuels. Cela ne réécrit jamais
|
|
58
|
+
vos prompts.
|
|
59
|
+
</p>
|
|
60
|
+
<p>
|
|
61
|
+
Agent Guidance : <output id="guidance-enabled">—</output><br />
|
|
62
|
+
Visual Fidelity guidance : <output id="guidance-fidelity">—</output>
|
|
63
|
+
</p>
|
|
64
|
+
<p class="muted">
|
|
65
|
+
Reflète la configuration locale importée ci-dessus. Pour modifier ce
|
|
66
|
+
réglage, éditez <code>agentGuidance</code> dans votre fichier de
|
|
67
|
+
configuration GazeSight puis reconnectez votre agent de codage.
|
|
68
|
+
</p>
|
|
69
|
+
<details>
|
|
70
|
+
<summary>Voir le texte des instructions</summary>
|
|
71
|
+
<pre id="guidance-text"></pre>
|
|
72
|
+
</details>
|
|
73
|
+
</section>
|
|
74
|
+
</main>
|
|
75
|
+
<script src="options.js" type="module"></script>
|
|
76
|
+
</html>
|