sliccy 1.55.2 → 1.55.3
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/README.md +1 -1
- package/dist/ui/assets/{anthropic-Ctm13Y4z.js → anthropic-Boy3af-y.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-C0Fcf6OA.js → azure-openai-responses-G5rlwrl5.js} +1 -1
- package/dist/ui/assets/bsh-watchdog-BaiyTJC8.js +42 -0
- package/dist/ui/assets/{fs-BAlzVbQY.js → fs-udwNbj6g.js} +1 -1
- package/dist/ui/assets/{google-D_JFv6N-.js → google-CiqbbNbH.js} +1 -1
- package/dist/ui/assets/{google-gemini-cli-BjwSjH_H.js → google-gemini-cli-3AIzUCEY.js} +1 -1
- package/dist/ui/assets/{google-shared-1MEdugC3.js → google-shared-BQIq1jLR.js} +1 -1
- package/dist/ui/assets/{google-vertex-MzEI1-me.js → google-vertex-CYEauGk8.js} +1 -1
- package/dist/ui/assets/{index-l6Ye92eW.js → index-C2ORW6FF.js} +46 -45
- package/dist/ui/assets/lick-manager-SqoZzrt5.js +1 -0
- package/dist/ui/assets/{mistral-DcpebUMg.js → mistral-DlH9JH9-.js} +1 -1
- package/dist/ui/assets/openai-codex-responses-BAgPA0HP.js +7 -0
- package/dist/ui/assets/{openai-completions-CTyIshQV.js → openai-completions-CD0ojk0e.js} +1 -1
- package/dist/ui/assets/{openai-responses-DEGSelVp.js → openai-responses-CUf4U6xB.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-DQA10qMf.js → openai-responses-shared-DcVKlc8e.js} +1 -1
- package/dist/ui/assets/{provider-settings-ZCf9cqx-.js → provider-settings-B3VwS5n4.js} +2 -2
- package/dist/ui/assets/{provider-settings-ZR6mRmU_.js → provider-settings-DtthfIx_.js} +1 -1
- package/dist/ui/assets/providers-CBTIfSNw.js +1 -0
- package/dist/ui/assets/secret-env-C4IwrDk1.js +1 -0
- package/dist/ui/assets/shell-BvugiBi7.js +1 -0
- package/dist/ui/assets/{simple-options-FPdEz6rB.js → simple-options-DZXt61Q2.js} +1 -1
- package/dist/ui/assets/{skills-1dwuOQLz.js → skills-BQCgGxAq.js} +1 -1
- package/dist/ui/assets/{skills-Ojk3qFM4.js → skills-BU359a2n.js} +1 -1
- package/dist/ui/assets/sprinkle-renderer-Ci3F_XSt.js +1 -0
- package/dist/ui/index.html +5 -5
- package/dist/ui/packages/webapp/index.html +5 -5
- package/package.json +1 -1
- package/dist/ui/assets/bsh-watchdog-Dfc2Sii6.js +0 -43
- package/dist/ui/assets/lick-manager-CjiK3pMV.js +0 -1
- package/dist/ui/assets/openai-codex-responses-g4roCtlP.js +0 -7
- package/dist/ui/assets/providers-B1EDWfDV.js +0 -1
- package/dist/ui/assets/secret-env-CZ1iNnfN.js +0 -1
- package/dist/ui/assets/shell-CEWm93pE.js +0 -1
- package/dist/ui/assets/sprinkle-renderer-CoVBjTaw.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,l as r,o as i,r as a,s as o,t as s,u as c}from"./constants-Dqhmtsws.js";import{a as l,c as u,d,f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./skills-
|
|
1
|
+
import{a as e,c as t,d as n,l as r,o as i,r as a,s as o,t as s,u as c}from"./constants-Dqhmtsws.js";import{a as l,c as u,d,f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./skills-BU359a2n.js";export{s as MANIFEST_FILE,a as MAX_SKILL_ARCHIVE_SIZE_BYTES,e as SKILLS_DIR,i as SKILLS_SYSTEM_VERSION,o as SKILL_ARCHIVE_EXTENSION,t as SKILL_FILE,r as SLICC_DIR,c as STATE_FILE,n as WORKSPACE_SKILLS_PATH,x as applySkill,f as checkConflicts,y as checkDependencies,l as discoverSkillCandidates,_ as discoverSkills,u as getAppliedSkills,b as getSkillInfo,h as initSkillsSystem,d as installSkillFromDrop,g as parseManifestContent,p as readManifest,m as readSkillInstructions,C as readState,v as resolveSkillNameCollisions,S as uninstallSkill};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,d as t,f as n,l as r,n as i,o as a,s as o,t as s,u as c}from"./constants-Dqhmtsws.js";import{a as l,s as u}from"./fs-
|
|
1
|
+
import{c as e,d as t,f as n,l as r,n as i,o as a,s as o,t as s,u as c}from"./constants-Dqhmtsws.js";import{a as l,s as u}from"./fs-udwNbj6g.js";function d(e){let t={},n=e.split(`
|
|
2
2
|
`),r=null,i=!1,a={},o=null;for(let e of n){let n=e.trim();if(!n||n.startsWith(`#`))continue;if(n.startsWith(`- `)){let e=n.slice(2).trim();i&&o?o.push(e):r&&r.push(e);continue}let s=n.indexOf(`:`);if(s===-1)continue;let c=n.slice(0,s).trim(),l=n.slice(s+1).trim(),u=e.search(/\S/);if(c===`structured`){i=!0,a={},t.structured=a;continue}if(i&&u>=2){if(u>=4&&o)continue;l===``||l===`[]`?(o=[],a[c]=o):(a[c]=l,o=null);continue}u===0&&(i=!1),l===``||l===`[]`?(r=[],t[c]=r):(t[c]=l,r=null)}return t}function f(e,t=s){let n=d(e);if(!n.skill||typeof n.skill!=`string`)throw Error(`Invalid manifest: missing 'skill' field in ${t}`);if(!n.version||typeof n.version!=`string`)throw Error(`Invalid manifest: missing 'version' field in ${t}`);return{skill:n.skill,version:n.version,description:n.description||``,adds:n.adds||[],modifies:n.modifies||[],structured:n.structured,conflicts:n.conflicts||[],depends:n.depends||[],test:n.test,author:n.author}}async function p(e,t){let n=`${t}/${s}`;return f(await e.readTextFile(n),n)}function m(e,t){let n=(e.depends||[]).filter(e=>!t.includes(e));return{ok:n.length===0,missing:n}}function h(e,t){let n=(e.conflicts||[]).filter(e=>t.includes(e));return{ok:n.length===0,conflicting:n}}var g=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,_=class extends Error{};function v(e){return new TextDecoder().decode(e)}function y(e){let t=e.replace(/\\/g,`/`);if(!t||t.endsWith(`/`))return null;if(t.startsWith(`/`)||/^[A-Za-z]:\//.test(t))throw Error(`Blocked suspicious path "${e}".`);let n=t.split(`/`);if(n.some(e=>e===``||e===`.`||e===`..`))throw Error(`Blocked suspicious path "${e}".`);return n.join(`/`)}function b(e){if(!g.test(e))throw Error(`Invalid manifest: skill name "${e}" must be a simple directory name.`)}function x(e){let t=[];for(let[n,r]of Object.entries(e)){let e=y(n);e&&t.push({originalPath:n,path:e,bytes:r})}return t}function S(e){let t=e.filter(e=>e.path===`manifest.yaml`||e.path.endsWith(`/manifest.yaml`));if(t.length===0)throw Error(`Skill archive is missing ${s}.`);if(t.length>1)throw Error(`Skill archive contains multiple ${s} files.`);return t[0]}function C(e){let t=0,r=0;return n(e,{filter(e){if(t++,t>1e3)throw new _(`Skill archives may contain at most ${i} entries.`);if(r+=e.originalSize,r>52428800)throw new _(`Skill archives must expand to 50 MB or smaller after extraction.`);return!0}})}function w(e){return l(t,`.${e}.tmp-${`${Date.now()}-${Math.random().toString(16).slice(2,8)}`}`)}async function T(e,n){if(!n.name.toLowerCase().endsWith(`.skill`))throw Error(`Only ${o} archives can be installed with drag and drop.`);if(n.size>52428800)throw Error(`Skill archives must be 50 MB or smaller.`);let r;try{r=C(new Uint8Array(await n.arrayBuffer()))}catch(e){if(e instanceof _)throw e;let t=e instanceof Error?e.message:String(e);throw Error(`Invalid .skill archive: ${t}`)}let i=x(r),a=S(i),c=f(v(a.bytes),a.path);b(c.skill);let d=l(t,c.skill);if(await e.exists(d))throw Error(`Skill "${c.skill}" already exists at ${d}.`);let p=w(c.skill),m=a.path===`manifest.yaml`?``:a.path.slice(0,-(s.length+1));await e.mkdir(p,{recursive:!0});try{let t=0;for(let n of i){if(m&&(n.path===m||!n.path.startsWith(`${m}/`)))continue;let r=m?n.path.slice(m.length+1):n.path;if(!r)continue;let i=l(p,r),{dir:a}=u(i);a!==`/`&&await e.mkdir(a,{recursive:!0}),await e.writeFile(i,n.bytes),t++}return await e.rename(p,d),{skillName:c.skill,destinationPath:d,fileCount:t}}catch(t){throw await e.exists(p)&&await e.rm(p,{recursive:!0}),t}}var E=`/${r}/${c}`;async function D(e){try{await e.mkdir(`/${r}`)}catch{}try{await e.stat(E)}catch{let t={version:a,applied_skills:[]};await e.writeFile(E,JSON.stringify(t,null,2))}}async function O(e){try{let t=await e.readTextFile(E);return JSON.parse(t)}catch(e){if(typeof e==`object`&&e&&e.code===`ENOENT`)return{version:a,applied_skills:[]};throw e}}async function k(e,t){await D(e),await e.writeFile(E,JSON.stringify(t,null,2))}async function A(e){return(await O(e)).applied_skills.map(e=>e.name)}async function j(e,t){let n=await O(e);n.applied_skills=n.applied_skills.filter(e=>e.name!==t.name),n.applied_skills.push(t),await k(e,n)}async function M(e,t){let n=await O(e);n.applied_skills=n.applied_skills.filter(e=>e.name!==t),await k(e,n)}async function N(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function P(e){return e.startsWith(`/`)?{valid:!1,error:`Absolute path not allowed: ${e}`}:e.split(`/`).some(e=>e===`..`)?{valid:!1,error:`Path traversal not allowed: ${e}`}:e.includes(`%2e%2e`)||e.includes(`%2E%2E`)?{valid:!1,error:`Encoded path traversal not allowed: ${e}`}:{valid:!0}}async function F(e,t){let n=t.split(`/`).filter(Boolean),r=``;for(let t of n){r+=`/`+t;try{await e.mkdir(r)}catch{}}}async function I(e,t,n=`/workspace/skills`){let r=`${n}/${t}`;await D(e);let i;try{i=await p(e,r)}catch(e){return{success:!1,skill:t,version:`unknown`,error:`Failed to read manifest: ${e instanceof Error?e.message:String(e)}`}}if(i.skill!==t)return{success:!1,skill:t,version:i.version,error:`Manifest skill name "${i.skill}" does not match directory name "${t}"`};let a=await A(e);if(a.includes(i.skill))return{success:!1,skill:i.skill,version:i.version,error:`Skill "${i.skill}" is already installed`};let o=m(i,a);if(!o.ok)return{success:!1,skill:i.skill,version:i.version,error:`Missing dependencies: ${o.missing.join(`, `)}`};let s=h(i,a);if(!s.ok)return{success:!1,skill:i.skill,version:i.version,error:`Conflicting skills: ${s.conflicting.join(`, `)}`};let c={},l=[];try{if(i.adds&&i.adds.length>0)for(let t of i.adds){let n=P(t);if(!n.valid)return{success:!1,skill:i.skill,version:i.version,error:n.error};let a=`${r}/add/${t}`,o=`/${t}`;try{let n=o.substring(0,o.lastIndexOf(`/`));n&&await F(e,n),await e.copyFile(a,o),l.push(t),c[t]=await N(await e.readTextFile(o))}catch(e){return{success:!1,skill:i.skill,version:i.version,error:`Failed to copy ${t}: ${e instanceof Error?e.message:String(e)}`}}}if(i.modifies&&i.modifies.length>0)for(let t of i.modifies){let n=P(t);if(!n.valid)return{success:!1,skill:i.skill,version:i.version,error:n.error};let a=`${r}/modify/${t}`;try{let n=await e.readTextFile(a),r=``;try{r=await e.readTextFile(`/${t}`)}catch{}let i;if(n.includes(`// APPEND_AFTER:`)){let e=n.split(`
|
|
3
3
|
`),t=e.find(e=>e.includes(`// APPEND_AFTER:`))?.split(`// APPEND_AFTER:`)[1]?.trim(),a=e.filter(e=>!e.includes(`// APPEND_AFTER:`)).join(`
|
|
4
4
|
`);if(t&&r.includes(t)){let e=r.indexOf(t)+t.length,n=r.indexOf(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-C2ORW6FF.js";export{e as collectThemeCSS};
|
package/dist/ui/index.html
CHANGED
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>slicc</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-C2ORW6FF.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-zsgVPwQN.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ca-nBW7U.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/logger-B-No_qN_.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/fs-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/fs-udwNbj6g.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/env-api-keys-DlVZ9FrG.js">
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/simple-options-
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/simple-options-DZXt61Q2.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/json-parse-JW3qhabb.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/openai-Cn7eGqwa.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/tray-follower-status-BlQSlF6m.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/provider-settings-
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/provider-settings-B3VwS5n4.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/cost-command-Bipyal__.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/constants-Dqhmtsws.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/pako-djzWUVJp.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/cdp-B4yzwpE0.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/db-QbwB670D.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/magick-wasm-cJ5msdlA.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/skills-
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/skills-BU359a2n.js">
|
|
26
26
|
<link rel="stylesheet" crossorigin href="/assets/index-BeYOzORh.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>slicc</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-C2ORW6FF.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-zsgVPwQN.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ca-nBW7U.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/logger-B-No_qN_.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/fs-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/fs-udwNbj6g.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/env-api-keys-DlVZ9FrG.js">
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/simple-options-
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/simple-options-DZXt61Q2.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/json-parse-JW3qhabb.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/openai-Cn7eGqwa.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/tray-follower-status-BlQSlF6m.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/provider-settings-
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/provider-settings-B3VwS5n4.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/cost-command-Bipyal__.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/constants-Dqhmtsws.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/pako-djzWUVJp.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/cdp-B4yzwpE0.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/db-QbwB670D.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/magick-wasm-cJ5msdlA.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/skills-
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/skills-BU359a2n.js">
|
|
26
26
|
<link rel="stylesheet" crossorigin href="/assets/index-BeYOzORh.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
package/package.json
CHANGED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-B-No_qN_.js";var t=[`/workspace`,`/shared`];async function n(e){let n=[],i=new Set;for(let a of t)await e.exists(a)&&await r(e,a,n,i);return n}async function r(e,t,n,r){for await(let o of e.walk(t)){if(!o.endsWith(`.bsh`)||r.has(o))continue;r.add(o);let t=i(o);if(!t)continue;let s=await e.readFile(o,{encoding:`utf-8`}),c=a(typeof s==`string`?s:new TextDecoder().decode(s));n.push({path:o,hostnamePattern:t,matchPatterns:c})}}function i(e){let t=e.split(`/`).pop()??``;if(!t.endsWith(`.bsh`))return null;let n=t.slice(0,-4);return n?n.startsWith(`-.`)?`*`+n.slice(1):n:null}function a(e){let t=e.split(`
|
|
2
|
-
`).slice(0,10),n=[];for(let e of t){let t=e.match(/^\s*\/\/\s*@match\s+(.+)$/);t&&n.push(t[1].trim())}return n}function o(e,t){if(t.startsWith(`*.`)){let n=t.slice(1);return e===t.slice(2)||e.endsWith(n)&&e.length>n.length}return e===t}function s(e,t){try{let n=new URL(e),r=t.match(/^(\*|https?):\/\/([^/]+)(\/.*)?$/);if(!r)return!1;let[,i,a,s]=r;return i!==`*`&&n.protocol.slice(0,-1)!==i||!o(n.hostname,a)?!1:s?c(n.pathname+n.search,s):!0}catch{return!1}}function c(e,t){let n=`^`+t.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`)+`$`;return new RegExp(n).test(e)}function l(e,t){try{let n=new URL(t);return e.filter(e=>o(n.hostname,e.hostnamePattern)?e.matchPatterns.length>0?e.matchPatterns.some(e=>s(t,e)):!0:!1)}catch{return[]}}var u=e(`bsh-watchdog`),d=class{transport;browserAPI;fs;discoveryIntervalMs;watcher;watcherUnsubs=[];entries=[];discoveryTimer=null;running=!1;executing=new Set;constructor(e){if(!e.transport&&!e.browserAPI)throw Error(`BshWatchdog requires either transport or browserAPI`);this.browserAPI=e.browserAPI,this.transport=e.transport??e.browserAPI.getTransport(),this.fs=e.fs,this.discoveryIntervalMs=e.discoveryIntervalMs??1e4,this.watcher=e.watcher}async start(){if(!this.running){if(this.running=!0,await this.discover(),this.watcher){let e=e=>e.endsWith(`.bsh`);this.watcherUnsubs=[this.watcher.watch(`/workspace`,e,()=>void this.discover()),this.watcher.watch(`/shared`,e,()=>void this.discover())]}else this.discoveryTimer=setInterval(()=>{this.discover()},this.discoveryIntervalMs);this.transport.on(`Page.frameNavigated`,this.onFrameNavigated),this.browserAPI&&this.browserAPI.setSessionChangeCallback((e,t)=>{t!==this.transport&&this.setTransport(t)}),u.info(`BSH watchdog started`,{scriptCount:this.entries.length})}}stop(){if(this.running){this.running=!1,this.transport.off(`Page.frameNavigated`,this.onFrameNavigated),this.discoveryTimer&&=(clearInterval(this.discoveryTimer),null),this.browserAPI&&this.browserAPI.setSessionChangeCallback(void 0);for(let e of this.watcherUnsubs)e();this.watcherUnsubs=[],this.entries=[],this.executing.clear(),u.info(`BSH watchdog stopped`)}}setTransport(e){e!==this.transport&&(this.transport.off(`Page.frameNavigated`,this.onFrameNavigated),this.transport=e,this.running&&this.transport.on(`Page.frameNavigated`,this.onFrameNavigated),u.info(`BSH watchdog transport swapped`))}async discover(){try{this.entries=await n(this.fs),u.debug(`BSH discovery complete`,{count:this.entries.length})}catch(e){u.error(`BSH discovery failed`,{error:e instanceof Error?e.message:String(e)})}}getEntries(){return this.entries}onFrameNavigated=e=>{let t=e.frame;if(t?.parentId||!t?.url)return;let n=t.url,r=e.sessionId;if(!n.startsWith(`http://`)&&!n.startsWith(`https://`))return;if(!r){u.warn(`BSH watchdog: no sessionId in Page.frameNavigated params, skipping`,{url:n});return}if(this.entries.length===0)return;let i=l(this.entries,n);if(i.length!==0)for(let e of i){let t=`${e.path}::${n}`;this.executing.has(t)||(this.executing.add(t),u.info(`BSH watchdog executing script`,{script:e.path,url:n}),this.executeInTargetPage(e.path,n,r).then(()=>{u.info(`BSH script completed`,{script:e.path,url:n})}).catch(t=>{u.error(`BSH script execution error`,{script:e.path,url:n,error:t instanceof Error?t.message:String(t)})}).finally(()=>{this.executing.delete(t)}))}};async executeInTargetPage(e,t,n){let r=await this.fs.readFile(e),i=typeof r==`string`?r:new TextDecoder().decode(r),a=`(async () => {
|
|
3
|
-
const __requireSpecifiers = (function() {
|
|
4
|
-
const re = /require\\s*\\(\\s*['"]([^'"]+)['"]\\s*\\)/g;
|
|
5
|
-
const code = ${JSON.stringify(i)};
|
|
6
|
-
const specs = [];
|
|
7
|
-
let m;
|
|
8
|
-
while ((m = re.exec(code)) !== null) specs.push(m[1]);
|
|
9
|
-
return [...new Set(specs)];
|
|
10
|
-
})();
|
|
11
|
-
const __NODE_BUILTINS_UNAVAILABLE = new Set([
|
|
12
|
-
'http', 'https', 'net', 'tls', 'dgram', 'dns', 'cluster',
|
|
13
|
-
'worker_threads', 'child_process', 'crypto', 'os', 'stream',
|
|
14
|
-
'zlib', 'vm', 'v8', 'perf_hooks', 'readline', 'repl', 'tty', 'inspector',
|
|
15
|
-
'fs'
|
|
16
|
-
]);
|
|
17
|
-
const __requireCache = Object.create(null);
|
|
18
|
-
const __uncached = __requireSpecifiers.filter(id => {
|
|
19
|
-
const bare = id.startsWith('node:') ? id.slice(5) : id;
|
|
20
|
-
return !__NODE_BUILTINS_UNAVAILABLE.has(bare) && bare !== 'buffer';
|
|
21
|
-
});
|
|
22
|
-
await Promise.allSettled(__uncached.map(async (id) => {
|
|
23
|
-
try {
|
|
24
|
-
const mod = await import('https://esm.sh/' + id);
|
|
25
|
-
__requireCache[id] = mod.default !== undefined ? mod.default : mod;
|
|
26
|
-
} catch(e) { /* will throw at require() call time */ }
|
|
27
|
-
}));
|
|
28
|
-
const require = (id) => {
|
|
29
|
-
const bareId = id.startsWith('node:') ? id.slice(5) : id;
|
|
30
|
-
if (bareId === 'buffer' && typeof Buffer !== 'undefined') return { Buffer };
|
|
31
|
-
if (__NODE_BUILTINS_UNAVAILABLE.has(bareId)) {
|
|
32
|
-
const __suggestions = { http: ' Use fetch() instead.', https: ' Use fetch() instead.', crypto: ' Use globalThis.crypto (Web Crypto API) instead.' };
|
|
33
|
-
const __hint = __suggestions[bareId] || '';
|
|
34
|
-
throw new Error("require('" + id + "'): Node built-in '" + bareId + "' is not available in the browser environment." + __hint);
|
|
35
|
-
}
|
|
36
|
-
if (bareId in __requireCache) return __requireCache[bareId];
|
|
37
|
-
if (id in __requireCache) return __requireCache[id];
|
|
38
|
-
throw new Error("require('" + id + "'): module not pre-loaded. Use a string literal or await import('https://esm.sh/" + id + "') directly.");
|
|
39
|
-
};
|
|
40
|
-
try {
|
|
41
|
-
${i}
|
|
42
|
-
} catch(e) { console.error('[bsh]', e); }
|
|
43
|
-
})()`;await this.transport.send(`Runtime.enable`,{},n);let o=(await this.transport.send(`Runtime.evaluate`,{expression:a,awaitPromise:!0,returnByValue:!0},n)).exceptionDetails;if(o){let n=o.exception?.description??o.text;u.warn(`BSH script evaluation error`,{script:e,url:t,error:n})}}};export{d as BshWatchdog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./index-l6Ye92eW.js";export{e as getLickManager};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./preload-helper-ca-nBW7U.js";import{t}from"./env-api-keys-DlVZ9FrG.js";import{a as n,d as r,n as i,r as a}from"./simple-options-FPdEz6rB.js";import{n as o,r as s,t as c}from"./openai-responses-shared-DQA10qMf.js";var l=null;typeof process<`u`&&(process.versions?.node||process.versions?.bun)&&(t=>e(()=>import(t),[]))(`node:os`).then(e=>{l=e});var u=`https://chatgpt.com/backend-api`,d=`https://api.openai.com/auth`,f=3,p=1e3,m=new Set([`openai`,`openai-codex`,`opencode`]),h=new Set([`completed`,`incomplete`,`failed`,`cancelled`,`queued`,`in_progress`]);function g(e,t){return e===429||e===500||e===502||e===503||e===504?!0:/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test(t)}function _(e,t){return new Promise((n,r)=>{if(t?.aborted){r(Error(`Request was aborted`));return}let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(Error(`Request was aborted`))})})}var v=(e,r,i)=>{let a=new n;return(async()=>{let n={role:`assistant`,content:[],api:`openai-codex-responses`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=i?.apiKey||t(e.provider)||``;if(!o)throw Error(`No API key for provider: ${e.provider}`);let s=G(o),c=b(e,r,i),l=await i?.onPayload?.(c,e);l!==void 0&&(c=l);let u=i?.sessionId||K(),d=J(e.headers,i?.headers,s,o,i?.sessionId),m=Y(e.headers,i?.headers,s,o,u),h=JSON.stringify(c),v=i?.transport||`sse`;if(v!==`sse`){let t=!1;try{if(await U(C(e.baseUrl),c,m,n,a,e,()=>{t=!0},i),i?.signal?.aborted)throw Error(`Request was aborted`);a.push({type:`done`,reason:n.stopReason,message:n}),a.end();return}catch(e){if(v===`websocket`||t)throw e}}let y,x;for(let t=0;t<=f;t++){if(i?.signal?.aborted)throw Error(`Request was aborted`);try{if(y=await fetch(S(e.baseUrl),{method:`POST`,headers:d,body:h,signal:i?.signal}),y.ok)break;let n=await y.text();if(t<f&&g(y.status,n)){await _(p*2**t,i?.signal);continue}let r=await W(new Response(n,{status:y.status,statusText:y.statusText}));throw Error(r.friendlyMessage||r.message)}catch(e){if(e instanceof Error&&(e.name===`AbortError`||e.message===`Request was aborted`))throw Error(`Request was aborted`);if(x=e instanceof Error?e:Error(String(e)),t<f&&!x.message.includes(`usage limit`)){await _(p*2**t,i?.signal);continue}throw x}}if(!y?.ok)throw x??Error(`Failed after retries`);if(!y.body)throw Error(`No response body`);if(a.push({type:`start`,partial:n}),await w(y,n,a,e),i?.signal?.aborted)throw Error(`Request was aborted`);a.push({type:`done`,reason:n.stopReason,message:n}),a.end()}catch(e){n.stopReason=i?.signal?.aborted?`aborted`:`error`,n.errorMessage=e instanceof Error?e.message:String(e),a.push({type:`error`,reason:n.stopReason,error:n}),a.end()}})(),a},y=(e,n,o)=>{let s=o?.apiKey||t(e.provider);if(!s)throw Error(`No API key for provider: ${e.provider}`);let c=i(e,o,s),l=r(e)?o?.reasoning:a(o?.reasoning);return v(e,n,{...c,reasoningEffort:l})};function b(e,t,n){let r=c(e,t,m,{includeSystemPrompt:!1}),i={model:e.id,store:!1,stream:!0,instructions:t.systemPrompt,input:r,text:{verbosity:n?.textVerbosity||`medium`},include:[`reasoning.encrypted_content`],prompt_cache_key:n?.sessionId,tool_choice:`auto`,parallel_tool_calls:!0};return n?.temperature!==void 0&&(i.temperature=n.temperature),t.tools&&(i.tools=o(t.tools,{strict:null})),n?.reasoningEffort!==void 0&&(i.reasoning={effort:x(e.id,n.reasoningEffort),summary:n.reasoningSummary??`auto`}),i}function x(e,t){let n=e.includes(`/`)?e.split(`/`).pop():e;return(n.startsWith(`gpt-5.2`)||n.startsWith(`gpt-5.3`)||n.startsWith(`gpt-5.4`))&&t===`minimal`?`low`:n===`gpt-5.1`&&t===`xhigh`?`high`:n===`gpt-5.1-codex-mini`?t===`high`||t===`xhigh`?`high`:`medium`:t}function S(e){let t=(e&&e.trim().length>0?e:u).replace(/\/+$/,``);return t.endsWith(`/codex/responses`)?t:t.endsWith(`/codex`)?`${t}/responses`:`${t}/codex/responses`}function C(e){let t=new URL(S(e));return t.protocol===`https:`&&(t.protocol=`wss:`),t.protocol===`http:`&&(t.protocol=`ws:`),t.toString()}async function w(e,t,n,r){await s(T(D(e)),t,n,r)}async function*T(e){for await(let t of e){let e=typeof t.type==`string`?t.type:void 0;if(e){if(e===`error`){let e=t.code||``,n=t.message||``;throw Error(`Codex error: ${n||e||JSON.stringify(t)}`)}if(e===`response.failed`){let e=t.response?.error?.message;throw Error(e||`Codex response failed`)}if(e===`response.done`||e===`response.completed`||e===`response.incomplete`){let e=t.response,n=e&&{...e,status:E(e.status)};yield{...t,type:`response.completed`,response:n};return}yield t}}}function E(e){if(typeof e==`string`)return h.has(e)?e:void 0}async function*D(e){if(!e.body)return;let t=e.body.getReader(),n=new TextDecoder,r=``;try{for(;;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.indexOf(`
|
|
2
|
-
|
|
3
|
-
`);for(;a!==-1;){let e=r.slice(0,a);r=r.slice(a+2);let t=e.split(`
|
|
4
|
-
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim());if(t.length>0){let e=t.join(`
|
|
5
|
-
`).trim();if(e&&e!==`[DONE]`)try{yield JSON.parse(e)}catch{}}a=r.indexOf(`
|
|
6
|
-
|
|
7
|
-
`)}}}finally{try{await t.cancel()}catch{}try{t.releaseLock()}catch{}}}var O=`responses_websockets=2026-02-06`,k=300*1e3,A=new Map;function j(){let e=globalThis.WebSocket;return typeof e==`function`?e:null}function M(e){let t={};for(let[n,r]of e.entries())t[n]=r;return t}function N(e){let t=e.readyState;return typeof t==`number`?t:void 0}function P(e){let t=N(e);return t===void 0||t===1}function F(e,t=1e3,n=`done`){try{e.close(t,n)}catch{}}function I(e,t){t.idleTimer&&clearTimeout(t.idleTimer),t.idleTimer=setTimeout(()=>{t.busy||(F(t.socket,1e3,`idle_timeout`),A.delete(e))},k)}async function L(e,t,n){let r=j();if(!r)throw Error(`WebSocket transport is not available in this runtime`);let i=M(t);return delete i[`OpenAI-Beta`],new Promise((t,a)=>{let o=!1,s;try{s=new r(e,{headers:i})}catch(e){a(e instanceof Error?e:Error(String(e)));return}let c=()=>{o||(o=!0,f(),t(s))},l=e=>{let t=z(e);o||(o=!0,f(),a(t))},u=e=>{let t=B(e);o||(o=!0,f(),a(t))},d=()=>{o||(o=!0,f(),s.close(1e3,`aborted`),a(Error(`Request was aborted`)))},f=()=>{s.removeEventListener(`open`,c),s.removeEventListener(`error`,l),s.removeEventListener(`close`,u),n?.removeEventListener(`abort`,d)};s.addEventListener(`open`,c),s.addEventListener(`error`,l),s.addEventListener(`close`,u),n?.addEventListener(`abort`,d)})}async function R(e,t,n,r){if(!n){let n=await L(e,t,r);return{socket:n,release:({keep:e}={})=>{if(e===!1){F(n);return}F(n)}}}let i=A.get(n);if(i){if(i.idleTimer&&=(clearTimeout(i.idleTimer),void 0),!i.busy&&P(i.socket))return i.busy=!0,{socket:i.socket,release:({keep:e}={})=>{if(!e||!P(i.socket)){F(i.socket),A.delete(n);return}i.busy=!1,I(n,i)}};if(i.busy){let n=await L(e,t,r);return{socket:n,release:()=>{F(n)}}}P(i.socket)||(F(i.socket),A.delete(n))}let a=await L(e,t,r),o={socket:a,busy:!0};return A.set(n,o),{socket:a,release:({keep:e}={})=>{if(!e||!P(o.socket)){F(o.socket),o.idleTimer&&clearTimeout(o.idleTimer),A.get(n)===o&&A.delete(n);return}o.busy=!1,I(n,o)}}}function z(e){if(e&&typeof e==`object`&&`message`in e){let t=e.message;if(typeof t==`string`&&t.length>0)return Error(t)}return Error(`WebSocket error`)}function B(e){if(e&&typeof e==`object`){let t=`code`in e?e.code:void 0,n=`reason`in e?e.reason:void 0,r=typeof t==`number`?` ${t}`:``,i=typeof n==`string`&&n.length>0?` ${n}`:``;return Error(`WebSocket closed${r}${i}`.trim())}return Error(`WebSocket closed`)}async function V(e){if(typeof e==`string`)return e;if(e instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(e));if(ArrayBuffer.isView(e)){let t=e;return new TextDecoder().decode(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}if(e&&typeof e==`object`&&`arrayBuffer`in e){let t=await e.arrayBuffer();return new TextDecoder().decode(new Uint8Array(t))}return null}async function*H(e,t){let n=[],r=null,i=!1,a=null,o=!1,s=()=>{if(!r)return;let e=r;r=null,e()},c=e=>{(async()=>{if(!e||typeof e!=`object`||!(`data`in e))return;let t=await V(e.data);if(t)try{let e=JSON.parse(t),r=typeof e.type==`string`?e.type:``;(r===`response.completed`||r===`response.done`||r===`response.incomplete`)&&(o=!0,i=!0),n.push(e),s()}catch{}})()},l=e=>{a=z(e),i=!0,s()},u=e=>{if(o){i=!0,s();return}a||=B(e),i=!0,s()},d=()=>{a=Error(`Request was aborted`),i=!0,s()};e.addEventListener(`message`,c),e.addEventListener(`error`,l),e.addEventListener(`close`,u),t?.addEventListener(`abort`,d);try{for(;;){if(t?.aborted)throw Error(`Request was aborted`);if(n.length>0){yield n.shift();continue}if(i)break;await new Promise(e=>{r=e})}if(a)throw a;if(!o)throw Error(`WebSocket stream closed before response.completed`)}finally{e.removeEventListener(`message`,c),e.removeEventListener(`error`,l),e.removeEventListener(`close`,u),t?.removeEventListener(`abort`,d)}}async function U(e,t,n,r,i,a,o,c){let{socket:l,release:u}=await R(e,n,c?.sessionId,c?.signal),d=!0;try{l.send(JSON.stringify({type:`response.create`,...t})),o(),i.push({type:`start`,partial:r}),await s(T(H(l,c?.signal)),r,i,a),c?.signal?.aborted&&(d=!1)}catch(e){throw d=!1,e}finally{u({keep:d})}}async function W(e){let t=await e.text(),n=t||e.statusText||`Request failed`,r;try{let i=JSON.parse(t)?.error;if(i){let t=i.code||i.type||``;if(/usage_limit_reached|usage_not_included|rate_limit_exceeded/i.test(t)||e.status===429){let e=i.plan_type?` (${i.plan_type.toLowerCase()} plan)`:``,t=i.resets_at?Math.max(0,Math.round((i.resets_at*1e3-Date.now())/6e4)):void 0;r=`You have hit your ChatGPT usage limit${e}.${t===void 0?``:` Try again in ~${t} min.`}`.trim()}n=i.message||r||n}}catch{}return{message:n,friendlyMessage:r}}function G(e){try{let t=e.split(`.`);if(t.length!==3)throw Error(`Invalid token`);let n=JSON.parse(atob(t[1]))?.[d]?.chatgpt_account_id;if(!n)throw Error(`No account ID in token`);return n}catch{throw Error(`Failed to extract accountId from token`)}}function K(){return typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():`codex_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}function q(e,t,n,r){let i=new Headers(e);for(let[e,n]of Object.entries(t||{}))i.set(e,n);i.set(`Authorization`,`Bearer ${r}`),i.set(`chatgpt-account-id`,n),i.set(`originator`,`pi`);let a=l?`pi (${l.platform()} ${l.release()}; ${l.arch()})`:`pi (browser)`;return i.set(`User-Agent`,a),i}function J(e,t,n,r,i){let a=q(e,t,n,r);return a.set(`OpenAI-Beta`,`responses=experimental`),a.set(`accept`,`text/event-stream`),a.set(`content-type`,`application/json`),i&&a.set(`session_id`,i),a}function Y(e,t,n,r,i){let a=q(e,t,n,r);return a.delete(`accept`),a.delete(`content-type`),a.delete(`OpenAI-Beta`),a.delete(`openai-beta`),a.set(`OpenAI-Beta`,O),a.set(`x-client-request-id`,i),a.set(`session_id`,i),a}export{v as streamOpenAICodexResponses,y as streamSimpleOpenAICodexResponses};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e,E as t}from"./provider-settings-ZCf9cqx-.js";export{t as getRegisteredProviderConfig,e as getRegisteredProviderIds};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./index-l6Ye92eW.js";export{e as fetchSecretEnvVars};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./index-l6Ye92eW.js";export{e as WasmShell};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./index-l6Ye92eW.js";export{e as collectThemeCSS};
|