@raycast/api 1.104.7 → 1.104.9

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.
@@ -811,8 +811,8 @@ Xcode setup error detected. Please ensure Xcode is correctly installed. Use 'sud
811
811
  You can try to delete the ${p} folder and run this command again, sometimes it helps`);return y.stdout}var eA=ua(require("node:fs")),g9e=ua(Owt()),y9e=ua(TPt());function ehe(){if(eA.existsSync("ai.json"))try{let i=eA.readFileSync("ai.json","utf8");return g9e.default.parse(i)}catch(i){throw new Error(`cannot read ai.json: ${i}`)}if(eA.existsSync("ai.json5"))try{let i=eA.readFileSync("ai.json5","utf8");return g9e.default.parse(i)}catch(i){throw new Error(`cannot read ai.json5: ${i}`)}if(eA.existsSync("ai.yaml"))try{let i=eA.readFileSync("ai.yaml","utf8");return y9e.default.parse(i)}catch(i){throw new Error(`cannot read ai.yaml: ${i}`)}if(eA.existsSync("ai.yml"))try{let i=eA.readFileSync("ai.yml","utf8");return y9e.default.parse(i)}catch(i){throw new Error(`cannot read ai.yml: ${i}`)}}var D9e=ua(require("node:fs")),mN=ua(require("node:path")),Za=ua(NPt());function IPt(i,s,c){let p=mN.join(i,"src","tools"),y=mN.join(i,"tsconfig.json"),x;try{x=Za.default.parseJsonSourceFileConfigFileContent(Za.default.readJsonConfigFile(mN.resolve(y),Za.default.sys.readFile),Za.default.sys,mN.dirname(y))}catch{}let E=[];return[s.map(U=>{let ne=mN.join(p,U.name+".ts");if(D9e.existsSync(ne)||(ne=mN.join(p,U.name+".tsx")),!D9e.existsSync(ne))return U;try{let _e=Za.default.createProgram({options:x?.options||{},projectReferences:x?.projectReferences,rootNames:[ne]}),Te=_e.getRootFileNames().map(rr=>_e.getSourceFile(rr))[0],Q=_e.getTypeChecker(),Le,Ae=!1;if(Za.default.forEachChild(Te,rr=>{if(Za.default.isFunctionDeclaration(rr)&&rr.modifiers)rr.modifiers.some(Ft=>Ft.kind===Za.default.SyntaxKind.ExportKeyword)&&rr.modifiers.some(Ft=>Ft.kind===Za.default.SyntaxKind.DefaultKeyword)?Le=rr:rr.modifiers.some(Ft=>Ft.kind===Za.default.SyntaxKind.ExportKeyword)&&rr.name?.text==="confirmation"&&(Ae=!0);else if(Za.default.isVariableStatement(rr)&&rr.modifiers){if(!rr.modifiers.some(vn=>vn.kind===Za.default.SyntaxKind.ExportKeyword))return;let{declarations:Ft}=rr.declarationList;for(let vn of Ft)Za.default.isVariableDeclaration(vn)&&Za.default.isIdentifier(vn.name)&&vn.name.text==="confirmation"&&(Ae=!0)}else if(Za.default.isExportAssignment(rr)){let Ft=rr.expression;for(;Ft;){let vn=C9e(Q,Ft);if(vn){Le=vn;break}if(!Za.default.isCallExpression(Ft))break;let sr=Ft.arguments[0];for(;Ft&&Za.default.isCallExpression(Ft);){if(Za.default.isIdentifier(Ft.expression)&&Ft.expression.text.startsWith("with")){Ft=sr;break}Za.default.isCallExpression(Ft.expression)?Ft=Ft.expression:Ft=null}}}else if(Za.default.isExportDeclaration(rr)&&rr.exportClause&&Za.default.isNamedExports(rr.exportClause)){let Ft=rr.exportClause.elements;for(let vn of Ft)vn.name.text==="confirmation"&&(Ae=!0)}}),!Le)throw new Error("Default exported function not found");let me=Q.getSignatureFromDeclaration(Le);if(!me)throw new Error("Could not get signature of the default exported function");if(me.getParameters().length>1)throw new Error(`Tools should have at most one parameter (has ${me.getParameters().length})`);let st=me.getParameters()[0],Xe=st?dN(Q,st.valueDeclaration?Q.getTypeOfSymbolAtLocation(st,st.valueDeclaration):Q.getTypeOfSymbol(st),{strict:!0,verbose:c?.verbose}):void 0,dr=me?.getReturnType();if(dr){let rr=Q.getAwaitedType(dr);rr&&(dr=rr)}let Ir=dr?dN(Q,dr,{strict:!1,verbose:c?.verbose}):void 0,xr=wS(me),gr={...U,instructions:xr,input:Xe,output:Ir,confirmation:Ae};return Xe||delete gr.input,Ir||delete gr.output,gr}catch(_e){return E.push({level:"error",message:_e.message,filePath:ne}),U}}),E]}function wS(i){let s=i?.getDocumentationComment(void 0)??[],c=i?.getJsDocTags()??[];if(!s.length&&!c.length)return;let p=c.map(y=>`@${y.name}${y.text&&y.text.length>0?` ${y.text.map(x=>x.text)}`:""}`);return s.map(y=>y.text).join(" ")+(p.length>0?`
812
812
 
