@weavetab/mcp 2.5.0-beta.2 → 2.5.0-beta.4

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 (113) hide show
  1. package/AGENTS.md +1 -1
  2. package/ARCHITECTURE.md +6 -6
  3. package/LICENSE +1 -1
  4. package/README.md +158 -961
  5. package/SECURITY.md +33 -22
  6. package/TROUBLESHOOTING.md +2 -2
  7. package/dist/cdp/bridge.js +2 -1
  8. package/dist/cdp/connector.d.ts +2 -0
  9. package/dist/cdp/connector.js +8 -4
  10. package/dist/cdp/helpers.d.ts +4 -0
  11. package/dist/cdp/helpers.js +181 -0
  12. package/dist/cdp/omni_broker.d.ts +1 -1
  13. package/dist/cdp/omni_broker.js +1 -1
  14. package/dist/cdp/walker.d.ts +25 -1
  15. package/dist/cdp/walker.js +304 -7
  16. package/dist/cli/plugin.js +24 -17
  17. package/dist/cli/updater.d.ts +1 -1
  18. package/dist/cli/updater.js +27 -7
  19. package/dist/config/loader.d.ts +8 -0
  20. package/dist/config/loader.js +41 -2
  21. package/dist/desktop/discovery.d.ts +44 -0
  22. package/dist/desktop/discovery.js +364 -0
  23. package/dist/index.js +95 -15
  24. package/dist/intelligence/marks.d.ts +36 -0
  25. package/dist/intelligence/marks.js +30 -0
  26. package/dist/intelligence/patternCompiler.d.ts +118 -0
  27. package/dist/intelligence/patternCompiler.js +259 -0
  28. package/dist/intelligence/sessionMemory.d.ts +2 -0
  29. package/dist/intelligence/sessionMemory.js +18 -8
  30. package/dist/overlay/injector.js +2 -2
  31. package/dist/plugin/interface.d.ts +76 -2
  32. package/dist/plugin/loader.d.ts +15 -1
  33. package/dist/plugin/loader.js +217 -70
  34. package/dist/plugin/pipeline.d.ts +75 -0
  35. package/dist/plugin/pipeline.js +183 -0
  36. package/dist/plugin/registry.js +3 -2
  37. package/dist/security/secrets.d.ts +1 -0
  38. package/dist/security/secrets.js +13 -0
  39. package/dist/sensors/actionability.js +1 -2
  40. package/dist/sensors/guard.js +4 -10
  41. package/dist/sensors/mutations.js +12 -0
  42. package/dist/sensors/operation_monitor.js +1 -0
  43. package/dist/server.d.ts +1 -1
  44. package/dist/server.js +428 -156
  45. package/dist/state/agent.d.ts +1 -0
  46. package/dist/state/agent.js +3 -0
  47. package/dist/state/delta.d.ts +12 -4
  48. package/dist/state/delta.js +67 -14
  49. package/dist/state/session.d.ts +6 -0
  50. package/dist/state/session.js +27 -0
  51. package/dist/tools/browser_detect.d.ts +16 -3
  52. package/dist/tools/browser_detect.js +50 -5
  53. package/dist/tools/burst.d.ts +17 -8
  54. package/dist/tools/burst.js +236 -77
  55. package/dist/tools/checkpoint.d.ts +38 -0
  56. package/dist/tools/checkpoint.js +271 -0
  57. package/dist/tools/click.d.ts +1 -0
  58. package/dist/tools/click.js +74 -70
  59. package/dist/tools/design_extract.js +1 -1
  60. package/dist/tools/eval.js +1 -1
  61. package/dist/tools/fill.d.ts +20 -1
  62. package/dist/tools/fill.js +199 -40
  63. package/dist/tools/find.d.ts +16 -0
  64. package/dist/tools/find.js +67 -44
  65. package/dist/tools/github/index.d.ts +19 -4
  66. package/dist/tools/github/index.js +40 -4
  67. package/dist/tools/highlight.d.ts +6 -2
  68. package/dist/tools/highlight.js +158 -72
  69. package/dist/tools/inspect.js +1 -1
  70. package/dist/tools/key.js +65 -56
  71. package/dist/tools/navigate.js +29 -34
  72. package/dist/tools/pdf.js +21 -13
  73. package/dist/tools/pointer.d.ts +18 -3
  74. package/dist/tools/pointer.js +89 -1
  75. package/dist/tools/read.d.ts +28 -8
  76. package/dist/tools/read.js +230 -56
  77. package/dist/tools/scrape.js +67 -13
  78. package/dist/tools/screenshot.js +21 -16
  79. package/dist/tools/scroll.js +6 -11
  80. package/dist/tools/select.js +8 -2
  81. package/dist/tools/snapshot.js +3 -34
  82. package/dist/tools/tabs.js +14 -6
  83. package/dist/tools/thought.d.ts +2 -0
  84. package/dist/tools/thought.js +13 -14
  85. package/dist/tools/type.d.ts +2 -0
  86. package/dist/tools/type.js +107 -58
  87. package/dist/tools/type_secret.js +42 -76
  88. package/dist/tools/upload.js +1 -1
  89. package/dist/tools/video_compiler.d.ts +1 -1
  90. package/dist/tools/video_compiler.js +11 -12
  91. package/dist/version.d.ts +5 -0
  92. package/dist/version.js +5 -0
  93. package/docs/DOCUMENTATION.md +21 -32
  94. package/docs/PLUGINS.md +121 -0
  95. package/docs/TOOLS.md +56 -0
  96. package/docs/architecture/blind-injection.md +83 -20
  97. package/docs/architecture/overview.md +49 -49
  98. package/docs/configuration/folders.md +55 -54
  99. package/docs/desktop-automation/electron-apps.md +217 -162
  100. package/docs/get-started/introduction.md +60 -60
  101. package/docs/intelligence/site-profiles.md +151 -0
  102. package/docs/tools/tools.md +631 -293
  103. package/docs/troubleshooting/trouble-loop.md +31 -31
  104. package/ext-dist/background.js +10 -62
  105. package/ext-dist/content.js +333 -920
  106. package/ext-dist/hud/hud.js +9 -9
  107. package/ext-dist/manifest.json +2 -6
  108. package/ext-dist/styles.css +6 -1
  109. package/mcp.json +101 -67
  110. package/package.json +5 -6
  111. package/server.json +3 -3
  112. package/ext-dist/sidepanel/sidepanel.js +0 -25
  113. package/ext-dist/sidepanel.html +0 -547
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var S={};window.wtState=S;window.addEventListener("message",e=>{let{type:t,...i}=e.data;if(t?.startsWith("RT_")){S[t]=i;return}$(t,i)});function $(e,t){e==="REHYDRATE"&&window.dispatchEvent(new CustomEvent("wt-rehydrate",{detail:t}))}var c=document.getElementById("rt-canvas"),s=c.getContext("2d"),d=window.innerWidth/2,u=window.innerHeight/2,D=d,L=u,v=0,_=0,g="idle",T="",A=!1,E=!0,Y=!1;window.addEventListener("message",function(e){e.data&&(e.data.type==="WT_SIDEPANEL_STATE"&&(A=!!e.data.open,A&&(T="")),e.data.type==="WT_SUPPRESS_THOUGHT_HUD"&&(Y=!0,T=""),e.data.type==="WT_SCRIPTED_PILL_TOGGLE"&&(E=!!e.data.enabled))});var W=[],y=[],N=0,h=0;function F(){c.width=window.innerWidth,c.height=window.innerHeight}window.addEventListener("resize",F);F();var H=.15,P=.6,K=0,x=0,C=0;var U=0,I=0;function M(){let e=window.wtState||{};e.RT_CURSOR_MOVE&&(d=e.RT_CURSOR_MOVE.x,u=e.RT_CURSOR_MOVE.y,g=e.RT_CURSOR_MOVE.phase||"idle",delete e.RT_CURSOR_MOVE),e.RT_CLICK&&(X(e.RT_CLICK.x,e.RT_CLICK.y,"#3b82f6"),g="clicking",C=Date.now(),setTimeout(()=>{g==="clicking"&&(g="idle")},300),delete e.RT_CLICK),e.RT_SCROLL&&(N=e.RT_SCROLL.y,h=e.RT_SCROLL.ratio,delete e.RT_SCROLL);let t=W.length>0||y.length>0||T||g!=="idle"||Math.abs(d-U)>.5||Math.abs(u-I)>.5;if(U=d,I=u,!t){h>0&&h<1&&(s.clearRect(0,0,c.width,c.height),O()),requestAnimationFrame(M);return}s.clearRect(0,0,c.width,c.height),v+=(d-D)*H,_+=(u-L)*H,v*=P,_*=P;let i=Date.now();if(T&&g!=="typing"&&g!=="clicking"){K+=.016,x+=.03;let n=3;d+=Math.sin(x)*n,u+=Math.cos(x*.7)*n,Math.random()<.02&&(x+=.5)}if(g==="clicking"&&i-C<300){let r=(Math.random()-.5)*2.5,w=(Math.random()-.5)*2.5;d+=r,u+=w;let l=(i-C)/50;d+=Math.sin(l)*1,u+=Math.cos(l)*1}D+=v,L+=_,E&&J(),E&&O(),requestAnimationFrame(M)}function X(e,t,i){for(let n=0;n<15;n++){let r=Math.random()*Math.PI*2,w=Math.random()*4+1;W.push({x:e,y:t,vx:Math.cos(r)*w,vy:Math.sin(r)*w,life:1,color:i})}for(let n=0;n<3;n++)setTimeout(()=>{y.push({x:e,y:t,radius:0,alpha:1})},n*100)}function J(){for(let e=y.length-1;e>=0;e--){let t=y[e];if(t.radius+=3,t.alpha-=.015,t.alpha<=0){y.splice(e,1);continue}s.beginPath(),s.arc(t.x,t.y,t.radius,0,Math.PI*2),s.strokeStyle=`rgba(59, 130, 246, ${t.alpha})`,s.lineWidth=3,s.shadowColor="#3b82f6",s.shadowBlur=10,s.stroke()}}function O(){if(h<=0||h>=1)return;let e=4,t=60,i=c.width-e-10,n=10+(c.height-t-20)*h;s.fillStyle="rgba(59, 130, 246, 0.5)",s.beginPath(),s.roundRect(i,n,e,t,2),s.fill()}requestAnimationFrame(M);var p=!0;function B(){window.addEventListener("message",e=>{e.data.type==="TOGGLE_HUD"&&z()}),window.toggleHUD=z}function z(){p=!p;let e=document.getElementById("rt-canvas"),t=document.getElementById("widgets");e&&(e.style.display=p?"block":"none"),t&&(t.style.display=p?"block":"none"),window.parent.postMessage({type:"HUD_STATE_CHANGED",state:{hudVisible:p}},"*")}function G(e){p=e;let t=document.getElementById("rt-canvas"),i=document.getElementById("widgets");t&&(t.style.display=p?"block":"none"),i&&(i.style.display=p?"block":"none")}var b=!1,a=null,o=null,Q="console";function q(){console.log("[Weavetab HUD] Debug menu initialized"),window.addEventListener("message",e=>{console.log("[Weavetab HUD] Received message:",e.data.type),e.data.type==="TOGGLE_DEBUG"&&(console.log("[Weavetab HUD] Toggling debug menu"),V())}),window.toggleDebugMenu=V,console.log("[Weavetab HUD] Debug menu ready - use Ctrl+F3 or WeaveTabHUD.toggleDebugMenu()")}function V(){console.log("[Weavetab HUD] toggleDebugMenu called, current state:",b),b=!b,a||(console.log("[Weavetab HUD] Creating debug menu container"),Z()),a&&(a.style.display=b?"flex":"none",console.log("[Weavetab HUD] Debug menu visibility set to:",b)),window.parent.postMessage({type:"HUD_STATE_CHANGED",state:{debugMenuVisible:b}},"*")}function Z(){a=document.createElement("div"),a.id="wt-debug-menu",a.style.cssText=`
1
+ "use strict";(()=>{var R={};window.wtState=R;window.addEventListener("message",e=>{let{type:t,...o}=e.data;if(t?.startsWith("RT_")){R[t]=o;return}$(t,o)});function $(e,t){e==="REHYDRATE"&&window.dispatchEvent(new CustomEvent("wt-rehydrate",{detail:t}))}var c=document.getElementById("rt-canvas"),s=c.getContext("2d"),g=window.innerWidth/2,u=window.innerHeight/2,D=g,L=u,v=0,T=0,d="idle",S="",_=!0;window.addEventListener("message",function(e){e.data&&e.data.type==="WT_SCRIPTED_PILL_TOGGLE"&&(_=!!e.data.enabled)});var W=[],y=[],q=0,w=0;function O(){c.width=window.innerWidth,c.height=window.innerHeight}window.addEventListener("resize",O);O();var H=.15,A=.6,Y=0,x=0,C=0;var U=0,P=0;function E(){let e=window.wtState||{};e.RT_CURSOR_MOVE&&(g=e.RT_CURSOR_MOVE.x,u=e.RT_CURSOR_MOVE.y,d=e.RT_CURSOR_MOVE.phase||"idle",delete e.RT_CURSOR_MOVE),e.RT_CLICK&&(K(e.RT_CLICK.x,e.RT_CLICK.y,"#3b82f6"),d="clicking",C=Date.now(),setTimeout(()=>{d==="clicking"&&(d="idle")},300),delete e.RT_CLICK),e.RT_SCROLL&&(q=e.RT_SCROLL.y,w=e.RT_SCROLL.ratio,delete e.RT_SCROLL);let t=W.length>0||y.length>0||S||d!=="idle"||Math.abs(g-U)>.5||Math.abs(u-P)>.5;if(U=g,P=u,!t){w>0&&w<1&&(s.clearRect(0,0,c.width,c.height),I()),requestAnimationFrame(E);return}s.clearRect(0,0,c.width,c.height),v+=(g-D)*H,T+=(u-L)*H,v*=A,T*=A;let o=Date.now();if(S&&d!=="typing"&&d!=="clicking"){Y+=.016,x+=.03;let n=3;g+=Math.sin(x)*n,u+=Math.cos(x*.7)*n,Math.random()<.02&&(x+=.5)}if(d==="clicking"&&o-C<300){let r=(Math.random()-.5)*2.5,h=(Math.random()-.5)*2.5;g+=r,u+=h;let l=(o-C)/50;g+=Math.sin(l)*1,u+=Math.cos(l)*1}D+=v,L+=T,_&&N(),_&&I(),requestAnimationFrame(E)}function K(e,t,o){for(let n=0;n<15;n++){let r=Math.random()*Math.PI*2,h=Math.random()*4+1;W.push({x:e,y:t,vx:Math.cos(r)*h,vy:Math.sin(r)*h,life:1,color:o})}for(let n=0;n<3;n++)setTimeout(()=>{y.push({x:e,y:t,radius:0,alpha:1})},n*100)}function N(){for(let e=y.length-1;e>=0;e--){let t=y[e];if(t.radius+=3,t.alpha-=.015,t.alpha<=0){y.splice(e,1);continue}s.beginPath(),s.arc(t.x,t.y,t.radius,0,Math.PI*2),s.strokeStyle=`rgba(59, 130, 246, ${t.alpha})`,s.lineWidth=3,s.shadowColor="#3b82f6",s.shadowBlur=10,s.stroke()}}function I(){if(w<=0||w>=1)return;let e=4,t=60,o=c.width-e-10,n=10+(c.height-t-20)*w;s.fillStyle="rgba(59, 130, 246, 0.5)",s.beginPath(),s.roundRect(o,n,e,t,2),s.fill()}requestAnimationFrame(E);var p=!0;function B(){window.addEventListener("message",e=>{e.data.type==="TOGGLE_HUD"&&F()}),window.toggleHUD=F}function F(){p=!p;let e=document.getElementById("rt-canvas"),t=document.getElementById("widgets");e&&(e.style.display=p?"block":"none"),t&&(t.style.display=p?"block":"none"),window.parent.postMessage({type:"HUD_STATE_CHANGED",state:{hudVisible:p}},"*")}function G(e){p=e;let t=document.getElementById("rt-canvas"),o=document.getElementById("widgets");t&&(t.style.display=p?"block":"none"),o&&(o.style.display=p?"block":"none")}var b=!1,a=null,i=null,X="console";function V(){console.log("[Weavetab HUD] Debug menu initialized"),window.addEventListener("message",e=>{console.log("[Weavetab HUD] Received message:",e.data.type),e.data.type==="TOGGLE_DEBUG"&&(console.log("[Weavetab HUD] Toggling debug menu"),z())}),window.toggleDebugMenu=z,console.log("[Weavetab HUD] Debug menu ready - use Ctrl+F3 or WeaveTabHUD.toggleDebugMenu()")}function z(){console.log("[Weavetab HUD] toggleDebugMenu called, current state:",b),b=!b,a||(console.log("[Weavetab HUD] Creating debug menu container"),J()),a&&(a.style.display=b?"flex":"none",console.log("[Weavetab HUD] Debug menu visibility set to:",b)),window.parent.postMessage({type:"HUD_STATE_CHANGED",state:{debugMenuVisible:b}},"*")}function J(){a=document.createElement("div"),a.id="wt-debug-menu",a.style.cssText=`
2
2
  position: fixed;
3
3
  top: 50%;
4
4
  left: 50%;
@@ -40,25 +40,25 @@
40
40
  cursor: pointer;
41
41
  font-size: 11px;
42
42
  font-family: inherit;
43
- `,m.onclick=()=>ee(l.toLowerCase()),t.appendChild(m)}),a.appendChild(t);let n=document.createElement("div");n.id="wt-debug-content",n.style.cssText=`
43
+ `,m.onclick=()=>Q(l.toLowerCase()),t.appendChild(m)}),a.appendChild(t);let n=document.createElement("div");n.id="wt-debug-content",n.style.cssText=`
44
44
  flex: 1;
45
45
  overflow-y: auto;
46
46
  padding: 12px 16px;
47
47
  min-height: 300px;
48
- `,o=document.createElement("div"),o.id="wt-debug-console",o.style.cssText=`
48
+ `,i=document.createElement("div"),i.id="wt-debug-console",i.style.cssText=`
49
49
  font-family: 'IBM Plex Mono', monospace;
50
50
  font-size: 11px;
51
51
  line-height: 1.4;
52
- `,o.innerHTML=`
52
+ `,i.innerHTML=`
53
53
  <div style="color: #6b7280;">[Debug Console Ready]</div>
54
54
  <div style="color: #6b7280;">Press Ctrl+F3 to close this menu</div>
55
55
  <div style="color: #6b7280; margin-top: 8px;">Use browserAsk to test messaging system</div>
56
- `,n.appendChild(o),a.appendChild(n);let r=document.createElement("div");r.style.cssText=`
56
+ `,n.appendChild(i),a.appendChild(n);let r=document.createElement("div");r.style.cssText=`
57
57
  padding: 8px 16px;
58
58
  border-top: 1px solid #2a2a30;
59
59
  display: flex;
60
60
  gap: 8px;
61
- `,[{label:"Clear",color:"#6b7280",action:()=>te()},{label:"Test Ask",color:"#3b82f6",action:()=>ne()},{label:"Export",color:"#22c55e",action:()=>ie()}].forEach(l=>{let f=document.createElement("button");f.textContent=l.label,f.style.cssText=`
61
+ `,[{label:"Clear",color:"#6b7280",action:()=>Z()},{label:"Test Ask",color:"#3b82f6",action:()=>ee()},{label:"Export",color:"#22c55e",action:()=>te()}].forEach(l=>{let f=document.createElement("button");f.textContent=l.label,f.style.cssText=`
62
62
  padding: 4px 12px;
63
63
  background: transparent;
64
64
  border: 1px solid ${l.color};
@@ -67,7 +67,7 @@
67
67
  cursor: pointer;
68
68
  font-size: 10px;
69
69
  font-family: inherit;
70
- `,f.onclick=l.action,r.appendChild(f)}),a.appendChild(r),document.getElementById("widgets").appendChild(a)}function ee(e){Q=e,a?.querySelectorAll("button[dataset-tab]")?.forEach(i=>{let n=i.dataset.tab===e;i.style.background=n?"#3b82f6":"transparent",i.style.color=n?"#fff":"#9ca3af"}),o&&(e==="console"?o.style.display="block":(o.style.display="none",o.innerHTML=`<div style="color: #6b7280;">[${e.charAt(0).toUpperCase()+e.slice(1)} Tab - Coming Soon]</div>`))}function te(){o&&(o.innerHTML='<div style="color: #6b7280;">[Console Cleared]</div>')}function ne(){R("Testing ask system...","info"),window.parent.postMessage({type:"TEST_ASK_SYSTEM"},"*")}function ie(){if(R("Exporting logs...","info"),o){let e=o.innerText,t=new Blob([e],{type:"text/plain"}),i=URL.createObjectURL(t),n=document.createElement("a");n.href=i,n.download="weavetab-debug-logs.txt",n.click(),URL.revokeObjectURL(i),R("Logs exported successfully","info")}}function R(e,t="info"){if(!o)return;let i={info:"#60a5fa",warn:"#f59e0b",error:"#ef4444"},n=new Date().toLocaleTimeString(),r=document.createElement("div");r.style.cssText=`
70
+ `,f.onclick=l.action,r.appendChild(f)}),a.appendChild(r),document.getElementById("widgets").appendChild(a)}function Q(e){X=e,a?.querySelectorAll("button[dataset-tab]")?.forEach(o=>{let n=o.dataset.tab===e;o.style.background=n?"#3b82f6":"transparent",o.style.color=n?"#fff":"#9ca3af"}),i&&(e==="console"?i.style.display="block":(i.style.display="none",i.innerHTML=`<div style="color: #6b7280;">[${e.charAt(0).toUpperCase()+e.slice(1)} Tab - Coming Soon]</div>`))}function Z(){i&&(i.innerHTML='<div style="color: #6b7280;">[Console Cleared]</div>')}function ee(){M("Testing ask system...","info"),window.parent.postMessage({type:"TEST_ASK_SYSTEM"},"*")}function te(){if(M("Exporting logs...","info"),i){let e=i.innerText,t=new Blob([e],{type:"text/plain"}),o=URL.createObjectURL(t),n=document.createElement("a");n.href=o,n.download="weavetab-debug-logs.txt",n.click(),URL.revokeObjectURL(o),M("Logs exported successfully","info")}}function M(e,t="info"){if(!i)return;let o={info:"#60a5fa",warn:"#f59e0b",error:"#ef4444"},n=new Date().toLocaleTimeString(),r=document.createElement("div");r.style.cssText=`
71
71
  margin-bottom: 4px;
72
- color: ${i[t]};
73
- `,r.innerHTML=`<span style="color: #6b7280;">[${n}]</span> ${e}`,o.appendChild(r),o.scrollTop=o.scrollHeight}function j(e){b=e,a&&(a.style.display=b?"flex":"none")}var oe=!1;function k(){try{oe=window.parent.__wt_devMode===!0}catch(e){console.log("[Weavetab HUD] Could not check devMode:",e)}}B();q();k();window.addEventListener("message",e=>{e.data.type==="WT_CONFIG_UPDATE"&&k()});window.addEventListener("message",e=>{if(e.data.type==="REHYDRATE"){let t=e.data.state||{};t.hudVisible!==void 0&&G(t.hudVisible),t.debugMenuVisible!==void 0&&j(t.debugMenuVisible),k(),window.dispatchEvent(new CustomEvent("wt-rehydrate",{detail:t}))}});window.WeaveTabHUD={};})();
72
+ color: ${o[t]};
73
+ `,r.innerHTML=`<span style="color: #6b7280;">[${n}]</span> ${e}`,i.appendChild(r),i.scrollTop=i.scrollHeight}function j(e){b=e,a&&(a.style.display=b?"flex":"none")}var ne=!1;function k(){try{ne=window.parent.__wt_devMode===!0}catch(e){console.log("[Weavetab HUD] Could not check devMode:",e)}}B();V();k();window.addEventListener("message",e=>{e.data.type==="WT_CONFIG_UPDATE"&&k()});window.addEventListener("message",e=>{if(e.data.type==="REHYDRATE"){let t=e.data.state||{};t.hudVisible!==void 0&&G(t.hudVisible),t.debugMenuVisible!==void 0&&j(t.debugMenuVisible),k(),window.dispatchEvent(new CustomEvent("wt-rehydrate",{detail:t}))}});window.WeaveTabHUD={};})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Weavetab Agent",
4
- "version": "1.0.63031",
4
+ "version": "1.0.62054",
5
5
  "description": "Native browser agent for Weavetab MCP",
