@raycast/api 1.93.1 → 1.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var pe=Object.create;var I=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty;var y=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),we=(e,r)=>{for(var t in r)I(e,t,{get:r[t],enumerable:!0})},U=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of me(r))!ye.call(e,s)&&s!==t&&I(e,s,{get:()=>r[s],enumerable:!(i=ge(r,s))||i.enumerable});return e};var p=(e,r,t)=>(t=e!=null?pe(he(e)):{},U(r||!e||!e.__esModule?I(t,"default",{value:e,enumerable:!0}):t,e)),be=e=>U(I({},"__esModule",{value:!0}),e);var z=y((He,V)=>{var ke=require("node:tty"),Ce=ke?.WriteStream?.prototype?.hasColors?.()??!1,o=(e,r)=>{if(!Ce)return s=>s;let t=`\x1B[${e}m`,i=`\x1B[${r}m`;return s=>{let a=s+"",c=a.indexOf(i);if(c===-1)return t+a+i;let f=t,u=0;for(;c!==-1;)f+=a.slice(u,c)+t,u=c+i.length,c=a.indexOf(i,u);return f+=a.slice(u)+i,f}},n={};n.reset=o(0,0);n.bold=o(1,22);n.dim=o(2,22);n.italic=o(3,23);n.underline=o(4,24);n.overline=o(53,55);n.inverse=o(7,27);n.hidden=o(8,28);n.strikethrough=o(9,29);n.black=o(30,39);n.red=o(31,39);n.green=o(32,39);n.yellow=o(33,39);n.blue=o(34,39);n.magenta=o(35,39);n.cyan=o(36,39);n.white=o(37,39);n.gray=o(90,39);n.bgBlack=o(40,49);n.bgRed=o(41,49);n.bgGreen=o(42,49);n.bgYellow=o(43,49);n.bgBlue=o(44,49);n.bgMagenta=o(45,49);n.bgCyan=o(46,49);n.bgWhite=o(47,49);n.bgGray=o(100,49);n.redBright=o(91,39);n.greenBright=o(92,39);n.yellowBright=o(93,39);n.blueBright=o(94,39);n.magentaBright=o(95,39);n.cyanBright=o(96,39);n.whiteBright=o(97,39);n.bgRedBright=o(101,49);n.bgGreenBright=o(102,49);n.bgYellowBright=o(103,49);n.bgBlueBright=o(104,49);n.bgMagentaBright=o(105,49);n.bgCyanBright=o(106,49);n.bgWhiteBright=o(107,49);V.exports=n});var D=y((er,Z)=>{"use strict";var H=require("fs"),B;function Pe(){try{return H.statSync("/.dockerenv"),!0}catch{return!1}}function Se(){try{return H.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Z.exports=()=>(B===void 0&&(B=Pe()||Se()),B)});var re=y((rr,O)=>{"use strict";var $e=require("os"),Te=require("fs"),Q=D(),ee=()=>{if(process.platform!=="linux")return!1;if($e.release().toLowerCase().includes("microsoft"))return!Q();try{return Te.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Q():!1}catch{return!1}};process.env.__IS_WSL_TEST__?O.exports=ee:O.exports=ee()});var ne=y((tr,te)=>{"use strict";te.exports=(e,r,t)=>{let i=s=>Object.defineProperty(e,r,{value:s,enumerable:!0,writable:!0});return Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){let s=t();return i(s),s},set(s){i(s)}}),e}});var le=y((nr,ue)=>{var Ne=require("path"),Be=require("child_process"),{promises:v,constants:ce}=require("fs"),C=re(),De=D(),R=ne(),oe=Ne.join(__dirname,"xdg-open"),{platform:h,arch:se}=process,Oe=()=>{try{return v.statSync("/run/.containerenv"),!0}catch{return!1}},F;function Fe(){return F===void 0&&(F=Oe()||De()),F}var Re=(()=>{let e="/mnt/",r;return async function(){if(r)return r;let t="/etc/wsl.conf",i=!1;try{await v.access(t,ce.F_OK),i=!0}catch{}if(!i)return e;let s=await v.readFile(t,{encoding:"utf8"}),a=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(s);return a?(r=a.groups.mountPoint.trim(),r=r.endsWith("/")?r:`${r}/`,r):e}})(),ie=async(e,r)=>{let t;for(let i of e)try{return await r(i)}catch(s){t=s}throw t},P=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return ie(e.app,f=>P({...e,app:f}));let{name:r,arguments:t=[]}=e.app||{};if(t=[...t],Array.isArray(r))return ie(r,f=>P({...e,app:{name:f,arguments:t}}));let i,s=[],a={};if(h==="darwin")i="open",e.wait&&s.push("--wait-apps"),e.background&&s.push("--background"),e.newInstance&&s.push("--new"),r&&s.push("-a",r);else if(h==="win32"||C&&!Fe()&&!r){let f=await Re();i=C?`${f}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,s.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),C||(a.windowsVerbatimArguments=!0);let u=["Start"];e.wait&&u.push("-Wait"),r?(u.push(`"\`"${r}\`""`,"-ArgumentList"),e.target&&t.unshift(e.target)):e.target&&u.push(`"${e.target}"`),t.length>0&&(t=t.map(m=>`"\`"${m}\`""`),u.push(t.join(","))),e.target=Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(r)i=r;else{let f=!__dirname||__dirname==="/",u=!1;try{await v.access(oe,ce.X_OK),u=!0}catch{}i=process.versions.electron||h==="android"||f||!u?"xdg-open":oe}t.length>0&&s.push(...t),e.wait||(a.stdio="ignore",a.detached=!0)}e.target&&s.push(e.target),h==="darwin"&&t.length>0&&s.push("--args",...t);let c=Be.spawn(i,s,a);return e.wait?new Promise((f,u)=>{c.once("error",u),c.once("close",m=>{if(!e.allowNonzeroExitCode&&m>0){u(new Error(`Exited with code ${m}`));return}f(c)})}):(c.unref(),c)},_=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return P({...r,target:e})},_e=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a `name`");let{arguments:t=[]}=r||{};if(t!=null&&!Array.isArray(t))throw new TypeError("Expected `appArguments` as Array type");return P({...r,app:{name:e,arguments:t}})};function ae(e){if(typeof e=="string"||Array.isArray(e))return e;let{[se]:r}=e;if(!r)throw new Error(`${se} is not supported`);return r}function G({[h]:e},{wsl:r}){if(r&&C)return ae(r);if(!e)throw new Error(`${h} is not supported`);return ae(e)}var S={};R(S,"chrome",()=>G({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));R(S,"firefox",()=>G({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));R(S,"edge",()=>G({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));_.apps=S;_.openApp=_e;ue.exports=_});var qe={};we(qe,{commFilePath:()=>L,notifyRaycast:()=>Ge,updatePid:()=>de});module.exports=be(qe);var j=require("node:child_process"),d=p(require("node:fs")),x=p(require("node:path"));var A=p(require("node:fs")),$=p(require("node:path")),K=p(require("node:os"));var q=p(require("node:path")),W=p(require("node:fs"));function E(){let e;try{e=q.resolve("package.json")}catch(t){throw new Error(`cannot resolve package manifest path: ${t}`)}let r;try{r=JSON.parse(W.readFileSync(e,"utf8"))}catch(t){throw new Error(`cannot read package manifest: ${t}`)}return r.name=r.name.replace(/^@workaround/g,""),r}var Y={production:{url:"https://www.raycast.com",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},staging:{url:"https://www.rayca.st",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},development:{url:"http://localhost:3000",clientID:"rOCD_LhnXFObSLu9v7788qOGu25FZDqEzGjet4Q45ZY"}}[process.env.API_ENV||"production"],xe="e69bae0ec90f5e838555",g={},T;function w(){let e=E();if(!e.name)throw new Error("extension name in manifest cannot be empty");return $.join(Ae(),"extensions",e.name)}function X(){let e=k(T);return e?`com.raycast.macos.${e}`:"com.raycast.macos"}function J(){return`raycast${k(T)}`}function Ie(e){switch(e){case"raycastApiURL":return process.env.RAY_APIURL||g.APIURL||Y.url;case"raycastAccessToken":return process.env.RAY_TOKEN||g.Token||g.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||g.ClientID||Y.clientID;case"githubClientId":return process.env.RAY_GithubClientID||g.GithubClientID||xe;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||g.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target||(typeof g.Target>"u"?k("release"):g.Target)}}function k(e){switch(e){case"debug":return"debug";case"internal":return"internal";case"release":return"";case void 0:return Ie("flavorName")}}function Ee(){let e=k(T);return e==""?"raycast":`raycast-${e}`}function Ae(){let e=$.join(K.default.homedir(),".config",Ee());return A.mkdirSync(e,{recursive:!0}),e}var l=p(z());var Ze=(0,l.blue)((0,l.dim)("internal only"));function N(e,r,t){console.log(ve[e]+r),typeof t?.exit<"u"&&process.exit(t.exit)}var ve={wait:`\u{1F550}${(0,l.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,l.cyan)("info")} - `,success:`\u2705${(0,l.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,l.yellow)("warn")} - `,error:`\u{1F4A5}${(0,l.red)("error")} - `,event:`\u26A1\uFE0F${(0,l.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,l.yellowBright)("plan")} - `};var fe=p(le());async function Ge(e,r){let t=!1;switch(e){case"start":{Me(),de(),Le();break}case"stop":{try{d.unlinkSync(L("log"))}catch{}try{d.unlinkSync(L("pid"))}catch{}return}default:t=!0}let i;try{i=E()}catch{return}Ue()||N("warn","Raycast is not running"),t?je(i.name,e,r):await M(i.name,e,r)}function L(e){return x.join(w(),e==="log"?"dev.log":"cli.pid")}function de(){let e=w();try{d.mkdirSync(e,{recursive:!0})}catch(t){throw new Error(`cannot create output directory (${t.message})`)}let r=process.pid.toString();try{d.writeFileSync(x.join(e,"cli.pid"),r,{mode:420})}catch(t){throw new Error(`cannot write pid file (${t.message})`)}}function Le(){let e=w();try{d.mkdirSync(e,{recursive:!0})}catch(r){throw new Error(`cannot create output directory (${r.message})`)}try{d.writeFileSync(x.join(e,"dev.log"),"")}catch(r){throw new Error(`cannot write log file (${r.message})`)}}function Me(){let e=x.join(w(),"cli.pid");try{let i=`kill -9 ${d.readFileSync(e,"utf8").trim()}`;(0,j.execSync)(i,{shell:"/bin/sh"})}catch{}}var b=null;function je(e,r,t){b?(clearTimeout(b),b=setTimeout(()=>{M(e,r,t)},300)):(M(e,r,t),b=setTimeout(()=>{b=null},300))}async function M(e,r,t){let i=process.cwd(),s=`${J()}://cli/${e}/${r}?cwd=${encodeURIComponent(i)}&info=${encodeURIComponent(t||"")}`;try{await(0,fe.default)(s,{background:!0})}catch(a){N("error",`cannot notify Raycast (${a.message})`)}}function Ue(){let r=X(),t="ps -e -o args | grep -v grep | grep -i contents/macos/raycast",i;try{i=(0,j.execSync)(t,{shell:"/bin/sh",encoding:"utf8"})}catch{return!1}let s=i.trim();if(s==="")return!1;let a=s.split(`
2
- `);for(let c of a){let f=c.indexOf("/Contents/MacOS/Raycast");if(f>-1&&(c=c.substring(0,f)),!!d.existsSync(c))return!0}return!1}0&&(module.exports={commFilePath,notifyRaycast,updatePid});
1
+ "use strict";var pe=Object.create;var E=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty;var y=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),we=(e,r)=>{for(var t in r)E(e,t,{get:r[t],enumerable:!0})},U=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of me(r))!ye.call(e,s)&&s!==t&&E(e,s,{get:()=>r[s],enumerable:!(i=ge(r,s))||i.enumerable});return e};var p=(e,r,t)=>(t=e!=null?pe(he(e)):{},U(r||!e||!e.__esModule?E(t,"default",{value:e,enumerable:!0}):t,e)),xe=e=>U(E({},"__esModule",{value:!0}),e);var J=y((ze,H)=>{var ke=require("node:tty"),Ce=ke?.WriteStream?.prototype?.hasColors?.()??!1,o=(e,r)=>{if(!Ce)return s=>s;let t=`\x1B[${e}m`,i=`\x1B[${r}m`;return s=>{let a=s+"",c=a.indexOf(i);if(c===-1)return t+a+i;let f=t,u=0;for(;c!==-1;)f+=a.slice(u,c)+t,u=c+i.length,c=a.indexOf(i,u);return f+=a.slice(u)+i,f}},n={};n.reset=o(0,0);n.bold=o(1,22);n.dim=o(2,22);n.italic=o(3,23);n.underline=o(4,24);n.overline=o(53,55);n.inverse=o(7,27);n.hidden=o(8,28);n.strikethrough=o(9,29);n.black=o(30,39);n.red=o(31,39);n.green=o(32,39);n.yellow=o(33,39);n.blue=o(34,39);n.magenta=o(35,39);n.cyan=o(36,39);n.white=o(37,39);n.gray=o(90,39);n.bgBlack=o(40,49);n.bgRed=o(41,49);n.bgGreen=o(42,49);n.bgYellow=o(43,49);n.bgBlue=o(44,49);n.bgMagenta=o(45,49);n.bgCyan=o(46,49);n.bgWhite=o(47,49);n.bgGray=o(100,49);n.redBright=o(91,39);n.greenBright=o(92,39);n.yellowBright=o(93,39);n.blueBright=o(94,39);n.magentaBright=o(95,39);n.cyanBright=o(96,39);n.whiteBright=o(97,39);n.bgRedBright=o(101,49);n.bgGreenBright=o(102,49);n.bgYellowBright=o(103,49);n.bgBlueBright=o(104,49);n.bgMagentaBright=o(105,49);n.bgCyanBright=o(106,49);n.bgWhiteBright=o(107,49);H.exports=n});var O=y((er,Z)=>{"use strict";var z=require("fs"),B;function $e(){try{return z.statSync("/.dockerenv"),!0}catch{return!1}}function Pe(){try{return z.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Z.exports=()=>(B===void 0&&(B=$e()||Pe()),B)});var re=y((rr,F)=>{"use strict";var Se=require("os"),Te=require("fs"),Q=O(),ee=()=>{if(process.platform!=="linux")return!1;if(Se.release().toLowerCase().includes("microsoft"))return!Q();try{return Te.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Q():!1}catch{return!1}};process.env.__IS_WSL_TEST__?F.exports=ee:F.exports=ee()});var ne=y((tr,te)=>{"use strict";te.exports=(e,r,t)=>{let i=s=>Object.defineProperty(e,r,{value:s,enumerable:!0,writable:!0});return Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){let s=t();return i(s),s},set(s){i(s)}}),e}});var le=y((nr,ue)=>{var Ne=require("path"),De=require("child_process"),{promises:$,constants:ce}=require("fs"),v=re(),Be=O(),_=ne(),oe=Ne.join(__dirname,"xdg-open"),{platform:h,arch:se}=process,Oe=()=>{try{return $.statSync("/run/.containerenv"),!0}catch{return!1}},R;function Fe(){return R===void 0&&(R=Oe()||Be()),R}var Re=(()=>{let e="/mnt/",r;return async function(){if(r)return r;let t="/etc/wsl.conf",i=!1;try{await $.access(t,ce.F_OK),i=!0}catch{}if(!i)return e;let s=await $.readFile(t,{encoding:"utf8"}),a=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(s);return a?(r=a.groups.mountPoint.trim(),r=r.endsWith("/")?r:`${r}/`,r):e}})(),ie=async(e,r)=>{let t;for(let i of e)try{return await r(i)}catch(s){t=s}throw t},P=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return ie(e.app,f=>P({...e,app:f}));let{name:r,arguments:t=[]}=e.app||{};if(t=[...t],Array.isArray(r))return ie(r,f=>P({...e,app:{name:f,arguments:t}}));let i,s=[],a={};if(h==="darwin")i="open",e.wait&&s.push("--wait-apps"),e.background&&s.push("--background"),e.newInstance&&s.push("--new"),r&&s.push("-a",r);else if(h==="win32"||v&&!Fe()&&!r){let f=await Re();i=v?`${f}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,s.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),v||(a.windowsVerbatimArguments=!0);let u=["Start"];e.wait&&u.push("-Wait"),r?(u.push(`"\`"${r}\`""`,"-ArgumentList"),e.target&&t.unshift(e.target)):e.target&&u.push(`"${e.target}"`),t.length>0&&(t=t.map(m=>`"\`"${m}\`""`),u.push(t.join(","))),e.target=Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(r)i=r;else{let f=!__dirname||__dirname==="/",u=!1;try{await $.access(oe,ce.X_OK),u=!0}catch{}i=process.versions.electron||h==="android"||f||!u?"xdg-open":oe}t.length>0&&s.push(...t),e.wait||(a.stdio="ignore",a.detached=!0)}e.target&&s.push(e.target),h==="darwin"&&t.length>0&&s.push("--args",...t);let c=De.spawn(i,s,a);return e.wait?new Promise((f,u)=>{c.once("error",u),c.once("close",m=>{if(!e.allowNonzeroExitCode&&m>0){u(new Error(`Exited with code ${m}`));return}f(c)})}):(c.unref(),c)},G=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return P({...r,target:e})},_e=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a `name`");let{arguments:t=[]}=r||{};if(t!=null&&!Array.isArray(t))throw new TypeError("Expected `appArguments` as Array type");return P({...r,app:{name:e,arguments:t}})};function ae(e){if(typeof e=="string"||Array.isArray(e))return e;let{[se]:r}=e;if(!r)throw new Error(`${se} is not supported`);return r}function M({[h]:e},{wsl:r}){if(r&&v)return ae(r);if(!e)throw new Error(`${h} is not supported`);return ae(e)}var S={};_(S,"chrome",()=>M({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));_(S,"firefox",()=>M({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));_(S,"edge",()=>M({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));G.apps=S;G.openApp=_e;ue.exports=G});var qe={};we(qe,{commFilePath:()=>L,notifyRaycast:()=>Ge,updatePid:()=>de});module.exports=xe(qe);var b=require("node:child_process"),d=p(require("node:fs")),I=p(require("node:path"));var k=p(require("node:fs")),T=p(require("node:path")),K=p(require("node:os"));var q=p(require("node:path")),W=p(require("node:fs"));function A(){let e;try{e=q.resolve("package.json")}catch(t){throw new Error(`cannot resolve package manifest path: ${t}`)}let r;try{r=JSON.parse(W.readFileSync(e,"utf8"))}catch(t){throw new Error(`cannot read package manifest: ${t}`)}return r.name=r.name.replace(/^@workaround/g,""),r}var Y={production:{url:"https://www.raycast.com",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},staging:{url:"https://www.rayca.st",clientID:"KqAdcGhNfBKiUpfjD3nU3VNgh1t0iMPoX2hYEkN9d4I"},development:{url:"http://localhost:3000",clientID:"rOCD_LhnXFObSLu9v7788qOGu25FZDqEzGjet4Q45ZY"}}[process.env.API_ENV||"production"],be="e69bae0ec90f5e838555",g={},N;function w(){let e=A();if(!e.name)throw new Error("extension name in manifest cannot be empty");return T.join(Ae(),"extensions",e.name)}function V(){let e=C(N);return e?.startsWith("x")?e==="x"?"com.raycast-x.macos":`com.raycast-x.macos.${e.replace("x-","")}`:e?`com.raycast.macos.${e}`:"com.raycast.macos"}function X(){return`raycast${C(N)}`}function Ie(e){switch(e){case"raycastApiURL":return process.env.RAY_APIURL||g.APIURL||Y.url;case"raycastAccessToken":return process.env.RAY_TOKEN||g.Token||g.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||g.ClientID||Y.clientID;case"githubClientId":return process.env.RAY_GithubClientID||g.GithubClientID||be;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||g.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target||(typeof g.Target>"u"?C("release"):g.Target)}}function C(e){switch(e){case"debug":return"debug";case"internal":return"internal";case"release":return"";case"x":return"x";case"x-internal":return"x-internal";case"x-debug":return"x-debug";case void 0:return Ie("flavorName")}}function Ee(){let e=C(N);return e==""?"raycast":`raycast-${e}`}function Ae(){let e=T.join(K.default.homedir(),".config",Ee());return k.mkdirSync(e,{recursive:!0}),e}var l=p(J());var Ze=(0,l.blue)((0,l.dim)("internal only"));function D(e,r,t){console.log(ve[e]+r),typeof t?.exit<"u"&&process.exit(t.exit)}var ve={wait:`\u{1F550}${(0,l.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,l.cyan)("info")} - `,success:`\u2705${(0,l.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,l.yellow)("warn")} - `,error:`\u{1F4A5}${(0,l.red)("error")} - `,event:`\u26A1\uFE0F${(0,l.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,l.yellowBright)("plan")} - `};var fe=p(le());async function Ge(e,r){let t=!1;switch(e){case"start":{Le(),de(),Me();break}case"stop":{try{d.unlinkSync(L("log"))}catch{}try{d.unlinkSync(L("pid"))}catch{}return}default:t=!0}let i;try{i=A()}catch{return}Ue()||D("warn","Raycast is not running"),t?je(i.name,e,r):await j(i.name,e,r)}function L(e){return I.join(w(),e==="log"?"dev.log":"cli.pid")}function de(){let e=w();try{d.mkdirSync(e,{recursive:!0})}catch(t){throw new Error(`cannot create output directory (${t.message})`)}let r=process.pid.toString();try{d.writeFileSync(I.join(e,"cli.pid"),r,{mode:420})}catch(t){throw new Error(`cannot write pid file (${t.message})`)}}function Me(){let e=w();try{d.mkdirSync(e,{recursive:!0})}catch(r){throw new Error(`cannot create output directory (${r.message})`)}try{d.writeFileSync(I.join(e,"dev.log"),"")}catch(r){throw new Error(`cannot write log file (${r.message})`)}}function Le(){let e=I.join(w(),"cli.pid");try{let t=d.readFileSync(e,"utf8").trim();process.platform==="win32"?(0,b.execSync)(`taskkill /F /PID ${t}`):(0,b.execSync)(`kill -9 ${t}`,{shell:"/bin/sh"})}catch{}}var x=null;function je(e,r,t){x?(clearTimeout(x),x=setTimeout(()=>{j(e,r,t)},300)):(j(e,r,t),x=setTimeout(()=>{x=null},300))}async function j(e,r,t){let i=process.cwd(),s=`${X()}://cli/${e}/${r}?cwd=${encodeURIComponent(i)}&info=${encodeURIComponent(t||"")}`;try{await(0,fe.default)(s,{background:!0})}catch(a){D("error",`cannot notify Raycast (${a.message})`)}}function Ue(){if(process.platform==="win32")return(0,b.execSync)('tasklist /FI "IMAGENAME eq Raycast.exe" /FO CSV /NH',{encoding:"utf8"}).toLowerCase().includes("raycast.exe");{let r=V(),t="ps -e -o args | grep -v grep | grep -i contents/macos/raycast",i;try{i=(0,b.execSync)(t,{shell:"/bin/sh",encoding:"utf8"})}catch{return!1}let s=i.trim();if(s==="")return!1;let a=s.split(`
2
+ `);for(let c of a){let f=c.indexOf("/Contents/MacOS/Raycast");if(f>-1&&(c=c.substring(0,f)),!!d.existsSync(c))return!0}}return!1}0&&(module.exports={commFilePath,notifyRaycast,updatePid});
@@ -49,7 +49,10 @@
49
49
  "options": [
50
50
  "debug",
51
51
  "internal",
52
- "release"
52
+ "release",
53
+ "x",
54
+ "x-debug",
55
+ "x-internal"
53
56
  ],
54
57
  "type": "option"
55
58
  },
@@ -156,7 +159,10 @@
156
159
  "options": [
157
160
  "debug",
158
161
  "internal",
159
- "release"
162
+ "release",
163
+ "x",
164
+ "x-debug",
165
+ "x-internal"
160
166
  ],
161
167
  "type": "option"
162
168
  },
@@ -247,7 +253,10 @@
247
253
  "options": [
248
254
  "debug",
249
255
  "internal",
250
- "release"
256
+ "release",
257
+ "x",
258
+ "x-debug",
259
+ "x-internal"
251
260
  ],
252
261
  "type": "option"
253
262
  },
@@ -352,7 +361,10 @@
352
361
  "options": [
353
362
  "debug",
354
363
  "internal",
355
- "release"
364
+ "release",
365
+ "x",
366
+ "x-debug",
367
+ "x-internal"
356
368
  ],
357
369
  "type": "option"
358
370
  },
@@ -446,7 +458,10 @@
446
458
  "options": [
447
459
  "debug",
448
460
  "internal",
449
- "release"
461
+ "release",
462
+ "x",
463
+ "x-debug",
464
+ "x-internal"
450
465
  ],
451
466
  "type": "option"
452
467
  }
@@ -516,7 +531,10 @@
516
531
  "options": [
517
532
  "debug",
518
533
  "internal",
519
- "release"
534
+ "release",
535
+ "x",
536
+ "x-debug",
537
+ "x-internal"
520
538
  ],
521
539
  "type": "option"
522
540
  }
@@ -537,11 +555,18 @@
537
555
  "index.js"
538
556
  ]
539
557
  },
540
- "migrate": {
558
+ "profile": {
541
559
  "aliases": [],
542
560
  "args": {},
543
- "description": "Migrate the extension to a newer version of the Raycast API\nInternally, the command makes use of https://www.npmjs.com/package/@raycast/migration",
561
+ "description": "Show profile of the currently logged in user",
544
562
  "flags": {
563
+ "json": {
564
+ "description": "Format output as json.",
565
+ "helpGroup": "GLOBAL",
566
+ "name": "json",
567
+ "allowNo": false,
568
+ "type": "boolean"
569
+ },
545
570
  "exit-on-error": {
546
571
  "aliases": [
547
572
  "exitOnError"
@@ -586,49 +611,35 @@
586
611
  "options": [
587
612
  "debug",
588
613
  "internal",
589
- "release"
614
+ "release",
615
+ "x",
616
+ "x-debug",
617
+ "x-internal"
590
618
  ],
591
619
  "type": "option"
592
- },
593
- "path": {
594
- "char": "p",
595
- "description": "Path to extension root",
596
- "name": "path",
597
- "default": ".",
598
- "hasDynamicHelp": false,
599
- "multiple": false,
600
- "type": "option"
601
620
  }
602
621
  },
603
622
  "hasDynamicHelp": false,
604
623
  "hiddenAliases": [],
605
- "id": "migrate",
624
+ "id": "profile",
606
625
  "pluginAlias": "ray",
607
626
  "pluginName": "ray",
608
627
  "pluginType": "core",
609
628
  "strict": true,
610
- "summary": "Migrate the extension to a newer version of the Raycast API",
611
- "enableJsonFlag": false,
629
+ "enableJsonFlag": true,
612
630
  "isESM": false,
613
631
  "relativePath": [
614
632
  "dist",
615
633
  "commands",
616
- "migrate",
634
+ "profile",
617
635
  "index.js"
618
636
  ]
619
637
  },
620
- "profile": {
638
+ "publish": {
621
639
  "aliases": [],
622
640
  "args": {},
623
- "description": "Show profile of the currently logged in user",
641
+ "description": "Publish the extension on the Raycast Store.\nPrivate extension are a team feature. Sign up for it here: https://www.raycast.com/pricing (​https://www.raycast.com/pricing​)",
624
642
  "flags": {
625
- "json": {
626
- "description": "Format output as json.",
627
- "helpGroup": "GLOBAL",
628
- "name": "json",
629
- "allowNo": false,
630
- "type": "boolean"
631
- },
632
643
  "exit-on-error": {
633
644
  "aliases": [
634
645
  "exitOnError"
@@ -673,31 +684,57 @@
673
684
  "options": [
674
685
  "debug",
675
686
  "internal",
676
- "release"
687
+ "release",
688
+ "x",
689
+ "x-debug",
690
+ "x-internal"
677
691
  ],
678
692
  "type": "option"
693
+ },
694
+ "clipboard": {
695
+ "char": "C",
696
+ "description": "Copy the extension link to the clipboard upon publishing",
697
+ "name": "clipboard",
698
+ "allowNo": false,
699
+ "type": "boolean"
700
+ },
701
+ "skip-validation": {
702
+ "char": "s",
703
+ "description": "Skip validation and always publish \u001b[34m\u001b[2minternal only\u001b[22m\u001b[39m",
704
+ "hidden": true,
705
+ "name": "skip-validation",
706
+ "allowNo": false,
707
+ "type": "boolean"
708
+ },
709
+ "skip-notify-raycast": {
710
+ "description": "Skip notifying Raycast after publishing \u001b[34m\u001b[2minternal only\u001b[22m\u001b[39m",
711
+ "hidden": true,
712
+ "name": "skip-notify-raycast",
713
+ "allowNo": false,
714
+ "type": "boolean"
679
715
  }
680
716
  },
681
717
  "hasDynamicHelp": false,
682
718
  "hiddenAliases": [],
683
- "id": "profile",
719
+ "id": "publish",
684
720
  "pluginAlias": "ray",
685
721
  "pluginName": "ray",
686
722
  "pluginType": "core",
687
723
  "strict": true,
688
- "enableJsonFlag": true,
724
+ "summary": "Publish the extension",
725
+ "enableJsonFlag": false,
689
726
  "isESM": false,
690
727
  "relativePath": [
691
728
  "dist",
692
729
  "commands",
693
- "profile",
730
+ "publish",
694
731
  "index.js"
695
732
  ]
696
733
  },
697
- "publish": {
734
+ "migrate": {
698
735
  "aliases": [],
699
736
  "args": {},
700
- "description": "Publish the extension on the Raycast Store.\nPrivate extension are a team feature. Sign up for it here: https://www.raycast.com/pricing (​https://www.raycast.com/pricing​)",
737
+ "description": "Migrate the extension to a newer version of the Raycast API\nInternally, the command makes use of https://www.npmjs.com/package/@raycast/migration",
701
738
  "flags": {
702
739
  "exit-on-error": {
703
740
  "aliases": [
@@ -743,47 +780,37 @@
743
780
  "options": [
744
781
  "debug",
745
782
  "internal",
746
- "release"
783
+ "release",
784
+ "x",
785
+ "x-debug",
786
+ "x-internal"
747
787
  ],
748
788
  "type": "option"
749
789
  },
750
- "clipboard": {
751
- "char": "C",
752
- "description": "Copy the extension link to the clipboard upon publishing",
753
- "name": "clipboard",
754
- "allowNo": false,
755
- "type": "boolean"
756
- },
757
- "skip-validation": {
758
- "char": "s",
759
- "description": "Skip validation and always publish \u001b[34m\u001b[2minternal only\u001b[22m\u001b[39m",
760
- "hidden": true,
761
- "name": "skip-validation",
762
- "allowNo": false,
763
- "type": "boolean"
764
- },
765
- "skip-notify-raycast": {
766
- "description": "Skip notifying Raycast after publishing \u001b[34m\u001b[2minternal only\u001b[22m\u001b[39m",
767
- "hidden": true,
768
- "name": "skip-notify-raycast",
769
- "allowNo": false,
770
- "type": "boolean"
790
+ "path": {
791
+ "char": "p",
792
+ "description": "Path to extension root",
793
+ "name": "path",
794
+ "default": ".",
795
+ "hasDynamicHelp": false,
796
+ "multiple": false,
797
+ "type": "option"
771
798
  }
772
799
  },
773
800
  "hasDynamicHelp": false,
774
801
  "hiddenAliases": [],
775
- "id": "publish",
802
+ "id": "migrate",
776
803
  "pluginAlias": "ray",
777
804
  "pluginName": "ray",
778
805
  "pluginType": "core",
779
806
  "strict": true,
780
- "summary": "Publish the extension",
807
+ "summary": "Migrate the extension to a newer version of the Raycast API",
781
808
  "enableJsonFlag": false,
782
809
  "isESM": false,
783
810
  "relativePath": [
784
811
  "dist",
785
812
  "commands",
786
- "publish",
813
+ "migrate",
787
814
  "index.js"
788
815
  ]
789
816
  },
@@ -836,7 +863,10 @@
836
863
  "options": [
837
864
  "debug",
838
865
  "internal",
839
- "release"
866
+ "release",
867
+ "x",
868
+ "x-debug",
869
+ "x-internal"
840
870
  ],
841
871
  "type": "option"
842
872
  }
@@ -913,7 +943,10 @@
913
943
  "options": [
914
944
  "debug",
915
945
  "internal",
916
- "release"
946
+ "release",
947
+ "x",
948
+ "x-debug",
949
+ "x-internal"
917
950
  ],
918
951
  "type": "option"
919
952
  },
@@ -990,7 +1023,10 @@
990
1023
  "options": [
991
1024
  "debug",
992
1025
  "internal",
993
- "release"
1026
+ "release",
1027
+ "x",
1028
+ "x-debug",
1029
+ "x-internal"
994
1030
  ],
995
1031
  "type": "option"
996
1032
  },
@@ -1077,7 +1113,10 @@
1077
1113
  "options": [
1078
1114
  "debug",
1079
1115
  "internal",
1080
- "release"
1116
+ "release",
1117
+ "x",
1118
+ "x-debug",
1119
+ "x-internal"
1081
1120
  ],
1082
1121
  "type": "option"
1083
1122
  }
@@ -1099,5 +1138,5 @@
1099
1138
  ]
1100
1139
  }
1101
1140
  },
1102
- "version": "1.93.1"
1141
+ "version": "1.94.0"
1103
1142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.93.1",
3
+ "version": "1.94.0",
4
4
  "description": "Build extensions for Raycast with React and Node.js.",
5
5
  "author": "Raycast Technologies Ltd.",
6
6
  "homepage": "https://developers.raycast.com",
@@ -10,22 +10,22 @@
10
10
  "license": "MIT",
11
11
  "types": "types/index.d.ts",
12
12
  "engines": {
13
- "node": ">=20.5.0"
13
+ "node": ">=22.14.0"
14
14
  },
15
15
  "dependencies": {
16
16
  "@oclif/core": "^4.0.33",
17
17
  "@oclif/plugin-autocomplete": "^3.2.10",
18
18
  "@oclif/plugin-help": "^6.2.18",
19
19
  "@oclif/plugin-not-found": "^3.2.28",
20
- "@types/node": "20.8.10",
21
- "@types/react": "18.3.3",
22
- "esbuild": "^0.25.0",
23
- "react": "18.3.1"
20
+ "@types/node": "22.13.10",
21
+ "@types/react": "19.0.10",
22
+ "esbuild": "^0.25.1",
23
+ "react": "19.0.0"
24
24
  },
25
25
  "peerDependencies": {
26
- "@types/node": "20.8.10",
27
- "@types/react": "18.3.3",
28
- "react-devtools": "5.2.0"
26
+ "@types/node": "22.13.10",
27
+ "@types/react": "19.0.10",
28
+ "react-devtools": "6.1.1"
29
29
  },
30
30
  "peerDependenciesMeta": {
31
31
  "@types/node": {
package/types/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- /// <reference types="node" />
2
-
3
1
  import { ForwardRefExoticComponent } from 'react';
4
2
  import { FunctionComponent } from 'react';
5
- import { JSX as JSX_2 } from 'react/jsx-runtime';
3
+ import { JSX } from 'react/jsx-runtime';
6
4
  import { PathLike } from 'fs';
7
5
  import { ReactElement } from 'react';
8
6
  import { ReactNode } from 'react';
@@ -502,7 +500,7 @@ export declare namespace AI {
502
500
  Anthropic_Claude_Haiku = "anthropic-claude-haiku",
503
501
  Anthropic_Claude_Opus = "anthropic-claude-opus",
504
502
  Anthropic_Claude_Sonnet = "anthropic-claude-sonnet",
505
- Mixtral_8x7B = "mixtral-8x7b",
503
+ "Anthropic_Claude_Sonnet_3.7" = "anthropic-claude-3-7-sonnet-latest",
506
504
  Mistral_Nemo = "mistral-nemo",
507
505
  Mistral_Large = "mistral-large",
508
506
  Mistral_Small = "mistral-small",
@@ -517,8 +515,6 @@ export declare namespace AI {
517
515
  Perplexity_Sonar_Reasoning_Pro = "perplexity-sonar-reasoning-pro",
518
516
  DeepSeek_R1 = "together-deepseek-ai/DeepSeek-R1",
519
517
  "DeepSeek_R1_Distill_Llama_3.3_70B" = "groq-deepseek-r1-distill-llama-70b",
520
- "Google_Gemini_1.5_Flash" = "google-gemini-1.5-flash",
521
- "Google_Gemini_1.5_Pro" = "google-gemini-1.5-pro",
522
518
  "Google_Gemini_2.0_Flash" = "google-gemini-2.0-flash",
523
519
  "Google_Gemini_2.0_Flash_Thinking" = "google-gemini-2.0-flash-thinking",
524
520
  xAI_Grok_2 = "xai-grok-2-latest",
@@ -552,9 +548,16 @@ export declare namespace AI {
552
548
  "Groq_DeepSeek_R1_Distill_Llama_3.3_70B" = "groq-deepseek-r1-distill-llama-70b",
553
549
  /** @deprecated Use `AI.Model.Together_DeepSeek_R1` instead */
554
550
  "Together_DeepSeek_R1" = "together-deepseek-ai/DeepSeek-R1",
555
- /** @deprecated Use `AI.Model["Mixtral_8x7B"]` instead */
556
- "MixtraL_8x7B" = "mixtral-8x7b"
551
+ /** @deprecated Use `AI.Model.Mistral_Nemo` instead */
552
+ "MixtraL_8x7B" = "mistral-nemo",
553
+ /** @deprecated Use `AI.Model["Google_Gemini_2.0_Flash"]` instead */
554
+ "Google_Gemini_1.5_Flash" = "google-gemini-1.5-flash",
555
+ /** @deprecated Use `AI.Model["Google_Gemini_2.0_Flash"]` instead */
556
+ "Google_Gemini_1.5_Pro" = "google-gemini-1.5-pro",
557
+ /** @deprecated Use `AI.Model.Mistral_Nemo` instead */
558
+ Mixtral_8x7B = "mistral-nemo"
557
559
  }
560
+
558
561
  /** @deprecated Use the `AI.Model` enum instead */
559
562
  export type __DeprecatedModelUnion =
560
563
  /** @deprecated */
@@ -1766,7 +1769,7 @@ declare interface CreateSnippetProps {
1766
1769
  /**
1767
1770
  * See {@link Form.DatePicker}
1768
1771
  */
1769
- declare const DatePicker: ForwardRefExoticComponent<DatePickerProps & RefAttributes<FormItemRef>> & DatePickerMembers;
1772
+ declare const DatePicker: ForwardRefExoticComponent<DatePickerProps & RefAttributes<DatePickerRef>> & DatePickerMembers;
1770
1773
 
1771
1774
  declare interface DatePickerMembers {
1772
1775
  /**
@@ -2119,7 +2122,7 @@ declare interface DetailProps_3 {
2119
2122
  /**
2120
2123
  * See {@link Form.Dropdown}
2121
2124
  */
2122
- declare const Dropdown: ForwardRefExoticComponent<DropdownProps & RefAttributes<FormItemRef>> & DropdownMembers;
2125
+ declare const Dropdown: ForwardRefExoticComponent<DropdownProps & RefAttributes<DropdownRef>> & DropdownMembers;
2123
2126
 
2124
2127
  /**
2125
2128
  * See {@link Grid.Dropdown}
@@ -5641,7 +5644,7 @@ declare interface ItemProps extends ActionsInterface {
5641
5644
  */
5642
5645
  quickLook?: {
5643
5646
  name?: string | null;
5644
- path: string;
5647
+ path: PathLike;
5645
5648
  };
5646
5649
  }
5647
5650
 
@@ -5687,7 +5690,7 @@ declare interface ItemProps_2 extends ActionsInterface {
5687
5690
  */
5688
5691
  quickLook?: {
5689
5692
  name?: string | null;
5690
- path: string;
5693
+ path: PathLike;
5691
5694
  };
5692
5695
  /**
5693
5696
  * An {@link ActionPanel} that will be updated for the selected grid item.
@@ -6834,7 +6837,7 @@ declare interface LabelProps {
6834
6837
  redirectMethod: RedirectMethod;
6835
6838
  providerName: string;
6836
6839
  providerIcon?: Image.ImageLike;
6837
- providerId?: string;
6840
+ providerId: string;
6838
6841
  description?: string;
6839
6842
  private resolvesOnRedirect?;
6840
6843
  private isAuthorizing;
@@ -7535,7 +7538,7 @@ declare interface LabelProps {
7535
7538
  /**
7536
7539
  * @deprecated Use {@link getPreferenceValues} instead.
7537
7540
  */
7538
- export declare const preferences: Preferences_2;
7541
+ export declare const preferences: Preferences;
7539
7542
 
7540
7543
  /**
7541
7544
  * A record type holding the preferences (entered in Raycast Preferences) that have been passed to the command.
@@ -8055,7 +8058,7 @@ declare interface LabelProps {
8055
8058
  * See {@link Action.SubmitForm.Props}
8056
8059
  */
8057
8060
  declare const SubmitForm: {
8058
- <T extends FormValues_2>(props: SubmitFormProps<T>): JSX_2.Element;
8061
+ <T extends Form.Values>(props: SubmitFormProps<T>): JSX.Element;
8059
8062
  displayName: string;
8060
8063
  };
8061
8064
 
@@ -8063,7 +8066,7 @@ declare interface LabelProps {
8063
8066
  * @deprecated Use {@link Action.SubmitForm} instead.
8064
8067
  */
8065
8068
  export declare const SubmitFormAction: {
8066
- <T extends FormValues_2>(props: SubmitFormProps<T>): JSX_2.Element;
8069
+ <T extends Form.Values>(props: SubmitFormProps<T>): JSX.Element;
8067
8070
  displayName: string;
8068
8071
  };
8069
8072
 
@@ -8161,7 +8164,7 @@ declare interface LabelProps {
8161
8164
  /**
8162
8165
  * See {@link Form.TagPicker}
8163
8166
  */
8164
- declare const TagPicker: ForwardRefExoticComponent<TagPickerProps & RefAttributes<FormItemRef>> & TagPickerMembers;
8167
+ declare const TagPicker: ForwardRefExoticComponent<TagPickerProps & RefAttributes<TagPickerRef>> & TagPickerMembers;
8165
8168
 
8166
8169
  /**
8167
8170
  * See {@link Form.TagPicker.Item}
@@ -8689,7 +8692,7 @@ declare interface LabelProps {
8689
8692
  export declare function useNavigation(): Navigation;
8690
8693
 
8691
8694
  /** @deprecated Use `useAI` from `@raycast/utils` */
8692
- export declare const useUnstableAI: () => any;
8695
+ export declare const useUnstableAI: () => undefined;
8693
8696
 
8694
8697
  export declare namespace WindowManagement {
8695
8698
  /**