813
813
  ${p.join(`
814
- `)}`:"")}function dN(i,s,c,p){if(s.intrinsicName==="error"&&s.aliasSymbol?.escapedName==="Omit"&&s.aliasTypeArguments?.length===2){let y=s.aliasTypeArguments;if(y&&y.length===2){let[x,E]=y,L=i.getBaseTypeOfLiteralType(x),U={type:"object",properties:{},required:[],description:wS(p??s.symbol)},ne=new Set;return E.isUnion()?E.types.forEach(_e=>{_e.isStringLiteral()&&ne.add(_e.value)}):E.isStringLiteral()&&ne.add(E.value),L.getProperties().forEach(_e=>{if(!ne.has(_e.getName())){let Te=i.getTypeOfSymbolAtLocation(_e,_e.valueDeclaration),Q=dN(i,Te,c,_e);Q&&(U.properties[_e.getName()]=Q,_e.flags&Za.default.SymbolFlags.Optional||U.required.push(_e.getName()))}}),U}}switch(s.flags){case Za.default.TypeFlags.String:return{type:"string",description:wS(p??s.symbol)};case Za.default.TypeFlags.Number:return{type:"number",description:wS(p??s.symbol)};case Za.default.TypeFlags.Boolean:return{type:"boolean",description:wS(p??s.symbol)};case Za.default.TypeFlags.Union:{if(s.isUnion()&&s.types.length===1)return dN(i,s.types[0],c,p);if(s.isUnion()&&s.types.some(y=>y.flags===Za.default.TypeFlags.Undefined))return s.types=s.types.filter(y=>y.flags!==Za.default.TypeFlags.Undefined),dN(i,s,c,p);if(s.isUnion()&&s.types.every(y=>y.isStringLiteral()))return{type:"string",description:wS(p??s.symbol),enum:Array.from(s.types).map(y=>y.value)};if(s.isUnion()&&s.types.every(y=>y.flags===Za.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:wS(p??s.symbol)};if(c.verbose&&console.error("Only string unions are supported.",s,s.symbol),!c.strict)return;throw new Error(`Only string unions are supported${p?` for "${p?.name}"`:""}`)}case Za.default.TypeFlags.Intersection:{if(c.verbose&&console.error("Intersection types are not supported",s),!c.strict)return;throw new Error(`Intersection types are not supported${p?` for "${p?.name}"`:""}`)}case Za.default.TypeFlags.Object:if(s.symbol.flags===Za.default.SymbolFlags.TypeLiteral||s.symbol.flags===Za.default.SymbolFlags.ObjectLiteral||s.symbol.flags===Za.default.SymbolFlags.Class)switch(s.flags){case Za.default.TypeFlags.Object:{let y={type:"object",properties:{},required:[],description:wS(p??s.symbol)};return s.symbol.members?.forEach(x=>{if(!c.strict&&x.valueDeclaration&&s.symbol.flags===Za.default.SymbolFlags.Class&&(Za.default.isMethodDeclaration(x.valueDeclaration)||Za.default.isGetAccessor(x.valueDeclaration)||Za.default.isSetAccessor(x.valueDeclaration)||x.name==="__constructor"||Za.default.isPropertyDeclaration(x.valueDeclaration)&&x.valueDeclaration.modifiers?.some(L=>L.kind===Za.default.SyntaxKind.PrivateKeyword)))return;let E=dN(i,x.valueDeclaration?i.getTypeOfSymbolAtLocation(x,x.valueDeclaration):i.getTypeOfSymbol(x),c,x);E&&(y.properties[x.name]=E,x.flags&Za.default.SymbolFlags.Optional||y.required.push(x.name))}),y}default:{if(c.verbose&&console.error("Not an object",s),!c.strict)return;throw new Error(`Not an object${p?` for "${p?.name}"`:""}`)}}else if(i.isArrayLikeType(s)||i.isArrayType(s)){let y=s.getNumberIndexType()||i.getIndexTypeOfType(s,Za.default.IndexKind.Number)||s.resolvedTypeArguments?.[0];if(!y){if(c.verbose&&console.error("No item type",s),!c.strict)return;throw new Error(`No item type${p?` for "${p?.name}"`:""}`)}let x=dN(i,y,c);if(!x){if(c.verbose&&console.error("No item type",s),!c.strict)return;throw new Error(`No item type${p?` for "${p?.name}"`:""}`)}return{type:"array",items:x,description:wS(p??s.symbol)}}else if(s.symbol.flags&Za.default.SymbolFlags.Function){let y=dN(i,s.getCallSignatures()[0].getReturnType(),c);if(!y){if(c.verbose&&console.error("No return type",s),!c.strict)return;throw new Error(`No return type${p?` for "${p?.name}"`:""}`)}return{type:"function",returns:y,description:wS(p??s.symbol)}}else{if(s.symbol.name==="Date"&&s.symbol.flags&Za.default.SymbolFlags.Interface)return{type:"string",description:wS(p??s.symbol)};if(s.symbol.flags===Za.default.SymbolFlags.Interface){let y={type:"object",properties:{},required:[],description:wS(p??s.symbol)};return s.symbol.members?.forEach(x=>{if(!c.strict&&x.valueDeclaration&&s.symbol.flags===Za.default.SymbolFlags.Class&&(Za.default.isMethodDeclaration(x.valueDeclaration)||Za.default.isGetAccessor(x.valueDeclaration)||Za.default.isSetAccessor(x.valueDeclaration)||x.name==="__constructor"||Za.default.isPropertyDeclaration(x.valueDeclaration)&&x.valueDeclaration.modifiers?.some(L=>L.kind===Za.default.SyntaxKind.PrivateKeyword)))return;let E=dN(i,x.valueDeclaration?i.getTypeOfSymbolAtLocation(x,x.valueDeclaration):i.getTypeOfSymbol(x),c,x);E&&(y.properties[x.name]=E,x.flags&Za.default.SymbolFlags.Optional||y.required.push(x.name))}),y}else{if(c.verbose&&console.error("Not a type literal",s,s.symbol,s.symbol.flags),!c.strict)return;throw new Error(`Not a type literal${p?` for "${p?.name}"`:""}`)}}case Za.default.TypeFlags.Void:case Za.default.TypeFlags.VoidLike:case Za.default.TypeFlags.Never:return;case Za.default.TypeFlags.Any:{if(!c.strict)return;throw s.intrinsicName==="error"?s.aliasSymbol?new Error(`Could not resolve type ${s.aliasSymbol.getEscapedName()}${p?` for "${p?.name}"`:""}`):new Error(`Could not resolve type${p?` for "${p?.name}"`:""}`):new Error(`\`any\` type is not supported${p?` for "${p?.name}"`:""}`)}default:{if(s.symbol?.flags&Za.default.SymbolFlags.Enum||s.symbol?.flags&Za.default.SymbolFlags.ConstEnum||s.symbol?.flags&Za.default.SymbolFlags.RegularEnum){if(s.symbol.valueDeclaration&&Za.default.isEnumDeclaration(s.symbol.valueDeclaration)&&s.symbol.valueDeclaration.members&&Array.from(s.symbol.valueDeclaration.members).every(y=>Za.default.isEnumMember(y)&&y.initializer?.kind===Za.default.SyntaxKind.StringLiteral))return{type:"string",description:wS(p??s.symbol),enum:Array.from(s.symbol.valueDeclaration.members).map(y=>JSON.parse(y.initializer.getText()))};if(c.verbose&&console.error("Only string enums are supported",s,p?.name),!c.strict)return;throw new Error(`Only string enums are supported${p?` for "${p?.name}"`:""}`)}if(s.isUnion()&&s.types.every(y=>y.flags&Za.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:wS(p??s.symbol)};if(c.verbose&&console.error("Unknown type",s,p?.name),!c.strict)return;throw new Error(`Unknown type${p?` for "${p?.name}"`:""}`)}}}function C9e(i,s){if(Za.default.isFunctionDeclaration(s)||Za.default.isFunctionExpression(s)||Za.default.isArrowFunction(s))return s;if(Za.default.isIdentifier(s)){let c=i.getSymbolAtLocation(s);if(c){let p=c.getDeclarations();if(!p)return;for(let y of p){let x=C9e(i,y);if(x)return x;if(Za.default.isVariableDeclaration(y)&&y.initializer)return C9e(i,y.initializer)}}}}var qPt=ua(pY());var cg=ua(require("node:fs")),tT=ua(require("node:path"));var nF=ua(require("node:fs")),E9e=ua(require("node:path")),yX=class i{structs=new Map;functions=[];static analyzePackage(s){let c=new i;return c.parseDirectory(E9e.join(s,"src")),{functions:c.functions,structs:Array.from(c.structs.values())}}parseDirectory(s){if(!nF.existsSync(s))return;let c=nF.readdirSync(s);for(let p of c){let y=E9e.join(s,p);if(nF.statSync(y).isDirectory())this.parseDirectory(y);else if(p.endsWith(".rs")){let x=nF.readFileSync(y,"utf-8");this.parseRustFile(x)}}}parseRustFile(s){let c=this.removeComments(s);this.parseStructs(c),this.parseFunctions(c)}removeComments(s){return s=s.replace(/\/\/.*$/gm,""),s=s.replace(/\/\*[\s\S]*?\*\//g,""),s}parseStructs(s){let c=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,p;for(;(p=c.exec(s))!==null;){let y=p[1],x=p[2],E=this.parseStructFields(x);this.structs.set(y,{name:y,fields:E})}}parseStructFields(s){let c=[],p=/(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,y;for(;(y=p.exec(s))!==null;){let x=y[1],E=y[2].trim();c.push({name:x,rustType:E,tsType:this.rustTypeToTypeScript(E)})}return c}parseFunctions(s){let c=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,p;for(;(p=c.exec(s))!==null;){let y=!!p[1],x=p[2],E=p[3],L=p[4]?.trim()||"()",U=this.parseParameters(E),{returnType:ne,returnTypeTs:_e,isResult:Te}=this.parseReturnType(L);this.functions.push({name:x,isAsync:y,parameters:U,returnType:ne,returnTypeTs:_e,isResult:Te})}}parseParameters(s){let c=[];if(!s.trim())return c;let p=this.splitParameters(s);for(let y of p){let x=y.trim().match(/(\w+)\s*:\s*(.+)/);if(x){let E=x[1],L=x[2].trim();c.push({name:E,rustType:L,tsType:this.rustTypeToTypeScript(L)})}}return c}splitParameters(s){let c=[],p="",y=0;for(let x of s){if(x==="<")y++;else if(x===">")y--;else if(x===","&&y===0){c.push(p.trim()),p="";continue}p+=x}return p.trim()&&c.push(p.trim()),c}parseReturnType(s){let c=s.trim(),p=c.match(/Result<([^,]+),\s*(.+)>/);if(p){let y=p[1].trim();return{returnType:c,returnTypeTs:this.rustTypeToTypeScript(y),isResult:!0}}return{returnType:c,returnTypeTs:this.rustTypeToTypeScript(c),isResult:!1}}rustTypeToTypeScript(s){let c=s.trim();if(c==="()")return"void";if(c==="String"||c==="&str")return"string";if(c==="bool")return"boolean";if(c.match(/^[ui]\d+$/)||c.match(/^f\d+$/))return"number";let p=c.match(/Option<(.+)>/);if(p)return`${this.rustTypeToTypeScript(p[1])} | null`;let y=c.match(/Vec<(.+)>/);if(y)return`${this.rustTypeToTypeScript(y[1])}[]`;let x=c.match(/Result<([^,]+),\s*(.+)>/);return x?this.rustTypeToTypeScript(x[1]):(this.structs.has(c),c)}},N5=class{static generateDefinitions(s,c){let p="";for(let y of c){p+=`export interface ${y.name} {
815
- `;for(let x of y.fields)p+=` ${x.name}: ${x.tsType};
814
+ `)}`:"")}function dN(i,s,c,p){if(s.intrinsicName==="error"&&s.aliasSymbol?.escapedName==="Omit"&&s.aliasTypeArguments?.length===2){let y=s.aliasTypeArguments;if(y&&y.length===2){let[x,E]=y,L=i.getBaseTypeOfLiteralType(x),U={type:"object",properties:{},required:[],description:wS(p??s.symbol)},ne=new Set;return E.isUnion()?E.types.forEach(_e=>{_e.isStringLiteral()&&ne.add(_e.value)}):E.isStringLiteral()&&ne.add(E.value),L.getProperties().forEach(_e=>{if(!ne.has(_e.getName())){let Te=i.getTypeOfSymbolAtLocation(_e,_e.valueDeclaration),Q=dN(i,Te,c,_e);Q&&(U.properties[_e.getName()]=Q,_e.flags&Za.default.SymbolFlags.Optional||U.required.push(_e.getName()))}}),U}}switch(s.flags){case Za.default.TypeFlags.String:return{type:"string",description:wS(p??s.symbol)};case Za.default.TypeFlags.Number:return{type:"number",description:wS(p??s.symbol)};case Za.default.TypeFlags.Boolean:return{type:"boolean",description:wS(p??s.symbol)};case Za.default.TypeFlags.Union:{if(s.isUnion()&&s.types.length===1)return dN(i,s.types[0],c,p);if(s.isUnion()&&s.types.some(y=>y.flags===Za.default.TypeFlags.Undefined))return s.types=s.types.filter(y=>y.flags!==Za.default.TypeFlags.Undefined),dN(i,s,c,p);if(s.isUnion()&&s.types.every(y=>y.isStringLiteral()))return{type:"string",description:wS(p??s.symbol),enum:Array.from(s.types).map(y=>y.value)};if(s.isUnion()&&s.types.every(y=>y.flags===Za.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:wS(p??s.symbol)};if(c.verbose&&console.error("Only string unions are supported.",s,s.symbol),!c.strict)return;throw new Error(`Only string unions are supported${p?` for "${p?.name}"`:""}`)}case Za.default.TypeFlags.Intersection:{if(c.verbose&&console.error("Intersection types are not supported",s),!c.strict)return;throw new Error(`Intersection types are not supported${p?` for "${p?.name}"`:""}`)}case Za.default.TypeFlags.Object:if(s.symbol.flags===Za.default.SymbolFlags.TypeLiteral||s.symbol.flags===Za.default.SymbolFlags.ObjectLiteral||s.symbol.flags===Za.default.SymbolFlags.Class)switch(s.flags){case Za.default.TypeFlags.Object:{let y={type:"object",properties:{},required:[],description:wS(p??s.symbol)};return s.symbol.members?.forEach(x=>{if(!c.strict&&x.valueDeclaration&&s.symbol.flags===Za.default.SymbolFlags.Class&&(Za.default.isMethodDeclaration(x.valueDeclaration)||Za.default.isGetAccessor(x.valueDeclaration)||Za.default.isSetAccessor(x.valueDeclaration)||x.name==="__constructor"||Za.default.isPropertyDeclaration(x.valueDeclaration)&&x.valueDeclaration.modifiers?.some(L=>L.kind===Za.default.SyntaxKind.PrivateKeyword)))return;let E=dN(i,x.valueDeclaration?i.getTypeOfSymbolAtLocation(x,x.valueDeclaration):i.getTypeOfSymbol(x),c,x);E&&(y.properties[x.name]=E,x.flags&Za.default.SymbolFlags.Optional||y.required.push(x.name))}),y}default:{if(c.verbose&&console.error("Not an object",s),!c.strict)return;throw new Error(`Not an object${p?` for "${p?.name}"`:""}`)}}else if(i.isArrayLikeType(s)||i.isArrayType(s)){let y=s.getNumberIndexType()||i.getIndexTypeOfType(s,Za.default.IndexKind.Number)||s.resolvedTypeArguments?.[0];if(!y){if(c.verbose&&console.error("No item type",s),!c.strict)return;throw new Error(`No item type${p?` for "${p?.name}"`:""}`)}let x=dN(i,y,c);if(!x){if(c.verbose&&console.error("No item type",s),!c.strict)return;throw new Error(`No item type${p?` for "${p?.name}"`:""}`)}return{type:"array",items:x,description:wS(p??s.symbol)}}else if(s.symbol.flags&Za.default.SymbolFlags.Function){let y=dN(i,s.getCallSignatures()[0].getReturnType(),c);if(!y){if(c.verbose&&console.error("No return type",s),!c.strict)return;throw new Error(`No return type${p?` for "${p?.name}"`:""}`)}return{type:"function",returns:y,description:wS(p??s.symbol)}}else{if(s.symbol.name==="Date"&&s.symbol.flags&Za.default.SymbolFlags.Interface)return{type:"string",description:wS(p??s.symbol)};if(s.symbol.flags===Za.default.SymbolFlags.Interface){let y={type:"object",properties:{},required:[],description:wS(p??s.symbol)};return s.symbol.members?.forEach(x=>{if(!c.strict&&x.valueDeclaration&&s.symbol.flags===Za.default.SymbolFlags.Class&&(Za.default.isMethodDeclaration(x.valueDeclaration)||Za.default.isGetAccessor(x.valueDeclaration)||Za.default.isSetAccessor(x.valueDeclaration)||x.name==="__constructor"||Za.default.isPropertyDeclaration(x.valueDeclaration)&&x.valueDeclaration.modifiers?.some(L=>L.kind===Za.default.SyntaxKind.PrivateKeyword)))return;let E=dN(i,x.valueDeclaration?i.getTypeOfSymbolAtLocation(x,x.valueDeclaration):i.getTypeOfSymbol(x),c,x);E&&(y.properties[x.name]=E,x.flags&Za.default.SymbolFlags.Optional||y.required.push(x.name))}),y}else{if(c.verbose&&console.error("Not a type literal",s,s.symbol,s.symbol.flags),!c.strict)return;throw new Error(`Not a type literal${p?` for "${p?.name}"`:""}`)}}case Za.default.TypeFlags.Void:case Za.default.TypeFlags.VoidLike:case Za.default.TypeFlags.Never:return;case Za.default.TypeFlags.Any:{if(!c.strict)return;throw s.intrinsicName==="error"?s.aliasSymbol?new Error(`Could not resolve type ${s.aliasSymbol.getEscapedName()}${p?` for "${p?.name}"`:""}`):new Error(`Could not resolve type${p?` for "${p?.name}"`:""}`):new Error(`\`any\` type is not supported${p?` for "${p?.name}"`:""}`)}default:{if(s.symbol?.flags&Za.default.SymbolFlags.Enum||s.symbol?.flags&Za.default.SymbolFlags.ConstEnum||s.symbol?.flags&Za.default.SymbolFlags.RegularEnum){if(s.symbol.valueDeclaration&&Za.default.isEnumDeclaration(s.symbol.valueDeclaration)&&s.symbol.valueDeclaration.members&&Array.from(s.symbol.valueDeclaration.members).every(y=>Za.default.isEnumMember(y)&&y.initializer?.kind===Za.default.SyntaxKind.StringLiteral))return{type:"string",description:wS(p??s.symbol),enum:Array.from(s.symbol.valueDeclaration.members).map(y=>JSON.parse(y.initializer.getText()))};if(c.verbose&&console.error("Only string enums are supported",s,p?.name),!c.strict)return;throw new Error(`Only string enums are supported${p?` for "${p?.name}"`:""}`)}if(s.isUnion()&&s.types.every(y=>y.flags&Za.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:wS(p??s.symbol)};if(c.verbose&&console.error("Unknown type",s,p?.name),!c.strict)return;throw new Error(`Unknown type${p?` for "${p?.name}"`:""}`)}}}function C9e(i,s){if(Za.default.isFunctionDeclaration(s)||Za.default.isFunctionExpression(s)||Za.default.isArrowFunction(s))return s;if(Za.default.isIdentifier(s)){let c=i.getSymbolAtLocation(s);if(c){let p=c.getDeclarations();if(!p)return;for(let y of p){let x=C9e(i,y);if(x)return x;if(Za.default.isVariableDeclaration(y)&&y.initializer)return C9e(i,y.initializer)}}}}var qPt=ua(pY());var cg=ua(require("node:fs")),tT=ua(require("node:path"));var nF=ua(require("node:fs")),E9e=ua(require("node:path")),yX=class i{structs=new Map;functions=[];static analyzePackage(s){let c=new i;return c.parseDirectory(E9e.join(s,"src")),{functions:c.functions,structs:Array.from(c.structs.values())}}parseDirectory(s){if(!nF.existsSync(s))return;let c=nF.readdirSync(s);for(let p of c){let y=E9e.join(s,p);if(nF.statSync(y).isDirectory())this.parseDirectory(y);else if(p.endsWith(".rs")){let x=nF.readFileSync(y,"utf-8");this.parseRustFile(x)}}}parseRustFile(s){let c=this.removeComments(s);this.parseStructs(c),this.parseFunctions(c)}removeComments(s){return s=s.replace(/\/\/.*$/gm,""),s=s.replace(/\/\*[\s\S]*?\*\//g,""),s}parseStructs(s){let c=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,p;for(;(p=c.exec(s))!==null;){let y=p[1],x=p[2],E=this.parseStructFields(x);this.structs.set(y,{name:y,fields:E})}}parseStructFields(s){let c=[],p=/(?:#\[serde\(([^\]]+)\)\]\s*)?(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,y;for(;(y=p.exec(s))!==null;){let x=y[1],E=y[2],L=y[3].trim(),U=E;if(x){let ne=x.match(/rename\s*=\s*"([^"]+)"/);ne&&(U=ne[1])}c.push({name:E,serializedName:U,rustType:L,tsType:this.rustTypeToTypeScript(L)})}return c}parseFunctions(s){let c=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,p;for(;(p=c.exec(s))!==null;){let y=!!p[1],x=p[2],E=p[3],L=p[4]?.trim()||"()",U=this.parseParameters(E),{returnType:ne,returnTypeTs:_e,isResult:Te}=this.parseReturnType(L);this.functions.push({name:x,isAsync:y,parameters:U,returnType:ne,returnTypeTs:_e,isResult:Te})}}parseParameters(s){let c=[];if(!s.trim())return c;let p=this.splitParameters(s);for(let y of p){let x=y.trim().match(/(\w+)\s*:\s*(.+)/);if(x){let E=x[1],L=x[2].trim();c.push({name:E,rustType:L,tsType:this.rustTypeToTypeScript(L)})}}return c}splitParameters(s){let c=[],p="",y=0;for(let x of s){if(x==="<")y++;else if(x===">")y--;else if(x===","&&y===0){c.push(p.trim()),p="";continue}p+=x}return p.trim()&&c.push(p.trim()),c}parseReturnType(s){let c=s.trim(),p=c.match(/Result<([^,]+),\s*(.+)>/);if(p){let y=p[1].trim();return{returnType:c,returnTypeTs:this.rustTypeToTypeScript(y),isResult:!0}}return{returnType:c,returnTypeTs:this.rustTypeToTypeScript(c),isResult:!1}}rustTypeToTypeScript(s){let c=s.trim();if(c==="()")return"void";if(c==="String"||c==="&str")return"string";if(c==="bool")return"boolean";if(c.match(/^[ui]\d+$/)||c.match(/^f\d+$/))return"number";let p=c.match(/Option<(.+)>/);if(p)return`${this.rustTypeToTypeScript(p[1])} | null | undefined`;let y=c.match(/Vec<(.+)>/);if(y)return`${this.rustTypeToTypeScript(y[1])}[]`;let x=c.match(/Result<([^,]+),\s*(.+)>/);return x?this.rustTypeToTypeScript(x[1]):(this.structs.has(c),c)}},N5=class{static generateDefinitions(s,c){let p="";for(let y of c){p+=`export interface ${y.name} {
815
+ `;for(let x of y.fields)p+=` ${x.serializedName}: ${x.tsType};
816
816
  `;p+=`}
817
817
 
818
818
  `}for(let y of s){let x=y.parameters.map(L=>`${L.name}: ${L.tsType}`).join(", "),E=y.returnTypeTs==="void"?"Promise<void>":`Promise<${y.returnTypeTs}>`;p+=`export declare function ${y.name}(${x}): ${E};
@@ -1 +1 @@
1
- "use strict";var G=Object.create;var m=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var A=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),S=(n,t)=>{for(var i in t)m(n,i,{get:t[i],enumerable:!0})},I=(n,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of O(t))!R.call(n,a)&&a!==i&&m(n,a,{get:()=>t[a],enumerable:!(o=D(t,a))||o.enumerable});return n};var h=(n,t,i)=>(i=n!=null?G(L(n)):{},I(t||!n||!n.__esModule?m(i,"default",{value:n,enumerable:!0}):i,n)),F=n=>I(m({},"__esModule",{value:!0}),n);var B=A((re,k)=>{var J=require("node:tty"),q=J?.WriteStream?.prototype?.hasColors?.()??!1,r=(n,t)=>{if(!q)return a=>a;let i=`\x1B[${n}m`,o=`\x1B[${t}m`;return a=>{let u=a+"",d=u.indexOf(o);if(d===-1)return i+u+o;let x=i,g=0,P=(t===22?o:"")+i;for(;d!==-1;)x+=u.slice(g,d)+P,g=d+o.length,d=u.indexOf(o,g);return x+=u.slice(g)+o,x}},e={};e.reset=r(0,0);e.bold=r(1,22);e.dim=r(2,22);e.italic=r(3,23);e.underline=r(4,24);e.overline=r(53,55);e.inverse=r(7,27);e.hidden=r(8,28);e.strikethrough=r(9,29);e.black=r(30,39);e.red=r(31,39);e.green=r(32,39);e.yellow=r(33,39);e.blue=r(34,39);e.magenta=r(35,39);e.cyan=r(36,39);e.white=r(37,39);e.gray=r(90,39);e.bgBlack=r(40,49);e.bgRed=r(41,49);e.bgGreen=r(42,49);e.bgYellow=r(43,49);e.bgBlue=r(44,49);e.bgMagenta=r(45,49);e.bgCyan=r(46,49);e.bgWhite=r(47,49);e.bgGray=r(100,49);e.redBright=r(91,39);e.greenBright=r(92,39);e.yellowBright=r(93,39);e.blueBright=r(94,39);e.magentaBright=r(95,39);e.cyanBright=r(96,39);e.whiteBright=r(97,39);e.bgRedBright=r(101,49);e.bgGreenBright=r(102,49);e.bgYellowBright=r(103,49);e.bgBlueBright=r(104,49);e.bgMagentaBright=r(105,49);e.bgCyanBright=r(106,49);e.bgWhiteBright=r(107,49);k.exports=e});var $=A((ce,K)=>{K.exports={name:"ray",description:"Build extensions for Raycast with React and Node.js.",version:"1.104.7",author:"mathieudutour",private:!0,bin:{ray:"./bin/run.js"},dependencies:{"@oclif/core":"^4.5.4","@oclif/plugin-autocomplete":"^3.2.35","@oclif/plugin-help":"^6.2.33","@oclif/plugin-not-found":"^3.2.68","@raycast/eslint-plugin":"^2.1.0",ajv:"^8.17.1",archiver:"^7.0.1",camelcase:"^8.0.0",chokidar:"^4.0.3","cli-progress":"^3.12.0",clipboardy:"^2.3.0",execa:"^9.6.0","json-source-map":"^0.6.1",json5:"^2.2.3","node-fetch-cjs":"^3.3.2",open:"^8.4.2",ora:"^8.2.0",tail:"^2.2.6","terminal-link":"^3.0.0",yaml:"^2.8.1","yoctocolors-cjs":"^2.1.3"},devDependencies:{"@raycast/eslint-config":"^1.0.11","@types/archiver":"^6.0.3","@types/cli-progress":"^3.11.6","@types/node":"22.10.10","@types/tail":"^2.2.3",esbuild:"^0.25.10",eslint:"^8","json-schema-to-typescript":"^15.0.4",oclif:"^4.22.27",typescript:"^5.6.3"},files:["/bin","/dist","/oclif.manifest.json"],license:"MIT",main:"dist/index.js",oclif:{bin:"ray",dirname:"ray",commands:"./dist/commands",plugins:["@oclif/plugin-autocomplete","@oclif/plugin-help","@oclif/plugin-not-found"]},scripts:{"json-schema-to-ts":"json2ts ../../api/schema.json -y > src/types/manifest-schema.d.ts","build-scripts":'tsc "./scripts/build.ts" "./scripts/build-command.ts" "./scripts/dev-command.ts" --outDir ./scripts/dist --esModuleInterop',prebuild:"npm run json-schema-to-ts && npm run build-scripts",build:"node ./scripts/dist/build-command.js",predev:"npm run json-schema-to-ts && npm run build-scripts",dev:"node ./scripts/dist/dev-command.js",lint:"eslint . --ext .ts"},types:"dist/index.d.ts"}});var V={};S(V,{default:()=>b});module.exports=F(V);var l=require("@oclif/core");var f=h(require("node:fs")),v=h(require("node:path")),C=h(require("node:os"));var T={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"],U="e69bae0ec90f5e838555",c={},E;function N(n){E=n;try{c=JSON.parse(f.readFileSync(v.join(Y(),"config.json"),"utf8"))}catch(t){if(t instanceof Error&&t.code==="ENOENT")return;throw new Error(`Failed to read config file: ${t}`)}}function _(n){switch(n){case"raycastApiURL":return process.env.RAY_APIURL||c.APIURL||T.url;case"raycastAccessToken":return process.env.RAY_TOKEN||c.Token||c.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||c.ClientID||T.clientID;case"githubClientId":return process.env.RAY_GithubClientID||c.GithubClientID||U;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||c.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target?process.env.RAY_Target:typeof c.Target<"u"?c.Target:w(process.platform==="win32"?"x":"release")}}function w(n){switch(n){case"debug":return"debug";case"internal":return"internal";case"release":return"";case"x":return"x";case"x-internal":return"x-internal";case"x-development":return"x-development";case void 0:return _("flavorName")}}function M(){let n=w(E);return n==""?"raycast":`raycast-${n}`}function Y(){let n=v.join(C.default.homedir(),".config",M());return f.mkdirSync(n,{recursive:!0}),n}var s=h(B());var te=(0,s.blue)((0,s.dim)("internal only"));var p={wait:`\u{1F550}${(0,s.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,s.cyan)("info")} - `,success:`\u2705${(0,s.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,s.yellow)("warn")} - `,error:`\u{1F4A5}${(0,s.red)("error")} - `,event:`\u26A1\uFE0F${(0,s.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,s.yellowBright)("plan")} - `},H=!0;function j(n,t){n||(p.wait=`${(0,s.blue)("wait")} - `,p.info=`${(0,s.cyan)("info")} - `,p.success=`${(0,s.green)("ready")} - `,p.warn=`${(0,s.yellow)("warn")} - `,p.error=`${(0,s.red)("error")} - `,p.event=`${(0,s.magenta)("event")} - `,p.paymentPrompt=`${(0,s.yellowBright)("plan")} - `),t&&(H=!1)}var y=class extends l.Command{static baseFlags={"exit-on-error":l.Flags.boolean({default:!0,helpGroup:"GLOBAL",aliases:["exitOnError"],deprecateAliases:!0,summary:"Always exit with non-zero code on error",allowNo:!0}),emoji:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Prefix output with emojis \u{1F308}"}),help:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Show the help message for the command"}),"non-interactive":l.Flags.boolean({char:"I",default:!1,helpGroup:"GLOBAL",summary:"Disable interactive outputs, useful for CI"}),target:l.Flags.option({char:"t",description:"Raycast app target",helpGroup:"GLOBAL",multiple:!1,options:["debug","internal","release","x","x-development","x-internal"],hidden:!0})()};flags;args;async init(){await super.init(),process.on("SIGINT",()=>process.exit(1));let{args:t,flags:i}=await this.parse({flags:this.ctor.flags,baseFlags:super.ctor.baseFlags,enableJsonFlag:this.ctor.enableJsonFlag,args:this.ctor.args,strict:this.ctor.strict});this.flags=i,this.args=t,N(this.flags.target),j(this.flags.emoji,this.flags["non-interactive"])}error(t,i){return i?.message&&t instanceof Error&&(t.message=`${i.message} (${t.message})`,delete i.message),super.error(t,i)}async catch(t){return super.catch(t)}async finally(t){return super.finally(t)}};var b=class n extends y{static description="Print the version number";async run(){await this.parse(n),this.log(`${$().version}`)}};
1
+ "use strict";var G=Object.create;var m=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var A=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),S=(n,t)=>{for(var i in t)m(n,i,{get:t[i],enumerable:!0})},I=(n,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of O(t))!R.call(n,a)&&a!==i&&m(n,a,{get:()=>t[a],enumerable:!(o=D(t,a))||o.enumerable});return n};var h=(n,t,i)=>(i=n!=null?G(L(n)):{},I(t||!n||!n.__esModule?m(i,"default",{value:n,enumerable:!0}):i,n)),F=n=>I(m({},"__esModule",{value:!0}),n);var B=A((re,k)=>{var J=require("node:tty"),q=J?.WriteStream?.prototype?.hasColors?.()??!1,r=(n,t)=>{if(!q)return a=>a;let i=`\x1B[${n}m`,o=`\x1B[${t}m`;return a=>{let u=a+"",d=u.indexOf(o);if(d===-1)return i+u+o;let x=i,g=0,P=(t===22?o:"")+i;for(;d!==-1;)x+=u.slice(g,d)+P,g=d+o.length,d=u.indexOf(o,g);return x+=u.slice(g)+o,x}},e={};e.reset=r(0,0);e.bold=r(1,22);e.dim=r(2,22);e.italic=r(3,23);e.underline=r(4,24);e.overline=r(53,55);e.inverse=r(7,27);e.hidden=r(8,28);e.strikethrough=r(9,29);e.black=r(30,39);e.red=r(31,39);e.green=r(32,39);e.yellow=r(33,39);e.blue=r(34,39);e.magenta=r(35,39);e.cyan=r(36,39);e.white=r(37,39);e.gray=r(90,39);e.bgBlack=r(40,49);e.bgRed=r(41,49);e.bgGreen=r(42,49);e.bgYellow=r(43,49);e.bgBlue=r(44,49);e.bgMagenta=r(45,49);e.bgCyan=r(46,49);e.bgWhite=r(47,49);e.bgGray=r(100,49);e.redBright=r(91,39);e.greenBright=r(92,39);e.yellowBright=r(93,39);e.blueBright=r(94,39);e.magentaBright=r(95,39);e.cyanBright=r(96,39);e.whiteBright=r(97,39);e.bgRedBright=r(101,49);e.bgGreenBright=r(102,49);e.bgYellowBright=r(103,49);e.bgBlueBright=r(104,49);e.bgMagentaBright=r(105,49);e.bgCyanBright=r(106,49);e.bgWhiteBright=r(107,49);k.exports=e});var $=A((ce,K)=>{K.exports={name:"ray",description:"Build extensions for Raycast with React and Node.js.",version:"1.104.9",author:"mathieudutour",private:!0,bin:{ray:"./bin/run.js"},dependencies:{"@oclif/core":"^4.5.4","@oclif/plugin-autocomplete":"^3.2.35","@oclif/plugin-help":"^6.2.33","@oclif/plugin-not-found":"^3.2.68","@raycast/eslint-plugin":"^2.1.0",ajv:"^8.17.1",archiver:"^7.0.1",camelcase:"^8.0.0",chokidar:"^4.0.3","cli-progress":"^3.12.0",clipboardy:"^2.3.0",execa:"^9.6.0","json-source-map":"^0.6.1",json5:"^2.2.3","node-fetch-cjs":"^3.3.2",open:"^8.4.2",ora:"^8.2.0",tail:"^2.2.6","terminal-link":"^3.0.0",yaml:"^2.8.1","yoctocolors-cjs":"^2.1.3"},devDependencies:{"@raycast/eslint-config":"^1.0.11","@types/archiver":"^6.0.3","@types/cli-progress":"^3.11.6","@types/node":"22.10.10","@types/tail":"^2.2.3",esbuild:"^0.25.10",eslint:"^8","json-schema-to-typescript":"^15.0.4",oclif:"^4.22.27",typescript:"^5.6.3"},files:["/bin","/dist","/oclif.manifest.json"],license:"MIT",main:"dist/index.js",oclif:{bin:"ray",dirname:"ray",commands:"./dist/commands",plugins:["@oclif/plugin-autocomplete","@oclif/plugin-help","@oclif/plugin-not-found"]},scripts:{"json-schema-to-ts":"json2ts ../../api/schema.json -y > src/types/manifest-schema.d.ts","build-scripts":'tsc "./scripts/build.ts" "./scripts/build-command.ts" "./scripts/dev-command.ts" --outDir ./scripts/dist --esModuleInterop',prebuild:"npm run json-schema-to-ts && npm run build-scripts",build:"node ./scripts/dist/build-command.js",predev:"npm run json-schema-to-ts && npm run build-scripts",dev:"node ./scripts/dist/dev-command.js",lint:"eslint . --ext .ts"},types:"dist/index.d.ts"}});var V={};S(V,{default:()=>b});module.exports=F(V);var l=require("@oclif/core");var f=h(require("node:fs")),v=h(require("node:path")),C=h(require("node:os"));var T={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"],U="e69bae0ec90f5e838555",c={},E;function N(n){E=n;try{c=JSON.parse(f.readFileSync(v.join(Y(),"config.json"),"utf8"))}catch(t){if(t instanceof Error&&t.code==="ENOENT")return;throw new Error(`Failed to read config file: ${t}`)}}function _(n){switch(n){case"raycastApiURL":return process.env.RAY_APIURL||c.APIURL||T.url;case"raycastAccessToken":return process.env.RAY_TOKEN||c.Token||c.AccessToken||"";case"raycastClientId":return process.env.RAY_CLIENT_ID||c.ClientID||T.clientID;case"githubClientId":return process.env.RAY_GithubClientID||c.GithubClientID||U;case"githubAccessToken":return process.env.GITHUB_ACCESS_TOKEN||c.GithubAccessToken||"";case"flavorName":return process.env.RAY_Target?process.env.RAY_Target:typeof c.Target<"u"?c.Target:w(process.platform==="win32"?"x":"release")}}function w(n){switch(n){case"debug":return"debug";case"internal":return"internal";case"release":return"";case"x":return"x";case"x-internal":return"x-internal";case"x-development":return"x-development";case void 0:return _("flavorName")}}function M(){let n=w(E);return n==""?"raycast":`raycast-${n}`}function Y(){let n=v.join(C.default.homedir(),".config",M());return f.mkdirSync(n,{recursive:!0}),n}var s=h(B());var te=(0,s.blue)((0,s.dim)("internal only"));var p={wait:`\u{1F550}${(0,s.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,s.cyan)("info")} - `,success:`\u2705${(0,s.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,s.yellow)("warn")} - `,error:`\u{1F4A5}${(0,s.red)("error")} - `,event:`\u26A1\uFE0F${(0,s.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,s.yellowBright)("plan")} - `},H=!0;function j(n,t){n||(p.wait=`${(0,s.blue)("wait")} - `,p.info=`${(0,s.cyan)("info")} - `,p.success=`${(0,s.green)("ready")} - `,p.warn=`${(0,s.yellow)("warn")} - `,p.error=`${(0,s.red)("error")} - `,p.event=`${(0,s.magenta)("event")} - `,p.paymentPrompt=`${(0,s.yellowBright)("plan")} - `),t&&(H=!1)}var y=class extends l.Command{static baseFlags={"exit-on-error":l.Flags.boolean({default:!0,helpGroup:"GLOBAL",aliases:["exitOnError"],deprecateAliases:!0,summary:"Always exit with non-zero code on error",allowNo:!0}),emoji:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Prefix output with emojis \u{1F308}"}),help:l.Flags.boolean({default:!1,helpGroup:"GLOBAL",summary:"Show the help message for the command"}),"non-interactive":l.Flags.boolean({char:"I",default:!1,helpGroup:"GLOBAL",summary:"Disable interactive outputs, useful for CI"}),target:l.Flags.option({char:"t",description:"Raycast app target",helpGroup:"GLOBAL",multiple:!1,options:["debug","internal","release","x","x-development","x-internal"],hidden:!0})()};flags;args;async init(){await super.init(),process.on("SIGINT",()=>process.exit(1));let{args:t,flags:i}=await this.parse({flags:this.ctor.flags,baseFlags:super.ctor.baseFlags,enableJsonFlag:this.ctor.enableJsonFlag,args:this.ctor.args,strict:this.ctor.strict});this.flags=i,this.args=t,N(this.flags.target),j(this.flags.emoji,this.flags["non-interactive"])}error(t,i){return i?.message&&t instanceof Error&&(t.message=`${i.message} (${t.message})`,delete i.message),super.error(t,i)}async catch(t){return super.catch(t)}async finally(t){return super.finally(t)}};var b=class n extends y{static description="Print the version number";async run(){await this.parse(n),this.log(`${$().version}`)}};
@@ -52,8 +52,8 @@ ${t}`,yF=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),bF=Objec
52
52
  `);return i!==-1&&(t=Sf(t,o,n,i)),n+t+o};Object.defineProperties(Et.prototype,He);var LF=Et(),o3=Et({level:Cf?Cf.level:0});var ue=LF;var G=E(require("node:process"),1);function Zo(){return G.default.platform!=="win32"?G.default.env.TERM!=="linux":!!G.default.env.CI||!!G.default.env.WT_SESSION||!!G.default.env.TERMINUS_SUBLIME||G.default.env.ConEmuTask==="{cmd::Cmder}"||G.default.env.TERM_PROGRAM==="Terminus-Sublime"||G.default.env.TERM_PROGRAM==="vscode"||G.default.env.TERM==="xterm-256color"||G.default.env.TERM==="alacritty"||G.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var jF={info:ue.blue("\u2139"),success:ue.green("\u2714"),warning:ue.yellow("\u26A0"),error:ue.red("\u2716")},UF={info:ue.blue("i"),success:ue.green("\u221A"),warning:ue.yellow("\u203C"),error:ue.red("\xD7")},kF=Zo()?jF:UF,yt=kF;function Qo({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var GF=Qo();function bt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(GF,"")}function Af(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function Bf(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Tf(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function WF(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function _f(e,{ambiguousAsWide:t=!1}={}){return WF(e),Bf(e)||Tf(e)||t&&Af(e)?2:1}var If=E(Rf(),1),zF=new Intl.Segmenter,VF=/^\p{Default_Ignorable_Code_Point}$/u;function ei(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=bt(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of zF.segment(e)){let a=s.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!VF.test(s)){if((0,If.default)().test(s)){o+=2;continue}o+=_f(a,i)}}return o}function ti({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var K=E(require("node:process"),1),YF=3,ri=class{#r=0;start(){this.#r++,this.#r===1&&this.#o()}stop(){if(this.#r<=0)throw new Error("`stop` called more times than `start`");this.#r--,this.#r===0&&this.#e()}#o(){K.default.platform==="win32"||!K.default.stdin.isTTY||(K.default.stdin.setRawMode(!0),K.default.stdin.on("data",this.#n),K.default.stdin.resume())}#e(){K.default.stdin.isTTY&&(K.default.stdin.off("data",this.#n),K.default.stdin.pause(),K.default.stdin.setRawMode(!1))}#n(t){t[0]===YF&&K.default.emit("SIGINT")}},qF=new ri,ni=qF;var HF=E(qo(),1),oi=class{#r=0;#o=!1;#e=0;#n=-1;#a=0;#t;#s;#i;#d;#m;#l;#f;#D;#h;#u;#c;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:St.default.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#m=this.#t.interval,this.#i=this.#t.stream,this.#l=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:ti({stream:this.#i}),this.#f=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,St.default.env.NODE_ENV==="test"&&(this._stream=this.#i,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#r},set(r){this.#r=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#D}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#D=t,this.#p()}get interval(){return this.#m??this.#s.interval??100}get spinner(){return this.#s}set spinner(t){if(this.#n=-1,this.#m=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#s=t}else if(!Ze())this.#s=wt.default.line;else if(t===void 0)this.#s=wt.default.dots;else if(t!=="default"&&wt.default[t])this.#s=wt.default[t];else throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#h}set text(t=""){this.#h=t,this.#p()}get prefixText(){return this.#u}set prefixText(t=""){this.#u=t,this.#p()}get suffixText(){return this.#c}set suffixText(t=""){this.#c=t,this.#p()}get isSpinning(){return this.#d!==void 0}#F(t=this.#u,r=" "){return typeof t=="string"&&t!==""?t+r:typeof t=="function"?t()+r:""}#g(t=this.#c,r=" "){return typeof t=="string"&&t!==""?r+t:typeof t=="function"?r+t():""}#p(){let t=this.#i.columns??80,r=this.#F(this.#u,"-"),n=this.#g(this.#c,"-"),o=" ".repeat(this.#D)+r+"--"+this.#h+"--"+n;this.#e=0;for(let i of bt(o).split(`
53
53
  `))this.#e+=Math.max(1,Math.ceil(ei(i,{countAnsiEscapeCodes:!0})/t))}get isEnabled(){return this.#l&&!this.#f}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=t}get isSilent(){return this.#f}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#f=t}frame(){let t=Date.now();(this.#n===-1||t-this.#a>=this.interval)&&(this.#n=++this.#n%this.#s.frames.length,this.#a=t);let{frames:r}=this.#s,n=r[this.#n];this.color&&(n=af[this.color](n));let o=typeof this.#u=="string"&&this.#u!==""?this.#u+" ":"",i=typeof this.text=="string"?" "+this.text:"",s=typeof this.#c=="string"&&this.#c!==""?" "+this.#c:"";return o+n+i+s}clear(){if(!this.#l||!this.#i.isTTY)return this;this.#i.cursorTo(0);for(let t=0;t<this.#r;t++)t>0&&this.#i.moveCursor(0,-1),this.#i.clearLine(1);return(this.#D||this.lastIndent!==this.#D)&&this.#i.cursorTo(this.#D),this.lastIndent=this.#D,this.#r=0,this}render(){return this.#f?this:(this.clear(),this.#i.write(this.frame()),this.#r=this.#e,this)}start(t){return t&&(this.text=t),this.#f?this:this.#l?this.isSpinning?this:(this.#t.hideCursor&&Yo.hide(this.#i),this.#t.discardStdin&&St.default.stdin.isTTY&&(this.#o=!0,ni.start()),this.render(),this.#d=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#i.write(`- ${this.text}
54
54
  `),this)}stop(){return this.#l?(clearInterval(this.#d),this.#d=void 0,this.#n=0,this.clear(),this.#t.hideCursor&&Yo.show(this.#i),this.#t.discardStdin&&St.default.stdin.isTTY&&this.#o&&(ni.stop(),this.#o=!1),this):this}succeed(t){return this.stopAndPersist({symbol:yt.success,text:t})}fail(t){return this.stopAndPersist({symbol:yt.error,text:t})}warn(t){return this.stopAndPersist({symbol:yt.warning,text:t})}info(t){return this.stopAndPersist({symbol:yt.info,text:t})}stopAndPersist(t={}){if(this.#f)return this;let r=t.prefixText??this.#u,n=this.#F(r," "),o=t.symbol??" ",i=t.text??this.text,a=typeof i=="string"?(o?" ":"")+i:"",u=t.suffixText??this.#c,l=this.#g(u," "),c=n+o+a+l+`
55
- `;return this.stop(),this.#i.write(c),this}};function ii(e){return new oi(e)}var v3=(0,R.blue)((0,R.dim)("internal only"));function ce(e,t,r){console.log(Mf[e]+t),typeof r?.exit<"u"&&process.exit(r.exit)}async function vf(e,t,r){if(!KF){ce("wait",e);try{let o=await t();o&&console.log(o),ce("success",e);return}catch(o){return ce("error",e),r?.printError!==!1&&console.log((0,R.red)(o.message)),o}}let n=ii({spinner:"simpleDots",prefixText:Mf.wait+e}).start();try{let o=await t();n.stop(),ce("success",e),o&&console.log(o)}catch(o){return n.stop(),ce("error",e),r?.printError!==!1&&console.error(o.message),o}}var Mf={wait:`\u{1F550}${(0,R.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,R.cyan)("info")} - `,success:`\u2705${(0,R.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,R.yellow)("warn")} - `,error:`\u{1F4A5}${(0,R.red)("error")} - `,event:`\u26A1\uFE0F${(0,R.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,R.yellowBright)("plan")} - `},KF=!0;var ge=E(require("node:fs")),si=E(require("node:path")),Ct=class e{structs=new Map;functions=[];static analyzePackage(t){let r=new e;return r.parseDirectory(si.join(t,"src")),{functions:r.functions,structs:Array.from(r.structs.values())}}parseDirectory(t){if(!ge.existsSync(t))return;let r=ge.readdirSync(t);for(let n of r){let o=si.join(t,n);if(ge.statSync(o).isDirectory())this.parseDirectory(o);else if(n.endsWith(".rs")){let i=ge.readFileSync(o,"utf-8");this.parseRustFile(i)}}}parseRustFile(t){let r=this.removeComments(t);this.parseStructs(r),this.parseFunctions(r)}removeComments(t){return t=t.replace(/\/\/.*$/gm,""),t=t.replace(/\/\*[\s\S]*?\*\//g,""),t}parseStructs(t){let r=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,n;for(;(n=r.exec(t))!==null;){let o=n[1],i=n[2],s=this.parseStructFields(i);this.structs.set(o,{name:o,fields:s})}}parseStructFields(t){let r=[],n=/(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,o;for(;(o=n.exec(t))!==null;){let i=o[1],s=o[2].trim();r.push({name:i,rustType:s,tsType:this.rustTypeToTypeScript(s)})}return r}parseFunctions(t){let r=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,n;for(;(n=r.exec(t))!==null;){let o=!!n[1],i=n[2],s=n[3],a=n[4]?.trim()||"()",u=this.parseParameters(s),{returnType:l,returnTypeTs:c,isResult:f}=this.parseReturnType(a);this.functions.push({name:i,isAsync:o,parameters:u,returnType:l,returnTypeTs:c,isResult:f})}}parseParameters(t){let r=[];if(!t.trim())return r;let n=this.splitParameters(t);for(let o of n){let i=o.trim().match(/(\w+)\s*:\s*(.+)/);if(i){let s=i[1],a=i[2].trim();r.push({name:s,rustType:a,tsType:this.rustTypeToTypeScript(a)})}}return r}splitParameters(t){let r=[],n="",o=0;for(let i of t){if(i==="<")o++;else if(i===">")o--;else if(i===","&&o===0){r.push(n.trim()),n="";continue}n+=i}return n.trim()&&r.push(n.trim()),r}parseReturnType(t){let r=t.trim(),n=r.match(/Result<([^,]+),\s*(.+)>/);if(n){let o=n[1].trim();return{returnType:r,returnTypeTs:this.rustTypeToTypeScript(o),isResult:!0}}return{returnType:r,returnTypeTs:this.rustTypeToTypeScript(r),isResult:!1}}rustTypeToTypeScript(t){let r=t.trim();if(r==="()")return"void";if(r==="String"||r==="&str")return"string";if(r==="bool")return"boolean";if(r.match(/^[ui]\d+$/)||r.match(/^f\d+$/))return"number";let n=r.match(/Option<(.+)>/);if(n)return`${this.rustTypeToTypeScript(n[1])} | null`;let o=r.match(/Vec<(.+)>/);if(o)return`${this.rustTypeToTypeScript(o[1])}[]`;let i=r.match(/Result<([^,]+),\s*(.+)>/);return i?this.rustTypeToTypeScript(i[1]):(this.structs.has(r),r)}},xe=class{static generateDefinitions(t,r){let n="";for(let o of r){n+=`export interface ${o.name} {
56
- `;for(let i of o.fields)n+=` ${i.name}: ${i.tsType};
55
+ `;return this.stop(),this.#i.write(c),this}};function ii(e){return new oi(e)}var v3=(0,R.blue)((0,R.dim)("internal only"));function ce(e,t,r){console.log(Mf[e]+t),typeof r?.exit<"u"&&process.exit(r.exit)}async function vf(e,t,r){if(!KF){ce("wait",e);try{let o=await t();o&&console.log(o),ce("success",e);return}catch(o){return ce("error",e),r?.printError!==!1&&console.log((0,R.red)(o.message)),o}}let n=ii({spinner:"simpleDots",prefixText:Mf.wait+e}).start();try{let o=await t();n.stop(),ce("success",e),o&&console.log(o)}catch(o){return n.stop(),ce("error",e),r?.printError!==!1&&console.error(o.message),o}}var Mf={wait:`\u{1F550}${(0,R.blue)("wait")} - `,info:`${process.env.GITHUB_ACTIONS==="true"?"\u2139\uFE0F":"\u2139\uFE0F "}${(0,R.cyan)("info")} - `,success:`\u2705${(0,R.green)("ready")} - `,warn:`${process.env.GITHUB_ACTIONS==="true"?"\u26A0\uFE0F":"\u26A0\uFE0F "}${(0,R.yellow)("warn")} - `,error:`\u{1F4A5}${(0,R.red)("error")} - `,event:`\u26A1\uFE0F${(0,R.magenta)("event")} - `,paymentPrompt:`\u{1F4B0}${(0,R.yellowBright)("plan")} - `},KF=!0;var ge=E(require("node:fs")),si=E(require("node:path")),Ct=class e{structs=new Map;functions=[];static analyzePackage(t){let r=new e;return r.parseDirectory(si.join(t,"src")),{functions:r.functions,structs:Array.from(r.structs.values())}}parseDirectory(t){if(!ge.existsSync(t))return;let r=ge.readdirSync(t);for(let n of r){let o=si.join(t,n);if(ge.statSync(o).isDirectory())this.parseDirectory(o);else if(n.endsWith(".rs")){let i=ge.readFileSync(o,"utf-8");this.parseRustFile(i)}}}parseRustFile(t){let r=this.removeComments(t);this.parseStructs(r),this.parseFunctions(r)}removeComments(t){return t=t.replace(/\/\/.*$/gm,""),t=t.replace(/\/\*[\s\S]*?\*\//g,""),t}parseStructs(t){let r=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,n;for(;(n=r.exec(t))!==null;){let o=n[1],i=n[2],s=this.parseStructFields(i);this.structs.set(o,{name:o,fields:s})}}parseStructFields(t){let r=[],n=/(?:#\[serde\(([^\]]+)\)\]\s*)?(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,o;for(;(o=n.exec(t))!==null;){let i=o[1],s=o[2],a=o[3].trim(),u=s;if(i){let l=i.match(/rename\s*=\s*"([^"]+)"/);l&&(u=l[1])}r.push({name:s,serializedName:u,rustType:a,tsType:this.rustTypeToTypeScript(a)})}return r}parseFunctions(t){let r=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,n;for(;(n=r.exec(t))!==null;){let o=!!n[1],i=n[2],s=n[3],a=n[4]?.trim()||"()",u=this.parseParameters(s),{returnType:l,returnTypeTs:c,isResult:f}=this.parseReturnType(a);this.functions.push({name:i,isAsync:o,parameters:u,returnType:l,returnTypeTs:c,isResult:f})}}parseParameters(t){let r=[];if(!t.trim())return r;let n=this.splitParameters(t);for(let o of n){let i=o.trim().match(/(\w+)\s*:\s*(.+)/);if(i){let s=i[1],a=i[2].trim();r.push({name:s,rustType:a,tsType:this.rustTypeToTypeScript(a)})}}return r}splitParameters(t){let r=[],n="",o=0;for(let i of t){if(i==="<")o++;else if(i===">")o--;else if(i===","&&o===0){r.push(n.trim()),n="";continue}n+=i}return n.trim()&&r.push(n.trim()),r}parseReturnType(t){let r=t.trim(),n=r.match(/Result<([^,]+),\s*(.+)>/);if(n){let o=n[1].trim();return{returnType:r,returnTypeTs:this.rustTypeToTypeScript(o),isResult:!0}}return{returnType:r,returnTypeTs:this.rustTypeToTypeScript(r),isResult:!1}}rustTypeToTypeScript(t){let r=t.trim();if(r==="()")return"void";if(r==="String"||r==="&str")return"string";if(r==="bool")return"boolean";if(r.match(/^[ui]\d+$/)||r.match(/^f\d+$/))return"number";let n=r.match(/Option<(.+)>/);if(n)return`${this.rustTypeToTypeScript(n[1])} | null | undefined`;let o=r.match(/Vec<(.+)>/);if(o)return`${this.rustTypeToTypeScript(o[1])}[]`;let i=r.match(/Result<([^,]+),\s*(.+)>/);return i?this.rustTypeToTypeScript(i[1]):(this.structs.has(r),r)}},xe=class{static generateDefinitions(t,r){let n="";for(let o of r){n+=`export interface ${o.name} {
56
+ `;for(let i of o.fields)n+=` ${i.serializedName}: ${i.tsType};
57
57
  `;n+=`}
58
58
 
59
59
  `}for(let o of t){let i=o.parameters.map(a=>`${a.name}: ${a.tsType}`).join(", "),s=o.returnTypeTs==="void"?"Promise<void>":`Promise<${o.returnTypeTs}>`;n+=`export declare function ${o.name}(${i}): ${s};
@@ -1,15 +1,15 @@
1
- "use strict";var d=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var F=(i,r)=>{for(var t in r)p(i,t,{get:r[t],enumerable:!0})},f=(i,r,t,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of S(r))!x.call(i,s)&&s!==t&&p(i,s,{get:()=>r[s],enumerable:!(e=v(r,s))||e.enumerable});return i};var y=(i,r,t)=>(t=i!=null?d($(i)):{},f(r||!i||!i.__esModule?p(t,"default",{value:i,enumerable:!0}):t,i)),w=i=>f(p({},"__esModule",{value:!0}),i);var P={};F(P,{RustParser:()=>m,TypeScriptGenerator:()=>l});module.exports=w(P);var o=y(require("node:fs")),u=y(require("node:path")),m=class i{structs=new Map;functions=[];static analyzePackage(r){let t=new i;return t.parseDirectory(u.join(r,"src")),{functions:t.functions,structs:Array.from(t.structs.values())}}parseDirectory(r){if(!o.existsSync(r))return;let t=o.readdirSync(r);for(let e of t){let s=u.join(r,e);if(o.statSync(s).isDirectory())this.parseDirectory(s);else if(e.endsWith(".rs")){let n=o.readFileSync(s,"utf-8");this.parseRustFile(n)}}}parseRustFile(r){let t=this.removeComments(r);this.parseStructs(t),this.parseFunctions(t)}removeComments(r){return r=r.replace(/\/\/.*$/gm,""),r=r.replace(/\/\*[\s\S]*?\*\//g,""),r}parseStructs(r){let t=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,e;for(;(e=t.exec(r))!==null;){let s=e[1],n=e[2],a=this.parseStructFields(n);this.structs.set(s,{name:s,fields:a})}}parseStructFields(r){let t=[],e=/(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,s;for(;(s=e.exec(r))!==null;){let n=s[1],a=s[2].trim();t.push({name:n,rustType:a,tsType:this.rustTypeToTypeScript(a)})}return t}parseFunctions(r){let t=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,e;for(;(e=t.exec(r))!==null;){let s=!!e[1],n=e[2],a=e[3],c=e[4]?.trim()||"()",T=this.parseParameters(a),{returnType:h,returnTypeTs:g,isResult:R}=this.parseReturnType(c);this.functions.push({name:n,isAsync:s,parameters:T,returnType:h,returnTypeTs:g,isResult:R})}}parseParameters(r){let t=[];if(!r.trim())return t;let e=this.splitParameters(r);for(let s of e){let n=s.trim().match(/(\w+)\s*:\s*(.+)/);if(n){let a=n[1],c=n[2].trim();t.push({name:a,rustType:c,tsType:this.rustTypeToTypeScript(c)})}}return t}splitParameters(r){let t=[],e="",s=0;for(let n of r){if(n==="<")s++;else if(n===">")s--;else if(n===","&&s===0){t.push(e.trim()),e="";continue}e+=n}return e.trim()&&t.push(e.trim()),t}parseReturnType(r){let t=r.trim(),e=t.match(/Result<([^,]+),\s*(.+)>/);if(e){let s=e[1].trim();return{returnType:t,returnTypeTs:this.rustTypeToTypeScript(s),isResult:!0}}return{returnType:t,returnTypeTs:this.rustTypeToTypeScript(t),isResult:!1}}rustTypeToTypeScript(r){let t=r.trim();if(t==="()")return"void";if(t==="String"||t==="&str")return"string";if(t==="bool")return"boolean";if(t.match(/^[ui]\d+$/)||t.match(/^f\d+$/))return"number";let e=t.match(/Option<(.+)>/);if(e)return`${this.rustTypeToTypeScript(e[1])} | null`;let s=t.match(/Vec<(.+)>/);if(s)return`${this.rustTypeToTypeScript(s[1])}[]`;let n=t.match(/Result<([^,]+),\s*(.+)>/);return n?this.rustTypeToTypeScript(n[1]):(this.structs.has(t),t)}},l=class{static generateDefinitions(r,t){let e="";for(let s of t){e+=`export interface ${s.name} {
2
- `;for(let n of s.fields)e+=` ${n.name}: ${n.tsType};
1
+ "use strict";var R=Object.create;var m=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var F=(i,s)=>{for(var t in s)m(i,t,{get:s[t],enumerable:!0})},T=(i,s,t,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of S(s))!x.call(i,r)&&r!==t&&m(i,r,{get:()=>s[r],enumerable:!(e=v(s,r))||e.enumerable});return i};var h=(i,s,t)=>(t=i!=null?R($(i)):{},T(s||!i||!i.__esModule?m(t,"default",{value:i,enumerable:!0}):t,i)),w=i=>T(m({},"__esModule",{value:!0}),i);var P={};F(P,{RustParser:()=>f,TypeScriptGenerator:()=>y});module.exports=w(P);var o=h(require("node:fs")),l=h(require("node:path")),f=class i{structs=new Map;functions=[];static analyzePackage(s){let t=new i;return t.parseDirectory(l.join(s,"src")),{functions:t.functions,structs:Array.from(t.structs.values())}}parseDirectory(s){if(!o.existsSync(s))return;let t=o.readdirSync(s);for(let e of t){let r=l.join(s,e);if(o.statSync(r).isDirectory())this.parseDirectory(r);else if(e.endsWith(".rs")){let n=o.readFileSync(r,"utf-8");this.parseRustFile(n)}}}parseRustFile(s){let t=this.removeComments(s);this.parseStructs(t),this.parseFunctions(t)}removeComments(s){return s=s.replace(/\/\/.*$/gm,""),s=s.replace(/\/\*[\s\S]*?\*\//g,""),s}parseStructs(s){let t=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,e;for(;(e=t.exec(s))!==null;){let r=e[1],n=e[2],a=this.parseStructFields(n);this.structs.set(r,{name:r,fields:a})}}parseStructFields(s){let t=[],e=/(?:#\[serde\(([^\]]+)\)\]\s*)?(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,r;for(;(r=e.exec(s))!==null;){let n=r[1],a=r[2],c=r[3].trim(),u=a;if(n){let p=n.match(/rename\s*=\s*"([^"]+)"/);p&&(u=p[1])}t.push({name:a,serializedName:u,rustType:c,tsType:this.rustTypeToTypeScript(c)})}return t}parseFunctions(s){let t=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,e;for(;(e=t.exec(s))!==null;){let r=!!e[1],n=e[2],a=e[3],c=e[4]?.trim()||"()",u=this.parseParameters(a),{returnType:p,returnTypeTs:g,isResult:d}=this.parseReturnType(c);this.functions.push({name:n,isAsync:r,parameters:u,returnType:p,returnTypeTs:g,isResult:d})}}parseParameters(s){let t=[];if(!s.trim())return t;let e=this.splitParameters(s);for(let r of e){let n=r.trim().match(/(\w+)\s*:\s*(.+)/);if(n){let a=n[1],c=n[2].trim();t.push({name:a,rustType:c,tsType:this.rustTypeToTypeScript(c)})}}return t}splitParameters(s){let t=[],e="",r=0;for(let n of s){if(n==="<")r++;else if(n===">")r--;else if(n===","&&r===0){t.push(e.trim()),e="";continue}e+=n}return e.trim()&&t.push(e.trim()),t}parseReturnType(s){let t=s.trim(),e=t.match(/Result<([^,]+),\s*(.+)>/);if(e){let r=e[1].trim();return{returnType:t,returnTypeTs:this.rustTypeToTypeScript(r),isResult:!0}}return{returnType:t,returnTypeTs:this.rustTypeToTypeScript(t),isResult:!1}}rustTypeToTypeScript(s){let t=s.trim();if(t==="()")return"void";if(t==="String"||t==="&str")return"string";if(t==="bool")return"boolean";if(t.match(/^[ui]\d+$/)||t.match(/^f\d+$/))return"number";let e=t.match(/Option<(.+)>/);if(e)return`${this.rustTypeToTypeScript(e[1])} | null | undefined`;let r=t.match(/Vec<(.+)>/);if(r)return`${this.rustTypeToTypeScript(r[1])}[]`;let n=t.match(/Result<([^,]+),\s*(.+)>/);return n?this.rustTypeToTypeScript(n[1]):(this.structs.has(t),t)}},y=class{static generateDefinitions(s,t){let e="";for(let r of t){e+=`export interface ${r.name} {
2
+ `;for(let n of r.fields)e+=` ${n.serializedName}: ${n.tsType};
3
3
  `;e+=`}
4
4
 
5
- `}for(let s of r){let n=s.parameters.map(c=>`${c.name}: ${c.tsType}`).join(", "),a=s.returnTypeTs==="void"?"Promise<void>":`Promise<${s.returnTypeTs}>`;e+=`export declare function ${s.name}(${n}): ${a};
6
- `}return e}static generateImplementation(r){let t=`const proxy = {
7
- `;for(let e of r){let s=e.parameters.map(a=>a.name).join(", "),n=e.parameters.length>0?`, ${s}`:"";t+=` ${e.name}: async (${e.parameters.map(a=>`${a.name}`).join(", ")}) => {
5
+ `}for(let r of s){let n=r.parameters.map(c=>`${c.name}: ${c.tsType}`).join(", "),a=r.returnTypeTs==="void"?"Promise<void>":`Promise<${r.returnTypeTs}>`;e+=`export declare function ${r.name}(${n}): ${a};
6
+ `}return e}static generateImplementation(s){let t=`const proxy = {
7
+ `;for(let e of s){let r=e.parameters.map(a=>a.name).join(", "),n=e.parameters.length>0?`, ${r}`:"";t+=` ${e.name}: async (${e.parameters.map(a=>`${a.name}`).join(", ")}) => {
8
8
  `,t+=` return await runRustFunction("${e.name}"${n});
9
9
  `,t+=` },
10
10
  `}t+=`};
11
11
 
12
- `;for(let e of r)t+=`export const ${e.name} = proxy.${e.name};
12
+ `;for(let e of s)t+=`export const ${e.name} = proxy.${e.name};
13
13
  `;return t+=`
14
14
  export default proxy;
15
15
  `,t}};0&&(module.exports={RustParser,TypeScriptGenerator});
@@ -777,8 +777,8 @@ Xcode setup error detected. Please ensure Xcode is correctly installed. Use 'sud
777
777
  You can try to delete the ${h} folder and run this command again, sometimes it helps`);return b.stdout}var jk=So(require("node:fs")),BNe=So(dgt()),jNe=So(r1t());function ufe(){if(jk.existsSync("ai.json"))try{let s=jk.readFileSync("ai.json","utf8");return BNe.default.parse(s)}catch(s){throw new Error(`cannot read ai.json: ${s}`)}if(jk.existsSync("ai.json5"))try{let s=jk.readFileSync("ai.json5","utf8");return BNe.default.parse(s)}catch(s){throw new Error(`cannot read ai.json5: ${s}`)}if(jk.existsSync("ai.yaml"))try{let s=jk.readFileSync("ai.yaml","utf8");return jNe.default.parse(s)}catch(s){throw new Error(`cannot read ai.yaml: ${s}`)}if(jk.existsSync("ai.yml"))try{let s=jk.readFileSync("ai.yml","utf8");return jNe.default.parse(s)}catch(s){throw new Error(`cannot read ai.yml: ${s}`)}}var VNe=So(require("node:fs")),H6=So(require("node:path")),Ya=So(f1t());function _1t(s,a,u){let h=H6.join(s,"src","tools"),b=H6.join(s,"tsconfig.json"),C;try{C=Ya.default.parseJsonSourceFileConfigFileContent(Ya.default.readJsonConfigFile(H6.resolve(b),Ya.default.sys.readFile),Ya.default.sys,H6.dirname(b))}catch{}let O=[];return[a.map(oe=>{let de=H6.join(h,oe.name+".ts");if(VNe.existsSync(de)||(de=H6.join(h,oe.name+".tsx")),!VNe.existsSync(de))return oe;try{let Pe=Ya.default.createProgram({options:C?.options||{},projectReferences:C?.projectReferences,rootNames:[de]}),Je=Pe.getRootFileNames().map(pr=>Pe.getSourceFile(pr))[0],re=Pe.getTypeChecker(),Xe,Ue=!1;if(Ya.default.forEachChild(Je,pr=>{if(Ya.default.isFunctionDeclaration(pr)&&pr.modifiers)pr.modifiers.some(Mt=>Mt.kind===Ya.default.SyntaxKind.ExportKeyword)&&pr.modifiers.some(Mt=>Mt.kind===Ya.default.SyntaxKind.DefaultKeyword)?Xe=pr:pr.modifiers.some(Mt=>Mt.kind===Ya.default.SyntaxKind.ExportKeyword)&&pr.name?.text==="confirmation"&&(Ue=!0);else if(Ya.default.isVariableStatement(pr)&&pr.modifiers){if(!pr.modifiers.some(Tn=>Tn.kind===Ya.default.SyntaxKind.ExportKeyword))return;let{declarations:Mt}=pr.declarationList;for(let Tn of Mt)Ya.default.isVariableDeclaration(Tn)&&Ya.default.isIdentifier(Tn.name)&&Tn.name.text==="confirmation"&&(Ue=!0)}else if(Ya.default.isExportAssignment(pr)){let Mt=pr.expression;for(;Mt;){let Tn=$Ne(re,Mt);if(Tn){Xe=Tn;break}if(!Ya.default.isCallExpression(Mt))break;let Pr=Mt.arguments[0];for(;Mt&&Ya.default.isCallExpression(Mt);){if(Ya.default.isIdentifier(Mt.expression)&&Mt.expression.text.startsWith("with")){Mt=Pr;break}Ya.default.isCallExpression(Mt.expression)?Mt=Mt.expression:Mt=null}}}else if(Ya.default.isExportDeclaration(pr)&&pr.exportClause&&Ya.default.isNamedExports(pr.exportClause)){let Mt=pr.exportClause.elements;for(let Tn of Mt)Tn.name.text==="confirmation"&&(Ue=!0)}}),!Xe)throw new Error("Default exported function not found");let Ce=re.getSignatureFromDeclaration(Xe);if(!Ce)throw new Error("Could not get signature of the default exported function");if(Ce.getParameters().length>1)throw new Error(`Tools should have at most one parameter (has ${Ce.getParameters().length})`);let Rt=Ce.getParameters()[0],bt=Rt?G6(re,Rt.valueDeclaration?re.getTypeOfSymbolAtLocation(Rt,Rt.valueDeclaration):re.getTypeOfSymbol(Rt),{strict:!0,verbose:u?.verbose}):void 0,Vr=Ce?.getReturnType();if(Vr){let pr=re.getAwaitedType(Vr);pr&&(Vr=pr)}let hn=Vr?G6(re,Vr,{strict:!1,verbose:u?.verbose}):void 0,Jr=Rb(Ce),bn={...oe,instructions:Jr,input:bt,output:hn,confirmation:Ue};return bt||delete bn.input,hn||delete bn.output,bn}catch(Pe){return O.push({level:"error",message:Pe.message,filePath:de}),oe}}),O]}function Rb(s){let a=s?.getDocumentationComment(void 0)??[],u=s?.getJsDocTags()??[];if(!a.length&&!u.length)return;let h=u.map(b=>`@${b.name}${b.text&&b.text.length>0?` ${b.text.map(C=>C.text)}`:""}`);return a.map(b=>b.text).join(" ")+(h.length>0?`
778
778
 
779
779
  ${h.join(`
780
- `)}`:"")}function G6(s,a,u,h){if(a.intrinsicName==="error"&&a.aliasSymbol?.escapedName==="Omit"&&a.aliasTypeArguments?.length===2){let b=a.aliasTypeArguments;if(b&&b.length===2){let[C,O]=b,U=s.getBaseTypeOfLiteralType(C),oe={type:"object",properties:{},required:[],description:Rb(h??a.symbol)},de=new Set;return O.isUnion()?O.types.forEach(Pe=>{Pe.isStringLiteral()&&de.add(Pe.value)}):O.isStringLiteral()&&de.add(O.value),U.getProperties().forEach(Pe=>{if(!de.has(Pe.getName())){let Je=s.getTypeOfSymbolAtLocation(Pe,Pe.valueDeclaration),re=G6(s,Je,u,Pe);re&&(oe.properties[Pe.getName()]=re,Pe.flags&Ya.default.SymbolFlags.Optional||oe.required.push(Pe.getName()))}}),oe}}switch(a.flags){case Ya.default.TypeFlags.String:return{type:"string",description:Rb(h??a.symbol)};case Ya.default.TypeFlags.Number:return{type:"number",description:Rb(h??a.symbol)};case Ya.default.TypeFlags.Boolean:return{type:"boolean",description:Rb(h??a.symbol)};case Ya.default.TypeFlags.Union:{if(a.isUnion()&&a.types.length===1)return G6(s,a.types[0],u,h);if(a.isUnion()&&a.types.some(b=>b.flags===Ya.default.TypeFlags.Undefined))return a.types=a.types.filter(b=>b.flags!==Ya.default.TypeFlags.Undefined),G6(s,a,u,h);if(a.isUnion()&&a.types.every(b=>b.isStringLiteral()))return{type:"string",description:Rb(h??a.symbol),enum:Array.from(a.types).map(b=>b.value)};if(a.isUnion()&&a.types.every(b=>b.flags===Ya.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:Rb(h??a.symbol)};if(u.verbose&&console.error("Only string unions are supported.",a,a.symbol),!u.strict)return;throw new Error(`Only string unions are supported${h?` for "${h?.name}"`:""}`)}case Ya.default.TypeFlags.Intersection:{if(u.verbose&&console.error("Intersection types are not supported",a),!u.strict)return;throw new Error(`Intersection types are not supported${h?` for "${h?.name}"`:""}`)}case Ya.default.TypeFlags.Object:if(a.symbol.flags===Ya.default.SymbolFlags.TypeLiteral||a.symbol.flags===Ya.default.SymbolFlags.ObjectLiteral||a.symbol.flags===Ya.default.SymbolFlags.Class)switch(a.flags){case Ya.default.TypeFlags.Object:{let b={type:"object",properties:{},required:[],description:Rb(h??a.symbol)};return a.symbol.members?.forEach(C=>{if(!u.strict&&C.valueDeclaration&&a.symbol.flags===Ya.default.SymbolFlags.Class&&(Ya.default.isMethodDeclaration(C.valueDeclaration)||Ya.default.isGetAccessor(C.valueDeclaration)||Ya.default.isSetAccessor(C.valueDeclaration)||C.name==="__constructor"||Ya.default.isPropertyDeclaration(C.valueDeclaration)&&C.valueDeclaration.modifiers?.some(U=>U.kind===Ya.default.SyntaxKind.PrivateKeyword)))return;let O=G6(s,C.valueDeclaration?s.getTypeOfSymbolAtLocation(C,C.valueDeclaration):s.getTypeOfSymbol(C),u,C);O&&(b.properties[C.name]=O,C.flags&Ya.default.SymbolFlags.Optional||b.required.push(C.name))}),b}default:{if(u.verbose&&console.error("Not an object",a),!u.strict)return;throw new Error(`Not an object${h?` for "${h?.name}"`:""}`)}}else if(s.isArrayLikeType(a)||s.isArrayType(a)){let b=a.getNumberIndexType()||s.getIndexTypeOfType(a,Ya.default.IndexKind.Number)||a.resolvedTypeArguments?.[0];if(!b){if(u.verbose&&console.error("No item type",a),!u.strict)return;throw new Error(`No item type${h?` for "${h?.name}"`:""}`)}let C=G6(s,b,u);if(!C){if(u.verbose&&console.error("No item type",a),!u.strict)return;throw new Error(`No item type${h?` for "${h?.name}"`:""}`)}return{type:"array",items:C,description:Rb(h??a.symbol)}}else if(a.symbol.flags&Ya.default.SymbolFlags.Function){let b=G6(s,a.getCallSignatures()[0].getReturnType(),u);if(!b){if(u.verbose&&console.error("No return type",a),!u.strict)return;throw new Error(`No return type${h?` for "${h?.name}"`:""}`)}return{type:"function",returns:b,description:Rb(h??a.symbol)}}else{if(a.symbol.name==="Date"&&a.symbol.flags&Ya.default.SymbolFlags.Interface)return{type:"string",description:Rb(h??a.symbol)};if(a.symbol.flags===Ya.default.SymbolFlags.Interface){let b={type:"object",properties:{},required:[],description:Rb(h??a.symbol)};return a.symbol.members?.forEach(C=>{if(!u.strict&&C.valueDeclaration&&a.symbol.flags===Ya.default.SymbolFlags.Class&&(Ya.default.isMethodDeclaration(C.valueDeclaration)||Ya.default.isGetAccessor(C.valueDeclaration)||Ya.default.isSetAccessor(C.valueDeclaration)||C.name==="__constructor"||Ya.default.isPropertyDeclaration(C.valueDeclaration)&&C.valueDeclaration.modifiers?.some(U=>U.kind===Ya.default.SyntaxKind.PrivateKeyword)))return;let O=G6(s,C.valueDeclaration?s.getTypeOfSymbolAtLocation(C,C.valueDeclaration):s.getTypeOfSymbol(C),u,C);O&&(b.properties[C.name]=O,C.flags&Ya.default.SymbolFlags.Optional||b.required.push(C.name))}),b}else{if(u.verbose&&console.error("Not a type literal",a,a.symbol,a.symbol.flags),!u.strict)return;throw new Error(`Not a type literal${h?` for "${h?.name}"`:""}`)}}case Ya.default.TypeFlags.Void:case Ya.default.TypeFlags.VoidLike:case Ya.default.TypeFlags.Never:return;case Ya.default.TypeFlags.Any:{if(!u.strict)return;throw a.intrinsicName==="error"?a.aliasSymbol?new Error(`Could not resolve type ${a.aliasSymbol.getEscapedName()}${h?` for "${h?.name}"`:""}`):new Error(`Could not resolve type${h?` for "${h?.name}"`:""}`):new Error(`\`any\` type is not supported${h?` for "${h?.name}"`:""}`)}default:{if(a.symbol?.flags&Ya.default.SymbolFlags.Enum||a.symbol?.flags&Ya.default.SymbolFlags.ConstEnum||a.symbol?.flags&Ya.default.SymbolFlags.RegularEnum){if(a.symbol.valueDeclaration&&Ya.default.isEnumDeclaration(a.symbol.valueDeclaration)&&a.symbol.valueDeclaration.members&&Array.from(a.symbol.valueDeclaration.members).every(b=>Ya.default.isEnumMember(b)&&b.initializer?.kind===Ya.default.SyntaxKind.StringLiteral))return{type:"string",description:Rb(h??a.symbol),enum:Array.from(a.symbol.valueDeclaration.members).map(b=>JSON.parse(b.initializer.getText()))};if(u.verbose&&console.error("Only string enums are supported",a,h?.name),!u.strict)return;throw new Error(`Only string enums are supported${h?` for "${h?.name}"`:""}`)}if(a.isUnion()&&a.types.every(b=>b.flags&Ya.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:Rb(h??a.symbol)};if(u.verbose&&console.error("Unknown type",a,h?.name),!u.strict)return;throw new Error(`Unknown type${h?` for "${h?.name}"`:""}`)}}}function $Ne(s,a){if(Ya.default.isFunctionDeclaration(a)||Ya.default.isFunctionExpression(a)||Ya.default.isArrowFunction(a))return a;if(Ya.default.isIdentifier(a)){let u=s.getSymbolAtLocation(a);if(u){let h=u.getDeclarations();if(!h)return;for(let b of h){let C=$Ne(s,b);if(C)return C;if(Ya.default.isVariableDeclaration(b)&&b.initializer)return $Ne(s,b.initializer)}}}}var b1t=So(J6e());var Fh=So(require("node:fs")),l2=So(require("node:path"));var EN=So(require("node:fs")),GNe=So(require("node:path")),XH=class s{structs=new Map;functions=[];static analyzePackage(a){let u=new s;return u.parseDirectory(GNe.join(a,"src")),{functions:u.functions,structs:Array.from(u.structs.values())}}parseDirectory(a){if(!EN.existsSync(a))return;let u=EN.readdirSync(a);for(let h of u){let b=GNe.join(a,h);if(EN.statSync(b).isDirectory())this.parseDirectory(b);else if(h.endsWith(".rs")){let C=EN.readFileSync(b,"utf-8");this.parseRustFile(C)}}}parseRustFile(a){let u=this.removeComments(a);this.parseStructs(u),this.parseFunctions(u)}removeComments(a){return a=a.replace(/\/\/.*$/gm,""),a=a.replace(/\/\*[\s\S]*?\*\//g,""),a}parseStructs(a){let u=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,h;for(;(h=u.exec(a))!==null;){let b=h[1],C=h[2],O=this.parseStructFields(C);this.structs.set(b,{name:b,fields:O})}}parseStructFields(a){let u=[],h=/(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,b;for(;(b=h.exec(a))!==null;){let C=b[1],O=b[2].trim();u.push({name:C,rustType:O,tsType:this.rustTypeToTypeScript(O)})}return u}parseFunctions(a){let u=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,h;for(;(h=u.exec(a))!==null;){let b=!!h[1],C=h[2],O=h[3],U=h[4]?.trim()||"()",oe=this.parseParameters(O),{returnType:de,returnTypeTs:Pe,isResult:Je}=this.parseReturnType(U);this.functions.push({name:C,isAsync:b,parameters:oe,returnType:de,returnTypeTs:Pe,isResult:Je})}}parseParameters(a){let u=[];if(!a.trim())return u;let h=this.splitParameters(a);for(let b of h){let C=b.trim().match(/(\w+)\s*:\s*(.+)/);if(C){let O=C[1],U=C[2].trim();u.push({name:O,rustType:U,tsType:this.rustTypeToTypeScript(U)})}}return u}splitParameters(a){let u=[],h="",b=0;for(let C of a){if(C==="<")b++;else if(C===">")b--;else if(C===","&&b===0){u.push(h.trim()),h="";continue}h+=C}return h.trim()&&u.push(h.trim()),u}parseReturnType(a){let u=a.trim(),h=u.match(/Result<([^,]+),\s*(.+)>/);if(h){let b=h[1].trim();return{returnType:u,returnTypeTs:this.rustTypeToTypeScript(b),isResult:!0}}return{returnType:u,returnTypeTs:this.rustTypeToTypeScript(u),isResult:!1}}rustTypeToTypeScript(a){let u=a.trim();if(u==="()")return"void";if(u==="String"||u==="&str")return"string";if(u==="bool")return"boolean";if(u.match(/^[ui]\d+$/)||u.match(/^f\d+$/))return"number";let h=u.match(/Option<(.+)>/);if(h)return`${this.rustTypeToTypeScript(h[1])} | null`;let b=u.match(/Vec<(.+)>/);if(b)return`${this.rustTypeToTypeScript(b[1])}[]`;let C=u.match(/Result<([^,]+),\s*(.+)>/);return C?this.rustTypeToTypeScript(C[1]):(this.structs.has(u),u)}},M7=class{static generateDefinitions(a,u){let h="";for(let b of u){h+=`export interface ${b.name} {
781
- `;for(let C of b.fields)h+=` ${C.name}: ${C.tsType};
780
+ `)}`:"")}function G6(s,a,u,h){if(a.intrinsicName==="error"&&a.aliasSymbol?.escapedName==="Omit"&&a.aliasTypeArguments?.length===2){let b=a.aliasTypeArguments;if(b&&b.length===2){let[C,O]=b,U=s.getBaseTypeOfLiteralType(C),oe={type:"object",properties:{},required:[],description:Rb(h??a.symbol)},de=new Set;return O.isUnion()?O.types.forEach(Pe=>{Pe.isStringLiteral()&&de.add(Pe.value)}):O.isStringLiteral()&&de.add(O.value),U.getProperties().forEach(Pe=>{if(!de.has(Pe.getName())){let Je=s.getTypeOfSymbolAtLocation(Pe,Pe.valueDeclaration),re=G6(s,Je,u,Pe);re&&(oe.properties[Pe.getName()]=re,Pe.flags&Ya.default.SymbolFlags.Optional||oe.required.push(Pe.getName()))}}),oe}}switch(a.flags){case Ya.default.TypeFlags.String:return{type:"string",description:Rb(h??a.symbol)};case Ya.default.TypeFlags.Number:return{type:"number",description:Rb(h??a.symbol)};case Ya.default.TypeFlags.Boolean:return{type:"boolean",description:Rb(h??a.symbol)};case Ya.default.TypeFlags.Union:{if(a.isUnion()&&a.types.length===1)return G6(s,a.types[0],u,h);if(a.isUnion()&&a.types.some(b=>b.flags===Ya.default.TypeFlags.Undefined))return a.types=a.types.filter(b=>b.flags!==Ya.default.TypeFlags.Undefined),G6(s,a,u,h);if(a.isUnion()&&a.types.every(b=>b.isStringLiteral()))return{type:"string",description:Rb(h??a.symbol),enum:Array.from(a.types).map(b=>b.value)};if(a.isUnion()&&a.types.every(b=>b.flags===Ya.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:Rb(h??a.symbol)};if(u.verbose&&console.error("Only string unions are supported.",a,a.symbol),!u.strict)return;throw new Error(`Only string unions are supported${h?` for "${h?.name}"`:""}`)}case Ya.default.TypeFlags.Intersection:{if(u.verbose&&console.error("Intersection types are not supported",a),!u.strict)return;throw new Error(`Intersection types are not supported${h?` for "${h?.name}"`:""}`)}case Ya.default.TypeFlags.Object:if(a.symbol.flags===Ya.default.SymbolFlags.TypeLiteral||a.symbol.flags===Ya.default.SymbolFlags.ObjectLiteral||a.symbol.flags===Ya.default.SymbolFlags.Class)switch(a.flags){case Ya.default.TypeFlags.Object:{let b={type:"object",properties:{},required:[],description:Rb(h??a.symbol)};return a.symbol.members?.forEach(C=>{if(!u.strict&&C.valueDeclaration&&a.symbol.flags===Ya.default.SymbolFlags.Class&&(Ya.default.isMethodDeclaration(C.valueDeclaration)||Ya.default.isGetAccessor(C.valueDeclaration)||Ya.default.isSetAccessor(C.valueDeclaration)||C.name==="__constructor"||Ya.default.isPropertyDeclaration(C.valueDeclaration)&&C.valueDeclaration.modifiers?.some(U=>U.kind===Ya.default.SyntaxKind.PrivateKeyword)))return;let O=G6(s,C.valueDeclaration?s.getTypeOfSymbolAtLocation(C,C.valueDeclaration):s.getTypeOfSymbol(C),u,C);O&&(b.properties[C.name]=O,C.flags&Ya.default.SymbolFlags.Optional||b.required.push(C.name))}),b}default:{if(u.verbose&&console.error("Not an object",a),!u.strict)return;throw new Error(`Not an object${h?` for "${h?.name}"`:""}`)}}else if(s.isArrayLikeType(a)||s.isArrayType(a)){let b=a.getNumberIndexType()||s.getIndexTypeOfType(a,Ya.default.IndexKind.Number)||a.resolvedTypeArguments?.[0];if(!b){if(u.verbose&&console.error("No item type",a),!u.strict)return;throw new Error(`No item type${h?` for "${h?.name}"`:""}`)}let C=G6(s,b,u);if(!C){if(u.verbose&&console.error("No item type",a),!u.strict)return;throw new Error(`No item type${h?` for "${h?.name}"`:""}`)}return{type:"array",items:C,description:Rb(h??a.symbol)}}else if(a.symbol.flags&Ya.default.SymbolFlags.Function){let b=G6(s,a.getCallSignatures()[0].getReturnType(),u);if(!b){if(u.verbose&&console.error("No return type",a),!u.strict)return;throw new Error(`No return type${h?` for "${h?.name}"`:""}`)}return{type:"function",returns:b,description:Rb(h??a.symbol)}}else{if(a.symbol.name==="Date"&&a.symbol.flags&Ya.default.SymbolFlags.Interface)return{type:"string",description:Rb(h??a.symbol)};if(a.symbol.flags===Ya.default.SymbolFlags.Interface){let b={type:"object",properties:{},required:[],description:Rb(h??a.symbol)};return a.symbol.members?.forEach(C=>{if(!u.strict&&C.valueDeclaration&&a.symbol.flags===Ya.default.SymbolFlags.Class&&(Ya.default.isMethodDeclaration(C.valueDeclaration)||Ya.default.isGetAccessor(C.valueDeclaration)||Ya.default.isSetAccessor(C.valueDeclaration)||C.name==="__constructor"||Ya.default.isPropertyDeclaration(C.valueDeclaration)&&C.valueDeclaration.modifiers?.some(U=>U.kind===Ya.default.SyntaxKind.PrivateKeyword)))return;let O=G6(s,C.valueDeclaration?s.getTypeOfSymbolAtLocation(C,C.valueDeclaration):s.getTypeOfSymbol(C),u,C);O&&(b.properties[C.name]=O,C.flags&Ya.default.SymbolFlags.Optional||b.required.push(C.name))}),b}else{if(u.verbose&&console.error("Not a type literal",a,a.symbol,a.symbol.flags),!u.strict)return;throw new Error(`Not a type literal${h?` for "${h?.name}"`:""}`)}}case Ya.default.TypeFlags.Void:case Ya.default.TypeFlags.VoidLike:case Ya.default.TypeFlags.Never:return;case Ya.default.TypeFlags.Any:{if(!u.strict)return;throw a.intrinsicName==="error"?a.aliasSymbol?new Error(`Could not resolve type ${a.aliasSymbol.getEscapedName()}${h?` for "${h?.name}"`:""}`):new Error(`Could not resolve type${h?` for "${h?.name}"`:""}`):new Error(`\`any\` type is not supported${h?` for "${h?.name}"`:""}`)}default:{if(a.symbol?.flags&Ya.default.SymbolFlags.Enum||a.symbol?.flags&Ya.default.SymbolFlags.ConstEnum||a.symbol?.flags&Ya.default.SymbolFlags.RegularEnum){if(a.symbol.valueDeclaration&&Ya.default.isEnumDeclaration(a.symbol.valueDeclaration)&&a.symbol.valueDeclaration.members&&Array.from(a.symbol.valueDeclaration.members).every(b=>Ya.default.isEnumMember(b)&&b.initializer?.kind===Ya.default.SyntaxKind.StringLiteral))return{type:"string",description:Rb(h??a.symbol),enum:Array.from(a.symbol.valueDeclaration.members).map(b=>JSON.parse(b.initializer.getText()))};if(u.verbose&&console.error("Only string enums are supported",a,h?.name),!u.strict)return;throw new Error(`Only string enums are supported${h?` for "${h?.name}"`:""}`)}if(a.isUnion()&&a.types.every(b=>b.flags&Ya.default.TypeFlags.BooleanLiteral))return{type:"boolean",description:Rb(h??a.symbol)};if(u.verbose&&console.error("Unknown type",a,h?.name),!u.strict)return;throw new Error(`Unknown type${h?` for "${h?.name}"`:""}`)}}}function $Ne(s,a){if(Ya.default.isFunctionDeclaration(a)||Ya.default.isFunctionExpression(a)||Ya.default.isArrowFunction(a))return a;if(Ya.default.isIdentifier(a)){let u=s.getSymbolAtLocation(a);if(u){let h=u.getDeclarations();if(!h)return;for(let b of h){let C=$Ne(s,b);if(C)return C;if(Ya.default.isVariableDeclaration(b)&&b.initializer)return $Ne(s,b.initializer)}}}}var b1t=So(J6e());var Fh=So(require("node:fs")),l2=So(require("node:path"));var EN=So(require("node:fs")),GNe=So(require("node:path")),XH=class s{structs=new Map;functions=[];static analyzePackage(a){let u=new s;return u.parseDirectory(GNe.join(a,"src")),{functions:u.functions,structs:Array.from(u.structs.values())}}parseDirectory(a){if(!EN.existsSync(a))return;let u=EN.readdirSync(a);for(let h of u){let b=GNe.join(a,h);if(EN.statSync(b).isDirectory())this.parseDirectory(b);else if(h.endsWith(".rs")){let C=EN.readFileSync(b,"utf-8");this.parseRustFile(C)}}}parseRustFile(a){let u=this.removeComments(a);this.parseStructs(u),this.parseFunctions(u)}removeComments(a){return a=a.replace(/\/\/.*$/gm,""),a=a.replace(/\/\*[\s\S]*?\*\//g,""),a}parseStructs(a){let u=/#\[derive\([^)]*(?:Serialize|Deserialize)[^)]*\)\]\s*(?:pub\s+)?struct\s+(\w+)\s*\{([^}]+)\}/g,h;for(;(h=u.exec(a))!==null;){let b=h[1],C=h[2],O=this.parseStructFields(C);this.structs.set(b,{name:b,fields:O})}}parseStructFields(a){let u=[],h=/(?:#\[serde\(([^\]]+)\)\]\s*)?(?:pub\s+)?(\w+)\s*:\s*([^,\n]+)/g,b;for(;(b=h.exec(a))!==null;){let C=b[1],O=b[2],U=b[3].trim(),oe=O;if(C){let de=C.match(/rename\s*=\s*"([^"]+)"/);de&&(oe=de[1])}u.push({name:O,serializedName:oe,rustType:U,tsType:this.rustTypeToTypeScript(U)})}return u}parseFunctions(a){let u=/#\[raycast\]\s*(?:pub\s+)?(async\s+)?fn\s+(\w+)\s*\(([^)]*)\)\s*(?:->\s*([^{]+?))?\s*\{/g,h;for(;(h=u.exec(a))!==null;){let b=!!h[1],C=h[2],O=h[3],U=h[4]?.trim()||"()",oe=this.parseParameters(O),{returnType:de,returnTypeTs:Pe,isResult:Je}=this.parseReturnType(U);this.functions.push({name:C,isAsync:b,parameters:oe,returnType:de,returnTypeTs:Pe,isResult:Je})}}parseParameters(a){let u=[];if(!a.trim())return u;let h=this.splitParameters(a);for(let b of h){let C=b.trim().match(/(\w+)\s*:\s*(.+)/);if(C){let O=C[1],U=C[2].trim();u.push({name:O,rustType:U,tsType:this.rustTypeToTypeScript(U)})}}return u}splitParameters(a){let u=[],h="",b=0;for(let C of a){if(C==="<")b++;else if(C===">")b--;else if(C===","&&b===0){u.push(h.trim()),h="";continue}h+=C}return h.trim()&&u.push(h.trim()),u}parseReturnType(a){let u=a.trim(),h=u.match(/Result<([^,]+),\s*(.+)>/);if(h){let b=h[1].trim();return{returnType:u,returnTypeTs:this.rustTypeToTypeScript(b),isResult:!0}}return{returnType:u,returnTypeTs:this.rustTypeToTypeScript(u),isResult:!1}}rustTypeToTypeScript(a){let u=a.trim();if(u==="()")return"void";if(u==="String"||u==="&str")return"string";if(u==="bool")return"boolean";if(u.match(/^[ui]\d+$/)||u.match(/^f\d+$/))return"number";let h=u.match(/Option<(.+)>/);if(h)return`${this.rustTypeToTypeScript(h[1])} | null | undefined`;let b=u.match(/Vec<(.+)>/);if(b)return`${this.rustTypeToTypeScript(b[1])}[]`;let C=u.match(/Result<([^,]+),\s*(.+)>/);return C?this.rustTypeToTypeScript(C[1]):(this.structs.has(u),u)}},M7=class{static generateDefinitions(a,u){let h="";for(let b of u){h+=`export interface ${b.name} {
781
+ `;for(let C of b.fields)h+=` ${C.serializedName}: ${C.tsType};
782
782
  `;h+=`}
783
783
 
784
784
  `}for(let b of a){let C=b.parameters.map(U=>`${U.name}: ${U.tsType}`).join(", "),O=b.returnTypeTs==="void"?"Promise<void>":`Promise<${b.returnTypeTs}>`;h+=`export declare function ${b.name}(${C}): ${O};
@@ -204,10 +204,10 @@
204
204
  "index.js"
205
205
  ]
206
206
  },
207
- "evals": {
207
+ "lint": {
208
208
  "aliases": [],
209
209
  "args": {},
210
- "description": "Run AI evals defined in extension package.json",
210
+ "description": "Validate the extension manifest and metadata, and lint its source code",
211
211
  "flags": {
212
212
  "exit-on-error": {
213
213
  "aliases": [
@@ -260,37 +260,26 @@
260
260
  ],
261
261
  "type": "option"
262
262
  },
263
- "skipBuild": {
264
- "char": "s",
265
- "description": "Skip extension build step",
266
- "name": "skipBuild",
263
+ "fix": {
264
+ "char": "f",
265
+ "description": "Attempt to fix linting issues",
266
+ "name": "fix",
267
267
  "allowNo": false,
268
268
  "type": "boolean"
269
269
  },
270
- "extension": {
271
- "char": "e",
272
- "description": "Path to extension. Current directory is used by default",
273
- "name": "extension",
274
- "default": "./",
275
- "hasDynamicHelp": false,
276
- "multiple": false,
277
- "type": "option"
270
+ "relaxed": {
271
+ "char": "r",
272
+ "description": "Use relaxed linting mode to skip validation of: package.json schema, icons and metadata.",
273
+ "name": "relaxed",
274
+ "allowNo": false,
275
+ "type": "boolean"
278
276
  },
279
- "apiEndpoint": {
280
- "char": "a",
281
- "description": "AI Evals API endpoint",
277
+ "schema": {
278
+ "char": "s",
279
+ "description": "Path to JSON schema for package.json validation \u001b[34m\u001b[2minternal only\u001b[22m\u001b[39m",
282
280
  "hidden": true,
283
- "name": "apiEndpoint",
284
- "default": "https://ai-evals.raycast.com/run-evals",
285
- "hasDynamicHelp": false,
286
- "multiple": false,
287
- "type": "option"
288
- },
289
- "only": {
290
- "char": "o",
291
- "description": "Only run specified evals (0-2, 1, 1,2,3)",
292
- "name": "only",
293
- "default": "",
281
+ "name": "schema",
282
+ "default": "https://www.raycast.com/schemas/extension.json",
294
283
  "hasDynamicHelp": false,
295
284
  "multiple": false,
296
285
  "type": "option"
@@ -298,7 +287,7 @@
298
287
  },
299
288
  "hasDynamicHelp": false,
300
289
  "hiddenAliases": [],
301
- "id": "evals",
290
+ "id": "lint",
302
291
  "pluginAlias": "ray",
303
292
  "pluginName": "ray",
304
293
  "pluginType": "core",
@@ -308,14 +297,14 @@
308
297
  "relativePath": [
309
298
  "dist",
310
299
  "commands",
311
- "evals",
300
+ "lint",
312
301
  "index.js"
313
302
  ]
314
303
  },
315
- "lint": {
304
+ "evals": {
316
305
  "aliases": [],
317
306
  "args": {},
318
- "description": "Validate the extension manifest and metadata, and lint its source code",
307
+ "description": "Run AI evals defined in extension package.json",
319
308
  "flags": {
320
309
  "exit-on-error": {
321
310
  "aliases": [
@@ -368,26 +357,37 @@
368
357
  ],
369
358
  "type": "option"
370
359
  },
371
- "fix": {
372
- "char": "f",
373
- "description": "Attempt to fix linting issues",
374
- "name": "fix",
360
+ "skipBuild": {
361
+ "char": "s",
362
+ "description": "Skip extension build step",
363
+ "name": "skipBuild",
375
364
  "allowNo": false,
376
365
  "type": "boolean"
377
366
  },
378
- "relaxed": {
379
- "char": "r",
380
- "description": "Use relaxed linting mode to skip validation of: package.json schema, icons and metadata.",
381
- "name": "relaxed",
382
- "allowNo": false,
383
- "type": "boolean"
367
+ "extension": {
368
+ "char": "e",
369
+ "description": "Path to extension. Current directory is used by default",
370
+ "name": "extension",
371
+ "default": "./",
372
+ "hasDynamicHelp": false,
373
+ "multiple": false,
374
+ "type": "option"
384
375
  },
385
- "schema": {
386
- "char": "s",
387
- "description": "Path to JSON schema for package.json validation \u001b[34m\u001b[2minternal only\u001b[22m\u001b[39m",
376
+ "apiEndpoint": {
377
+ "char": "a",
378
+ "description": "AI Evals API endpoint",
388
379
  "hidden": true,
389
- "name": "schema",
390
- "default": "https://www.raycast.com/schemas/extension.json",
380
+ "name": "apiEndpoint",
381
+ "default": "https://ai-evals.raycast.com/run-evals",
382
+ "hasDynamicHelp": false,
383
+ "multiple": false,
384
+ "type": "option"
385
+ },
386
+ "only": {
387
+ "char": "o",
388
+ "description": "Only run specified evals (0-2, 1, 1,2,3)",
389
+ "name": "only",
390
+ "default": "",
391
391
  "hasDynamicHelp": false,
392
392
  "multiple": false,
393
393
  "type": "option"
@@ -395,7 +395,7 @@
395
395
  },
396
396
  "hasDynamicHelp": false,
397
397
  "hiddenAliases": [],
398
- "id": "lint",
398
+ "id": "evals",
399
399
  "pluginAlias": "ray",
400
400
  "pluginName": "ray",
401
401
  "pluginType": "core",
@@ -405,7 +405,7 @@
405
405
  "relativePath": [
406
406
  "dist",
407
407
  "commands",
408
- "lint",
408
+ "evals",
409
409
  "index.js"
410
410
  ]
411
411
  },
@@ -1144,5 +1144,5 @@
1144
1144
  ]
1145
1145
  }
1146
1146
  },
1147
- "version": "1.104.7"
1147
+ "version": "1.104.9"
1148
1148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.104.7",
3
+ "version": "1.104.9",
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",
package/types/index.d.ts CHANGED
@@ -505,12 +505,14 @@ export declare namespace AI {
505
505
  "OpenAI_GPT-4o" = "openai-gpt-4o",
506
506
  "OpenAI_GPT-4o_mini" = "openai-gpt-4o-mini",
507
507
  "OpenAI_GPT-5" = "openai_o1-gpt-5",
508
- "OpenAI_GPT-5_Codex" = "openai-gpt-5-codex",
509
508
  "OpenAI_GPT-5.1" = "openai-gpt-5.1",
510
509
  "OpenAI_GPT-5.1_Codex" = "openai-gpt-5.1-codex",
511
510
  "OpenAI_GPT-5.1_Instant" = "openai-gpt-5.1-instant",
512
511
  "OpenAI_GPT-5.2" = "openai-gpt-5.2",
513
512
  "OpenAI_GPT-5.2_Instant" = "openai-gpt-5.2-instant",
513
+ "OpenAI_GPT-5.3_Instant" = "openai-gpt-5.3-instant",
514
+ "OpenAI_GPT-5.3_Codex" = "openai-gpt-5.3-codex",
515
+ "OpenAI_GPT-5.4" = "openai-gpt-5.4",
514
516
  "OpenAI_o3" = "openai_o1-o3",
515
517
  "OpenAI_o4-mini" = "openai_o1-o4-mini",
516
518
  "OpenAI_o1" = "openai_o1-o1",
@@ -520,15 +522,14 @@ export declare namespace AI {
520
522
  "Anthropic_Claude_4.5_Haiku" = "anthropic-claude-4-5-haiku",
521
523
  "Anthropic_Claude_4_Sonnet" = "anthropic-claude-sonnet-4",
522
524
  "Anthropic_Claude_4.5_Sonnet" = "anthropic-claude-sonnet-4-5",
523
- "Anthropic_Claude_4_Opus" = "anthropic-claude-opus-4",
524
- "Anthropic_Claude_4.1_Opus" = "anthropic-claude-opus-4-1",
525
+ "Anthropic_Claude_4.6_Sonnet" = "anthropic-claude-sonnet-4-6",
525
526
  "Anthropic_Claude_4.5_Opus" = "anthropic-claude-opus-4-5",
527
+ "Anthropic_Claude_4.6_Opus" = "anthropic-claude-opus-4-6",
526
528
  "Perplexity_Sonar" = "perplexity-sonar",
527
529
  "Perplexity_Sonar_Pro" = "perplexity-sonar-pro",
528
530
  "Groq_Llama_4_Scout" = "groq-meta-llama/llama-4-scout-17b-16e-instruct",
529
531
  "Groq_Llama_3.3_70B" = "groq-llama-3.3-70b-versatile",
530
532
  "Groq_Llama_3.1_8B" = "groq-llama-3.1-8b-instant",
531
- "Together_AI_Llama_3.1_405B" = "together-meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
532
533
  "Mistral_Nemo" = "mistral-open-mistral-nemo",
533
534
  "Mistral_Large" = "mistral-mistral-large-latest",
534
535
  "Mistral_Medium" = "mistral-mistral-medium-latest",
@@ -536,33 +537,45 @@ export declare namespace AI {
536
537
  "Mistral_Codestral" = "mistral-codestral-latest",
537
538
  "Groq_Kimi_K2_Instruct" = "groq-moonshotai/kimi-k2-instruct",
538
539
  "Groq_Qwen3-32B" = "groq-qwen/qwen3-32b",
540
+ "Google_Gemini_3.1_Flash_Lite" = "google-gemini-3.1-flash-lite",
539
541
  "Google_Gemini_3_Flash" = "google-gemini-3-flash",
540
- "Google_Gemini_3_Pro" = "google-gemini-3-pro",
542
+ "Google_Gemini_3.1_Pro" = "google-gemini-3.1-pro",
541
543
  "Google_Gemini_2.5_Pro" = "google-gemini-2.5-pro",
542
544
  "Google_Gemini_2.5_Flash" = "google-gemini-2.5-flash",
543
545
  "Google_Gemini_2.5_Flash_Lite" = "google-gemini-2.5-flash-lite",
544
546
  "Together_AI_Qwen3-235B-A22B-Instruct-2507-tput" = "together-Qwen/Qwen3-235B-A22B-Instruct-2507-tput",
545
547
  "Together_AI_DeepSeek-R1" = "together-deepseek-ai/DeepSeek-R1",
546
548
  "Together_AI_DeepSeek-V3" = "together-deepseek-ai/DeepSeek-V3",
549
+ "Together_AI_Kimi_K2.5" = "together-moonshotai/Kimi-K2.5",
547
550
  "xAI_Grok-4.1_Fast" = "xai-grok-4-1-fast",
548
551
  "xAI_Grok-4" = "xai-grok-4",
549
552
  "xAI_Grok-4_Fast" = "xai-grok-4-fast",
550
553
  "xAI_Grok_Code_Fast_1" = "xai-grok-code-fast",
551
554
  "xAI_Grok-3_Beta" = "xai-grok-3",
552
555
  "xAI_Grok-3_Mini_Beta" = "xai-grok-3-mini",
556
+ /** @deprecated Use `AI.Model["Google_Gemini_3.1_Pro"]` instead */
557
+ "Google_Gemini_3_Pro" = "google-gemini-3-pro",
558
+ /** @deprecated Use `AI.Model["OpenAI_GPT-5.3_Codex"]` instead */
559
+ "OpenAI_GPT-5_Codex" = "openai-gpt-5-codex",
553
560
  /** @deprecated Use `AI.Model["Anthropic_Claude_4.5_Haiku"]` instead */
554
561
  "Anthropic_Claude_3.5_Haiku" = "anthropic-claude-4-5-haiku",
555
562
  /** @deprecated Use `AI.Model["Anthropic_Claude_4.5_Sonnet"]` instead */
556
- "Anthropic_Claude_3.7_Sonnet" = "anthropic-claude-3-7-sonnet-latest",
563
+ "Anthropic_Claude_3.7_Sonnet" = "anthropic-claude-sonnet-4-5",
564
+ /** @deprecated Use `AI.Model["Anthropic_Claude_4.6_Opus"]` instead */
565
+ "Anthropic_Claude_4_Opus" = "anthropic-claude-opus-4",
566
+ /** @deprecated Use `AI.Model["Anthropic_Claude_4.6_Opus"]` instead */
567
+ "Anthropic_Claude_4.1_Opus" = "anthropic-claude-opus-4-1",
568
+ /** @deprecated Use `AI.Model["Together_AI_DeepSeek-V3"]` instead */
569
+ "Together_AI_Llama_3.1_405B" = "together-meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
557
570
  /** @deprecated Use `AI.Model["Google_Gemini_3_Flash"]` instead */
558
571
  "Google_Gemini_2.0_Flash" = "google-gemini-2.0-flash",
559
572
  /** @deprecated Use `AI.Model["Google_Gemini_3_Flash"]` instead */
560
573
  "Google_Gemini_2.0_Flash_Lite" = "google-gemini-2.0-flash-lite",
561
- /** @deprecated Use `AI.Model["xAI_Grok-4"]` instead */
574
+ /** @deprecated Use `AI.Model["xAI_Grok-4.1_Fast"]` instead */
562
575
  "xAI_Grok-2" = "xai-grok-2-latest",
563
576
  /** @deprecated Use `AI.Model["OpenAI_GPT-4o_mini"]` instead */
564
577
  "OpenAI_GPT3.5-turbo-instruct" = "openai-gpt-4o-mini",
565
- /** @deprecated Use `AI.Model["Anthropic_Claude_4.1_Opus"]` instead */
578
+ /** @deprecated Use `AI.Model["Anthropic_Claude_4.6_Opus"]` instead */
566
579
  "Anthropic_Claude_Opus" = "anthropic-claude-opus-4-1",
567
580
  /** @deprecated Use `AI.Model["Google_Gemini_2.5_Flash"]` instead */
568
581
  "Google_Gemini_2.0_Flash_Thinking" = "google-gemini-2.5-flash",
@@ -611,7 +624,7 @@ export declare namespace AI {
611
624
  /** @deprecated Use `AI.Model["Groq_Llama_3.3_70B"]` instead */
612
625
  "Llama3_70B" = "groq-llama-3.3-70b-versatile",
613
626
  /** @deprecated Use `AI.Model["Anthropic_Claude_4.5_Sonnet"]` instead */
614
- "Anthropic_Claude_Sonnet_3.7" = "anthropic-claude-3-7-sonnet-latest",
627
+ "Anthropic_Claude_Sonnet_3.7" = "anthropic-claude-sonnet-4-5",
615
628
  /** @deprecated Use `AI.Model["Anthropic_Claude_4.5_Sonnet"]` instead */
616
629
  "Anthropic_Claude_Sonnet" = "anthropic-claude-sonnet-4-5",
617
630
  /** @deprecated Use `AI.Model["Perplexity_Sonar_Pro"]` instead */
@@ -641,14 +654,14 @@ export declare namespace AI {
641
654
  /** @deprecated Use `AI.Model["OpenAI_GPT-4o_mini"]` instead */
642
655
  "OpenAI_GPT4o-mini" = "openai-gpt-4o-mini",
643
656
  /** @deprecated Use `AI.Model["Anthropic_Claude_4.5_Haiku"]` instead */
644
- "Anthropic_Claude_Haiku" = "anthropic-claude-haiku",
657
+ "Anthropic_Claude_Haiku" = "anthropic-claude-4-5-haiku",
645
658
  /** @deprecated Use `AI.Model["Mistral_Small_3"]` instead */
646
659
  "Mistral_Small" = "mistral-mistral-small-latest",
647
660
  /** @deprecated Use `AI.Model["Groq_Llama_3.3_70B"]` instead */
648
661
  "Llama3.3_70B" = "groq-llama-3.3-70b-versatile",
649
662
  /** @deprecated Use `AI.Model["Groq_Llama_3.1_8B"]` instead */
650
663
  "Llama3.1_8B" = "groq-llama-3.1-8b-instant",
651
- /** @deprecated Use `AI.Model["Together_AI_Llama_3.1_405B"]` instead */
664
+ /** @deprecated Use `AI.Model["Together_AI_DeepSeek-V3"]` instead */
652
665
  "Llama3.1_405B" = "together-meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
653
666
  /** @deprecated Use `AI.Model["Groq_Llama_4_Scout"]` instead */
654
667
  "Llama4_Scout" = "groq-meta-llama/llama-4-scout-17b-16e-instruct",