sliccy 6.105.0 → 6.105.2
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/dist/node-server/_cloud_core/src/operations/list.d.ts.map +1 -1
- package/dist/node-server/_cloud_core/src/operations/list.js +149 -115
- package/dist/node-server/_shared/tray-signaling.d.ts +28 -1
- package/dist/node-server/_shared/tray-signaling.d.ts.map +1 -1
- package/dist/node-server/_shared/tray-signaling.js.map +1 -1
- package/dist/node-server/routes/lick-api.js +71 -4
- package/dist/ui/.vite/manifest.json +127 -127
- package/dist/ui/assets/SKILL-Boj7N1xe.js +1 -0
- package/dist/ui/assets/{account-store-DG6fHM_V.js → account-store-BaTmqQCH.js} +1 -1
- package/dist/ui/assets/{account-store-ChIwciCW.js → account-store-CHgSp6SB.js} +1 -1
- package/dist/ui/assets/{adobe-3WjIpRUT.js → adobe-CH2DsFrY.js} +1 -1
- package/dist/ui/assets/{adobe-DJkbFq9G.js → adobe-CpalWkIK.js} +1 -1
- package/dist/ui/assets/{agent-panels-tKYkUvdP.js → agent-panels-OnTGHQkG.js} +1 -1
- package/dist/ui/assets/{apply-layout-CM3LBbqI.js → apply-layout-B4zUEdwn.js} +1 -1
- package/dist/ui/assets/{apps-DjfwghFw.js → apps-KhIC51KH.js} +1 -1
- package/dist/ui/assets/{azure-openai-BdYS25f_.js → azure-openai-DzFu6LbW.js} +1 -1
- package/dist/ui/assets/{azure-openai-CtbbffyG.js → azure-openai-uxQv3w4B.js} +1 -1
- package/dist/ui/assets/cdp-ws-page-bridge-DI26JBMr.js +1 -0
- package/dist/ui/assets/{cerebras-cVRZgXZu.js → cerebras-r-in8Inh.js} +1 -1
- package/dist/ui/assets/{cerebras-cB1Un2e8.js → cerebras-uwqZLHdF.js} +1 -1
- package/dist/ui/assets/{connect-surface-DT_tKlEJ.js → connect-surface-COZ8qeD4.js} +1 -1
- package/dist/ui/assets/{dist-N1MMHRNk.js → dist-CIyvNQb4.js} +3 -3
- package/dist/ui/assets/{dist-BmTb9jmr.js → dist-CLbkZ_1_.js} +1 -1
- package/dist/ui/assets/{dist-BnDrtqYs.js → dist-ChNj9ewx.js} +1 -1
- package/dist/ui/assets/{dist-RekgwRC0.js → dist-DhiPJE96.js} +3 -3
- package/dist/ui/assets/{fs-C343c9le.js → fs-B7WAwF-q.js} +1 -1
- package/dist/ui/assets/{fs-CZt4jt7E.js → fs-CiufgGRG.js} +2 -2
- package/dist/ui/assets/{github-0N7JEs6o.js → github-C3CflEFq.js} +1 -1
- package/dist/ui/assets/{github-CbTrlTDc.js → github-CUPlgkJ4.js} +2 -2
- package/dist/ui/assets/{github-copilot-D8KEH9_8.js → github-copilot-BGah-ri-.js} +1 -1
- package/dist/ui/assets/{github-copilot-B_sSIHQ9.js → github-copilot-DnK9K-w0.js} +1 -1
- package/dist/ui/assets/{github-install-CORVkVS2.js → github-install-B3PxKIA9.js} +1 -1
- package/dist/ui/assets/{github-zip-Cx9nWjUO.js → github-zip-DlpU53sL.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-5ergWUC8.js → js-realm-worker-zKU0v1vE.js} +1 -1
- package/dist/ui/assets/{kernel-worker-DAg1kk9T.js → kernel-worker-v5zxjG5E.js} +596 -596
- package/dist/ui/assets/lick-manager-DsQLFcKr.js +2 -0
- package/dist/ui/assets/{lick-manager-proxy-B953oJ2Q.js → lick-manager-proxy-DMaLHm_t.js} +1 -1
- package/dist/ui/assets/lick-ws-bridge-1UPwiSVX.js +1 -0
- package/dist/ui/assets/{local-llm-D7TUI-yw.js → local-llm-D-etSg11.js} +1 -1
- package/dist/ui/assets/{local-llm-BaGh_ZI-.js → local-llm-M_xiCmuW.js} +1 -1
- package/dist/ui/assets/{main-BcZbFpyc.js → main-BcfY0APV.js} +3 -3
- package/dist/ui/assets/{mount-3rB1M3LV.js → mount-Bx3D0gVr.js} +2 -2
- package/dist/ui/assets/{mount-ctgoIoWo.js → mount-CHtLYCJk.js} +1 -1
- package/dist/ui/assets/{mount-recovery-g_5aJYzL.js → mount-recovery-DL9GlfHA.js} +1 -1
- package/dist/ui/assets/new-session-COA3q4w7.js +2 -0
- package/dist/ui/assets/{oauth-bootstrap-yw-xe8Vv.js → oauth-bootstrap-BPR0IgmZ.js} +2 -2
- package/dist/ui/assets/{onboarding-orchestrator-B-FUyeGB.js → onboarding-orchestrator-5WhumpNJ.js} +1 -1
- package/dist/ui/assets/{openai-codex-BFok3oyS.js → openai-codex-CjwoH0Hy.js} +1 -1
- package/dist/ui/assets/{openai-codex-cLIR3T6l.js → openai-codex-pUiCqrNz.js} +1 -1
- package/dist/ui/assets/{openrouter-FWB-kSYo.js → openrouter-BCxd8O71.js} +1 -1
- package/dist/ui/assets/{openrouter-CDPyW_TQ.js → openrouter-CdL4vTyx.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DAARzo5S.js → openrouter-oauth-CsUVNT2k.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DZirIqg2.js → openrouter-oauth-Dj48fB3X.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-DrqsnYA3.js → panel-rpc-handlers-QwtLrbX7.js} +2 -2
- package/dist/ui/assets/{panelize-shell-giUuZ6dY.js → panelize-shell-CPME7tYP.js} +1 -1
- package/dist/ui/assets/provider-CKVeq844.js +2 -0
- package/dist/ui/assets/{provider-DUYOy2mD.js → provider-CR46uvW6.js} +1 -1
- package/dist/ui/assets/{provider-settings-Cw0rYGSz.js → provider-settings-e94aWkxT.js} +1 -1
- package/dist/ui/assets/provider-store-access-CamE9gn8.js +1 -0
- package/dist/ui/assets/provider-store-access-wSpMHw1M.js +1 -0
- package/dist/ui/assets/{providers-zHBaRRbi.js → providers-Bpgm6hcR.js} +1 -1
- package/dist/ui/assets/{providers-EvW22h9s.js → providers-N-GzEZuq.js} +2 -2
- package/dist/ui/assets/{quick-llm-CCC28hMC.js → quick-llm-Dx10uCk3.js} +1 -1
- package/dist/ui/assets/{recovery-screen-DRwDpcP6.js → recovery-screen-Xm3PO1gX.js} +1 -1
- package/dist/ui/assets/{redirect-uri-BUHYoStY.js → redirect-uri-BiQsjA10.js} +1 -1
- package/dist/ui/assets/{run-DL-Uxc18.js → run-Bu6cgQMI.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-Czi_ny8P.js → setup-feature-flags-remote-Cf37xnQ1.js} +1 -1
- package/dist/ui/assets/sidecar-repair-6yH0jK3Q.js +1 -0
- package/dist/ui/assets/{skills-B9hTovVh.js → skills-Bm5AxgzO.js} +1 -1
- package/dist/ui/assets/slicc-version-rYLQXBjd.js +1 -0
- package/dist/ui/assets/{state-BKg54qnI.js → state-CJZU3MUJ.js} +1 -1
- package/dist/ui/assets/{store-Ckx5Qk8r.js → store-ByoR63_A.js} +1 -1
- package/dist/ui/assets/store-CKhg-xXm.js +1 -0
- package/dist/ui/assets/{sudo-BYKLWL8l.js → sudo-gXakxwpD.js} +1 -1
- package/dist/ui/assets/{sync-dialog-CaY6_dCO.js → sync-dialog-CtrrU_-X.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-CHw8U7kW.js → tray-sidecar-DP-OKeYT.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-BGI4k545.js → upgrade-detection-4KedpK0u.js} +1 -1
- package/dist/ui/assets/{voice-reply-BLB0WMGq.js → voice-reply-DJDzh5c_.js} +1 -1
- package/dist/ui/assets/{wc-attach-DfPSrixU.js → wc-attach-CHoh_npa.js} +2 -2
- package/dist/ui/assets/{wc-extension-DhuoWguy.js → wc-extension-DinzzE-u.js} +2 -2
- package/dist/ui/assets/{wc-float-label-cFzM9BsP.js → wc-float-label-_5Qu7XYI.js} +1 -1
- package/dist/ui/assets/{wc-floatbar-online-BKJPRq_0.js → wc-floatbar-online-DdJjsUiB.js} +1 -1
- package/dist/ui/assets/{wc-follower-oauth-CuUqosbc.js → wc-follower-oauth-CQymgqdo.js} +1 -1
- package/dist/ui/assets/{wc-follower-BiIsjqEt.js → wc-follower-orVLyho6.js} +3 -3
- package/dist/ui/assets/{wc-live-9ZO5QfgI.js → wc-live-Y30MNXP6.js} +7 -7
- package/dist/ui/assets/{wc-nav-DW3cMVIc.js → wc-nav-CObJ1-cm.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-SeOTnz2o.js → wc-onboarding-13bz6Y1P.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-BMJjSG0P.js → wc-placeholder-DEerShZk.js} +3 -3
- package/dist/ui/assets/{wc-settings-UD2VUoLt.js → wc-settings-S7sjuH3z.js} +3 -3
- package/dist/ui/assets/{wc-shell-hnMI7FOV.js → wc-shell-DHFdDKPB.js} +2 -2
- package/dist/ui/assets/{wc-shortcut-config-CqDAvdEe.js → wc-shortcut-config-CY9y5JD2.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-_BGRskZQ.js → wc-sprinkles-BX0o3VdV.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-DXo_nXRM.js → wc-transcript-export-BS7RBV-1.js} +2 -2
- package/dist/ui/assets/{wc-tray-Cy15l2Cc.js → wc-tray-CdT1k5xd.js} +2 -2
- package/dist/ui/assets/welcome-detection-DbHTpMYI.js +1 -0
- package/dist/ui/assets/{xai-grok-CKUQxsx-.js → xai-grok-DaoF-Hq_.js} +1 -1
- package/dist/ui/assets/{xai-grok-B6FjD17P.js → xai-grok-_z4Y3sUx.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/ui/llm-proxy-sw.js +1 -1
- package/dist/ui/packages/webapp/index.html +3 -3
- package/package.json +1 -1
- package/dist/ui/assets/SKILL-B-2ojpz4.js +0 -1
- package/dist/ui/assets/cdp-ws-page-bridge-D_PY6ku1.js +0 -1
- package/dist/ui/assets/lick-manager-CYlek4qq.js +0 -2
- package/dist/ui/assets/lick-ws-bridge-BJTVP6Z3.js +0 -1
- package/dist/ui/assets/new-session-D1hm84f7.js +0 -2
- package/dist/ui/assets/provider-DM7nUGRc.js +0 -2
- package/dist/ui/assets/provider-store-access-D4PsvZNr.js +0 -1
- package/dist/ui/assets/provider-store-access-DLlfWlp9.js +0 -1
- package/dist/ui/assets/sidecar-repair-FzgS788B.js +0 -1
- package/dist/ui/assets/slicc-version-mN6TT2sL.js +0 -1
- package/dist/ui/assets/store-DRjMIGJv.js +0 -1
- package/dist/ui/assets/welcome-detection-NLNTy3II.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as e,d as t}from"./account-store-
|
|
1
|
+
import{H as e,d as t}from"./account-store-BaTmqQCH.js";import{a as n}from"./diagnostics-DN_idNHx.js";import{c as r,u as i}from"./claude-model-version-C0HLsjny.js";import{c as a,i as o,r as s,s as c}from"./legacy-api-aliases-7-tLus57.js";import"./main-BcfY0APV.js";import{n as l,r as u,t as d}from"./pkce-hGf_TEnP.js";import{XaiErrorCode as f,XaiOAuthError as p}from"./xai-grok-errors-bnlIBeu-.js";var m=`xai-grok`,h=`https://auth.x.ai`,g=`${h}/oauth2/authorize`,_=`${h}/oauth2/token`,v=`b1a00492-073a-47ea-816f-4c329264a828`,y=`openid profile email offline_access grok-cli:access api:access`,b=`http://127.0.0.1:56121/callback`,x=`http://127.0.0.1:56121/*`,S=`https://api.x.ai/v1`,C=`grok-4.5`,w=`${m}-openai`;function T(){return r(`xai`)}function E(e){return{id:e.id,name:e.name,api:`openai`,reasoning:e.reasoning,input:e.input,context_window:e.contextWindow,max_tokens:e.maxTokens,compat:e.compat,thinkingLevelMap:e.thinkingLevelMap}}function D(e){let t=T(),n=t.find(t=>t.id===e.id);if(!n&&(console.warn(`xAI model "${e.id}" is no longer in the pi-ai catalog; falling back to default "${C}"`),n=t.find(e=>e.id===C),!n))throw Error(`xAI default model "${C}" is not registered by pi-ai`);if(n.api!==`openai-responses`&&n.api!==`openai-completions`)throw Error(`Unsupported pi-ai API "${n.api}" for xAI model "${e.id}"`);return{...e,...n,baseUrl:S}}async function O(e,t){let n=new URLSearchParams({grant_type:`authorization_code`,code:e,redirect_uri:b,client_id:v,code_verifier:t}),r=await fetch(_,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n});if(!r.ok)throw new p(`xAI token exchange failed: ${r.status} ${await r.text()}`,f.TOKEN_EXCHANGE_FAILED);let i=await r.json();if(!i.access_token)throw new p(`xAI token exchange did not return access_token.`,f.TOKEN_EXCHANGE_INVALID);return i}async function k(e){try{let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e,client_id:v}),n=await fetch(_,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:t});return n.ok?await n.json():(console.error(`[xai-grok] refresh failed:`,n.status,await n.text()),null)}catch(e){return console.error(`[xai-grok] refresh error:`,e instanceof Error?e.message:String(e)),null}}function A(){return t().find(e=>e.providerId===m)}async function j(){let t=A();if(!t?.accessToken)throw new p("Not signed in to xAI Grok — run /login or `oauth-token xai-grok`",f.AUTH_MISSING,!0);let n=t.tokenExpiresAt??0;if(n&&Date.now()+6e4<n)return t.accessToken;if(t.refreshToken){let n=await k(t.refreshToken);if(n?.access_token)return await e({providerId:m,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token}return t.accessToken}function M(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:w,provider:m,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:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function N(e,t){return t?{...e??{},"x-grok-conv-id":t}:e}var P=(e,t,r={})=>{let i=n();return(async()=>{try{let n=await j(),a=r.sessionId,c=D(e),l={...r,apiKey:n,headers:N(r.headers,a)},u=c.api===`openai-responses`?o(c,t,l):s(c,t,l);for await(let e of u)i.push(e);i.end()}catch(t){console.error(`[xai-grok] Stream error:`,t instanceof Error?t.message:String(t)),i.push(M(e,t)),i.end()}})(),i},F=(e,t,r)=>{let i=n();return(async()=>{try{let n=await j(),o=r?.sessionId,s=D(e),l={...r,apiKey:n,headers:N(r?.headers,o)},u=s.api===`openai-responses`?a(s,t,l):c(s,t,l);for await(let e of u)i.push(e);i.end()}catch(t){console.error(`[xai-grok] Stream error:`,t instanceof Error?t.message:String(t)),i.push(M(e,t)),i.end()}})(),i},I={id:m,name:`xAI Grok (SuperGrok OAuth)`,description:`Grok via xAI OAuth — uses your SuperGrok subscription, no API key needed. Default model is Grok 4.5.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:C,oauthTokenDomains:[`api.x.ai`,`*.x.ai`,`auth.x.ai`,`accounts.x.ai`],getModelIds:()=>T().map(E),onOAuthLoginIntercepted:async(t,n,r)=>{let i=l(),a=await d(i),o=u(),s=u(),c=new URL(g);c.searchParams.set(`response_type`,`code`),c.searchParams.set(`client_id`,v),c.searchParams.set(`redirect_uri`,b),c.searchParams.set(`scope`,r?.scopes??y),c.searchParams.set(`code_challenge`,a),c.searchParams.set(`code_challenge_method`,`S256`),c.searchParams.set(`state`,o),c.searchParams.set(`nonce`,s),c.searchParams.set(`plan`,`generic`),c.searchParams.set(`referrer`,`slicc`);let h=await t({authorizeUrl:c.toString(),redirectUriPattern:x,onCapture:`close`});if(!h)throw new p(`xAI OAuth login was cancelled or timed out`,f.CALLBACK_TIMEOUT);let _=new URL(h),C=_.searchParams.get(`code`),w=_.searchParams.get(`state`);if(!C)throw new p(`xAI OAuth redirect did not include a code`,f.CODE_MISSING);if(w!==o)throw new p(`xAI OAuth state mismatch — possible CSRF, aborting`,f.STATE_MISMATCH);let T=await O(C,i);await e({providerId:m,accessToken:T.access_token,refreshToken:T.refresh_token,tokenExpiresAt:Date.now()+(T.expires_in??21600)*1e3,baseUrl:S,scopes:T.scope}),n()},onOAuthLogout:async()=>{await e({providerId:m,accessToken:``})},onSilentRenew:async()=>{let t=A();if(!t?.refreshToken)return null;let n=await k(t.refreshToken);return n?.access_token?(await e({providerId:m,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token):null}};function L(){i({api:w,stream:P,streamSimple:F})}export{f as XaiErrorCode,p as XaiOAuthError,I as config,L as register};
|
package/dist/ui/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
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/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-BcfY0APV.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-CHZomqvU.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/image-markers-CxJ9ZBgw.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/tool-ui-DfXu6quJ.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/providers-
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/providers-N-GzEZuq.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/panel-rpc-B3MSVImO.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-compat-CgBMwna8.js">
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/account-store-
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/account-store-BaTmqQCH.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/runtime-env-CgsZ7LTp.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="/assets/telemetry-BVzuNdvW.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/messages-BD4p8GuF.js">
|
package/dist/ui/llm-proxy-sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var v="https://www.sliccy.ai";var T="bridgeToken",I="bridge",B="X-Bridge-Token";var Ee=new URL(v).hostname,at={[Ee]:"sliccy.now","sliccy.ai":"sliccy.now","slicc-tray-hub-staging.minivelos.workers.dev":"sliccy.dev","localhost:8787":"localhost:8787"};var Re=["ghp_","gho_","ghu_","ghs_","ghr_","github_pat_","sk-","pk-","xoxb-","xoxp-","xoxa-","xoxs-","AKIA","ABIA","ACCA","ASIA","sk-ant-","Bearer "],ft=[...Re].sort((e,t)=>t.length-e.length);var Me=["canonical-agent-history-unavailable","tool-data-may-be-truncated","model-metadata-unavailable","scoop-history-unavailable","attachment-file-missing","attachment-association-unavailable","complete-snapshot-unavailable"];var It=new Set(Me);var Ft=[{category:"jwt",source:String.raw`ey[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+`,flags:"g"},{category:"private-key",source:"-----BEGIN [A-Z ]* PRIVATE KEY-----"+String.raw`[\s\S]*?`+"-----END [A-Z ]* PRIVATE KEY-----",flags:"g"},{category:"bearer-token",source:"Bearer [A-Za-z0-9._~+/=!-]+",flags:"gi"},{category:"api-key",source:"(?:sk-(?:live|test|prod|proj)-[A-Za-z0-9]{8,}|sk-ant-[A-Za-z0-9-]{8,}|xoxb-[A-Za-z0-9-]{10,}|xoxp-[A-Za-z0-9-]{10,}|AKIA[A-Z0-9]{16}|ghp_[A-Za-z0-9]{36}|hf_[A-Za-z0-9]{34})",flags:"g"},{category:"password",source:String.raw`\b(?:password|passwd|token|secret|api_key)\s*[=:]\s*\S+`,flags:"gi"}];var Ot=16*1024;var Pt=64*1024,Dt=32*1024;var _e="slicc-sync-fs-";function q(e){return _e+e}var H="sync-fs-nonce",V="sync-fs-need-nonce",E="/__slicc/fs-sync/";var R="/__slicc/exec-sync",N="x-slicc-fs-token",S="x-slicc-fs-errno",m="x-slicc-fs",M="x-slicc-fs-no-responder",j="sync-fs-req",Y="sync-fs-ack",W="sync-fs-res",G=25e3,z=2e3,K=12e4,F=6e5,X=2e3;function U(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let s=r.toLowerCase();s==="cookie"?t["X-Proxy-Cookie"]=n:s==="origin"?t["X-Proxy-Origin"]=n:s==="referer"?t["X-Proxy-Referer"]=n:s.startsWith("proxy-")?t[`X-Proxy-${r}`]=n:t[r]=n}return t}function J(e){let t={};for(let[r,n]of Object.entries(e))r.toLowerCase()==="x-proxy-set-cookie"?t["set-cookie"]=n:t[r]=n;return t}var be=new Set([101,103,204,205,304]);function Ae(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Q(e){let t,r,n=new Promise((o,a)=>{t=o,r=a}),s=null,i=new ReadableStream({start(o){s=o}}),l=!1,p=!1,g=()=>{try{s?.close()}catch{}},y=o=>{try{s?.error(o)}catch{}},f=o=>{if(l)return;l=!0;let a=new Headers;for(let[k,x]of Object.entries(J(o.headers)))a.set(k,x);let h=be.has(o.status)?null:i;t(new Response(h,{status:o.status,statusText:o.statusText,headers:a}))},u=o=>{p=!0;let a=new Error(o.error);l?y(a):r(a),e.close?.()};return e.onmessage=o=>{let a=o.data;!a||typeof a.type!="string"||p||(a.type==="response-head"?f(a):a.type==="response-chunk"?s?.enqueue(Ae(a.dataBase64)):a.type==="response-end"?(p=!0,g(),e.close?.()):a.type==="response-error"&&u(a))},e.start?.(),{responsePromise:n}}var we=new Set([101,103,204,205,304]);function L(e){let t=we.has(e.status)?null:e.body;return new Response(t,{status:e.status,statusText:e.statusText,headers:e.headers})}var Z="slicc",ee="leader";function te(e){try{let t=new URL(e);return`${t.protocol==="wss:"?"https:":"http:"}//${t.host}`}catch{return null}}var ve="slicc:bridge-config";function re(e,t){if(e?.apiBaseUrl&&e.token)return{apiBaseUrl:e.apiBaseUrl.replace(/\/+$/,""),token:e.token};if(!t)return null;let r;try{r=new URL(t)}catch{return null}let n=r.searchParams.get(I),s=r.searchParams.get(T);if(!n||!s)return null;let i=te(n);return i?{apiBaseUrl:i.replace(/\/+$/,""),token:s}:null}function ne(e,t){if(e?.apiBaseUrl&&e.token)return re(e,null);for(let r of t){let n=re(null,r);if(n)return n}return null}function se(e,t){return t?`${t.apiBaseUrl}${e}`:e}function oe(e,t){let r,n;try{r=new URL(t),n=new URL(e)}catch{return!1}return n.origin===r.origin&&n.pathname.startsWith("/api/")}function ie(e){return!e||typeof e!="object"?!1:e.type===ve}var _=class{byClient=new Map;set(t,r){if(t){if(!r.apiBaseUrl||!r.token){this.byClient.delete(t);return}this.byClient.set(t,{apiBaseUrl:r.apiBaseUrl.replace(/\/+$/,""),token:r.token})}}get(t){return t?this.byClient.get(t)??null:null}delete(t){this.byClient.delete(t)}size(){return this.byClient.size}},Te="slicc:extension-delegate-config",ae="slicc:ext-fetch";function ce(e){return!e||typeof e!="object"?!1:e.type===Te}function O(e){if(!e)return null;let t;try{t=new URL(e)}catch{return null}if(t.searchParams.get(Z)!==ee)return null;let r=t.searchParams.get("ext");return r?{extensionId:r}:null}function le(e,t){if(e?.extensionId)return{extensionId:e.extensionId};for(let r of t){let n=O(r);if(n)return n}return null}var b=class{byClient=new Map;set(t,r){if(t){if(!r.extensionId){this.byClient.delete(t);return}this.byClient.set(t,{extensionId:r.extensionId})}}get(t){return t?this.byClient.get(t)??null:null}delete(t){this.byClient.delete(t)}size(){return this.byClient.size}},Ie=new Set(["image","font","style","video","audio","track","iframe","object","embed"]);function ue(e){return Ie.has(e)}function P(e){let t=e;return t?.type==="window"&&t.frameType==="top-level"}function A(e){return P(e)}function w(e){return e.filter(A)}function fe(){let e=[];return{notify(){let t=e;e=[];for(let r of t)r()},wait(t){return new Promise(r=>{let n=!1,s=()=>{n||(n=!0,clearTimeout(i),e=e.filter(l=>l!==s),r())},i=setTimeout(s,t);e.push(s)})}}}var D="exec";function de(e,t){return typeof e!="number"||!Number.isFinite(e)||e<=0?Math.min(t,F):Math.min(e,F)}var Fe=G,Ue=200,Le=1e4,Oe=new Set(["stat","lstat","readdir","exists"]),Pe=new Set(["mkdir","rm"]);function De(e){return $e(e)?de(e.timeoutMs,K)+X:Fe}function $e(e){return e.channel===D}function Be(e){switch(e){case"ENOENT":return 404;case"EACCES":return 403;case"EISDIR":case"ENOTDIR":case"EINVAL":return 400;case"EIO":return 503;default:return 500}}async function qe(e){if(e.method!=="POST")return null;let t;try{let i=await e.arrayBuffer();t=JSON.parse(new TextDecoder().decode(new Uint8Array(i)))}catch{return null}if(!t||typeof t!="object")return null;let r=t,n=r.command;return typeof n=="string"||Array.isArray(n)&&n.every(i=>typeof i=="string")?{token:e.headers.get(N)??"",channel:D,command:n,...Array.isArray(r.args)&&r.args.every(i=>typeof i=="string")?{args:r.args}:{},...typeof r.stdin=="string"?{stdin:r.stdin}:{},...typeof r.timeoutMs=="number"?{timeoutMs:r.timeoutMs}:{}}:null}async function pe(e){let t=new URL(e.url);if(t.pathname===R)return qe(e);if(!t.pathname.startsWith(E))return null;let r=t.pathname.slice(E.length-1),n;try{n=r.split("/").map(decodeURIComponent).join("/")}catch{return null}let s=e.headers.get(N)??"",i=t.searchParams.get("op");if(e.method==="POST"){if(i&&Pe.has(i))return{token:s,op:i,path:n};let l=await e.arrayBuffer();return{token:s,op:"write",path:n,body:new Uint8Array(l)}}return i&&Oe.has(i)?{token:s,op:i,path:n}:{token:s,op:"read",path:n}}function He(e){if(!e.ok){let r=e.errno??"EIO";return new Response(e.message??r,{status:Be(r),headers:{[S]:r,[m]:"1"}})}if(e.kind==="json")return new Response(JSON.stringify(e.json??null),{status:200,headers:{"content-type":"application/json",[m]:"1"}});let t=e.kind==="bytes"?new Uint8Array(e.bytes):new Uint8Array(0);return new Response(t,{status:200,headers:{"content-type":"application/octet-stream",[m]:"1"}})}function ge(e,t,r={}){let n=r.timeoutMs??De(t),s=r.retryIntervalMs??Ue,i=Math.min(r.noResponderMs??Le,n),l=crypto.randomUUID();return new Promise(p=>{let g=!1,y=!1,f,u,o,a=()=>{for(let c of e)c.removeEventListener("message",k);f&&clearInterval(f),u&&clearTimeout(u),o&&clearTimeout(o)},h=c=>{y||(y=!0,a(),p(c))},k=c=>{let d=c.data;if(!(!d||d.id!==l)){if(d.type===Y){g=!0,f&&clearInterval(f),o&&clearTimeout(o);return}d.type===W&&h(He(d))}};for(let c of e)c.addEventListener("message",k);let x=()=>{for(let c of e)c.postMessage({type:j,id:l,...t})};x(),f=setInterval(()=>{g||x()},s),o=setTimeout(()=>{g||h(new Response("sync-fs bridge: no responder",{status:503,headers:{[S]:"EIO",[m]:"1",[M]:"1"}}))},i),u=setTimeout(()=>{h(new Response("sync-fs bridge timeout",{status:503,headers:{[S]:"EIO",[m]:"1"}}))},n)})}var Ve="/api/fetch-proxy",C="x-bypass-llm-proxy",Se=new _,ke=new b,je=32*1024*1024;self.importScripts("/preview-sw.js");self.addEventListener("install",e=>{e.waitUntil(self.skipWaiting())});self.addEventListener("activate",e=>{e.waitUntil(self.clients.claim())});self.addEventListener("message",e=>{let t=e.source;if(!t||!("id"in t)||typeof t.id!="string")return;if(ie(e.data)&&A(t)){Se.set(t.id,{apiBaseUrl:e.data.apiBaseUrl,token:e.data.token});return}if(ce(e.data)&&A(t)){ke.set(t.id,{extensionId:e.data.extensionId});return}let r=e.data;if(r?.type===H&&typeof r.nonce=="string"){P(t)&&Ye(r.nonce);return}});self.addEventListener("fetch",e=>{let t=e.request;if(t.headers.get(C)==="1"||ue(t.destination))return;let r;try{r=new URL(t.url)}catch{return}r.origin!==self.location.origin&&(r.protocol!=="http:"&&r.protocol!=="https:"||e.respondWith(We(t,e.clientId||null)))});var $=new Map,xe=fe();function me(){return[...$.values()]}function Ye(e){$.has(e)||($.set(e,new BroadcastChannel(q(e))),xe.notify())}async function ye(){let e=await self.clients.matchAll({type:"window"}),t={type:V};for(let r of e)r.postMessage(t)}self.addEventListener("fetch",e=>{let t=new URL(e.request.url);t.origin===self.location.origin&&(!t.pathname.startsWith(E)&&t.pathname!==R||e.respondWith((async()=>{let r=await pe(e.request);if(!r)return new Response("sync bridge: malformed request",{status:400,headers:{[S]:"EINVAL",[m]:"1"}});let n=me();if(n.length===0&&(ye(),await xe.wait(z),n=me(),n.length===0))return new Response("sync-fs bridge not ready",{status:503,headers:{[S]:"EIO",[m]:"1"}});let s=await ge(n,r);return s.headers.get(M)==="1"&&ye(),s})()))});async function We(e,t){let r=e.url,n={};e.headers.forEach((c,d)=>{d.toLowerCase()!==C&&(n[d]=c)});let s=U(n),i=new Headers;for(let[c,d]of Object.entries(s))i.set(c,d);i.set("X-Target-URL",r);let l=Se.get(t),p=ke.get(t),g=await Ge(t),y=l||p?[]:await ze(),f=[g,...y],u=le(p,f);if(u){let c=await Ke();if(c)return Je(e,u,c,r)}let o=ne(l,f);if(o&&oe(e.url,o.apiBaseUrl)){let c=new Headers(e.headers);c.set(C,"1");let d={method:e.method,headers:c,cache:"no-store",credentials:e.credentials,redirect:"manual",signal:e.signal,body:await he(e)};return L(await fetch(e.url,d))}o&&i.set(B,o.token);let a=se(Ve,o),h=await he(e),k={method:e.method,headers:i,cache:"no-store",credentials:"omit",redirect:"manual",signal:e.signal,body:h},x=await fetch(a,k);return L(x)}async function he(e){if(e.method==="GET"||e.method==="HEAD")return;let t=await e.arrayBuffer();return t.byteLength>0?t:void 0}async function Ge(e){if(!e)return null;try{let t=await self.clients.get(e);return w(t?[t]:[])[0]?.url??null}catch{return null}}async function ze(){try{let e=await self.clients.matchAll({type:"window",includeUncontrolled:!0});return w(e).map(t=>t.url).filter(t=>!!t)}catch{return[]}}async function Ke(){try{let e=w(await self.clients.matchAll({type:"window",includeUncontrolled:!0}));return e.length===0?null:e.find(r=>O(r.url)!==null)??e[0]}catch{return null}}function Xe(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}async function Je(e,t,r,n){let s={};e.headers.forEach((u,o)=>{o.toLowerCase()!==C&&(s[o]=u)});let i=U(s),l,p=!1;if(e.method!=="GET"&&e.method!=="HEAD"){let u=await e.arrayBuffer();u.byteLength>je?p=!0:u.byteLength>0&&(l=Xe(new Uint8Array(u)))}let g=new MessageChannel,{responsePromise:y}=Q(g.port1),f={type:ae,requestId:Qe(),extensionId:t.extensionId,request:{url:n,method:e.method,headers:i,bodyBase64:l,requestBodyTooLarge:p}};return r.postMessage(f,[g.port2]),y}function Qe(){let e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}})();
|
|
1
|
+
"use strict";(()=>{var C="https://www.sliccy.ai";var T="bridgeToken",I="bridge",B="X-Bridge-Token";var Ee=new URL(C).hostname,at={[Ee]:"sliccy.now","sliccy.ai":"sliccy.now","slicc-tray-hub-staging.minivelos.workers.dev":"sliccy.dev","localhost:8787":"localhost:8787"};var Re=["ghp_","gho_","ghu_","ghs_","ghr_","github_pat_","sk-","pk-","xoxb-","xoxp-","xoxa-","xoxs-","AKIA","ABIA","ACCA","ASIA","sk-ant-","Bearer "],ft=[...Re].sort((e,t)=>t.length-e.length);var Me=["canonical-agent-history-unavailable","tool-data-may-be-truncated","model-metadata-unavailable","scoop-history-unavailable","attachment-file-missing","attachment-association-unavailable","complete-snapshot-unavailable"];var It=new Set(Me);var Ft=[{category:"jwt",source:String.raw`ey[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+`,flags:"g"},{category:"private-key",source:"-----BEGIN [A-Z ]* PRIVATE KEY-----"+String.raw`[\s\S]*?`+"-----END [A-Z ]* PRIVATE KEY-----",flags:"g"},{category:"bearer-token",source:"Bearer [A-Za-z0-9._~+/=!-]+",flags:"gi"},{category:"api-key",source:"(?:sk-(?:live|test|prod|proj)-[A-Za-z0-9]{8,}|sk-ant-[A-Za-z0-9-]{8,}|xoxb-[A-Za-z0-9-]{10,}|xoxp-[A-Za-z0-9-]{10,}|AKIA[A-Z0-9]{16}|ghp_[A-Za-z0-9]{36}|hf_[A-Za-z0-9]{34})",flags:"g"},{category:"password",source:String.raw`\b(?:password|passwd|token|secret|api_key)\s*[=:]\s*\S+`,flags:"gi"}];var Ot=16*1024;var Dt=64*1024,Pt=32*1024;var _e="slicc-sync-fs-";function q(e){return _e+e}var H="sync-fs-nonce",V="sync-fs-need-nonce",E="/__slicc/fs-sync/";var R="/__slicc/exec-sync",N="x-slicc-fs-token",S="x-slicc-fs-errno",m="x-slicc-fs",M="x-slicc-fs-no-responder",j="sync-fs-req",Y="sync-fs-ack",W="sync-fs-res",G=25e3,z=2e3,K=12e4,F=6e5,X=2e3;function U(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let s=r.toLowerCase();s==="cookie"?t["X-Proxy-Cookie"]=n:s==="origin"?t["X-Proxy-Origin"]=n:s==="referer"?t["X-Proxy-Referer"]=n:s.startsWith("proxy-")?t[`X-Proxy-${r}`]=n:t[r]=n}return t}function J(e){let t={};for(let[r,n]of Object.entries(e))r.toLowerCase()==="x-proxy-set-cookie"?t["set-cookie"]=n:t[r]=n;return t}var be=new Set([101,103,204,205,304]);function Ae(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Q(e){let t,r,n=new Promise((o,a)=>{t=o,r=a}),s=null,i=new ReadableStream({start(o){s=o}}),l=!1,p=!1,g=()=>{try{s?.close()}catch{}},y=o=>{try{s?.error(o)}catch{}},f=o=>{if(l)return;l=!0;let a=new Headers;for(let[k,x]of Object.entries(J(o.headers)))a.set(k,x);let h=be.has(o.status)?null:i;t(new Response(h,{status:o.status,statusText:o.statusText,headers:a}))},u=o=>{p=!0;let a=new Error(o.error);l?y(a):r(a),e.close?.()};return e.onmessage=o=>{let a=o.data;!a||typeof a.type!="string"||p||(a.type==="response-head"?f(a):a.type==="response-chunk"?s?.enqueue(Ae(a.dataBase64)):a.type==="response-end"?(p=!0,g(),e.close?.()):a.type==="response-error"&&u(a))},e.start?.(),{responsePromise:n}}var we=new Set([101,103,204,205,304]);function L(e){let t=we.has(e.status)?null:e.body;return new Response(t,{status:e.status,statusText:e.statusText,headers:e.headers})}var Z="slicc",ee="leader";function te(e){try{let t=new URL(e);return`${t.protocol==="wss:"?"https:":"http:"}//${t.host}`}catch{return null}}var Ce="slicc:bridge-config";function re(e,t){if(e?.apiBaseUrl&&e.token)return{apiBaseUrl:e.apiBaseUrl.replace(/\/+$/,""),token:e.token};if(!t)return null;let r;try{r=new URL(t)}catch{return null}let n=r.searchParams.get(I),s=r.searchParams.get(T);if(!n||!s)return null;let i=te(n);return i?{apiBaseUrl:i.replace(/\/+$/,""),token:s}:null}function ne(e,t){if(e?.apiBaseUrl&&e.token)return re(e,null);for(let r of t){let n=re(null,r);if(n)return n}return null}function se(e,t){return t?`${t.apiBaseUrl}${e}`:e}function oe(e,t){let r,n;try{r=new URL(t),n=new URL(e)}catch{return!1}return n.origin===r.origin&&n.pathname.startsWith("/api/")}function ie(e){return!e||typeof e!="object"?!1:e.type===Ce}var _=class{byClient=new Map;set(t,r){if(t){if(!r.apiBaseUrl||!r.token){this.byClient.delete(t);return}this.byClient.set(t,{apiBaseUrl:r.apiBaseUrl.replace(/\/+$/,""),token:r.token})}}get(t){return t?this.byClient.get(t)??null:null}delete(t){this.byClient.delete(t)}size(){return this.byClient.size}},Te="slicc:extension-delegate-config",ae="slicc:ext-fetch";function ce(e){return!e||typeof e!="object"?!1:e.type===Te}function O(e){if(!e)return null;let t;try{t=new URL(e)}catch{return null}if(t.searchParams.get(Z)!==ee)return null;let r=t.searchParams.get("ext");return r?{extensionId:r}:null}function le(e,t){if(e?.extensionId)return{extensionId:e.extensionId};for(let r of t){let n=O(r);if(n)return n}return null}var b=class{byClient=new Map;set(t,r){if(t){if(!r.extensionId){this.byClient.delete(t);return}this.byClient.set(t,{extensionId:r.extensionId})}}get(t){return t?this.byClient.get(t)??null:null}delete(t){this.byClient.delete(t)}size(){return this.byClient.size}},Ie=new Set(["image","font","style","video","audio","track","iframe","object","embed"]);function ue(e){return Ie.has(e)}function D(e){let t=e;return t?.type==="window"&&t.frameType==="top-level"}function A(e){return D(e)}function w(e){return e.filter(A)}function fe(){let e=[];return{notify(){let t=e;e=[];for(let r of t)r()},wait(t){return new Promise(r=>{let n=!1,s=()=>{n||(n=!0,clearTimeout(i),e=e.filter(l=>l!==s),r())},i=setTimeout(s,t);e.push(s)})}}}var P="exec";function de(e,t){return typeof e!="number"||!Number.isFinite(e)||e<=0?Math.min(t,F):Math.min(e,F)}var Fe=G,Ue=200,Le=1e4,Oe=new Set(["stat","lstat","readdir","exists"]),De=new Set(["mkdir","rm"]);function Pe(e){return $e(e)?de(e.timeoutMs,K)+X:Fe}function $e(e){return e.channel===P}function Be(e){switch(e){case"ENOENT":return 404;case"EACCES":return 403;case"EISDIR":case"ENOTDIR":case"EINVAL":return 400;case"EIO":return 503;default:return 500}}async function qe(e){if(e.method!=="POST")return null;let t;try{let i=await e.arrayBuffer();t=JSON.parse(new TextDecoder().decode(new Uint8Array(i)))}catch{return null}if(!t||typeof t!="object")return null;let r=t,n=r.command;return typeof n=="string"||Array.isArray(n)&&n.every(i=>typeof i=="string")?{token:e.headers.get(N)??"",channel:P,command:n,...Array.isArray(r.args)&&r.args.every(i=>typeof i=="string")?{args:r.args}:{},...typeof r.stdin=="string"?{stdin:r.stdin}:{},...typeof r.timeoutMs=="number"?{timeoutMs:r.timeoutMs}:{}}:null}async function pe(e){let t=new URL(e.url);if(t.pathname===R)return qe(e);if(!t.pathname.startsWith(E))return null;let r=t.pathname.slice(E.length-1),n;try{n=r.split("/").map(decodeURIComponent).join("/")}catch{return null}let s=e.headers.get(N)??"",i=t.searchParams.get("op");if(e.method==="POST"){if(i&&De.has(i))return{token:s,op:i,path:n};let l=await e.arrayBuffer();return{token:s,op:"write",path:n,body:new Uint8Array(l)}}return i&&Oe.has(i)?{token:s,op:i,path:n}:{token:s,op:"read",path:n}}function He(e){if(!e.ok){let r=e.errno??"EIO";return new Response(e.message??r,{status:Be(r),headers:{[S]:r,[m]:"1"}})}if(e.kind==="json")return new Response(JSON.stringify(e.json??null),{status:200,headers:{"content-type":"application/json",[m]:"1"}});let t=e.kind==="bytes"?new Uint8Array(e.bytes):new Uint8Array(0);return new Response(t,{status:200,headers:{"content-type":"application/octet-stream",[m]:"1"}})}function ge(e,t,r={}){let n=r.timeoutMs??Pe(t),s=r.retryIntervalMs??Ue,i=Math.min(r.noResponderMs??Le,n),l=crypto.randomUUID();return new Promise(p=>{let g=!1,y=!1,f,u,o,a=()=>{for(let c of e)c.removeEventListener("message",k);f&&clearInterval(f),u&&clearTimeout(u),o&&clearTimeout(o)},h=c=>{y||(y=!0,a(),p(c))},k=c=>{let d=c.data;if(!(!d||d.id!==l)){if(d.type===Y){g=!0,f&&clearInterval(f),o&&clearTimeout(o);return}d.type===W&&h(He(d))}};for(let c of e)c.addEventListener("message",k);let x=()=>{for(let c of e)c.postMessage({type:j,id:l,...t})};x(),f=setInterval(()=>{g||x()},s),o=setTimeout(()=>{g||h(new Response("sync-fs bridge: no responder",{status:503,headers:{[S]:"EIO",[m]:"1",[M]:"1"}}))},i),u=setTimeout(()=>{h(new Response("sync-fs bridge timeout",{status:503,headers:{[S]:"EIO",[m]:"1"}}))},n)})}var Ve="/api/fetch-proxy",v="x-bypass-llm-proxy",Se=new _,ke=new b,je=32*1024*1024;self.importScripts("/preview-sw.js");self.addEventListener("install",e=>{e.waitUntil(self.skipWaiting())});self.addEventListener("activate",e=>{e.waitUntil(self.clients.claim())});self.addEventListener("message",e=>{let t=e.source;if(!t||!("id"in t)||typeof t.id!="string")return;if(ie(e.data)&&A(t)){Se.set(t.id,{apiBaseUrl:e.data.apiBaseUrl,token:e.data.token});return}if(ce(e.data)&&A(t)){ke.set(t.id,{extensionId:e.data.extensionId});return}let r=e.data;if(r?.type===H&&typeof r.nonce=="string"){D(t)&&Ye(r.nonce);return}});self.addEventListener("fetch",e=>{let t=e.request;if(t.headers.get(v)==="1"||ue(t.destination))return;let r;try{r=new URL(t.url)}catch{return}r.origin!==self.location.origin&&(r.protocol!=="http:"&&r.protocol!=="https:"||e.respondWith(We(t,e.clientId||null)))});var $=new Map,xe=fe();function me(){return[...$.values()]}function Ye(e){$.has(e)||($.set(e,new BroadcastChannel(q(e))),xe.notify())}async function ye(){let e=await self.clients.matchAll({type:"window"}),t={type:V};for(let r of e)r.postMessage(t)}self.addEventListener("fetch",e=>{let t=new URL(e.request.url);t.origin===self.location.origin&&(!t.pathname.startsWith(E)&&t.pathname!==R||e.respondWith((async()=>{let r=await pe(e.request);if(!r)return new Response("sync bridge: malformed request",{status:400,headers:{[S]:"EINVAL",[m]:"1"}});let n=me();if(n.length===0&&(ye(),await xe.wait(z),n=me(),n.length===0))return new Response("sync-fs bridge not ready",{status:503,headers:{[S]:"EIO",[m]:"1"}});let s=await ge(n,r);return s.headers.get(M)==="1"&&ye(),s})()))});async function We(e,t){let r=e.url,n={};e.headers.forEach((c,d)=>{d.toLowerCase()!==v&&(n[d]=c)});let s=U(n),i=new Headers;for(let[c,d]of Object.entries(s))i.set(c,d);i.set("X-Target-URL",r);let l=Se.get(t),p=ke.get(t),g=await Ge(t),y=l||p?[]:await ze(),f=[g,...y],u=le(p,f);if(u){let c=await Ke();if(c)return Je(e,u,c,r)}let o=ne(l,f);if(o&&oe(e.url,o.apiBaseUrl)){let c=new Headers(e.headers);c.set(v,"1");let d={method:e.method,headers:c,cache:"no-store",credentials:e.credentials,redirect:"manual",signal:e.signal,body:await he(e)};return L(await fetch(e.url,d))}o&&i.set(B,o.token);let a=se(Ve,o),h=await he(e),k={method:e.method,headers:i,cache:"no-store",credentials:"omit",redirect:"manual",signal:e.signal,body:h},x=await fetch(a,k);return L(x)}async function he(e){if(e.method==="GET"||e.method==="HEAD")return;let t=await e.arrayBuffer();return t.byteLength>0?t:void 0}async function Ge(e){if(!e)return null;try{let t=await self.clients.get(e);return w(t?[t]:[])[0]?.url??null}catch{return null}}async function ze(){try{let e=await self.clients.matchAll({type:"window",includeUncontrolled:!0});return w(e).map(t=>t.url).filter(t=>!!t)}catch{return[]}}async function Ke(){try{let e=w(await self.clients.matchAll({type:"window",includeUncontrolled:!0}));return e.length===0?null:e.find(r=>O(r.url)!==null)??e[0]}catch{return null}}function Xe(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}async function Je(e,t,r,n){let s={};e.headers.forEach((u,o)=>{o.toLowerCase()!==v&&(s[o]=u)});let i=U(s),l,p=!1;if(e.method!=="GET"&&e.method!=="HEAD"){let u=await e.arrayBuffer();u.byteLength>je?p=!0:u.byteLength>0&&(l=Xe(new Uint8Array(u)))}let g=new MessageChannel,{responsePromise:y}=Q(g.port1),f={type:ae,requestId:Qe(),extensionId:t.extensionId,request:{url:n,method:e.method,headers:i,bodyBase64:l,requestBodyTooLarge:p}};return r.postMessage(f,[g.port2]),y}function Qe(){let e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}})();
|
|
@@ -5,7 +5,7 @@
|
|
|
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/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-BcfY0APV.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-CHZomqvU.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/image-markers-CxJ9ZBgw.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/tool-ui-DfXu6quJ.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/providers-
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/providers-N-GzEZuq.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/panel-rpc-B3MSVImO.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-compat-CgBMwna8.js">
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/account-store-
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/account-store-BaTmqQCH.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/runtime-env-CgsZ7LTp.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="/assets/telemetry-BVzuNdvW.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/messages-BD4p8GuF.js">
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e='---\nname: automation\ndescription: |\n Use this when setting up event-driven automation in SLICC — webhooks, cron\n tasks, or filesystem watchers that route events to a scoop or cone. Covers\n `webhook`,\n `crontask`, and `fswatch` shell commands. Read this BEFORE wiring up anything\n that should fire on a schedule, an HTTP call, or a VFS change.\nallowed-tools: bash\n---\n\n# Automation: webhooks, cron, filesystem watchers\n\nSLICC\'s automation primitives turn external or VFS-internal events into **licks** — messages routed to a work unit. Three shell commands set them up:\n\n| Command | Trigger | Use case |\n| ---------- | ---------------------------- | --------------------------------- |\n| `webhook` | Inbound HTTP request | Callbacks from external services |\n| `crontask` | Cron schedule | Recurring background work |\n| `fswatch` | VFS create / modify / delete | React to authored content changes |\n\nAll three take `--scoop <target>`, which names **a unit, not a species**: a scoop name, a cone name, or a folder (`cone-<slug>`, `<name>-scoop`). Omit it and events come back to whichever unit you are — the cone you are in, or the scoop itself if you are one. A target naming no live unit is dropped, never re-routed.\n\n**If you want your own events, omit `--scoop` — never hardcode `cone`.** All three commands behave identically here, so omitting the flag is always available, and it works the same whether you are a cone or a scoop. The literal folder `cone` is not a synonym for "me": it belongs to whichever cone currently holds it, and it is handed to the next new cone after the original one is dropped. A skill that hardcodes it delivers its callbacks into another cone\'s chat in exactly the multi-cone workspaces where the target matters.\n\n## `webhook`\n\nReceive HTTP callbacks. The lick carries the request method, path, headers, and body; `create` allocates a path and prints the URL.\n\n```bash\nwebhook create --scoop pr-watcher --name gh-prs\nwebhook create --scoop Research --name inbox # a cone, by name\nwebhook create --name inbox # your own cone\nwebhook list && webhook delete wh-1\n```\n\nFlags:\n\n- `--scoop <target>` — scoop name, cone name, or folder. Omit for your own cone.\n- `--name <label>` — label shown in `webhook list`.\n- `--filter <js>` — JS expression per request; falsy drops the event before the agent sees it.\n\n## `crontask`\n\nRun on a cron schedule. Standard 5-field cron (minute hour day month weekday).\n\n```bash\ncrontask create --cron "0 * * * *" --scoop hourly-summary --name hourly\ncrontask create --cron "0 9 * * *" --name digest # your own cone\ncrontask list && crontask delete ct-1 # `kill` is an alias for `delete`\n```\n\nFlags:\n\n- `--cron <expr>` — required; 5-field cron expression.\n- `--scoop <target>` — scoop name, cone name, or folder. Omit for your own cone.\n- `--name <label>` — label.\n- `--filter <js>` — JS expression evaluated each tick; falsy skips that fire.\n\n## `fswatch`\n\nWatch a VFS path; deliver a lick when a matching file is created, modified, or deleted.\n\n```bash\nfswatch create --path /workspace --pattern "*.md" --scoop doc-watcher --name md-changes\nfswatch create --path /workspace/src --pattern "*.ts" # your own cone\nfswatch list && fswatch delete fsw-1\n```\n\nEvents carry the change type (`create`, `modify`, `delete`) and the path.\n\n## Don\'t\n\n- Don\'t poll on a `crontask` for work the cone could do reactively. Cron is for genuinely recurring jobs (digests, refreshes); reactive work belongs on `fswatch`/`webhook`.\n- Don\'t leave watchers/webhooks/crons orphaned. If the owning unit is gone, the lick is dropped — `... list` and `... delete` to clean up.\n- Don\'t fan one trigger out to N near-identical entries. Register once, let the receiver dispatch.\n';export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";function t(e){let t=e;if(t.__sliccWsRouter)return;let n=new Map;function r(e){if(e!==void 0)try{return new RegExp(e)}catch{return null}}function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];if(i(r)){if(!i(o)||!a(o,r))return!1;continue}if(!Object.is(o,r))return!1}return!0}function o(e,t){if(t===`text`)return e;try{return JSON.parse(e)}catch{return}}function s(e,t){if(!t||t.length===0||!i(e))return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function c(e,n){let r=t.__sliccWsRouterReport;if(typeof r==`function`)try{r(JSON.stringify({subId:e,payload:n}))}catch{}}function l(e,t){if(n.size!==0)for(let r of n.values()){if(r.urlMatch!==void 0){let t=r._urlMatchRe;if(t===null||t&&!t.test(e))continue}let n=o(t,r.filter?.parseAs);n!==void 0&&(r.filter?.where&&Object.keys(r.filter.where).length>0&&(!i(n)||!a(n,r.filter.where))||c(r.id,s(n,r.filter?.project)))}}let u=new WeakSet;function d(e){u.has(e)||(u.add(e),e.addEventListener(`message`,t=>{if(typeof t.data==`string`)try{l(e.url,t.data)}catch{}}))}let f=e.WebSocket;if(!f)return;let p=f.prototype.send;f.prototype.send=function(e){d(this),p.call(this,e)},Object.defineProperty(t,"__sliccWsRouter",{value:{register(e){n.set(e.id,{...e,_urlMatchRe:r(e.urlMatch)})},update(e,t){let i=n.get(e);if(!i)return;let a={...i,id:e};Object.prototype.hasOwnProperty.call(t,`urlMatch`)&&(t.urlMatch===null?(delete a.urlMatch,a._urlMatchRe=void 0):typeof t.urlMatch==`string`&&(a.urlMatch=t.urlMatch,a._urlMatchRe=r(t.urlMatch))),Object.prototype.hasOwnProperty.call(t,`filter`)&&(t.filter===null?delete a.filter:t.filter!==void 0&&(a.filter=t.filter)),n.set(e,a)},unregister(e){n.delete(e)},_dispatch:l},configurable:!1})}const n=`(${t.toString()})(globalThis);`,r=e(`cdp-ws-page-bridge`),i=`__sliccWsRouterReport`;var a=class{browser;installs=new Map;frameHandler=null;bindingListenerAttached=!1;onBindingCalled=e=>{if(e.name!==i)return;let t=e.payload;if(typeof t!=`string`)return;let n;try{n=JSON.parse(t)}catch{return}if(typeof n!=`object`||!n)return;let a=n.subId;if(typeof a!=`string`)return;let o=n.payload;try{this.frameHandler?.(a,o)}catch(e){r.warn(`frame handler threw`,{subId:a,error:e instanceof Error?e.message:String(e)})}};constructor(e){this.browser=e.browser}async installRouter(e){if(this.installs.has(e))return;this.ensureBindingListener();let t=await this.browser.withTab(e,async()=>{await this.browser.sendCDP(`Runtime.enable`),await this.browser.sendCDP(`Runtime.addBinding`,{name:i});let e=await this.browser.sendCDP(`Page.addScriptToEvaluateOnNewDocument`,{source:n});return await this.browser.sendCDP(`Runtime.evaluate`,{expression:n,returnByValue:!0}),e}),r=typeof t.identifier==`string`?t.identifier:null;this.installs.set(e,{scriptIdentifier:r})}async registerSelector(e,t,n,r){await this.evalRouterCall(e,`register`,{id:t,...n===void 0?{}:{urlMatch:n},...r===void 0?{}:{filter:r}})}async updateSelector(e,t,n,r){await this.browser.withTab(e,async()=>{let e={};n===null?e.urlMatch=null:n!==void 0&&(e.urlMatch=n),r===null?e.filter=null:r!==void 0&&(e.filter=r);let i=`window.__sliccWsRouter && window.__sliccWsRouter.update(${JSON.stringify(t)}, ${JSON.stringify(e)})`;await this.browser.sendCDP(`Runtime.evaluate`,{expression:i,returnByValue:!0})})}async unregisterSelector(e,t){await this.browser.withTab(e,async()=>{let e=`window.__sliccWsRouter && window.__sliccWsRouter.unregister(${JSON.stringify(t)})`;await this.browser.sendCDP(`Runtime.evaluate`,{expression:e,returnByValue:!0})})}onMatchedFrame(e){return this.frameHandler=e,()=>{this.frameHandler===e&&(this.frameHandler=null)}}dispose(){this.bindingListenerAttached&&=(this.browser.getTransport().off(`Runtime.bindingCalled`,this.onBindingCalled),!1),this.installs.clear(),this.frameHandler=null}ensureBindingListener(){this.bindingListenerAttached||=(this.browser.getTransport().on(`Runtime.bindingCalled`,this.onBindingCalled),!0)}async evalRouterCall(e,t,n){await this.browser.withTab(e,async()=>{let e=`window.__sliccWsRouter && window.__sliccWsRouter.${t}(${JSON.stringify(n)})`;await this.browser.sendCDP(`Runtime.evaluate`,{expression:e,returnByValue:!0})})}};export{a as CdpWsPageBridge};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{s as n}from"./src-CcFD5QfS.js";import{T as r,c as i,f as a,i as o,l as s,p as c,v as l,x as u,y as d}from"./db-DSIYsBgP.js";function f(e,t){if(e==null)return[];let n;if(Array.isArray(e))n=e.join(`, `).replace(/\n/g,`, `);else if(typeof e==`string`)n=e.replace(/\n/g,`, `);else return[];if(n.length===0)return[];let r=[],i=n.length,a=0;for(;a<i&&(a=p(n,a),!(a>=i));){if(n[a]!==`<`){a=m(n,a);continue}let e=n.indexOf(`>`,a+1);if(e===-1)break;let o=n.slice(a+1,e);a=e+1;let s=[];for(;a<i&&(a=p(n,a),!(a>=i));){if(n[a]===`,`){a++;break}if(n[a]!==`;`){a=m(n,a);break}a++,a=p(n,a);let e=a;for(;a<i&&ne(n.charCodeAt(a));)a++;if(a<i&&n[a]===`*`&&a++,e===a){a=m(n,a);break}let t=n.slice(e,a).toLowerCase();a=p(n,a);let r=``;if(a<i&&n[a]===`=`){if(a++,a=p(n,a),a<i&&n[a]===`"`){let e=te(n,a);r=e.value,a=e.end}else{let e=a;for(;a<i&&n[a]!==`;`&&n[a]!==`,`&&!ee(n[a]);)a++;r=n.slice(e,a)}}s.push([t,r])}let c=h(o,s,t);c&&r.push(c)}return r}function p(e,t){for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return t}function ee(e){return e===` `||e===` `}function m(e,t){let n=!1;for(;t<e.length;){let r=e[t];if(n){if(r===`\\`&&t+1<e.length){t+=2;continue}r===`"`&&(n=!1)}else if(r===`"`)n=!0;else if(r===`,`)return t+1;t++}return t}function te(e,t){t++;let n=``;for(;t<e.length;){let r=e[t];if(r===`\\`)t++,t<e.length&&(n+=e[t],t++);else if(r===`"`)return{value:n,end:t+1};else n+=r,t++}return{value:n,end:t}}function ne(e){if(e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)return!0;switch(e){case 33:case 35:case 36:case 37:case 38:case 39:case 42:case 43:case 45:case 46:case 94:case 95:case 96:case 124:case 126:return!0}return!1}function h(e,t,n){let r={},i={};for(let[e,n]of t){if(e.endsWith(`*`)){let t=_(n);t!=null&&(i[e.slice(0,-1)]=t);continue}e===`rel`&&`rel`in r||(r[e]=n)}for(let[e,t]of Object.entries(i))r[e]=t;let a=g(e,n),o=r.anchor==null?void 0:g(r.anchor,n),s={href:a,rel:(r.rel??``).split(/[ \t]+/).filter(e=>e.length>0),params:r};return o!=null&&(s.anchor=o),r.type!=null&&(s.type=r.type),r.title!=null&&(s.title=r.title),r.hreflang!=null&&(s.hreflang=r.hreflang),s}function g(e,t){if(!t)return e;try{return new URL(e,t).toString()}catch{return e}}function _(e){let t=e.indexOf(`'`);if(t===-1)return null;let n=e.indexOf(`'`,t+1);if(n===-1||e.slice(0,t).toLowerCase()!==`utf-8`)return null;try{return decodeURIComponent(e.slice(n+1))}catch{return null}}function v(e){if(!e)return[];let t=[];for(let[n,r]of Object.entries(e))n.toLowerCase()===`link`&&typeof r==`string`&&r.length>0&&t.push(r);return t}function y(e){for(let t of e)if(t.rel.includes(`ai-catalog`))return{kind:`ai-catalog`,url:t.href};return null}function re(e){return[e.origin??``,e.kind??``,e.url??``].join(`\0`)}const ie=`${n}/rel/handoff`,b=`${n}/rel/upskill`;function ae(e){let t=e.replace(/\/+$/,``),n=t.toLowerCase();return n.endsWith(`/skill.md`)?t.slice(0,-9):n===`skill.md`?``:t}const oe=/^[A-Za-z0-9._/-]+$/,x=/^[A-Za-z0-9._/-]+$/;function S(e){return!(e.length===0||e.length>250||!oe.test(e)||e.startsWith(`-`)||e.startsWith(`/`)||e.endsWith(`/`)||e.includes(`..`)||e.endsWith(`.lock`))}function C(e){return!(e.length===0||e.length>1024||!x.test(e)||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`))}function w(e,t){let n=t.branch;typeof n==`string`&&S(n)&&(e.branch=n);let r=t.path;if(typeof r==`string`&&r.length>0){let t=ae(r);t.length>0&&C(t)&&(e.path=t)}}function T(e){for(let t of e){if(t.rel.includes(ie)){let e={verb:`handoff`,target:t.href};return t.title!=null&&t.title.length>0&&(e.instruction=t.title),e}if(t.rel.includes(b)){let e={verb:`upskill`,target:t.href};return t.title!=null&&t.title.length>0&&(e.instruction=t.title),w(e,t.params),e}}return null}function E(e){return[e.verb,e.target,e.branch??``,e.path??``,e.instruction??``].join(`\0`)}function se(e,t){let n=v(e);if(n.length===0)return{match:null,links:[]};let r=f(n,t);return{match:T(r),links:r}}function D(e){return Date.UTC(e.y,e.m-1,e.d,e.h,e.i,e.s)}function O(e,t){return e.y===t.y&&e.m===t.m&&e.d===t.d&&e.h===t.h&&e.i===t.i&&e.s===t.s}function k(e,t){let n=new Date(Date.parse(e));if(isNaN(n))throw Error(`Invalid ISO8601 passed to timezone parser.`);let r=e.substring(9);return r.includes(`Z`)||r.includes(`+`)||r.includes(`-`)?N(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),`Etc/UTC`):N(n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),t)}function A(e,t,n){return j(k(e,t),n)}function j(e,t){let n=new Date(D(e)),r=M(n,e.tz),i=D(e)-D(r),a=new Date(n.getTime()+i),o=M(a,e.tz);if(O(o,e)){let t=new Date(a.getTime()-36e5);return O(M(t,e.tz),e)?t:a}let s=new Date(a.getTime()+D(e)-D(o));if(O(M(s,e.tz),e))return s;if(t)throw Error(`Invalid date passed to fromTZ()`);return a.getTime()>s.getTime()?a:s}function M(e,t){let n,r;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,hour12:!1}),r=n.formatToParts(e)}catch(e){let n=e instanceof Error?e.message:String(e);throw RangeError(`toTZ: Invalid timezone '${t}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${n}`)}let i={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let e of r)(e.type===`year`||e.type===`month`||e.type===`day`||e.type===`hour`||e.type===`minute`||e.type===`second`)&&(i[e.type]=parseInt(e.value,10));if(isNaN(i.year)||isNaN(i.month)||isNaN(i.day)||isNaN(i.hour)||isNaN(i.minute)||isNaN(i.second))throw Error(`toTZ: Failed to parse all date components from timezone '${t}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(i)}`);return i.hour===24&&(i.hour=0),{y:i.year,m:i.month,d:i.day,h:i.hour,i:i.minute,s:i.second,tz:t}}function N(e,t,n,r,i,a,o){return{y:e,m:t,d:n,h:r,i,s:a,tz:o}}var P=[1,2,4,8,16],F=class{pattern;timezone;mode;alternativeWeekdays;sloppyRanges;second;minute;hour;day;month;dayOfWeek;year;lastDayOfMonth;lastWeekday;nearestWeekdays;starDOM;starDOW;starYear;useAndLogic;constructor(e,t,n){this.pattern=e,this.timezone=t,this.mode=n?.mode??`auto`,this.alternativeWeekdays=n?.alternativeWeekdays??!1,this.sloppyRanges=n?.sloppyRanges??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern==`string`||this.pattern instanceof String))throw TypeError(`CronPattern: Pattern has to be of type string.`);this.pattern.indexOf(`@`)>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let e=this.pattern.match(/\S+/g)||[``],t=e.length;if(e.length<5||e.length>7)throw TypeError(`CronPattern: invalid configuration format ('`+this.pattern+`'), exactly five, six, or seven space separated parts are required.`);if(this.mode!==`auto`){let e;switch(this.mode){case`5-part`:e=5;break;case`6-part`:e=6;break;case`7-part`:e=7;break;case`5-or-6-parts`:e=[5,6];break;case`6-or-7-parts`:e=[6,7];break;default:e=0}if(!(Array.isArray(e)?e.includes(t):t===e)){let n=Array.isArray(e)?e.join(` or `):e.toString();throw TypeError(`CronPattern: mode '${this.mode}' requires exactly ${n} parts, but pattern '${this.pattern}' has ${t} parts.`)}}if(e.length===5&&e.unshift(`0`),e.length===6&&e.push(`*`),e[3].toUpperCase()===`LW`?(this.lastWeekday=!0,e[3]=``):e[3].toUpperCase().indexOf(`L`)>=0&&(e[3]=e[3].replace(/L/gi,``),this.lastDayOfMonth=!0),e[3]==`*`&&(this.starDOM=!0),e[6]==`*`&&(this.starYear=!0),e[4].length>=3&&(e[4]=this.replaceAlphaMonths(e[4])),e[5].length>=3&&(e[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(e[5]):this.replaceAlphaDays(e[5])),e[5].startsWith(`+`)&&(this.useAndLogic=!0,e[5]=e[5].substring(1),e[5]===``))throw TypeError(`CronPattern: Day-of-week field cannot be empty after '+' modifier.`);switch(e[5]==`*`&&(this.starDOW=!0),this.pattern.indexOf(`?`)>=0&&(e[0]=e[0].replace(/\?/g,`*`),e[1]=e[1].replace(/\?/g,`*`),e[2]=e[2].replace(/\?/g,`*`),e[3]=e[3].replace(/\?/g,`*`),e[4]=e[4].replace(/\?/g,`*`),e[5]=e[5].replace(/\?/g,`*`),e[6]&&=e[6].replace(/\?/g,`*`)),this.mode){case`5-part`:e[0]=`0`,e[6]=`*`;break;case`6-part`:e[6]=`*`;break;case`5-or-6-parts`:e[6]=`*`}this.throwAtIllegalCharacters(e),this.partToArray(`second`,e[0],0,1),this.partToArray(`minute`,e[1],0,1),this.partToArray(`hour`,e[2],0,1),this.partToArray(`day`,e[3],-1,1),this.partToArray(`month`,e[4],-1,1);let n=this.alternativeWeekdays?-1:0;this.partToArray(`dayOfWeek`,e[5],n,63),this.partToArray(`year`,e[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(e,t,n,r){let i=this[e],a=e===`day`&&this.lastDayOfMonth,o=e===`day`&&this.lastWeekday;if(t===``&&!a&&!o)throw TypeError(`CronPattern: configuration entry `+e+` (`+t+`) is empty, check for trailing spaces.`);if(t===`*`)return i.fill(r);let s=t.split(`,`);if(s.length>1)for(let t=0;t<s.length;t++)this.partToArray(e,s[t],n,r);else t.indexOf(`-`)!==-1&&t.indexOf(`/`)!==-1?this.handleRangeWithStepping(t,e,n,r):t.indexOf(`-`)===-1?t.indexOf(`/`)===-1?t!==``&&this.handleNumber(t,e,n,r):this.handleStepping(t,e,n,r):this.handleRange(t,e,n,r)}throwAtIllegalCharacters(e){for(let t=0;t<e.length;t++)if((t===3?/[^/*0-9,\-WwLl]+/:t===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(e[t]))throw TypeError(`CronPattern: configuration entry `+t+` (`+e[t]+`) contains illegal characters.`)}handleNumber(e,t,n,r){let i=this.extractNth(e,t),a=e.toUpperCase().includes(`W`);if(t!==`day`&&a)throw TypeError(`CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.`);a&&(t=`nearestWeekdays`);let o=parseInt(i[0],10)+n;if(isNaN(o))throw TypeError(`CronPattern: `+t+` is not a number: '`+e+`'`);this.setPart(t,o,i[1]||r)}setPart(e,t,n){if(!Object.prototype.hasOwnProperty.call(this,e))throw TypeError(`CronPattern: Invalid part specified: `+e);if(e===`dayOfWeek`){if(t===7&&(t=0),t<0||t>6)throw RangeError(`CronPattern: Invalid value for dayOfWeek: `+t);this.setNthWeekdayOfMonth(t,n);return}if(e===`second`||e===`minute`){if(t<0||t>=60)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`hour`){if(t<0||t>=24)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`day`||e===`nearestWeekdays`){if(t<0||t>=31)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`month`){if(t<0||t>=12)throw RangeError(`CronPattern: Invalid value for `+e+`: `+t)}else if(e===`year`&&(t<1||t>=1e4))throw RangeError(`CronPattern: Invalid value for `+e+`: `+t+` (supported range: 1-9999)`);this[e][t]=n}validateNotNaN(e,t){if(isNaN(e))throw TypeError(t)}validateRange(e,t,n,r,i){if(e>t)throw TypeError(`CronPattern: From value is larger than to value: '`+i+`'`);if(n!==void 0){if(n===0)throw TypeError(`CronPattern: Syntax error, illegal stepping: 0`);if(n>this[r].length)throw TypeError(`CronPattern: Syntax error, steps cannot be greater than maximum value of part (`+this[r].length+`)`)}}handleRangeWithStepping(e,t,n,r){if(e.toUpperCase().includes(`W`))throw TypeError(`CronPattern: Syntax error, W is not allowed in ranges with stepping.`);let i=this.extractNth(e,t),a=i[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(a===null)throw TypeError(`CronPattern: Syntax error, illegal range with stepping: '`+e+`'`);let[,o,s,c]=a,l=parseInt(o,10)+n,u=parseInt(s,10)+n,d=parseInt(c,10);this.validateNotNaN(l,`CronPattern: Syntax error, illegal lower range (NaN)`),this.validateNotNaN(u,`CronPattern: Syntax error, illegal upper range (NaN)`),this.validateNotNaN(d,`CronPattern: Syntax error, illegal stepping: (NaN)`),this.validateRange(l,u,d,t,e);for(let e=l;e<=u;e+=d)this.setPart(t,e,i[1]||r)}extractNth(e,t){let n=e,r;if(n.includes(`#`)){if(t!==`dayOfWeek`)throw Error(`CronPattern: nth (#) only allowed in day-of-week field`);r=n.split(`#`)[1],n=n.split(`#`)[0]}else if(n.toUpperCase().endsWith(`L`)){if(t!==`dayOfWeek`)throw Error(`CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)`);r=`L`,n=n.slice(0,-1)}return[n,r]}handleRange(e,t,n,r){if(e.toUpperCase().includes(`W`))throw TypeError(`CronPattern: Syntax error, W is not allowed in a range.`);let i=this.extractNth(e,t),a=i[0].split(`-`);if(a.length!==2)throw TypeError(`CronPattern: Syntax error, illegal range: '`+e+`'`);let o=parseInt(a[0],10)+n,s=parseInt(a[1],10)+n;this.validateNotNaN(o,`CronPattern: Syntax error, illegal lower range (NaN)`),this.validateNotNaN(s,`CronPattern: Syntax error, illegal upper range (NaN)`),this.validateRange(o,s,void 0,t,e);for(let e=o;e<=s;e++)this.setPart(t,e,i[1]||r)}handleStepping(e,t,n,r){if(e.toUpperCase().includes(`W`))throw TypeError(`CronPattern: Syntax error, W is not allowed in parts with stepping.`);let i=this.extractNth(e,t),a=i[0].split(`/`);if(a.length!==2)throw TypeError(`CronPattern: Syntax error, illegal stepping: '`+e+`'`);if(this.sloppyRanges)a[0]===``&&(a[0]=`*`);else{if(a[0]===``)throw TypeError(`CronPattern: Syntax error, stepping with missing prefix ('`+e+`') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.`);if(a[0]!==`*`)throw TypeError(`CronPattern: Syntax error, stepping with numeric prefix ('`+e+`') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.`)}let o=0;a[0]!==`*`&&(o=parseInt(a[0],10)+n);let s=parseInt(a[1],10);this.validateNotNaN(s,`CronPattern: Syntax error, illegal stepping: (NaN)`),this.validateRange(0,this[t].length-1,s,t,e);for(let e=o;e<this[t].length;e+=s)this.setPart(t,e,i[1]||r)}replaceAlphaDays(e){return e.replace(/-sun/gi,`-7`).replace(/sun/gi,`0`).replace(/mon/gi,`1`).replace(/tue/gi,`2`).replace(/wed/gi,`3`).replace(/thu/gi,`4`).replace(/fri/gi,`5`).replace(/sat/gi,`6`)}replaceAlphaDaysQuartz(e){return e.replace(/sun/gi,`1`).replace(/mon/gi,`2`).replace(/tue/gi,`3`).replace(/wed/gi,`4`).replace(/thu/gi,`5`).replace(/fri/gi,`6`).replace(/sat/gi,`7`)}replaceAlphaMonths(e){return e.replace(/jan/gi,`1`).replace(/feb/gi,`2`).replace(/mar/gi,`3`).replace(/apr/gi,`4`).replace(/may/gi,`5`).replace(/jun/gi,`6`).replace(/jul/gi,`7`).replace(/aug/gi,`8`).replace(/sep/gi,`9`).replace(/oct/gi,`10`).replace(/nov/gi,`11`).replace(/dec/gi,`12`)}handleNicknames(e){let t=e.trim().toLowerCase();if(t===`@yearly`||t===`@annually`)return`0 0 1 1 *`;if(t===`@monthly`)return`0 0 1 * *`;if(t===`@weekly`)return`0 0 * * 0`;if(t===`@daily`||t===`@midnight`)return`0 0 * * *`;if(t===`@hourly`)return`0 * * * *`;if(t===`@reboot`)throw TypeError(`CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.`);return e}setNthWeekdayOfMonth(e,t){if(typeof t!=`number`&&t.toUpperCase()===`L`)this.dayOfWeek[e]=this.dayOfWeek[e]|32;else if(t===63)this.dayOfWeek[e]=63;else if(t<6&&t>0)this.dayOfWeek[e]=this.dayOfWeek[e]|P[t-1];else throw TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`)}},I=[31,28,31,30,31,30,31,31,30,31,30,31],L=[[`month`,`year`,0],[`day`,`month`,-1],[`hour`,`day`,0],[`minute`,`hour`,0],[`second`,`minute`,0]],R=class e{tz;ms;second;minute;hour;day;month;year;constructor(t,n){if(this.tz=n,t&&t instanceof Date){if(!isNaN(t))this.fromDate(t);else throw TypeError(`CronDate: Invalid date passed to CronDate constructor`)}else if(t==null)this.fromDate(new Date);else if(t&&typeof t==`string`)this.fromString(t);else if(t instanceof e)this.fromCronDate(t);else throw TypeError(`CronDate: Invalid type (`+typeof t+`) passed to CronDate constructor`)}getLastDayOfMonth(e,t){return t===1?new Date(Date.UTC(e,t+1,0)).getUTCDate():I[t]}getLastWeekday(e,t){let n=this.getLastDayOfMonth(e,t),r=new Date(Date.UTC(e,t,n)).getUTCDay();return r===0?n-2:r===6?n-1:n}getNearestWeekday(e,t,n){let r=this.getLastDayOfMonth(e,t);if(n>r)return-1;let i=new Date(Date.UTC(e,t,n)).getUTCDay();return i===0?n===r?n-2:n+1:i===6?n===1?n+2:n-1:n}isNthWeekdayOfMonth(e,t,n,r){let i=new Date(Date.UTC(e,t,n)).getUTCDay(),a=0;for(let r=1;r<=n;r++)new Date(Date.UTC(e,t,r)).getUTCDay()===i&&a++;if(r&63&&P[a-1]&r)return!0;if(r&32){let r=this.getLastDayOfMonth(e,t);for(let a=n+1;a<=r;a++)if(new Date(Date.UTC(e,t,a)).getUTCDay()===i)return!1;return!0}return!1}fromDate(e){if(this.tz!==void 0){if(typeof this.tz==`number`)this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes()+this.tz,this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),this.apply();else try{let t=M(e,this.tz);this.ms=e.getMilliseconds(),this.second=t.s,this.minute=t.i,this.hour=t.h,this.day=t.d,this.month=t.m-1,this.year=t.y}catch(e){let t=e instanceof Error?e.message:String(e);throw TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${t}`)}}else this.ms=e.getMilliseconds(),this.second=e.getSeconds(),this.minute=e.getMinutes(),this.hour=e.getHours(),this.day=e.getDate(),this.month=e.getMonth(),this.year=e.getFullYear()}fromCronDate(e){this.tz=e.tz,this.year=e.year,this.month=e.month,this.day=e.day,this.hour=e.hour,this.minute=e.minute,this.second=e.second,this.ms=e.ms}apply(){if(this.month>11||this.month<0||this.day>I[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let e=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=e.getUTCMilliseconds(),this.second=e.getUTCSeconds(),this.minute=e.getUTCMinutes(),this.hour=e.getUTCHours(),this.day=e.getUTCDate(),this.month=e.getUTCMonth(),this.year=e.getUTCFullYear(),!0}return!1}fromString(e){if(typeof this.tz==`number`){let t=A(e);this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes(),this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),this.apply()}else return this.fromDate(A(e,this.tz))}findNext(e,t,n,r){return this._findMatch(e,t,n,r,1)}_findMatch(e,t,n,r,i){let a=this[t],o;n.lastDayOfMonth&&(o=this.getLastDayOfMonth(this.year,this.month));let s=!n.starDOW&&t==`day`?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,c=this[t]+r,l=i===1?e=>e<n[t].length:e=>e>=0;for(let u=c;l(u);u+=i){let i=n[t][u];if(t===`day`&&!i){for(let e=0;e<n.nearestWeekdays.length;e++)if(n.nearestWeekdays[e]){let t=this.getNearestWeekday(this.year,this.month,e-r);if(t===-1)continue;if(t===u-r){i=1;break}}}if(t===`day`&&n.lastWeekday){let e=this.getLastWeekday(this.year,this.month);u-r===e&&(i=1)}if(t===`day`&&n.lastDayOfMonth&&u-r==o&&(i=1),t===`day`&&!n.starDOW){let t=n.dayOfWeek[(s+(u-r-1))%7];if(t&&t&63)t=+!!this.isNthWeekdayOfMonth(this.year,this.month,u-r,t);else if(t)throw Error(`CronDate: Invalid value for dayOfWeek encountered. ${t}`);n.useAndLogic?i&&=t:!e.domAndDow&&!n.starDOM?i||=t:i&&=t}if(i)return this[t]=u-r,a===this[t]?1:2}return 3}recurse(e,t,n){if(n===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let t=-1;for(let n=this.year+1;n<e.year.length&&n<1e4;n++)if(e.year[n]===1){t=n;break}if(t===-1)return null;this.year=t,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let r=this.findNext(t,L[n][0],e,L[n][2]);if(r>1){let i=n+1;for(;i<L.length;)this[L[i][0]]=-L[i][2],i++;if(r===3){if(this[L[n][1]]++,this[L[n][0]]=-L[n][2],this.apply(),n===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=e.year.length)return null}return this.recurse(e,t,0)}if(this.apply())return this.recurse(e,t,n-1)}return n+=1,n>=L.length?this:(e.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(e,t,n)}increment(e,t,n){return this.second+=t.interval!==void 0&&t.interval>1&&n?t.interval:1,this.ms=0,this.apply(),this.recurse(e,t,0)}decrement(e,t){return this.second-=t.interval!==void 0&&t.interval>1?t.interval:1,this.ms=0,this.apply(),this.recurseBackward(e,t,0,0)}recurseBackward(e,t,n,r=0){if(r>1e4)return null;if(n===0&&!e.starYear){if(this.year>=0&&this.year<e.year.length&&e.year[this.year]===0){let t=-1;for(let n=this.year-1;n>=0;n--)if(e.year[n]===1){t=n;break}if(t===-1)return null;this.year=t,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let i=this.findPrevious(t,L[n][0],e,L[n][2]);if(i>1){let a=n+1;for(;a<L.length;){let t=L[a][0],n=L[a][2],r=this.getMaxPatternValue(t,e,n);this[t]=r,a++}if(i===3){if(this[L[n][1]]--,n===0){let e=this.getLastDayOfMonth(this.year,this.month);this.day>e&&(this.day=e)}if(n===1){if(this.day<=0)this.day=1;else{let e=this.year,t=this.month;for(;t<0;)t+=12,e--;for(;t>11;)t-=12,e++;let n=t===1?new Date(Date.UTC(e,t+1,0)).getUTCDate():I[t];this.day>n&&(this.day=n)}}this.apply();let i=L[n][0],a=L[n][2],o=this.getMaxPatternValue(i,e,a);if(i===`day`){let e=this.getLastDayOfMonth(this.year,this.month);this[i]=Math.min(o,e)}else this[i]=o;if(this.apply(),n===0){let t=L[1][2],n=this.getMaxPatternValue(`day`,e,t),r=this.getLastDayOfMonth(this.year,this.month),i=Math.min(n,r);i!==this.day&&(this.day=i,this.hour=this.getMaxPatternValue(`hour`,e,L[2][2]),this.minute=this.getMaxPatternValue(`minute`,e,L[3][2]),this.second=this.getMaxPatternValue(`second`,e,L[4][2]))}if(n===0&&!e.starYear){for(;this.year>=0&&this.year<e.year.length&&e.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(e,t,0,r+1)}if(this.apply())return this.recurseBackward(e,t,n-1,r+1)}return n+=1,n>=L.length?this:this.year<0?null:this.recurseBackward(e,t,n,r+1)}getMaxPatternValue(e,t,n){if(e===`day`&&t.lastDayOfMonth||e===`day`&&!t.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let r=t[e].length-1;r>=0;r--)if(t[e][r])return r-n;return t[e].length-1-n}findPrevious(e,t,n,r){return this._findMatch(e,t,n,r,-1)}getDate(e){return e||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz==`number`?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):j(N(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(e,t){if(!e.starYear&&(this.year<0||this.year>=e.year.length||e.year[this.year]===0))return!1;for(let n=0;n<L.length;n++){let r=L[n][0],i=L[n][2],a=this[r];if(a+i<0||a+i>=e[r].length)return!1;let o=e[r][a+i];if(r===`day`){if(!o){for(let t=0;t<e.nearestWeekdays.length;t++)if(e.nearestWeekdays[t]){let e=this.getNearestWeekday(this.year,this.month,t-i);if(e!==-1&&e===a){o=1;break}}}if(e.lastWeekday&&a===this.getLastWeekday(this.year,this.month)&&(o=1),e.lastDayOfMonth&&a===this.getLastDayOfMonth(this.year,this.month)&&(o=1),!e.starDOW){let n=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),r=e.dayOfWeek[(n+(a-1))%7];r&&r&63&&(r=+!!this.isNthWeekdayOfMonth(this.year,this.month,a,r)),e.useAndLogic?o&&=r:!t.domAndDow&&!e.starDOM?o||=r:o&&=r}}if(!o)return!1}return!0}};function z(e){if(e===void 0&&(e={}),delete e.name,e.legacyMode!==void 0&&e.domAndDow===void 0?e.domAndDow=!e.legacyMode:e.domAndDow===void 0&&(e.domAndDow=!1),e.legacyMode=!e.domAndDow,e.paused=e.paused!==void 0&&e.paused,e.maxRuns=e.maxRuns===void 0?1/0:e.maxRuns,e.catch=e.catch!==void 0&&e.catch,e.interval=e.interval===void 0?0:parseInt(e.interval.toString(),10),e.utcOffset=e.utcOffset===void 0?void 0:parseInt(e.utcOffset.toString(),10),e.dayOffset=e.dayOffset===void 0?0:parseInt(e.dayOffset.toString(),10),e.unref=e.unref!==void 0&&e.unref,e.mode=e.mode===void 0?`auto`:e.mode,e.alternativeWeekdays=e.alternativeWeekdays!==void 0&&e.alternativeWeekdays,e.sloppyRanges=e.sloppyRanges!==void 0&&e.sloppyRanges,![`auto`,`5-part`,`6-part`,`7-part`,`5-or-6-parts`,`6-or-7-parts`].includes(e.mode))throw Error(`CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.`);if(e.startAt&&(e.startAt=new R(e.startAt,e.timezone)),e.stopAt&&(e.stopAt=new R(e.stopAt,e.timezone)),e.interval!==null){if(isNaN(e.interval))throw Error(`CronOptions: Supplied value for interval is not a number`);if(e.interval<0)throw Error(`CronOptions: Supplied value for interval can not be negative`)}if(e.utcOffset!==void 0){if(isNaN(e.utcOffset))throw Error(`CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.`);if(e.utcOffset<-870||e.utcOffset>870)throw Error(`CronOptions: utcOffset out of bounds.`);if(e.utcOffset!==void 0&&e.timezone)throw Error(`CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.`)}if(e.unref!==!0&&e.unref!==!1)throw Error(`CronOptions: Unref should be either true, false or undefined(false).`);if(e.dayOffset!==void 0&&e.dayOffset!==0&&isNaN(e.dayOffset))throw Error(`CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.`);return e}function B(e){return Object.prototype.toString.call(e)===`[object Function]`||typeof e==`function`||e instanceof Function}function V(e){return B(e)}function H(e){typeof Deno<`u`&&typeof Deno.unrefTimer<`u`?Deno.unrefTimer(e):e&&typeof e.unref<`u`&&e.unref()}var U=3e4,W=[],G=class{name;options;_states;fn;getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(e){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let t=this.options.dayOffset*24*60*60*1e3;return new Date(e.getTime()+t)}return e}constructor(e,t,n){let r,i;if(B(t))i=t;else if(typeof t==`object`)r=t;else if(t!==void 0)throw Error(`Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).`);if(B(n))i=n;else if(typeof n==`object`)r=n;else if(n!==void 0)throw Error(`Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).`);if(this.name=r?.name,this.options=z(r),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:r?r.maxRuns:void 0,paused:r?r.paused:!1,pattern:new F(`* * * * *`,void 0,{mode:`auto`})},e&&(e instanceof Date||typeof e==`string`&&e.indexOf(`:`)>0)?this._states.once=new R(e,this.getTz()):this._states.pattern=new F(e,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(W.find(e=>e.name===this.name))throw Error(`Cron: Tried to initialize new named job '`+this.name+`', but name already taken.`);W.push(this)}return i!==void 0&&V(i)&&(this.fn=i,this.schedule()),this}nextRun(e){let t=this._next(e);return t?this.applyDayOffset(t.getDate(!1)):null}nextRuns(e,t){this._states.maxRuns!==void 0&&e>this._states.maxRuns&&(e=this._states.maxRuns);let n=t||this._states.currentRun||void 0;return this._enumerateRuns(e,n,`next`)}previousRuns(e,t){return this._enumerateRuns(e,t||void 0,`previous`)}_enumerateRuns(e,t,n){let r=[],i=t?new R(t,this.getTz()):null,a=n===`next`?this._next:this._previous;for(;e--;){let e=a.call(this,i);if(!e)break;let t=e.getDate(!1);r.push(this.applyDayOffset(t)),i=e}return r}match(e){if(this._states.once){let t=new R(e,this.getTz());t.ms=0;let n=new R(this._states.once,this.getTz());return n.ms=0,t.getTime()===n.getTime()}let t=new R(e,this.getTz());return t.ms=0,t.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let e=this.nextRun(this._states.currentRun),t=!this._states.paused,n=this.fn!==void 0,r=!this._states.kill;return t&&n&&r&&e!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(e){let t=this._next(e);return t?e instanceof R||e instanceof Date?t.getTime()-e.getTime():t.getTime()-new R(e).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let e=W.indexOf(this);e>=0&&W.splice(e,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(e){if(e&&this.fn)throw Error(`Cron: It is not allowed to schedule two functions using the same Croner instance.`);e&&(this.fn=e);let t=this.msToNext(),n=this.nextRun(this._states.currentRun);return t==null||isNaN(t)||n===null?this:(t>U&&(t=U),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(n),t),this._states.currentTimeout&&this.options.unref&&H(this._states.currentTimeout),this)}async _trigger(e){this._states.blocking=!0,this._states.currentRun=new R(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(e){if(B(this.options.catch))try{this.options.catch(e,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new R(e,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(e){let t=new Date,n=!this._states.paused&&t.getTime()>=e.getTime(),r=this._states.blocking&&this.options.protect;n&&!r?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):n&&r&&B(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(e){let t=!!(e||this._states.currentRun),n=!1;!e&&this.options.startAt&&this.options.interval&&([e,t]=this._calculatePreviousRun(e,t),n=!e),e=new R(e,this.getTz()),this.options.startAt&&e&&e.getTime()<this.options.startAt.getTime()&&(e=this.options.startAt);let r=this._states.once||new R(e,this.getTz());return!n&&r!==this._states.once&&(r=r.increment(this._states.pattern,this.options,t)),this._states.once&&this._states.once.getTime()<=e.getTime()||r===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&r.getTime()>=this.options.stopAt.getTime()?null:r}_previous(e){let t=new R(e,this.getTz());this.options.stopAt&&t.getTime()>this.options.stopAt.getTime()&&(t=this.options.stopAt);let n=new R(t,this.getTz());return this._states.once?this._states.once.getTime()<t.getTime()?this._states.once:null:(n=n.decrement(this._states.pattern,this.options),n===null||this.options.startAt&&n.getTime()<this.options.startAt.getTime()?null:n)}_calculatePreviousRun(e,t){let n=new R(void 0,this.getTz()),r=e;if(this.options.startAt.getTime()<=n.getTime()){r=this.options.startAt;let e=r.getTime()+this.options.interval*1e3;for(;e<=n.getTime();)r=new R(r,this.getTz()).increment(this._states.pattern,this.options,!0),e=r.getTime()+this.options.interval*1e3;t=!0}return r===null&&(r=void 0),[r,t]}};function K(e,t){try{return new G(e.trim(),{domAndDow:!0}).nextRun(t)??null}catch{return null}}var q=e({FORWARDABLE_TO_LEADER:()=>Y,LickManager:()=>X,buildActiveLicksError:()=>Q,getLickManager:()=>ue,lickScoopMatches:()=>Z});const J=t(`lick-manager`),Y=new Set([`navigate`,`discovery`]);function ce(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.verb!=`string`||typeof t.target!=`string`?null:E({verb:t.verb,target:t.target,branch:typeof t.branch==`string`?t.branch:void 0,path:typeof t.path==`string`?t.path:void 0,instruction:typeof t.instruction==`string`?t.instruction:void 0})}function le(e){return!e.discoveryKind&&!e.discoveryUrl&&!e.discoveryOrigin?null:re({origin:e.discoveryOrigin,kind:e.discoveryKind,url:e.discoveryUrl})}var X=class{webhooks=new Map;crontasks=new Map;cronInterval=null;eventHandler=null;forwarder=null;seenNavigateFingerprints=new Set;seenDiscoveryFingerprints=new Set;scoopResolver=null;discoveryIgnore=null;async init(){await d();let e=await a();for(let t of e)this.webhooks.set(t.id,t);J.info(`Loaded webhooks`,{count:this.webhooks.size});let t=await s();for(let e of t)this.crontasks.set(e.id,e);J.info(`Loaded crontasks`,{count:this.crontasks.size}),await this.reconcileOrphans(),this.cronInterval=setInterval(()=>this.runCronScheduler(),6e4),J.info(`Cron scheduler started`)}setScoopExistenceResolver(e){this.scoopResolver=e}setDiscoveryIgnore(e){this.discoveryIgnore=e}isOrphanedLick(e){return!this.scoopResolver||!e?!1:!this.scoopResolver(e)}async reconcileOrphans(){if(this.scoopResolver){for(let e of Array.from(this.webhooks.values()))if(this.isOrphanedLick(e.scoop)){J.warn(`Removing orphaned webhook at init; target scoop no longer exists`,{id:e.id,name:e.name,scoop:e.scoop}),this.webhooks.delete(e.id);try{await i(e.id)}catch(t){J.warn(`Failed to delete orphaned webhook from DB`,{id:e.id,error:t instanceof Error?t.message:String(t)})}}for(let e of Array.from(this.crontasks.values()))if(this.isOrphanedLick(e.scoop)){J.warn(`Removing orphaned cron task at init; target scoop no longer exists`,{id:e.id,name:e.name,scoop:e.scoop}),this.crontasks.delete(e.id);try{await o(e.id)}catch(t){J.warn(`Failed to delete orphaned cron task from DB`,{id:e.id,error:t instanceof Error?t.message:String(t)})}}}}dispose(){this.cronInterval&&=(clearInterval(this.cronInterval),null)}setEventHandler(e){this.eventHandler=e}setForwarder(e){this.forwarder=e}dispatch(e){if(!(e.type===`discovery`&&this.shouldSuppressDiscovery(e))){if(this.forwarder&&Y.has(e.type)){this.forwarder(e);return}this.eventHandler?.(e)}}handleForwardedEvent(e){e.type===`discovery`&&this.shouldSuppressDiscovery(e)||this.isDuplicateFingerprint(e)||this.eventHandler?.(e)}emitEvent(e){e.type===`discovery`&&this.shouldSuppressDiscovery(e)||this.isDuplicateFingerprint(e)||(J.info(`External lick event`,{type:e.type,target:e.targetScoop}),this.dispatch(e))}isDuplicateFingerprint(e){let t=null,n,r;if(e.type===`navigate`)t=ce(e.body),n=this.seenNavigateFingerprints,r=`navigate`;else if(e.type===`discovery`)t=le(e),n=this.seenDiscoveryFingerprints,r=`discovery`;else return!1;return t===null?!1:n.has(t)?(J.debug(`Suppressing duplicate ${r} lick`,{fingerprint:t}),!0):(n.add(t),!1)}shouldSuppressDiscovery(e){return e.discoverySource===`live-navigation`?this.discoveryIgnore?.(e)?(J.debug(`Suppressing ignored llms.txt discovery`,{origin:e.discoveryOrigin}),!0):!1:(J.debug(`Suppressing discovery without live-navigation provenance`),!0)}async createWebhook(e,t,n){let i=this.generateId(),a={id:i,name:e,createdAt:new Date().toISOString(),filter:n,scoop:t};return n&&this.compileFilter(n,!0),this.webhooks.set(i,a),await r(a),J.info(`Webhook created`,{id:i,name:e,scoop:t}),a}async deleteWebhook(e){return this.webhooks.has(e)?(this.webhooks.delete(e),await i(e),J.info(`Webhook deleted`,{id:e}),!0):await l(e)!==null&&(await i(e),J.info(`Webhook deleted`,{id:e}),!0)}listWebhooks(){return Array.from(this.webhooks.values())}getWebhook(e){return this.webhooks.get(e)}handleWebhookEvent(e,t,n){let r=this.webhooks.get(e);if(!r){J.warn(`Webhook not found`,{webhookId:e});return}let i={type:`webhook`,webhookId:e,webhookName:r.name,targetScoop:r.scoop,timestamp:new Date().toISOString(),headers:t,body:n};if(r.filter)try{let t=this.compileFilter(r.filter,!0)(i);if(t===!1){J.debug(`Webhook event dropped by filter`,{webhookId:e,name:r.name});return}typeof t==`object`&&t&&(i=t)}catch(t){J.error(`Webhook filter error`,{webhookId:e,error:t instanceof Error?t.message:String(t)})}J.info(`Webhook event received`,{webhookId:e,name:r.name,targetScoop:r.scoop}),this.dispatch(i)}async createCronTask(e,t,n,r){let i=K(t,new Date);if(!i)throw Error(`Invalid cron expression`);r&&this.compileFilter(r,!1);let a=this.generateId(),o={id:a,name:e,cron:t,scoop:n,filter:r,nextRun:i.toISOString(),lastRun:null,status:`active`,createdAt:new Date().toISOString()};return this.crontasks.set(a,o),await u(o),J.info(`Cron task created`,{id:a,name:e,cron:t,scoop:n}),o}async deleteCronTask(e){return this.crontasks.has(e)?(this.crontasks.delete(e),await o(e),J.info(`Cron task deleted`,{id:e}),!0):await c(e)!==null&&(await o(e),J.info(`Cron task deleted`,{id:e}),!0)}listCronTasks(){return Array.from(this.crontasks.values())}getCronTask(e){return this.crontasks.get(e)}getLicksForScoop(e,t){return{webhooks:Array.from(this.webhooks.values()).filter(n=>Z(n.scoop,e,t)),cronTasks:Array.from(this.crontasks.values()).filter(n=>Z(n.scoop,e,t))}}async getLicksForScoopFromDb(e,t){let[n,r]=await Promise.all([a(),s()]);return{webhooks:n.filter(n=>Z(n.scoop,e,t)),cronTasks:r.filter(n=>Z(n.scoop,e,t))}}async deleteIfOrphanedCron(e){if(!this.isOrphanedLick(e.scoop))return!1;J.warn(`Deleting orphaned cron task; target scoop no longer exists`,{id:e.id,name:e.name,scoop:e.scoop}),this.crontasks.delete(e.id);try{await o(e.id)}catch(t){J.warn(`Failed to delete orphaned cron task from DB`,{id:e.id,error:t instanceof Error?t.message:String(t)})}return!0}async runCronScheduler(){let e=new Date;for(let t of this.crontasks.values())await this.deleteIfOrphanedCron(t)||t.status===`active`&&t.nextRun&&(new Date(t.nextRun)>e||await this.runDueCronTask(t,e))}async runDueCronTask(e,t){let n={time:t.toISOString()};if(e.filter)try{let r=this.compileFilter(e.filter,!1)(null);if(r===!1){J.debug(`Cron task skipped by filter`,{id:e.id,name:e.name}),e.nextRun=K(e.cron,t)?.toISOString()??null,e.lastRun=t.toISOString(),await u(e);return}typeof r==`object`&&r&&(n=r)}catch(t){J.error(`Cron filter error`,{id:e.id,error:t instanceof Error?t.message:String(t)})}let r={type:`cron`,cronId:e.id,cronName:e.name,targetScoop:e.scoop,timestamp:t.toISOString(),body:n};J.info(`Cron task running`,{id:e.id,name:e.name}),this.dispatch(r),e.nextRun=K(e.cron,t)?.toISOString()??null,e.lastRun=t.toISOString(),await u(e)}generateId(){let e=``;for(let t=0;t<12;t++)e+=`abcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*36)];return e}compileFilter(e,t){try{return t?Function(`event`,`return (${e})(event);`):Function(`return (${e})();`)}catch(e){throw Error(`Invalid filter function: ${e instanceof Error?e.message:String(e)}`)}}};function Z(e,t,n){return e?e===t||e===n||`${e}-scoop`===n:!1}function Q(e,t,n){if(t.length===0&&n.length===0)return null;let r=[];t.length>0&&r.push(`${t.length} active webhook${t.length>1?`s`:``}`),n.length>0&&r.push(`${n.length} active cron task${n.length>1?`s`:``}`);let i=[...t.map(e=>` webhook delete ${e.id}`),...n.map(e=>` crontask delete ${e.id}`)].join(`
|
|
2
|
-
`);return Error(`Cannot remove scoop '${e}': it has ${r.join(` and `)}. Unregister them first:\n${i}`)}let $=null;function ue(){return $||=new X,$}export{b as a,S as c,f as d,K as i,C as l,Z as n,T as o,q as r,se as s,Q as t,y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";import"./logger-DQgFbfwx.js";import{a as t,i as n,n as r,r as i,t as a}from"./lick-urls-51I5JBZv.js";const o=e(`lick-ws-bridge`);function s(e){if(e.stopped)return;let t;try{t=e.wsFactory(e.wsUrl)}catch(t){o.error(`Failed to construct lick WebSocket`,{url:e.wsUrl,error:t instanceof Error?t.message:String(t)}),c(e,`construct-threw`);return}e.socket=t,t.onopen=()=>{e.consecutiveFailures>0?o.info(`Lick WebSocket recovered`,{attempts:e.consecutiveFailures}):o.info(`Lick WebSocket connected`),e.consecutiveFailures=0,e.unrecoverableSignalled=!1},t.onmessage=n=>{u(e,t,n.data).catch(e=>{let t=typeof n.data==`string`?n.data.slice(0,200):`[non-string payload]`;o.error(`Failed to process lick message`,{error:e instanceof Error?e.message:String(e),preview:t})})},t.onclose=n=>{if(e.socket===t&&(e.socket=null),e.stopped)return;let r=n.reason?` reason=${JSON.stringify(n.reason)}`:``;c(e,`disconnected code=${n.code}${r}`)},t.onerror=t=>{let n=t.target;o.error(`Lick WebSocket error`,{url:e.wsUrl,readyState:n?.readyState,eventType:t.type})}}function c(e,t){if(e.reconnectHandle!=null){o.debug(`Lick WS failure during pending reconnect — keeping existing timer`,{cause:t});return}e.consecutiveFailures++;let n=Math.min(e.baseDelay*2**(e.consecutiveFailures-1),6e4),r={url:e.wsUrl,attempt:e.consecutiveFailures,cause:t,retryInMs:n};if(e.consecutiveFailures>=3?o.error(`Lick WebSocket still down`,r):o.warn(`Lick WebSocket down`,r),e.consecutiveFailures===20&&!e.unrecoverableSignalled){e.unrecoverableSignalled=!0;try{e.lickManager.emitEvent({type:`session-reload`,targetScoop:void 0,timestamp:new Date().toISOString(),body:{reason:`lick-ws-bridge-down`,url:e.wsUrl,attempts:e.consecutiveFailures}})}catch(e){o.error(`Failed to emit lick-ws-bridge-down signal`,{error:e instanceof Error?e.message:String(e)})}}l(e,n)}function l(e,t){e.stopped||e.reconnectHandle!=null||(e.reconnectHandle=e.setTimer(()=>{e.reconnectHandle=null,s(e)},t))}async function u(e,t,n){let r=JSON.parse(typeof n==`string`?n:String(n));if(r.requestId){let n=r.requestId,i=await m(e,r,n);if(e.stopped||e.socket!==t||t.readyState!==1){o.warn(`Lick reply dropped — socket changed/closed mid-request`,{type:r.type,requestId:n});return}try{t.send(JSON.stringify(i))}catch(e){o.error(`ws.send() failed delivering lick reply`,{type:r.type,requestId:n,error:e instanceof Error?e.message:String(e)})}return}if(r.type===`webhook_event`){d(e.lickManager,r);return}r.type===`navigate_event`&&p(e.lickManager,r)}function d(e,t){let n=typeof t.webhookId==`string`?t.webhookId:null;if(!n){o.error(`Malformed webhook_event from lick-ws`,{receivedKeys:Object.keys(t)});return}let r=t.headers&&typeof t.headers==`object`?t.headers:{};try{e.handleWebhookEvent(n,r,t.body)}catch(e){o.error(`Webhook event dispatch failed`,{webhookId:n,error:e instanceof Error?e.message:String(e)})}}function f(e){let t=typeof e.verb==`string`?e.verb:null,n=typeof e.target==`string`?e.target:null,r=typeof e.url==`string`&&e.url.length>0?e.url:null;if(t!==`handoff`&&t!==`upskill`||!n||!r)return null;let i={url:r,verb:t,target:n};return typeof e.instruction==`string`&&(i.instruction=e.instruction),typeof e.branch==`string`&&(i.branch=e.branch),typeof e.path==`string`&&(i.path=e.path),typeof e.title==`string`&&(i.title=e.title),{type:`navigate`,navigateUrl:r,targetScoop:void 0,timestamp:typeof e.timestamp==`string`?e.timestamp:new Date().toISOString(),body:i}}function p(e,t){let n=f(t);if(!n){o.debug(`navigate_event dropped — invalid payload`,{hasVerb:typeof t.verb==`string`,hasTarget:typeof t.target==`string`,hasUrl:typeof t.url==`string`&&t.url.length>0});return}e.emitEvent(n)}async function m(e,t,r){let{lickManager:i}=e;try{switch(t.type){case`list_webhooks`:return{type:`response`,requestId:r,data:i.listWebhooks().map(t=>({...t,url:h(e,t.id)}))};case`create_webhook`:{let n=await i.createWebhook(t.name||`default`,t.scoop,t.filter);return{type:`response`,requestId:r,data:{...n,url:h(e,n.id)}}}case`delete_webhook`:return await i.deleteWebhook(t.id)?{type:`response`,requestId:r,data:{ok:!0}}:{type:`response`,requestId:r,data:{error:`Webhook not found`}};case`list_crontasks`:return{type:`response`,requestId:r,data:i.listCronTasks()};case`create_crontask`:if(!t.name)throw Error(`name is required`);if(!t.cron)throw Error(`cron is required`);return{type:`response`,requestId:r,data:await i.createCronTask(t.name,t.cron,t.scoop,t.filter)};case`delete_crontask`:return await i.deleteCronTask(t.id)?{type:`response`,requestId:r,data:{ok:!0}}:{type:`response`,requestId:r,data:{error:`Cron task not found`}};case`tray_status`:{let e=n();return{type:`response`,requestId:r,data:{state:e.state,joinUrl:e.session?.joinUrl??null,workerBaseUrl:e.session?.workerBaseUrl??null,trayId:e.session?.trayId??null}}}default:return{type:`response`,requestId:r,error:`Unknown request type: ${t.type}`}}}catch(e){return{type:`response`,requestId:r,error:e instanceof Error?e.message:String(e)}}}function h(e,n){let a=t().session;return a?.webhookUrl?r(a.webhookUrl,n):e.webhookOriginOverride?`${e.webhookOriginOverride}/webhooks/${n}`:i(e.options.locationHref,n)}function g(e){if(e.stopped)return;e.stopped=!0,e.reconnectHandle!=null&&(e.clearTimer(e.reconnectHandle),e.reconnectHandle=null);let t=e.socket;if(e.socket=null,t)try{t.close()}catch(e){t.readyState!==3&&t.readyState!==2&&o.warn(`Lick socket close() threw before terminal state`,{readyState:t.readyState,error:e instanceof Error?e.message:String(e)})}}function _(e,t){try{new URL(t.locationHref)}catch(e){throw Error(`startLickWsBridge: invalid locationHref ${JSON.stringify(t.locationHref)}: ${e instanceof Error?e.message:String(e)}`)}let n=typeof t.lickWsUrl==`string`&&t.lickWsUrl.length>0?t.lickWsUrl:a(t.locationHref),r=null;if(typeof t.lickWsUrl==`string`&&t.lickWsUrl.length>0)try{let e=new URL(t.lickWsUrl);r=`${e.protocol===`wss:`?`https:`:`http:`}//${e.host}`}catch{r=null}let i={lickManager:e,options:t,wsUrl:n,webhookOriginOverride:r,baseDelay:t.reconnectDelayMs??3e3,wsFactory:t.webSocketFactory??(e=>new WebSocket(e)),setTimer:t.setTimeoutFn??setTimeout.bind(globalThis),clearTimer:t.clearTimeoutFn??clearTimeout.bind(globalThis),stopped:!1,socket:null,reconnectHandle:null,consecutiveFailures:0,unrecoverableSignalled:!1};return s(i),{stop(){g(i)}}}export{_ as startLickWsBridge};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/quick-llm-CCC28hMC.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/account-store-DG6fHM_V.js","assets/preload-helper-Czpn1I53.js","assets/claude-model-version-C0HLsjny.js","assets/models-BSkXF4T6.js","assets/diagnostics-DN_idNHx.js","assets/provider-env-CTOcDKrQ.js","assets/__vite-browser-external-5eBdwsFd.js","assets/openrouter.models-BxrUfzom.js","assets/libesm-BypnjKEL.js","assets/logger-DDBAeTLF.js","assets/src-CAWTvdAa.js","assets/proxied-fetch-CFWkfPNA.js","assets/base64-DJRlyqZu.js","assets/runtime-env-Dlaokqg1.js","assets/fetch-body-D2PwksUW.js","assets/api-endpoint-GRCyib6X.js","assets/float-topology-BYb7rxY5.js","assets/runtime-env-E-i2SW1s.js","assets/secret-topology-BE7Eyd3P.js","assets/secrets-bridge-client-CHZomqvU.js","assets/port-bridge-client-Cti-DmEY.js","assets/image-markers-CxJ9ZBgw.js","assets/tool-ui-DfXu6quJ.js","assets/providers-EvW22h9s.js","assets/panel-rpc-B3MSVImO.js","assets/bedrock-camp-compat-CgBMwna8.js","assets/llm-session-id-bZQs6gBN.js","assets/icons-ZLR7gmJ4.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{L as e,m as t}from"./account-store-DG6fHM_V.js";import{t as n}from"./preload-helper-Czpn1I53.js";import{t as r}from"./logger-DDBAeTLF.js";import{A as i,M as a,O as o,R as s,j as c,k as l}from"./wc-live-9ZO5QfgI.js";import{r as u}from"./feature-flags-ByMXaIc4.js";import"./main-BcZbFpyc.js";import{t as d}from"./llm-session-id-bZQs6gBN.js";var f=r(`new-session`),p=`ui-new-session`,m=2e4,h=250;async function g(n){try{let r=await n.openVfs(),i=t()??void 0;if(!i)return;let o;try{o=e()}catch{return}let s=o.provider===`adobe`?{"X-Session-Id":d(p)}:void 0;await a({vfs:r,model:o,apiKey:i,headers:s}),n.onComplete?.()}catch(e){f.warn(`Pending session catch-up failed (boot continues)`,{error:e instanceof Error?e.message:String(e)})}}function _(e){(e.schedule??v)(()=>{g(e)})}function v(e){if(typeof globalThis.requestIdleCallback==`function`){globalThis.requestIdleCallback(e,{timeout:5e3});return}setTimeout(e,0)}function y(e){if(u(`agentic-memory`)){if(!e.agenticMemorySpawn){f.info(`Agentic memory enabled but agent bridge unavailable — using legacy enrichment`);return}return e.agenticMemorySpawn}}async function b(e,t,n,r,a,o){let s=await i({sessionStore:t,vfs:e.vfs,mode:`quick`,agenticMemorySpawn:o,cone:e.cone});if(!s)return null;if(e.captureCompleteSnapshot)try{await e.captureCompleteSnapshot(s)}catch(t){let n=t?.code??`unknown`;f.warn(`captureCompleteSnapshot failed`,{code:n}),s.completeSnapshotUnavailable=!0;try{await c(e.vfs,s.filename)}catch{}}return x(e,t,n,r,a,o,s),s}async function x(e,t,r,i,a,s,c){let u=c;try{let t=await l(e.vfs,c,{model:r,apiKey:i,headers:a,skipMemory:!0,pickIcon:e=>n(async()=>{let{pickLucideIcon:e}=await import(`./quick-llm-CCC28hMC.js`).then(e=>e.n);return{pickLucideIcon:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29])).then(({pickLucideIcon:t})=>t(e))});t&&(u={...t,archive:c.archive},e.onBackgroundEnriched?.(t))}catch(e){f.warn(`Agentic title enrichment threw (draft stays pending)`,{filename:c.filename,error:e instanceof Error?e.message:String(e)})}let d=await o({sessionStore:t,vfs:e.vfs,mode:`full`,model:r,apiKey:i,headers:a,agenticMemorySpawn:s,cone:e.cone},u).catch(e=>(f.warn(`Agentic memory curator threw (entry stays pending)`,{filename:u.filename,error:e instanceof Error?e.message:String(e)}),null));f.info(`Agentic memory curator finished`,{filename:u.filename,memoryPending:!d||d.memoryPending===!0}),e.onBackgroundEnriched?.(d)}async function S(e,t,n,r){for(let i of n){let n=`${t}/${i.name}`;r.has(n)||i.type===`directory`&&(await S(e,n,await e.readDir(n),r),[...r].some(e=>e.startsWith(`${n}/`)))||await e.rm(n)}}async function C(e){let t=new Set((await e.listMountPoints()).map(({path:e})=>e).filter(e=>e===`/tmp`||e.startsWith(`/tmp/`)));if(t.has(`/tmp`))return;let n;try{n=await e.readDir(`/tmp`)}catch(t){if(t?.code!==`ENOENT`)throw t;await e.mkdir(`/tmp`,{recursive:!0});return}await S(e,`/tmp`,n,t),await e.mkdir(`/tmp`,{recursive:!0})}async function w(r){let a=r.enrichmentRaceMs??m,o=t()??void 0,u;try{u=e()}catch(e){f.info(`No active model — freezing without LLM enrichment`,{error:e instanceof Error?e.message:String(e)})}let h=u?.provider===`adobe`?{"X-Session-Id":d(p)}:void 0,g=new s;try{await g.init()}catch(e){return f.warn(`SessionStore init failed — cannot freeze`,{error:e instanceof Error?e.message:String(e)}),null}let _=o&&u?y(r):void 0;if(_)return await b(r,g,u,o,h,_);let v=await i({sessionStore:g,vfs:r.vfs,mode:`quick`,cone:r.cone});if(!v)return null;if(r.captureCompleteSnapshot)try{await r.captureCompleteSnapshot(v)}catch(e){let t=e?.code??`unknown`;f.warn(`captureCompleteSnapshot failed`,{code:t}),v.completeSnapshotUnavailable=!0;try{await c(r.vfs,v.filename)}catch{}}if(!o||!u)return f.info(`Frozen without enrichment (no LLM credentials) — left pending`,{filename:v.filename}),v;let x=u,S=l(r.vfs,v,{model:x,apiKey:o,headers:h,pickIcon:e=>n(async()=>{let{pickLucideIcon:e}=await import(`./quick-llm-CCC28hMC.js`).then(e=>e.n);return{pickLucideIcon:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29])).then(({pickLucideIcon:t})=>t(e))}).catch(e=>(f.warn(`Single-click enrichment threw (entry stays pending)`,{filename:v.filename,error:e instanceof Error?e.message:String(e)}),null)),C=await T(S,a,r.onProgress);return C.kind===`llm`?C.updated?{...C.updated,archive:v.archive}:v:(S.then(e=>{f.info(`Background enrichment resolved after race window`,{filename:v.filename,enriched:e?.filename??null}),r.onBackgroundEnriched?.(e)}),v)}async function T(e,t,n){let r=Date.now(),i,a;n?.(0),n&&(i=setInterval(()=>{n(Math.min(1,(Date.now()-r)/t))},h));let o=new Promise(e=>{a=setTimeout(()=>e({kind:`timer`}),t)}),s=e.then(e=>({kind:`llm`,updated:e}));try{return await Promise.race([s,o])}finally{i&&clearInterval(i),a&&clearTimeout(a),n?.(null)}}async function E(e){return O(e,void 0)}async function D(e){return O(e,`skip`)}async function O(e,t){let n=new s;try{await n.init()}catch(e){return f.warn(`SessionStore init failed — cannot quick-freeze`,{error:e instanceof Error?e.message:String(e)}),null}let r=await i({sessionStore:n,vfs:e.vfs,mode:`quick`,cone:e.cone,...t?{memory:t}:{}});if(r&&e.captureCompleteSnapshot)try{await e.captureCompleteSnapshot(r)}catch(t){let n=t?.code??`unknown`;f.warn(`captureCompleteSnapshot failed (quick-freeze)`,{code:n}),r.completeSnapshotUnavailable=!0;try{await c(e.vfs,r.filename)}catch{}}return r}export{C as resetNewSessionTmp,D as runNewSessionArchiveOnly,w as runNewSessionFreeze,E as runNewSessionFreezeQuick,_ as schedulePendingSessionCatchup};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fs-CZt4jt7E.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/preload-helper-Czpn1I53.js","assets/logger-DDBAeTLF.js","assets/tool-ui-DfXu6quJ.js","assets/path-utils-DNJG-zQf.js","assets/types-idfTVsM8.js","assets/virtual-device-paths-D45tpPP6.js","assets/picker-approval-D89YhXsA.js","assets/html-B_Hg2WOy.js","assets/mount-picker-popup-Bc3ca2Vl.js","assets/logger-BoSvu4mW.js","assets/picker-popup-Bwcnocm6.js","assets/runtime-env-Dlaokqg1.js","assets/runtime-env-CgsZ7LTp.js","assets/runtime-env-E-i2SW1s.js","assets/src-CAWTvdAa.js","assets/mount-table-store-dY2IfQ5S.js","assets/proxied-fetch-CFWkfPNA.js","assets/base64-DJRlyqZu.js","assets/fetch-body-D2PwksUW.js","assets/api-endpoint-GRCyib6X.js","assets/oauth-service-DJuzPXsg.js","assets/panel-rpc-B3MSVImO.js","assets/permissions-surface-registry-CilCRwhh.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{H as e,S as t,d as n}from"./account-store-DG6fHM_V.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{t as i}from"./logger-DDBAeTLF.js";import{n as a}from"./float-topology-BYb7rxY5.js";import{i as o}from"./providers-EvW22h9s.js";import{t as s}from"./global-db-CbuLl-zx.js";import{n as c,r as l,t as u}from"./pkce-hGf_TEnP.js";import{t as d}from"./types-idfTVsM8.js";var f=i(`mcp-store`),p=`/workspace/.mcp/servers.json`,m=1,h=null,g=null;async function _(){return h||=await r(()=>import(`./fs-CZt4jt7E.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])),h}async function v(e){if(e)return e;if(g&&g.dbName===`slicc-fs-global`)return g.instance;let{VirtualFS:t}=await _(),n=await t.create({dbName:s});return g={instance:n,dbName:s},n}function y(){return{version:m,servers:{}}}function b(e){if(!e||typeof e!=`object`)return null;let t={...e};return typeof t.url==`string`?(delete t.sessionId,t):null}function x(e){if(!e||typeof e!=`object`)return y();let t=e,n=typeof t.version==`number`?t.version:m,r={};if(t.servers&&typeof t.servers==`object`)for(let[e,n]of Object.entries(t.servers)){let t=b(n);t&&(r[e]=t)}return{version:n,servers:r}}async function S(e){try{let t=await(await v(e)).readFile(p,{encoding:`utf-8`});try{return x(JSON.parse(t))}catch(e){return f.warn(`servers.json is not valid JSON; treating as empty`,{error:e instanceof Error?e.message:String(e)}),y()}}catch(e){return e instanceof d&&e.code===`ENOENT`||f.warn(`Failed to read servers.json`,{error:e instanceof Error?e.message:String(e)}),y()}}async function C(e){return(await S(e)).servers}async function w(){let e=await C(),t=[];for(let[n,r]of Object.entries(e))!r?.url||!r.auth?.clientId||t.push({name:n,serverUrl:r.url,auth:r.auth});return t}var T=i(`mcp-oauth`);function E(e,t){let{discoveryPath:n,prmUrl:r,prmReason:i,asmUrl:a,asmReason:o}=t;if(!e)throw Error(n===`asm-origin-fallback`?`MCP OAuth discovery failed. PRM (${r}): ${i}. ASM fallback (${a}): ${o}.`:`ASM fetch failed: ${o} (${a})`);if(!(e.authorization_endpoint&&e.token_endpoint))throw Error(n===`asm-origin-fallback`?`MCP OAuth discovery failed. PRM (${r}): ${i}. ASM fallback (${a}) is missing required endpoints (authorization_endpoint, token_endpoint).`:`ASM at ${a} is missing required endpoints`)}async function D(e,t,n){let r=new URL(e).origin,i=t??`${r}/.well-known/oauth-protected-resource`,a=null,o=null;T.debug(`Fetching PRM`,{prmUrl:i});try{let e=await n(i,{headers:{Accept:`application/json`}});if(!e.ok)o=`${e.status} ${e.statusText}`;else{let t=await e.json();!t.authorization_servers||t.authorization_servers.length===0?o=`lists no authorization_servers`:a=t}}catch(e){o=e instanceof Error?e.message:String(e)}let s,c,l;a?.authorization_servers&&a.authorization_servers.length>0?(s=a.authorization_servers[0].replace(/\/+$/,``),c=`${s}/.well-known/oauth-authorization-server`,l=`prm`,T.debug(`Discovery via PRM`,{prmUrl:i,asmUrl:c})):(s=r,c=`${r}/.well-known/oauth-authorization-server`,l=`asm-origin-fallback`,T.debug(`PRM unavailable; falling back to ASM at server origin`,{prmUrl:i,prmReason:o,asmUrl:c}));let u=null,d=null;T.debug(`Fetching ASM`,{asmUrl:c});try{let e=await n(c,{headers:{Accept:`application/json`}});e.ok?u=await e.json():d=`${e.status} ${e.statusText}`}catch(e){d=e instanceof Error?e.message:String(e)}return E(u,{discoveryPath:l,prmUrl:i,prmReason:o,asmUrl:c,asmReason:d}),{issuer:u.issuer||s,authorizationEndpoint:u.authorization_endpoint,tokenEndpoint:u.token_endpoint,registrationEndpoint:u.registration_endpoint,supportedScopes:u.scopes_supported??a?.scopes_supported,codeChallengeMethods:u.code_challenge_methods_supported,grantTypes:u.grant_types_supported,discoveryPath:l}}function O(e){return!e||e.length===0||e.includes(`S256`)?`S256`:e.includes(`plain`)?`plain`:`S256`}async function k(e){let t=c();return e===`plain`?{codeVerifier:t,codeChallenge:t,method:e}:{codeVerifier:t,codeChallenge:await u(t),method:e}}function A(e){try{let t=new URL(e);return{code:t.searchParams.get(`code`),state:t.searchParams.get(`state`)}}catch{return{code:null,state:null}}}async function j(e){let t=await k(O(e.asMetadata.codeChallengeMethods)),n=l(),r=new URLSearchParams({response_type:`code`,client_id:e.clientId,redirect_uri:e.redirectUri,code_challenge:t.codeChallenge,code_challenge_method:t.method,state:n});e.scope&&r.set(`scope`,e.scope);let i=`${e.asMetadata.authorizationEndpoint}?${r.toString()}`,a=await e.launcher(i);if(!a)throw Error(`MCP OAuth flow cancelled or timed out`);let{code:o,state:s}=A(a);if(!o)throw Error("MCP OAuth redirect missing `code` parameter");if(s!==n)throw Error(`MCP OAuth state mismatch — possible CSRF`);return N({tokenEndpoint:e.asMetadata.tokenEndpoint,clientId:e.clientId,code:o,codeVerifier:t.codeVerifier,redirectUri:e.redirectUri,fetchImpl:e.fetchImpl})}function M(e){if(e.error||!e.access_token)throw Error(`Token endpoint error: ${e.error??`no_access_token`}${e.error_description?` — ${e.error_description}`:``}`);return{accessToken:e.access_token,refreshToken:e.refresh_token,expiresAt:e.expires_in?Date.now()+e.expires_in*1e3:void 0,scope:e.scope,tokenType:e.token_type}}async function N(e){let t=new URLSearchParams({grant_type:`authorization_code`,code:e.code,redirect_uri:e.redirectUri,client_id:e.clientId,code_verifier:e.codeVerifier}).toString(),n=await e.fetchImpl(e.tokenEndpoint,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:t}),r=await n.json();if(!n.ok&&!r.access_token)throw Error(`Token exchange failed: ${n.status} ${n.statusText}${r.error?` (${r.error})`:``}`);return M(r)}async function P(e){let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e.refreshToken,client_id:e.clientId});e.scope&&t.set(`scope`,e.scope);let n=await e.fetchImpl(e.tokenEndpoint,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:t.toString()}),r=await n.json();if(!n.ok&&!r.access_token)throw Error(`Token refresh failed: ${n.status} ${n.statusText}${r.error?` (${r.error})`:``}`);return M(r)}var F=`/auth/mcp-callback`;async function I(){let e=a();if(e===`extension-direct`){let e=chrome;return e.identity?.getRedirectURL?.(`mcp-callback`)??`https://${e.runtime?.id??``}.chromiumapp.org/mcp-callback`}if(e===`node-rest`){let{getLocalApiBaseUrl:e}=await r(async()=>{let{getLocalApiBaseUrl:e}=await import(`./proxied-fetch-CFWkfPNA.js`).then(e=>e.n);return{getLocalApiBaseUrl:e}},__vite__mapDeps([18,1,2,19,16,13,20,21])),t=e();if(t)return`${t}/auth/callback`}let{getOAuthPageOrigin:t}=await r(async()=>{let{getOAuthPageOrigin:e}=await import(`./oauth-service-DJuzPXsg.js`);return{getOAuthPageOrigin:e}},__vite__mapDeps([22,2,18,1,19,16,13,20,21,14,15,23,24])),{origin:n}=await t();return`${n}${e===`extension-delegate`?F:`/auth/callback`}`}var L=i(`mcp-provider`),R=`mcp:`;function z(){return typeof globalThis<`u`&&globalThis.indexedDB!==void 0}function B(e){return`${R}${e}`}var V=new Map,H=new Set;async function U(e){if(e)return e;let{createProxiedFetch:t}=await r(async()=>{let{createProxiedFetch:e}=await import(`./proxied-fetch-CFWkfPNA.js`).then(e=>e.n);return{createProxiedFetch:e}},__vite__mapDeps([18,1,2,19,16,13,20,21])),n=t();return async(e,t)=>{let r=await n(e,{method:t?.method,headers:t?.headers,body:t?.body}),i=new TextDecoder().decode(r.body);return{ok:r.status>=200&&r.status<300,status:r.status,statusText:r.statusText,text:async()=>i,json:async()=>JSON.parse(i),headers:{get:e=>r.headers[e.toLowerCase()]??null}}}}async function W(e){let t=V.get(B(e.name));if(t)return t;let n=await U(e.fetchImpl),r=await D(e.serverUrl,void 0,n);return V.set(B(e.name),r),r}function G(r){let i=B(r.name),a=(()=>{try{return new URL(r.serverUrl).host}catch{return``}})();return{id:i,name:`MCP: ${r.name}`,description:`MCP server at ${r.serverUrl}`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,oauthTokenDomains:a?[a]:[],getModelIds:()=>[],onOAuthLogin:async(t,n)=>{let a=r.launcher??t,o=await U(r.fetchImpl),s=await j({asMetadata:await W(r),clientId:r.auth.clientId,scope:r.auth.scope,redirectUri:r.auth.redirectUri??await I(),launcher:a,fetchImpl:o});await e({providerId:i,accessToken:s.accessToken,refreshToken:s.refreshToken,tokenExpiresAt:s.expiresAt,scopes:s.scope}),n()},onSilentRenew:async()=>{if(!t(i))return null;let a=n().find(e=>e.providerId===i),o=a?.refreshToken;if(!o)return L.info(`No refresh token for MCP provider, skipping silent renewal`,{id:i}),null;try{let t=await W(r),n=t.grantTypes??[];if(n.length>0&&!n.includes(`refresh_token`))return L.info(`AS does not advertise refresh_token grant; skipping silent renewal`,{id:i}),null;let s=await U(r.fetchImpl),c=await P({tokenEndpoint:t.tokenEndpoint,clientId:r.auth.clientId,refreshToken:o,scope:r.auth.scope,fetchImpl:s});return await e({providerId:i,accessToken:c.accessToken,refreshToken:c.refreshToken??o,tokenExpiresAt:c.expiresAt,scopes:c.scope??a.scopes}),c.accessToken}catch(e){return L.warn(`MCP silent renewal failed`,{id:i,error:e instanceof Error?e.message:String(e)}),null}}}}function K(e){let t=B(e.name);if(H.has(t))return;let n=G(e);o(n),H.add(t),L.debug(`Registered MCP provider`,{id:t})}async function q(){if(!z())return[];let{readMcpAuthEntries:e}=await r(async()=>{let{readMcpAuthEntries:e}=await import(`./provider-store-access-DLlfWlp9.js`);return{readMcpAuthEntries:e}},[]),t=await e(),n=[];for(let e of t)K({name:e.name,serverUrl:e.serverUrl,auth:e.auth}),n.push(B(e.name));return n}export{q as ensureAllMcpProvidersRegistered,w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./store-DRjMIGJv.js";export{e as readMcpAuthEntries};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./provider-DM7nUGRc.js";export{e as readMcpAuthEntries};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./fs-CZt4jt7E.js";export{t as repairOpfsMetadataSidecar,e as resolveWithSidecarRepair};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return{version:`6.105.0`,releasedAt:`2026-08-28T07:41:56Z`,buildId:`6.105.0-mtcn8hgo`}}let t=null;function n(e){t=e}function r(){return t}export{e as n,n as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{t as n}from"./types-idfTVsM8.js";import{t as r}from"./global-db-DJXlpNui.js";var i=e({MCP_STORE_PATH:()=>o,deleteServer:()=>v,getServer:()=>g,listServers:()=>y,readMcpAuthEntries:()=>x,readMcpAuthEntry:()=>b,readServersFile:()=>m,setServer:()=>_,writeServersFile:()=>h});const a=t(`mcp-store`),o=`/workspace/.mcp/servers.json`;let s=null,c=null;async function l(){return s||=await import(`./fs-C343c9le.js`).then(e=>e.t),s}async function u(e){if(e)return e;if(c&&c.dbName===`slicc-fs-global`)return c.instance;let{VirtualFS:t}=await l(),n=await t.create({dbName:r});return c={instance:n,dbName:r},n}function d(){return{version:1,servers:{}}}function f(e){if(!e||typeof e!=`object`)return null;let t={...e};return typeof t.url==`string`?(delete t.sessionId,t):null}function p(e){if(!e||typeof e!=`object`)return d();let t=e,n=typeof t.version==`number`?t.version:1,r={};if(t.servers&&typeof t.servers==`object`)for(let[e,n]of Object.entries(t.servers)){let t=f(n);t&&(r[e]=t)}return{version:n,servers:r}}async function m(e){try{let t=await(await u(e)).readFile(o,{encoding:`utf-8`});try{return p(JSON.parse(t))}catch(e){return a.warn(`servers.json is not valid JSON; treating as empty`,{error:e instanceof Error?e.message:String(e)}),d()}}catch(e){return e instanceof n&&e.code===`ENOENT`||a.warn(`Failed to read servers.json`,{error:e instanceof Error?e.message:String(e)}),d()}}async function h(e,t){let n=await u(t);await n.mkdir(`/workspace/.mcp`,{recursive:!0});let r=p({version:e.version||1,servers:e.servers??{}});await n.writeFile(o,JSON.stringify(r,null,2))}async function g(e,t){return(await m(t)).servers[e]??null}async function _(e,t,n){let r=await m(n),i=f({...r.servers[e],...t});if(!i)throw Error(`MCP server entry requires a URL`);return r.servers[e]=i,await h(r,n),i}async function v(e,t){let n=await m(t);return e in n.servers&&(delete n.servers[e],await h(n,t),!0)}async function y(e){return(await m(e)).servers}async function b(e){let t=await g(e);return!t?.url||!t.auth?.clientId?null:{name:e,serverUrl:t.url,auth:t.auth}}async function x(){let e=await y(),t=[];for(let[n,r]of Object.entries(e))!r?.url||!r.auth?.clientId||t.push({name:n,serverUrl:r.url,auth:r.auth});return t}export{b as n,i as r,x as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./wc-onboarding-SeOTnz2o.js";export{e as hasOnboardingFinalLickInHistory};
|