sliccy 1.11.3 → 1.12.1

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.
@@ -1 +1 @@
1
- import{_ as e}from"./__vite-browser-external-D7Ct-6yo.js";import{g as r}from"./index-CszlSH8q.js";const a=r(e);export{a as r};
1
+ import{_ as e}from"./__vite-browser-external-D7Ct-6yo.js";import{g as r}from"./index-Dnh8MClc.js";const a=r(e);export{a as r};
@@ -1,2 +1,2 @@
1
- import{c as u}from"./index-CszlSH8q.js";const l=["/workspace","/shared"];async function d(s){const t=[],e=new Set;for(const r of l)await s.exists(r)&&await p(s,r,t,e);return t}async function p(s,t,e,r){for await(const n of s.walk(t)){if(!n.endsWith(".bsh")||r.has(n))continue;r.add(n);const i=g(n);if(!i)continue;const a=await s.readFile(n,{encoding:"utf-8"}),c=typeof a=="string"?a:new TextDecoder().decode(a),f=m(c);e.push({path:n,hostnamePattern:i,matchPatterns:f})}}function g(s){const t=s.split("/").pop()??"";if(!t.endsWith(".bsh"))return null;const e=t.slice(0,-4);return e?e.startsWith("-.")?"*"+e.slice(1):e:null}function m(s){const t=s.split(`
1
+ import{c as u}from"./index-Dnh8MClc.js";const l=["/workspace","/shared"];async function d(s){const t=[],e=new Set;for(const r of l)await s.exists(r)&&await p(s,r,t,e);return t}async function p(s,t,e,r){for await(const n of s.walk(t)){if(!n.endsWith(".bsh")||r.has(n))continue;r.add(n);const i=g(n);if(!i)continue;const a=await s.readFile(n,{encoding:"utf-8"}),c=typeof a=="string"?a:new TextDecoder().decode(a),f=m(c);e.push({path:n,hostnamePattern:i,matchPatterns:f})}}function g(s){const t=s.split("/").pop()??"";if(!t.endsWith(".bsh"))return null;const e=t.slice(0,-4);return e?e.startsWith("-.")?"*"+e.slice(1):e:null}function m(s){const t=s.split(`
2
2
  `).slice(0,10),e=[];for(const r of t){const n=r.match(/^\s*\/\/\s*@match\s+(.+)$/);n&&e.push(n[1].trim())}return e}function h(s,t){if(t.startsWith("*.")){const e=t.slice(1);return s.endsWith(e)&&s.length>e.length}return s===t}function v(s,t){try{const e=new URL(s),r=t.match(/^(\*|https?):\/\/([^/]+)(\/.*)?$/);if(!r)return!1;const[,n,i,a]=r;return n!=="*"&&e.protocol.slice(0,-1)!==n||!h(e.hostname,i)?!1:a?x(e.pathname+e.search,a):!0}catch{return!1}}function x(s,t){const e="^"+t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(e).test(s)}function w(s,t){try{const e=new URL(t);return s.filter(r=>h(e.hostname,r.hostnamePattern)?r.matchPatterns.length>0?r.matchPatterns.some(n=>v(t,n)):!0:!1)}catch{return[]}}const o=u("bsh-watchdog");class S{transport;fs;execute;discoveryIntervalMs;entries=[];discoveryTimer=null;running=!1;executing=new Set;constructor(t){this.transport=t.transport,this.fs=t.fs,this.execute=t.execute,this.discoveryIntervalMs=t.discoveryIntervalMs??3e4}async start(){this.running||(this.running=!0,await this.discover(),this.discoveryTimer=setInterval(()=>{this.discover()},this.discoveryIntervalMs),this.transport.on("Page.frameNavigated",this.onFrameNavigated),o.info("BSH watchdog started",{scriptCount:this.entries.length}))}stop(){this.running&&(this.running=!1,this.transport.off("Page.frameNavigated",this.onFrameNavigated),this.discoveryTimer&&(clearInterval(this.discoveryTimer),this.discoveryTimer=null),this.entries=[],this.executing.clear(),o.info("BSH watchdog stopped"))}async discover(){try{this.entries=await d(this.fs),o.debug("BSH discovery complete",{count:this.entries.length})}catch(t){o.error("BSH discovery failed",{error:t instanceof Error?t.message:String(t)})}}getEntries(){return this.entries}onFrameNavigated=t=>{const e=t.frame;if(e?.parentId||!e?.url)return;const r=e.url;if(!r.startsWith("http://")&&!r.startsWith("https://")||this.entries.length===0)return;const n=w(this.entries,r);if(n.length!==0)for(const i of n){const a=`${i.path}::${r}`;this.executing.has(a)||(this.executing.add(a),o.info("BSH watchdog executing script",{script:i.path,url:r}),this.execute(i.path).then(c=>{c.exitCode!==0?o.warn("BSH script failed",{script:i.path,url:r,exitCode:c.exitCode,stderr:c.stderr.slice(0,200)}):o.info("BSH script completed",{script:i.path,url:r})}).catch(c=>{o.error("BSH script execution error",{script:i.path,url:r,error:c instanceof Error?c.message:String(c)})}).finally(()=>{this.executing.delete(a)}))}}}export{S as BshWatchdog};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CszlSH8q.js","assets/index-D2mLc9tI.css"])))=>i.map(i=>d[i]);
2
- import{_ as c}from"./index-CszlSH8q.js";const o={origins:["<all_urls>"]};async function d(){return chrome.permissions.contains(o)}async function l(){return chrome.permissions.request(o)}function f(s){chrome.permissions.onRemoved.addListener(n=>{n.origins?.includes("<all_urls>")&&s()})}const u=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dnh8MClc.js","assets/index-D2mLc9tI.css"])))=>i.map(i=>d[i]);
2
+ import{_ as c}from"./index-Dnh8MClc.js";const o={origins:["<all_urls>"]};async function d(){return chrome.permissions.contains(o)}async function l(){return chrome.permissions.request(o)}function f(s){chrome.permissions.onRemoved.addListener(n=>{n.origins?.includes("<all_urls>")&&s()})}const u=`
3
3
  <div class="sprinkle-action-card">
4
4
  <div class="sprinkle-action-card__header">Web access required <span class="sprinkle-badge sprinkle-badge--notice">approval</span></div>
5
5
  <div class="sprinkle-action-card__body">The agent needs permission to access web pages for cross-origin requests. This enables fetching external resources and connecting to APIs.</div>
@@ -8,4 +8,4 @@ import{_ as c}from"./index-CszlSH8q.js";const o={origins:["<all_urls>"]};async f
8
8
  <button class="sprinkle-btn sprinkle-btn--primary" data-action="grant">Grant access</button>
9
9
  </div>
10
10
  </div>
11
- `;async function g(){if(!(typeof chrome<"u"&&!!chrome?.runtime?.id)||await d())return!0;const{getToolExecutionContext:n,showToolUIFromContext:i}=await c(async()=>{const{getToolExecutionContext:e,showToolUIFromContext:r}=await import("./index-CszlSH8q.js").then(a=>a.N);return{getToolExecutionContext:e,showToolUIFromContext:r}},__vite__mapDeps([0,1]));if(!n())return!1;const t=await i({html:u,onAction:async e=>e==="grant"?{granted:await l()}:{denied:!0}});return t?!!t.granted:!1}export{g as ensureHostPermission,d as hasHostPermission,f as onHostPermissionRevoked,l as requestHostPermission};
11
+ `;async function g(){if(!(typeof chrome<"u"&&!!chrome?.runtime?.id)||await d())return!0;const{getToolExecutionContext:n,showToolUIFromContext:i}=await c(async()=>{const{getToolExecutionContext:e,showToolUIFromContext:r}=await import("./index-Dnh8MClc.js").then(a=>a.N);return{getToolExecutionContext:e,showToolUIFromContext:r}},__vite__mapDeps([0,1]));if(!n())return!1;const t=await i({html:u,onAction:async e=>e==="grant"?{granted:await l()}:{denied:!0}});return t?!!t.granted:!1}export{g as ensureHostPermission,d as hasHostPermission,f as onHostPermissionRevoked,l as requestHostPermission};
@@ -1 +1 @@
1
- import{requestHostPermission as d}from"./host-permission-DHN0LidV.js";import"./index-CszlSH8q.js";function p(a,i){return new Promise(c=>{const e=document.createElement("div");e.className="dialog-overlay";const t=document.createElement("div");t.className="dialog",t.style.maxWidth="420px",t.innerHTML=['<div class="dialog__title">Web access required</div>','<div class="dialog__desc">',`slicc needs permission to access web pages to <strong>${r(i)}</strong>. `,"This lets the agent interact with websites on your behalf. ","No browsing data is collected — all processing stays local.","</div>",'<div class="dialog__desc" style="font-size: 11px; opacity: 0.7;">',"You can revoke this anytime in chrome://extensions.","</div>",'<div style="display:flex;gap:8px;margin-top:16px;">','<button class="dialog__btn--secondary" style="flex:1;" data-action="dismiss">Not now</button>','<button class="dialog__btn" style="flex:1;width:auto;" data-action="grant">Grant access</button>',"</div>"].join(""),e.appendChild(t);function n(s){e.remove(),c(s)}t.addEventListener("click",async s=>{const o=s.target.dataset?.action;if(o==="grant"){const l=await d();n(l)}else o==="dismiss"&&n(!1)}),e.addEventListener("click",s=>{s.target===e&&n(!1)}),a.appendChild(e)})}function r(a){const i=document.createElement("div");return i.textContent=a,i.innerHTML}export{p as showHostPermissionDialog};
1
+ import{requestHostPermission as d}from"./host-permission-Bu0g7HFD.js";import"./index-Dnh8MClc.js";function p(a,i){return new Promise(c=>{const e=document.createElement("div");e.className="dialog-overlay";const t=document.createElement("div");t.className="dialog",t.style.maxWidth="420px",t.innerHTML=['<div class="dialog__title">Web access required</div>','<div class="dialog__desc">',`slicc needs permission to access web pages to <strong>${r(i)}</strong>. `,"This lets the agent interact with websites on your behalf. ","No browsing data is collected — all processing stays local.","</div>",'<div class="dialog__desc" style="font-size: 11px; opacity: 0.7;">',"You can revoke this anytime in chrome://extensions.","</div>",'<div style="display:flex;gap:8px;margin-top:16px;">','<button class="dialog__btn--secondary" style="flex:1;" data-action="dismiss">Not now</button>','<button class="dialog__btn" style="flex:1;width:auto;" data-action="grant">Grant access</button>',"</div>"].join(""),e.appendChild(t);function n(s){e.remove(),c(s)}t.addEventListener("click",async s=>{const o=s.target.dataset?.action;if(o==="grant"){const l=await d();n(l)}else o==="dismiss"&&n(!1)}),e.addEventListener("click",s=>{s.target===e&&n(!1)}),a.appendChild(e)})}function r(a){const i=document.createElement("div");return i.textContent=a,i.innerHTML}export{p as showHostPermissionDialog};