6
6
  "permissions": [
7
7
  "tabs",
@@ -16,8 +16,7 @@
16
16
  "alarms",
17
17
  "contextMenus",
18
18
  "downloads",
19
- "browsingData",
20
- "sidePanel"
19
+ "browsingData"
21
20
  ],
22
21
  "host_permissions": [
23
22
  "<all_urls>"
@@ -25,9 +24,6 @@
25
24
  "background": {
26
25
  "service_worker": "background.js"
27
26
  },
28
- "side_panel": {
29
- "default_path": "sidepanel.html"
30
- },
31
27
  "content_scripts": [
32
28
  {
33
29
  "matches": [
@@ -1,6 +1,5 @@
1
1
  /* ═══════════════════════════════════════════════════════════════
2
2
  Weavetab · UI Design System
3
- Claude Chrome-inspired sidepanel + floating elements
4
3
  ═══════════════════════════════════════════════════════════════ */
5
4
 
6
5
  /* ── SHARED TOKENS (Light theme default) ─────────────────────── */
@@ -216,3 +215,9 @@
216
215
  max-width: 280px !important;
217
216
  }
218
217
  }
218
+
219
+ /* ── ACTION RIPPLE ANIMATION ─────────────────────────────────── */
220
+ @keyframes __wt_ripple_expand {
221
+ 0% { transform: scale(1); opacity: 1; }
222
+ 100% { transform: scale(7.5); opacity: 0; }
223
+ }
package/mcp.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weavetab/mcp",
3
3
  "mcpName": "io.github.weavetab/mcp",
4
- "version": "2.5.0-beta.2",
4
+ "version": "2.5.0-beta.4",
5
5
  "description": "Weavetab MCP — Direct Layer 0 interface for AI agents across web and desktop applications. Direct socket transport, zero wrapper overhead, deterministic state execution.",
6
6
  "icon": "icon.png",
7
7
  "author": "fy2ne",
@@ -38,13 +38,15 @@
38
38
  "tools": {
39
39
  "browser_map": {
40
40
  "category": "vision",
41
- "description": "Snapshot interactive DOM with stable ref IDs (w:NN). For complex SPAs, use scope or query to constrain tokens. Supports delta temporal diffing (up to 97% token reduction), semantic pruning (dropping hidden elements), AX tree fallback (Shadow DOM traversal), scope filtering, query filtering, and forced rebuilds.",
41
+ "description": "Snapshot interactive DOM with stable ref IDs (w:NN). For complex SPAs, use scope or query to constrain tokens. Supports delta temporal diffing (up to 97% token reduction), semantic pruning (dropping hidden elements), Set-of-Marks visual grounding (visual: true / \"auto\" for canvas/WebGL pages), AX tree fallback (Shadow DOM traversal), scope filtering, query filtering, and forced rebuilds with automatic loop strike reset (force: true).",
42
42
  "features": [
43
43
  "Semantic DOM pruning (up to 97% token reduction with delta)",
44
+ "Set-of-Marks visual grounding (visual: true / \"auto\")",
44
45
  "Per-tab snapshot temporal diffing (delta mode)",
45
46
  "Shadow DOM / AX tree fallback parsing",
46
47
  "Scope and query filtering for complex SPAs",
47
- "Framework auto-detection injection"
48
+ "Framework auto-detection injection",
49
+ "Loop strike counter reset on forced re-mapping (force: true)"
48
50
  ]
49
51
  },
50
52
  "browser_navigate": {
@@ -59,8 +61,9 @@
59
61
  },
60
62
  "browser_click": {
61
63
  "category": "input",
62
- "description": "Click a DOM element. Physical click engine incorporating Bézier curve trajectory kinematics (Ghost Cursor). Multi-stage targeting fallback: ref ID -> selector -> label -> intent -> coordinates -> backendNodeId.",
64
+ "description": "Click a DOM element. Physical click engine incorporating Bézier curve trajectory kinematics (Ghost Cursor). Multi-stage targeting fallback: mark number (SoM visual grounding) -> ref ID -> selector -> label -> intent -> coordinates -> backendNodeId.",
63
65
  "features": [
66
+ "Direct mark number targeting (mark: N) from visual mode",
64
67
  "Bézier curve trajectory kinematics",
65
68
  "Humanized acceleration and velocity curves",
66
69
  "Multi-stage fallback targeting resolution",
@@ -119,16 +122,18 @@
119
122
  },
120
123
  "browser_burst": {
121
124
  "category": "mission_execution",
122
- "description": "Chain multiple tool calls in one round-trip. High-throughput macro execution engine executing serial action pipelines in a single MCP request, bypassing JSON-RPC serialization overhead. Supports macro steps: type_and_send, navigate_and_read, click_and_wait, scroll_and_read, fill_form, drag_and_drop (ref -> end_ref), and hover_and_read.",
125
+ "description": "HIGH-SPEED MULTI-ACTION PIPELINE: Executes 2 or more sequential browser actions in a single round-trip without waiting for LLM turns between steps. PREFER THIS over individual single-action calls to slash latency and token burn. Supports native primitives (browser_click, browser_fill, browser_type, browser_type_secret, browser_navigate, browser_key, browser_scroll, browser_wait, browser_map) plus compound macros (type_and_send, click_and_wait, navigate_and_read, scroll_and_read, fill_form). If compile_from_history: true is passed, automatically compiles and executes recent successful session trail actions into a burst macro.",
123
126
  "features": [
124
- "Single-request multi-action pipeline execution",
125
- "Compound macro step abstractions (type_and_send, navigate_and_read, click_and_wait, scroll_and_read, fill_form, drag_and_drop, hover_and_read)",
127
+ "Single-request multi-action pipeline execution with zero intermediate LLM round-trips",
128
+ "Compound macro abstractions (type_and_send, click_and_wait, navigate_and_read, scroll_and_read, fill_form, drag_and_drop, hover_and_read)",
129
+ "Automatic session history compilation into replayable burst macros (compile_from_history: true)",
130
+ "Fail-fast execution guard (stop_on_error: true) to prevent cascading errors",
126
131
  "Automatic loop counter reset on execution start"
127
132
  ]
128
133
  },
129
134
  "browser_tabs": {
130
135
  "category": "tabs",
131
- "description": "Manage browser tabs (open, switch, close, list, consolidate, heal, list_windows, focus_window). Full CRUD lifecycle management for tabs and windows.",
136
+ "description": "Manage browser and Electron app tabs/windows (open, switch, close, list). Specify 'app' when targeting desktop apps (e.g. app: 'discord') to avoid opening web browser.",
132
137
  "features": [
133
138
  "Single and batch tab operations",
134
139
  "Duplicate tab consolidation",
@@ -147,15 +152,24 @@
147
152
  "Heuristic auto-condition resolution"
148
153
  ]
149
154
  },
155
+ "browser_captcha": {
156
+ "category": "safety",
157
+ "description": "Autonomous zero-API detection and solving of Turnstile, reCAPTCHA, GeeTest, and hCaptcha bot challenges using local CDP behavioral solvers.",
158
+ "features": [
159
+ "Zero-API autonomous solving",
160
+ "Cloudflare Turnstile, reCAPTCHA v2/v3, GeeTest, and hCaptcha support",
161
+ "Human oversight fallback via wait_for_user"
162
+ ]
163
+ },
150
164
  "browser_thoughts": {
151
165
  "category": "dialog_and_interaction",
152
- "description": "Agent-to-user communication layer rendered as a Shadow DOM overlay. Supports 'question' mode (two-way blocking prompt) and 'feedback' mode (one-way green sticky status update). Consolidates former ask/feedback tools.",
166
+ "description": "Agent-to-user communication layer rendered in the middle down of the page. Supports question mode (interactive prompt with answer submission) and feedback mode (status, observation, decision, or warning update). Supports contextual element anchoring (anchor: 'w:NN') and visual styles ('observation', 'decision', 'warning', 'question').",
153
167
  "features": [
154
- "Shadow DOM HUD thought bubble overlay",
155
- "Feedback mode (asynchronous status notification)",
156
- "Question mode (blocking interactive user response)",
157
- "Sentence and paragraph user input modes",
158
- "Configurable response timeout"
168
+ "Middle-down floating card HUD with precision dark styling",
169
+ "Contextual element anchoring (anchor: 'w:NN') with auto-highlighting",
170
+ "Feedback mode (observation, decision, warning updates)",
171
+ "Question mode (interactive user response directly on page)",
172
+ "Configurable auto-fade and response timeout"
159
173
  ]
160
174
  },
161
175
  "browser_pointer": {
@@ -170,7 +184,7 @@
170
184
  },
171
185
  "browser_select": {
172
186
  "category": "input",
173
- "description": "Select an option from a native dropdown by visible text or value. Utilizes native property setters and dispatches input/change events for framework compatibility (React, Vue, Angular).",
187
+ "description": "Select an option from a native dropdown by visible text or value. Uses native property setters and dispatches input/change events for framework compatibility (React, Vue, Angular).",
174
188
  "features": [
175
189
  "Option matching by visible text or value",
176
190
  "Framework-safe prototype property setter invocation",
@@ -189,11 +203,13 @@
189
203
  },
190
204
  "browser_highlight": {
191
205
  "category": "canvas_and_visual",
192
- "description": "Highlight an element with a colored overlay. Renders temporary visual CDP overlay highlights over target elements without DOM tree mutations.",
206
+ "description": "Highlight elements on page. Renders temporary visual overlays over target elements without DOM tree mutations. Supports multi-element consideration overlays (refs: ['w:12', 'w:15']), presentation styles ('consideration', 'target', 'danger', 'success', 'shimmer'), floating badges, and configurable durations.",
193
207
  "features": [
194
- "CDP visual overlay highlighting",
195
- "Configurable overlay color and duration",
196
- "Targeting via ref ID, selector, or nodeId"
208
+ "Multi-candidate consideration overlay (refs array)",
209
+ "Five visual styles: consideration, target lock, danger, success, shimmer",
210
+ "Floating label badge display above highlighted elements",
211
+ "Configurable duration and color override",
212
+ "Targeting via ref IDs (w:NN), CSS selectors, or CDP backendNodeId"
197
213
  ]
198
214
  },
199
215
  "browser_upload": {
@@ -223,6 +239,17 @@
223
239
  "Origin storage purging"
224
240
  ]
225
241
  },
242
+ "browser_checkpoint": {
243
+ "category": "storage_and_cookies",
244
+ "description": "Snapshot and restore browser state (cookies, localStorage, sessionStorage, and scroll/URL) into named checkpoints to time-travel and rollback failed automation branches.",
245
+ "features": [
246
+ "Session state time-travel and rollback",
247
+ "Cookies backup and restoration (HttpOnly and Secure via CDP)",
248
+ "LocalStorage and SessionStorage snapshotting",
249
+ "URL, page title, and viewport scroll position persistence",
250
+ "Optional lightweight DOM snapshot capture"
251
+ ]
252
+ },
226
253
  "browser_network_intercept": {
227
254
  "category": "network",
228
255
  "description": "Intercept/stub network responses (mock APIs, block tracking) and capture raw protocol network telemetry (TLS/SSL certificate metadata, microsecond timing breakdown, and OS-level network failure reasons).",
@@ -369,17 +396,9 @@
369
396
  "Automated raw frame cleanup"
370
397
  ]
371
398
  },
372
- "browser_reset_loop_counter": {
373
- "category": "wait_and_timing",
374
- "description": "Reset the loop detection strike counter to zero when legitimate repetitive actions flag automated safeguards.",
375
- "features": [
376
- "Atomic strike counter reset",
377
- "Explicit reset reason logging"
378
- ]
379
- },
380
399
  "browser_detect": {
381
400
  "category": "tabs",
382
- "description": "Detect available browsers on the machine and report CDP feature coverage per engine (Chromium, Firefox, WebKit).",
401
+ "description": "CRITICAL INITIALIZATION TOOL. Detect available browsers and configured desktop apps (Discord, Slack, etc.). Call this FIRST before interacting with the environment to know if apps are online/offline and what tabs they have open.",
383
402
  "features": [
384
403
  "Local browser engine discovery",
385
404
  "Engine CDP API coverage analysis",
@@ -395,60 +414,75 @@
395
414
  "Resource loading timing distributions"
396
415
  ]
397
416
  },
398
- "browser_macro_compile": {
399
- "category": "macro",
400
- "description": "Compile a recent action trail into a reusable browser_burst macro sequence for deterministic replay.",
417
+ "browser_pattern_learn": {
418
+ "category": "memory",
419
+ "description": "Read (action=get), register (action=learn), update, or record execution outcome for a named workflow pattern on a given origin in ~/.weavetab-system/memory/sites/. Use action=get at session start to inspect site profiles and reliability scores. Use learn after completing a flow to persist it for future fast-path replay.",
401
420
  "features": [
402
- "Interaction trail analysis and compilation",
403
- "Reusable macro structure generation",
404
- "Full compatibility with browser_burst engine"
421
+ "Site profile inspection via action=get (reads ~/.weavetab-system/memory/sites/)",
422
+ "Named pattern creation and update (merge-on-write, no duplicates)",
423
+ "Volatile selector stabilization before persistence",
424
+ "EWMA reliability score update on execution outcome",
425
+ "3-strike degradation and re-learn flagging",
426
+ "Site quirk registration (cookie_banner, rate_limit, modal_popup)"
405
427
  ]
406
428
  },
407
- "github_analyze": {
429
+ "browser_github": {
408
430
  "category": "github",
409
- "description": "Analyze a GitHub repository structure, file tree, and README snippet directly via raw endpoints without API key rate limits.",
431
+ "description": "Interact with GitHub repositories without burning browser turns. Analyze repo trees, read raw source files, search/inspect issues, and examine PR diffs and review comments.",
410
432
  "features": [
411
- "Repository metadata parsing",
412
- "Directory tree listing",
413
- "README payload extraction",
414
- "Zero GitHub API token requirement"
433
+ "Action-based repo analysis, file reading, issues, and PR review",
434
+ "Zero GitHub API token requirement for raw reads",
435
+ "Automated active tab repository context resolution",
436
+ "Line range subset reading and issue/PR search"
415
437
  ]
416
438
  },
417
- "github_read": {
418
- "category": "github",
419
- "description": "Read file contents from a GitHub repository via raw content endpoints.",
439
+ "browser_office": {
440
+ "category": "documents",
441
+ "description": "Read and extract structured content from office documents (Excel, Word, PDF, CSV) via live browser session cookies or local downloads directory.",
420
442
  "features": [
421
- "Raw file content retrieval",
422
- "Branch, tag, and commit ref targeting",
423
- "Line range subset reading"
443
+ "In-session authenticated document fetching",
444
+ "Structured tabular extraction (.xlsx, .csv)",
445
+ "Document text and metadata extraction (.docx, .pdf)"
424
446
  ]
425
447
  },
426
- "github_issues": {
427
- "category": "github",
428
- "description": "Interact with GitHub issues. List, search, and fetch issue details with comment threads.",
448
+ "browser_emulate": {
449
+ "category": "environment",
450
+ "description": "Emulate browser environmental conditions over CDP: network throttling profiles, CPU slowdown multipliers, geolocation overrides, timezone IDs, and custom User-Agent strings.",
429
451
  "features": [
430
- "Issue state filtering (open, closed, all)",
431
- "Full-text issue search",
432
- "Comment thread extraction"
452
+ "Network throttling (Offline, Slow 3G, Fast 3G, 4G)",
453
+ "CPU throttling multipliers",
454
+ "Geolocation and timezone overrides"
433
455
  ]
434
456
  },
435
- "github_get_pr": {
436
- "category": "github",
437
- "description": "Interact with GitHub pull requests. Retrieve metadata, changed files, diff summaries, and review comments.",
457
+ "list_plugins": {
458
+ "category": "plugins",
459
+ "description": "Inspect installed Weavetab SDK plugins, available unloadable plugins, tool overrides, custom schemas, and capability manifests.",
460
+ "features": [
461
+ "Installed plugin discovery",
462
+ "Manifest and schema introspection",
463
+ "Ecosystem capability listing"
464
+ ]
465
+ },
466
+ "load_plugin": {
467
+ "category": "plugins",
468
+ "description": "Dynamically load any published Weavetab plugin by npm package name into the active runtime with isolated sandboxing and hot tool registration.",
438
469
  "features": [
439
- "Pull request metadata parsing",
440
- "Changed file list enumeration",
441
- "Review comment thread extraction"
470
+ "Dynamic npm package loading",
471
+ "Hot tool registration with client notification",
472
+ "Isolated plugin execution context"
442
473
  ]
443
474
  }
444
475
  },
445
476
  "resources": {
446
477
  "session_memory": {
447
- "description": "Per-domain persistent profile store (~/.weavetab-system/memory/) tracking detected web frameworks, Shadow DOM utilization, and interaction strategies across sessions.",
478
+ "description": "Two-tier persistent memory system. Tier 1 (~/.weavetab-system/memory/): per-domain selector confidence cache tracking detected web frameworks, Shadow DOM utilization, and interaction strategies. Tier 2 (~/.weavetab-system/memory/sites/): named workflow patterns with EWMA reliability scores, site quirks (cookie banners, rate limits), and fast-path eligibility flags — all accumulated and refined across sessions.",
448
479
  "features": [
449
480
  "Framework detection (React, Vue, Angular, Lit, Svelte, Next, Nuxt, Gatsby)",
450
- "Successful selector strategy caching",
451
- "Interaction history accumulation"
481
+ "Successful selector strategy caching with confidence decay (Tier 1)",
482
+ "Named workflow pattern compilation with EWMA reliability scoring (Tier 2)",
483
+ "Site quirk registration: cookie banners, rate limits, modal popups (Tier 2)",
484
+ "3-strike pattern degradation with re-learn flagging (Tier 2)",
485
+ "Fast-path eligibility: patterns with reliability ≥ 0.8 skip exploratory DOM navigation"
452
486
  ]
453
487
  },
454
488
  "knowledge_hints": {
@@ -502,7 +536,7 @@
502
536
  ]
503
537
  },
504
538
  "vision_fallback": {
505
- "description": "Local pixel analysis pipeline utilizing sharp for visual layout evaluation when accessibility trees return zero nodes.",
539
+ "description": "Local pixel analysis pipeline using sharp for visual layout evaluation when accessibility trees return zero nodes.",
506
540
  "pipeline": "AX Tree Check -> Screenshot -> Grayscale -> 4x4 Grid Heatmap -> Text Density -> Clickable Region Analysis",
507
541
  "features": [
508
542
  "Local execution (zero external API dependencies)",
@@ -520,7 +554,7 @@
520
554
  "features": [
521
555
  "Rolling action window evaluation",
522
556
  "Escalating alert tiers",
523
- "Manual reset via browser_reset_loop_counter"
557
+ "Manual reset via browser_map({ force: true }) or browser_wait({ reset_loop: true })"
524
558
  ]
525
559
  },
526
560
  "framework_detection": {
@@ -554,9 +588,9 @@
554
588
  "rbac": {
555
589
  "description": "Role-Based Access Control enforcing tool execution boundaries based on configured session role.",
556
590
  "roles": {
557
- "admin": "Full access to all 42 tools and system operations",
591
+ "admin": "Full access to all 44 tools and system operations",
558
592
  "system": "Full tool access excluding system-level operations",
559
- "viewer": "Read-only access (browser_map, browser_find, browser_scrape, browser_screenshot, browser_inspect, browser_snapshot, browser_console, browser_pdf, browser_storage, browser_cookies, browser_tabs, browser_wait, github_*)",
593
+ "viewer": "Read-only access (browser_map, browser_find, browser_scrape, browser_screenshot, browser_inspect, browser_snapshot, browser_console, browser_pdf, browser_storage, browser_cookies, browser_tabs, browser_wait, browser_github)",
560
594
  "automation": "Restricted execution set for non-interactive automated workflows"
561
595
  }
562
596
  },
@@ -771,7 +805,7 @@
771
805
  }
772
806
  },
773
807
  "metadata": {
774
- "total_tools": 42,
808
+ "total_tools": 50,
775
809
  "tool_categories": 15,
776
810
  "latency": "3-8ms mean",
777
811
  "token_efficiency": "Up to 97% reduction via semantic delta engine + DOM pruner",
@@ -786,4 +820,4 @@
786
820
  "weavetab"
787
821
  ]
788
822
  }
789
- }
823
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weavetab/mcp",
3
- "version": "2.5.0-beta.2",
3
+ "version": "2.5.0-beta.4",
4
4
  "description": "Direct Layer 0 interface for AI agents across web and desktop applications. No WebDriver. No cloud. Pure control.",
5
5
  "author": {
6
6
  "name": "fy2ne",
@@ -68,9 +68,8 @@
68
68
  "README.md"
69
69
  ],
70
70
  "scripts": {
71
- "build": "npm run build:ext && npm run build:hud && npm run build:sidepanel && tsc",
71
+ "build": "npm run build:ext && npm run build:hud && tsc",
72
72
  "build:hud": "esbuild ext-dist/hud/src/index.ts --bundle --minify --outfile=ext-dist/hud/hud.js --format=iife",
73
- "build:sidepanel": "esbuild ext-dist/sidepanel/src/index.ts --bundle --minify --outfile=ext-dist/sidepanel/sidepanel.js --format=iife",
74
73
  "build:ext": "node scripts/build-ext.js",
75
74
  "docs:generate": "node scripts/generate-docs.js",
76
75
  "verify:versions": "node scripts/verify-versions.js",
@@ -79,8 +78,8 @@
79
78
  "dev": "tsx src/index.ts",
80
79
  "start": "node dist/index.js",
81
80
  "prepublishOnly": "npm run verify && npm run build",
82
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
83
- "test:unit": "node --import tsx/esm --test \"tests/unit/cache.test.ts\" \"tests/unit/delta.test.ts\" \"tests/unit/sessionMemory.test.ts\" \"tests/unit/trail.test.ts\" \"tests/unit/walker.test.ts\" \"tests/unit/burst.test.ts\" \"tests/unit/navigate.test.ts\" \"tests/unit/select.test.ts\" \"tests/unit/design_extract.test.ts\" \"tests/unit/plugin.test.ts\" \"tests/unit/electron.test.ts\"",
81
+ "test": "npm run test:unit",
82
+ "test:unit": "node --import tsx/esm --test \"tests/unit/cache.test.ts\" \"tests/unit/delta.test.ts\" \"tests/unit/sessionMemory.test.ts\" \"tests/unit/site_memory.test.ts\" \"tests/unit/trail.test.ts\" \"tests/unit/walker.test.ts\" \"tests/unit/burst.test.ts\" \"tests/unit/navigate.test.ts\" \"tests/unit/select.test.ts\" \"tests/unit/design_extract.test.ts\" \"tests/unit/plugin.test.ts\" \"tests/unit/plugin_lifecycle.test.ts\" \"tests/unit/plugin_interceptors.test.ts\" \"tests/unit/electron.test.ts\" \"tests/unit/stale_ref_recovery.test.ts\" \"tests/unit/secret_containment.test.ts\" \"tests/unit/checkpoint.test.ts\" \"tests/unit/marks.test.ts\" \"tests/unit/highlight.test.ts\"",
84
83
  "test:e2e": "tsx tests/e2e/smoke_test.ts"
85
84
  },
86
85
  "dependencies": {
@@ -99,7 +98,7 @@
99
98
  "proper-lockfile": "^4.1.2",
100
99
  "ws": "^8.20.0",
101
100
  "xlsx": "^0.18.5",
102
- "zod": "^3.23.8"
101
+ "zod": "^3.25.76"
103
102
  },
104
103
  "optionalDependencies": {
105
104
  "sharp": "^0.34.5"
package/server.json CHANGED
@@ -2,18 +2,18 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.weavetab/mcp",
4
4
  "title": "Weavetab MCP",
5
- "description": "Direct Layer 0 interface for AI agents across web and desktop applications. No WebDriver. No cloud. Pure control.",
5
+ "description": "Give AI agents full control over live browsers and apps to navigate, click, extract, and automate.",
6
6
  "repository": {
7
7
  "url": "https://github.com/weavetab/mcp",
8
8
  "source": "github"
9
9
  },
10
- "version": "2.5.0-beta.2",
10
+ "version": "2.5.0-beta.4",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "registryBaseUrl": "https://registry.npmjs.org",
15
15
  "identifier": "@weavetab/mcp",
16
- "version": "2.5.0-beta.2",
16
+ "version": "2.5.0-beta.4",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  },
@@ -1,25 +0,0 @@
1
- "use strict";(()=>{var s=typeof browser<"u"?browser:chrome,Y=s.runtime.connect({name:"wt-sidepanel"});Y.onDisconnect.addListener(()=>{});var f=document.getElementById("tool-feed-container"),E=document.getElementById("thoughts-feed"),S=document.getElementById("notes-list"),$=document.getElementById("status-dot"),P=document.getElementById("status-label"),R=document.getElementById("badge-devmode"),w=document.getElementById("notes-input"),Z=document.getElementById("btn-send"),T=!1,c=!0,tt=500,et=200;function b(t){let e={idle:{dot:"#6b7280",label:"IDLE",color:"#6b7280"},weaving:{dot:"#3b82f6",label:"WEAVING",color:"#3b82f6"},stuck:{dot:"#f59e0b",label:"STUCK",color:"#f59e0b"},done:{dot:"#10b981",label:"DONE",color:"#10b981"}},{dot:n,label:a,color:d}=e[t]??e.idle;$.style.background=n,$.style.boxShadow=`0 0 6px ${n}`,P.textContent=a,P.style.color=d}var y=new Map;function N(t){let{name:e,status:n,args:a,result:d,id:z}=t,I=z??e,r=y.get(I),k=!r;k&&(r=document.createElement("div"),r.className="tool-call",y.set(I,r));let B={pending:{icon:"\u23F3",cls:"status-pending"},done:{icon:"\u2713",cls:"status-done"},error:{icon:"\u2717",cls:"status-error"}},{icon:J,cls:A}=B[n]??B.pending,O=a?JSON.stringify(a).slice(0,150):"",H=d?String(d).slice(0,120):"",j=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"});if(r.innerHTML=`
2
- <div class="tool-header">
3
- <span style="font-weight:600;color:var(--text);">${v(e??"?")}</span>
4
- <div style="display:flex;align-items:center;gap:6px;">
5
- <span style="font-size:9px;color:var(--text-muted);">${j}</span>
6
- <span class="${A}">${J}</span>
7
- </div>
8
- </div>
9
- ${O?`<div class="tool-args">${v(O)}</div>`:""}
10
- ${H?`<div class="tool-result ${A}">${v(H)}</div>`:""}
11
- `,k){let x=f.querySelector(".empty");for(x&&x.remove(),f.prepend(r);f.children.length>tt;){let M=f.lastElementChild;if(M){let C=[...y.entries()].find(([,Q])=>Q===M)?.[0];C&&y.delete(C),M.remove()}}}}function G(t,e="thought"){let n=E.querySelector(".empty");n&&n.remove();let a=document.createElement("div");a.className=`thought-item thought-${e}`;let d=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"});for(a.innerHTML=`<span class="thought-ts">${d}</span><span class="thought-text">${v(t)}</span>`,E.prepend(a);E.children.length>et;)E.lastElementChild?.remove()}function V(t){if(S.innerHTML="",!t?.length){S.innerHTML='<div class="task-item"><span class="task-icon" style="color:var(--text-muted)">\u25CB</span><span style="color:var(--text-muted)">No active mission</span></div>';return}t.forEach(e=>{let n=document.createElement("div");n.className="task-item",n.innerHTML=`<span class="task-icon">\u25C8</span><span>${v(e)}</span>`,S.appendChild(n)})}s.runtime.onMessage.addListener(t=>{switch(t.type){case"Weavetab_GROUP_STATE":case"WT_AGENT_STATUS":{let e=t.state??t.status;(e==="weaving"||e==="idle"||e==="stuck"||e==="done")&&b(e);break}case"Weavetab_STATE":{if(t.hud?.action){let e=String(t.hud.action).trim();if(e){let n=e.startsWith("[ERR]")?"error":e.startsWith("[OK]")?"done":"pending";N({id:`wt-state-${Date.now()}-${Math.random()}`,name:e,status:n,timestamp:Date.now()})}}break}case"TOOL_CALL_EVENT":case"WT_TOOL_CALL":{let e=t.payload??t.data??t;e?.name&&N(e),(e?.status==="pending"||e?.status==="done")&&b((e.status==="pending","weaving"));break}case"WT_THOUGHT":{t.text&&G(t.text,t.kind??"thought");break}case"WT_PLAN_UPDATE":{V(t.data?.tasks??[]);break}case"WT_CONFIG_UPDATE":case"Weavetab_CONFIG":{T=!!t.devMode,R.style.display=T?"inline-block":"none";break}}});var p=!0,l=document.getElementById("btn-master-visuals"),g=document.getElementById("btn-scripted-pill");s.storage.local.get(["wt_devMode","wt_plan","wt_agent_status","wt_scripted_pill","wt_master_visuals"],t=>{T=!!t.wt_devMode,R.style.display=T?"inline-block":"none",t.wt_plan?.tasks&&V(t.wt_plan.tasks),t.wt_agent_status&&b(t.wt_agent_status),c=t.wt_scripted_pill!==!1,F(),p=t.wt_master_visuals!==!1,U()});function U(){l&&(p?(l.textContent="Visuals: ON",l.classList.remove("off")):(l.textContent="Visuals: OFF",l.classList.add("off")))}function nt(t){s.runtime.sendMessage({type:"WT_TOGGLE_MASTER_VISUALS",enabled:t}).catch(()=>{}),s.tabs.query({},e=>{e.forEach(n=>{n.id&&s.tabs.sendMessage(n.id,{type:"WT_TOGGLE_MASTER_VISUALS",enabled:t}).catch(()=>{})})})}l&&l.addEventListener("click",()=>{p=!p,s.storage.local.set({wt_master_visuals:p}),U(),nt(p)});function F(){g&&(g.textContent=c?"Cursor Pills: ON":"Cursor Pills: OFF",g.style.opacity=c?"1":"0.5")}function st(t){s.tabs.query({},e=>{e.forEach(n=>{n.id&&s.tabs.sendMessage(n.id,{type:"WT_SCRIPTED_PILL_TOGGLE",enabled:t}).catch(()=>{})})})}g&&g.addEventListener("click",()=>{c=!c,s.storage.local.set({wt_scripted_pill:c}),F(),st(c)});var W="dom_target",u=null,i=document.getElementById("btn-snipe-trigger"),o=document.getElementById("snipe-popover"),_=document.getElementById("popover-opt-dom"),h=document.getElementById("popover-opt-vision"),L=document.getElementById("snipe-badge-container"),m=document.getElementById("snipe-badge-content"),D=document.getElementById("btn-remove-snipe");function it(t){if(t.stopPropagation(),!o)return;let e=o.style.display==="none";o.style.display=e?"flex":"none",i&&i.classList.toggle("active",e)}document.addEventListener("click",t=>{o&&o.style.display!=="none"&&!o.contains(t.target)&&t.target!==i&&(o.style.display="none",i&&i.classList.remove("active"))});i&&i.addEventListener("click",it);function q(t){W=t,o&&(o.style.display="none"),i&&i.classList.add("active"),_&&_.classList.toggle("active",t==="dom_target"),h&&h.classList.toggle("active",t==="visual_crop"),s.tabs.query({active:!0,currentWindow:!0},e=>{e[0]?.id&&s.tabs.sendMessage(e[0].id,{type:"WT_START_SNIPE",mode:W}).catch(()=>{})})}_&&_.addEventListener("click",()=>q("dom_target"));h&&h.addEventListener("click",()=>q("visual_crop"));function K(){u=null,L&&(L.style.display="none"),m&&(m.innerHTML=""),i&&i.classList.remove("active")}D&&D.addEventListener("click",K);function ot(t){if(u=t,i&&i.classList.remove("active"),!(!L||!m))if(L.style.display="flex",t.mode==="visual_crop"&&t.cropImage){let e=t.boundingRect?`${t.boundingRect.width}\xD7${t.boundingRect.height}px`:"WebP Image",n=t.cropImage?Math.round(t.cropImage.length/120):100;m.innerHTML=`
12
- <img class="snipe-badge-thumb" src="${t.cropImage}" alt="crop preview" />
13
- <div class="snipe-badge-meta">
14
- <span class="snipe-badge-title">Vision Crop Attachment</span>
15
- <span class="snipe-badge-subtitle">${e} \u2022 WebP Image (~${n} tokens)</span>
16
- </div>
17
- `}else{let e=t.elements?.length||0,n=t.elements?.[0]?.selector||t.elements?.[0]?.tag||"DOM Target";m.innerHTML=`
18
- <div class="snipe-badge-icon-box">
19
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
20
- </div>
21
- <div class="snipe-badge-meta">
22
- <span class="snipe-badge-title">DOM Target Attachment</span>
23
- <span class="snipe-badge-subtitle">${e} elements \u2022 0 image tokens</span>
24
- </div>
25
- `}}s.runtime.onMessage.addListener(t=>{t.type==="WT_SNIPE_COMPLETED"&&t.payload&&ot(t.payload)});function X(){let t=w.value.trim();if(!t&&!u)return;let e={type:"WT_USER_NOTE",text:t||"(Targeted area annotation sent)",ts:Date.now()};u&&(e.snipe=u),s.runtime.sendMessage(e).catch(()=>{}),G(`[you] ${u?"[Snipe Attached] ":""}${t||"Annotation attached"}`,"action"),w.value="",K()}Z.addEventListener("click",X);w.addEventListener("keydown",t=>{t.key==="Enter"&&X()});function v(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}b("idle");})();