@tabsmith/autocomplete-specs 1.0.0 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@magnolia/cli.js +2 -2
- package/build/@withfig/autocomplete-tools.js +2 -2
- package/build/airflow.js +2 -2
- package/build/ansible-playbook.js +2 -2
- package/build/apt.js +4 -4
- package/build/asr.js +2 -2
- package/build/bun.js +9 -9
- package/build/cargo.js +4 -4
- package/build/cd.js +2 -2
- package/build/chezmoi.js +2 -2
- package/build/cloudflared.js +2 -2
- package/build/coda.js +3 -3
- package/build/codesign.js +2 -2
- package/build/dapr.js +2 -2
- package/build/deno/generators.js +4 -4
- package/build/deno.js +2 -2
- package/build/deployctl.js +2 -2
- package/build/direnv.js +2 -2
- package/build/docker.js +18 -18
- package/build/dotenv-vault.js +2 -2
- package/build/dotnet/dotnet-add.js +2 -2
- package/build/dotnet/dotnet-build.js +2 -2
- package/build/dotnet/dotnet-clean.js +2 -2
- package/build/dotnet/dotnet-format.js +2 -2
- package/build/dotnet/dotnet-list.js +2 -2
- package/build/dotnet/dotnet-migrate.js +2 -2
- package/build/dotnet/dotnet-nuget.js +3 -3
- package/build/dotnet/dotnet-pack.js +2 -2
- package/build/dotnet/dotnet-publish.js +2 -2
- package/build/dotnet/dotnet-remove.js +2 -2
- package/build/dotnet/dotnet-restore.js +2 -2
- package/build/dotnet/dotnet-sln.js +2 -2
- package/build/dotnet/dotnet-store.js +2 -2
- package/build/dotnet/dotnet-test.js +2 -2
- package/build/dotnet/dotnet-tool.js +3 -3
- package/build/dotnet.js +2 -2
- package/build/dtm.js +3 -3
- package/build/dynamic/index.js +1 -1
- package/build/elixir.js +2 -2
- package/build/elm-json.js +2 -2
- package/build/esbuild.js +3 -3
- package/build/file.js +2 -2
- package/build/flutter.js +5 -5
- package/build/gh.js +4 -4
- package/build/git.js +20 -20
- package/build/glow.js +2 -2
- package/build/hub.js +20 -20
- package/build/iex.js +2 -2
- package/build/index.js +1 -1
- package/build/index.json +1 -1
- package/build/java.js +2 -2
- package/build/julia.js +2 -2
- package/build/limactl.js +3 -3
- package/build/man.js +3 -3
- package/build/meteor.js +3 -3
- package/build/mgnl.js +2 -2
- package/build/mix.js +2 -2
- package/build/mongoimport.js +2 -2
- package/build/n.js +3 -3
- package/build/ni.js +2 -2
- package/build/node.js +2 -2
- package/build/npm.js +2 -2
- package/build/nr.js +3 -3
- package/build/nrm.js +2 -2
- package/build/opencode.js +2 -2
- package/build/osascript.js +2 -2
- package/build/osqueryi.js +2 -2
- package/build/pandoc.js +3 -3
- package/build/pdfunite.js +2 -2
- package/build/pi.js +2 -2
- package/build/pipenv.js +2 -2
- package/build/pm2.js +2 -2
- package/build/pnpm.js +23 -24
- package/build/pod.js +2 -2
- package/build/pre-commit.js +126 -126
- package/build/python.js +2 -2
- package/build/python3.js +2 -2
- package/build/r.js +3 -3
- package/build/rails.js +3 -3
- package/build/rancher.js +3 -3
- package/build/react-native.js +5 -5
- package/build/robot.js +2 -2
- package/build/rojo.js +2 -2
- package/build/rollup.js +2 -2
- package/build/rscript.js +2 -2
- package/build/rush.js +5 -5
- package/build/rushx.js +4 -4
- package/build/scc.js +2 -2
- package/build/shortcuts.js +2 -2
- package/build/sidekiq.js +2 -2
- package/build/sqlite3.js +2 -2
- package/build/streamlit.js +2 -2
- package/build/subl.js +2 -2
- package/build/swift.js +2 -2
- package/build/systemctl.js +2 -2
- package/build/ts-node.js +3 -3
- package/build/tsc.js +2 -2
- package/build/tsx.js +2 -2
- package/build/turbo.js +20 -20
- package/build/typst.js +2 -2
- package/build/vsce.js +20 -20
- package/build/wasm-bindgen.js +2 -2
- package/build/yarn.js +4 -4
- package/build/yomo.js +2 -2
- package/package.json +20 -20
- package/build/ai-agents specs.js +0 -1
package/build/rancher.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var ee=Object.create;var q=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,
|
|
2
|
-
`),[".DS_Store"]),F=[];for(let R of Y)if(R){let
|
|
3
|
-
`),n=[];for(let s=1;s<t.length;s++)if(t[s].match(/\S+/g)[0]!="*"){let
|
|
1
|
+
var ee=Object.create;var q=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ie=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ne(t))!re.call(e,r)&&r!==n&&q(e,r,{get:()=>t[r],enumerable:!(s=te(t,r))||s.enumerable});return e};var oe=(e,t,n)=>(n=e!=null?ee(se(e)):{},ie(t||!e||!e.__esModule?q(n,"default",{value:e,enumerable:!0}):n,e));var G=I(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.shellExpand=A.ensureTrailingSlash=void 0;var ae=e=>e.endsWith("/")?e:`${e}/`;A.ensureTrailingSlash=ae;var ce=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,le=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var i;let o=r.slice(1);return(i=t[o])!==null&&i!==void 0?i:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,i,o)=>{var l,u;return(u=(l=t[i])!==null&&l!==void 0?l:o)!==null&&u!==void 0?u:r}),ue=(e,t)=>{var n;let{environmentVariables:s}=t;return le(ce(e,(n=s?.HOME)!==null&&n!==void 0?n:"~"),s)};A.shellExpand=ue});var U=I(b=>{"use strict";var de=b&&b.__awaiter||function(e,t,n,s){function r(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(a){try{c(s.next(a))}catch(d){o(d)}}function u(a){try{c(s.throw(a))}catch(d){o(d)}}function c(a){a.done?i(a.value):r(a.value).then(l,u)}c((s=s.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=H;var P=G();function H(e,t=[]){let n=t.map(r=>r.toLowerCase()),s=e.filter(r=>!n.includes(r.toLowerCase()));return[...s.filter(r=>!r.startsWith(".")).sort((r,i)=>r.localeCompare(i)),...s.filter(r=>r.startsWith(".")).sort((r,i)=>r.localeCompare(i)),"../"]}var pe=(e,t,n)=>{if(e===null)return"/";let s=(0,P.shellExpand)(t,n),r=s.slice(0,s.lastIndexOf("/")+1);return r===""?(0,P.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,P.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=pe;function L(e={}){let{extensions:t=[],equals:n=[],matches:s,filterFolders:r=!1,editFileSuggestions:i,editFolderSuggestions:o,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),a=new Set(n),d=()=>t.length>0||n.length>0||s,g=(f=[])=>d()?f.filter(({name:h="",type:w})=>{if(!r&&w==="folder"||a.has(h)||s&&h.match(s))return!0;let[,...p]=h.split(".");if(p.length>=1){let y=p.length-1,_=p[y];do{if(c.has(_))return!0;y-=1,_=[p[y],_].join(".")}while(y>=0)}return!1}):f,O=(f=[])=>!i&&!o?f:f.map(h=>Object.assign(Object.assign({},h),(h.type==="file"?i:o)||{}));return{trigger:(f,h)=>{let w=f.lastIndexOf("/"),p=h.lastIndexOf("/");return w!==p?!0:w===-1&&p===-1?!1:f.slice(0,w)!==h.slice(0,p)},getQueryTerm:f=>f.slice(f.lastIndexOf("/")+1),custom:(f,h,w)=>de(this,void 0,void 0,function*(){var p;let{isDangerous:y,currentWorkingDirectory:_,searchTerm:m}=w,S=(p=(0,b.getCurrentInsertedDirectory)(l??_,m,w))!==null&&p!==void 0?p:"/";try{let D=yield h({command:"ls",args:["-1ApL"],cwd:S}),Y=H(D.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),F=[];for(let R of Y)if(R){let j=R.endsWith("/")?"folders":"filepaths";(j==="filepaths"&&u!=="only"||j==="folders"&&u!=="never")&&F.push({type:j==="filepaths"?"file":"folder",name:R,insertValue:R,isDangerous:y,context:{templateType:j}})}return O(g(F))}catch{return[]}})}}b.folders=Object.assign(()=>L({showFolders:"only"}),Object.freeze(L({showFolders:"only"})));b.filepaths=Object.assign(L,Object.freeze(L()))});var B=I(T=>{"use strict";var E=T&&T.__awaiter||function(e,t,n,s){function r(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(a){try{c(s.next(a))}catch(d){o(d)}}function u(a){try{c(s.throw(a))}catch(d){o(d)}}function c(a){a.done?i(a.value):r(a.value).then(l,u)}c((s=s.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.valueList=fe;T.keyValue=me;T.keyValueList=he;var W=new Map;function M(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function $(e,t,n){return E(this,void 0,void 0,function*(){if(typeof e=="function"){let s=yield e(...n);return M(t,s)}if(typeof e[0]=="string"){let s=e.map(r=>({name:r}));return M(t,s)}return M(t,e)})}function k(e,t,n,s){return E(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=W.get(e);return r===void 0&&(r=yield $(e,t,s),W.set(e,r)),r}return $(e,t,s)})}function K(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function N(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function V(e,t){let n=new Set(e);return t.filter(s=>{var r;return typeof s.name=="string"?!n.has(s.name):!(!((r=s.name)===null||r===void 0)&&r.some(i=>n.has(i)))})}function fe({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:s=!1,allowRepeatedValues:r=!1}){return{trigger:(i,o)=>i.lastIndexOf(e)!==o.lastIndexOf(e),getQueryTerm:i=>i.slice(i.lastIndexOf(e)+e.length),custom:(...i)=>E(this,void 0,void 0,function*(){var o;let l=yield k(t,s?e:"",n,i);if(r)return l;let[u]=i,c=(o=u[u.length-1])===null||o===void 0?void 0:o.split(e);return V(c,l)})}}function me({separator:e="=",keys:t=[],values:n=[],cache:s=!1,insertSeparator:r=!0}){return{trigger:(i,o)=>i.indexOf(e)!==o.indexOf(e),getQueryTerm:i=>i.slice(i.indexOf(e)+1),custom:(...i)=>E(this,void 0,void 0,function*(){let[o]=i,u=!o[o.length-1].includes(e),c=u?t:n,a=K(u,s);return k(c,u&&r?e:"",a,i)})}}function he({separator:e="=",delimiter:t=",",keys:n=[],values:s=[],cache:r=!1,insertSeparator:i=!0,insertDelimiter:o=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,a)=>{let d=N(c,e,t),g=N(a,e,t);return d!==g},getQueryTerm:c=>{let a=N(c,e,t);return c.slice(a+1)},custom:(...c)=>E(this,void 0,void 0,function*(){let[a]=c,d=a[a.length-1],g=N(d,e,t),O=g===-1||d.slice(g,g+e.length)!==e,f=O?n:s,h=K(O,r),p=yield k(f,O?i?e:"":o?t:"",h,c);if(O){if(l)return p;let _=d.split(t).map(m=>m.slice(0,m.indexOf(e)));return V(_,p)}if(u)return p;let y=d.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return V(y,p)})}}});var J=I(x=>{"use strict";var ge=x&&x.__awaiter||function(e,t,n,s){function r(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(a){try{c(s.next(a))}catch(d){o(d)}}function u(a){try{c(s.throw(a))}catch(d){o(d)}}function c(a){a.done?i(a.value):r(a.value).then(l,u)}c((s=s.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.ai=_e;var ve=4097,ye=4,be=.8,we=ve*ye*be;function _e({name:e,prompt:t,message:n,postProcess:s,temperature:r,splitOn:i}){return{scriptTimeout:15e3,custom:(o,l,u)=>ge(this,void 0,void 0,function*(){var c,a;let d=yield l({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof t=="function"?yield t({tokens:o,executeCommand:l,generatorContext:u}):t,O=typeof n=="function"?yield n({tokens:o,executeCommand:l,generatorContext:u}):n;if(O===null||O.length===0)return console.warn("No message provided to AI generator"),[];let f=we-((c=g?.length)!==null&&c!==void 0?c:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:O.slice(0,f)}],temperature:r},w=JSON.stringify(h),p=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),y=JSON.parse(p.stdout);return(a=y?.choices.map(m=>{var S;return(S=m?.message)===null||S===void 0?void 0:S.content}).filter(m=>typeof m=="string").flatMap(m=>i?m.split(i).filter(S=>S.trim().length>0):[m]).map(m=>{if(s)return s(m);let S=m.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&a!==void 0?a:[]})}}});var Q=I(v=>{"use strict";var Oe=v&&v.__createBinding||(Object.create?function(e,t,n,s){s===void 0&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){s===void 0&&(s=n),e[s]=t[n]}),Se=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Oe(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var z=U();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return z.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return z.folders}});Se(B(),v);var Te=J();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Te.ai}})});var Z=oe(Q(),1),X={script:["rancher","server","ls"],postProcess:function(e){let t=e.split(`
|
|
3
|
+
`),n=[];for(let s=1;s<t.length;s++)if(t[s].match(/\S+/g)[0]!="*"){let i=t[s].match(/\S+/g)[1],o=t[s].match(/\S+/g)[2];n.push({name:i,description:o,icon:"https://rancher.com/docs/img/favicon.png"})}return n.length===0&&n.push({name:"No other servers found to swtich to",description:"",icon:"https://rancher.com/docs/img/favicon.png"}),n}},C=[{name:["--format","-o"],description:"Output format: 'json', 'yaml' or custom format",args:{name:"format",suggestions:["json","yaml"]}},{name:["--quiet","-q"],description:"Only display IDs or suppress help text"},{name:["--help","-h"],description:"Show help"}],Ae={name:"rancher",description:"The Rancher CLI (Command Line Interface) is a unified tool that you can use to interact with Rancher",subcommands:[{name:["apps","app"],description:"Operations with apps. Uses helm. Flags are prepended with 'helm' can also be accurately described by helm documentation",subcommands:[{name:"ls",description:"List all apps in the current Rancher server"},{name:"delete",description:"Delete an app",args:{name:"APP_NAME/APP_ID",description:"The name of the app to delete"}},{name:"install",description:"Install an app template",args:[{name:"TEMPLATE_NAME/TEMPLATE_PATH",description:"Install an app template in the current Rancher server"},{name:"APP_NAME",description:"The name of the app to install"}],options:[{name:["--answers","-a"],description:"Path to an answers file, the format of the file is a map with key:value. This supports JSON and YAML",args:{name:"answers-file-path",generators:(0,Z.filepaths)({extensions:["json","yaml"]})}},{name:["--values","-v"],description:"Path to a helm values file",args:{name:"values-file-path",template:"filepaths"}},{name:["--namespace","-n"],description:"Namespace to install the app into",args:{name:"namespace"}},{name:"--set",description:"Set answers for the template, can be used multiple times. Example: --set foo=bar",args:{name:"key=value"},isRepeatable:!0},{name:"--set-string",description:"Set string answers for the template (Skips Helm's type conversion), can be used multiple times. Example: --set-string foo=bar",args:{name:"key=value"},isRepeatable:!0},{name:"--version",description:"Version of the template to use",args:{name:"version"}},{name:"--no-prompt",description:"Suppress asking questions and use the default values when required answers are not provided"},{name:"--helm-timeout",description:"Amount of time for helm to wait for k8s commands (default is 300 secs). Example: --helm-timeout 600 (default: 300)",args:{name:"seconds"}},{name:"--helm-wait",description:"Helm will wait for as long as timeout value, for installed resources to be ready (pods, PVCs, deployments, etc.). Example: --helm-wait"}]},{name:"rollback",description:"Rollback an app to a previous version",args:[{name:"APP_NAME/APP_ID",description:"The name/id of the app to rollback"},{name:"REVISION_ID/REVISION_NAME",description:"The name/id of the revision to rollback"}]},{name:"upgrade",description:"Upgrade an existing app to a newer version"},{name:["list-templates","lt"],description:"List templates available for installation"},{name:["show-tempate","st"],description:"Show versions available to install for an app template"},{name:["show-app","sa"],description:"Show an app's available versions and revisions"},{name:"show-notes",description:"Show contents of apps notes.txt"}],options:C},{name:"catalog",description:"Operations with catalogs",subcommands:[{name:"ls",description:"List all catalogs in the current Rancher server",options:[...C,{name:["--verbose","-v"]}]},{name:"add",description:"Add a catalog",args:[{name:"CATALOG_NAME",description:"The name of the catalog to add"},{name:"CATALOG_URL",description:"The URL of the catalog to add"}],options:[{name:"--branch",description:"Branch from the url to use (default: 'master')",args:{name:"branch name"}},{name:"--helm-version",description:"Version of helm the app(s) in your catalog will use for deployment. Use 'v2' for helm 2 or 'v3' for helm 3 (default: 'v2')",args:{name:"version"}}]}]},{name:["clusters","cluster"],description:"Operations on clusters",icon:"https://rancher.com/docs/img/favicon.png"},{name:"context",description:"Operations for the context"},{name:"globaldns",description:"Operations on global DNS providers and entries"},{name:"inspect",description:"View details of resources"},{name:"kubectl",description:"Run kubectl commands",icon:"fig://icon?type=kubernetes"},{name:["login","-l"],description:"Login to a Rancher server",args:{name:"SERVER_URL",description:"The server url you want to login to"},options:[{name:"--token",description:"API Bearer Token to authenticate Rancher CLI to your Rancher server",args:{name:"BEARER_TOKEN",description:"The bearer token you want to use"}}]},{name:["machines","machine"],description:"Operations on machines"},{name:["multiclusterapps","multiclusterapp"],description:"Operations with multi-cluster apps"},{name:["namespaces","namespace"],description:"Operations on namespaces"},{name:["nodes","node"],description:"Operations on nodes"},{name:["projects","project"],description:"Operations on projects"},{name:"ps",description:"Show workloads in a project"},{name:"server",description:"Operations for the server",subcommands:[{name:"current",description:"Display the current server"},{name:"delete",description:"\u26A0\uFE0F Delete a server from the local config",args:{name:"SERVER_NAME",description:"The name of server you want to delete",generators:X},isDangerous:!0},{name:"ls",description:"List all servers"},{name:"switch",description:"Switch to a new server",args:{name:"SERVER_NAME",description:"The name of server you want to switch to",generators:X}}]},{name:["settings","setting"],description:"Show settings for the current server",subcommands:[{name:"ls",description:"List settings"},{name:"get",description:"Print a setting",args:{name:"SETTING_NAME",description:"The name of setting you want to get"}},{name:"set",description:"Set the value for a setting",args:[{name:"SETTINGNAME",description:"The name of setting you want to set"},{name:"SETTING_VALUE",description:"The value of setting you want to set"}],options:[...C,{name:"--default",description:"Reset the setting back to it's default value. If the default value is (blank) it will be set to that"}]}]},{name:"ssh",description:"SSH into a node"},{name:"up",description:"Apply compose config"},{name:"wait",description:"Wait for resources cluster, app, project, multiClusterApp"},{name:"token",description:"Authenticate and generate new kubeconfig token"},{name:["help","h"],description:"Shows a list of commands or help for one command"}],options:[{name:"--debug",description:"Debug logging"},{name:["--config","-c"],description:"Path to rancher config (default: `$home/.rancher`) [$RANCHER_CONFIG_DIR]",args:{name:"RANCHER_CONFIG_PATH",template:"folders",description:"The path to the rancher config"}},{name:["--help","-h"],description:"Show help for rancher cli"},{name:["--version","-v"],description:"Print the version"}]},Ne=Ae;export{Ne as default};
|
package/build/react-native.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var ne=Object.create;var q=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),B=[];for(let
|
|
3
|
-
`).filter(t=>!t.match(/^(List)|\*/)).filter(Boolean).filter(t=>t.match(/device$/)).map(t=>t.split(/device/)[0].trim()).map(t=>({name:t,icon:
|
|
4
|
-
`).filter(t=>!t.match(/^=/)).filter(Boolean).map(t=>t.split(/\([\w\d\-]+\)$/)).map(([t])=>({name:t.trim()}))},
|
|
1
|
+
var ne=Object.create;var q=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var I=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var ae=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of re(n))!se.call(e,r)&&r!==t&&q(e,r,{get:()=>n[r],enumerable:!(i=ie(n,r))||i.enumerable});return e};var ce=(e,n,t)=>(t=e!=null?ne(oe(e)):{},ae(n||!e||!e.__esModule?q(t,"default",{value:e,enumerable:!0}):t,e));var U=I(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.shellExpand=j.ensureTrailingSlash=void 0;var le=e=>e.endsWith("/")?e:`${e}/`;j.ensureTrailingSlash=le;var ue=(e,n)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",n):e,de=(e,n)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var o;let a=r.slice(1);return(o=n[a])!==null&&o!==void 0?o:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,o,a)=>{var l,u;return(u=(l=n[o])!==null&&l!==void 0?l:a)!==null&&u!==void 0?u:r}),pe=(e,n)=>{var t;let{environmentVariables:i}=n;return de(ue(e,(t=i?.HOME)!==null&&t!==void 0?t:"~"),i)};j.shellExpand=pe});var $=I(b=>{"use strict";var me=b&&b.__awaiter||function(e,n,t,i){function r(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(s){try{c(i.next(s))}catch(d){a(d)}}function u(s){try{c(i.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):r(s.value).then(l,u)}c((i=i.apply(e,n||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=H;var L=U();function H(e,n=[]){let t=n.map(r=>r.toLowerCase()),i=e.filter(r=>!t.includes(r.toLowerCase()));return[...i.filter(r=>!r.startsWith(".")).sort((r,o)=>r.localeCompare(o)),...i.filter(r=>r.startsWith(".")).sort((r,o)=>r.localeCompare(o)),"../"]}var fe=(e,n,t)=>{if(e===null)return"/";let i=(0,L.shellExpand)(n,t),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,L.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,L.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=fe;function D(e={}){let{extensions:n=[],equals:t=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:l,showFolders:u="always"}=e,c=new Set(n),s=new Set(t),d=()=>n.length>0||t.length>0||i,h=(m=[])=>d()?m.filter(({name:g="",type:w})=>{if(!r&&w==="folder"||s.has(g)||i&&g.match(i))return!0;let[,...p]=g.split(".");if(p.length>=1){let y=p.length-1,O=p[y];do{if(c.has(O))return!0;y-=1,O=[p[y],O].join(".")}while(y>=0)}return!1}):m,S=(m=[])=>!o&&!a?m:m.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:a)||{}));return{trigger:(m,g)=>{let w=m.lastIndexOf("/"),p=g.lastIndexOf("/");return w!==p?!0:w===-1&&p===-1?!1:m.slice(0,w)!==g.slice(0,p)},getQueryTerm:m=>m.slice(m.lastIndexOf("/")+1),custom:(m,g,w)=>me(this,void 0,void 0,function*(){var p;let{isDangerous:y,currentWorkingDirectory:O,searchTerm:f}=w,x=(p=(0,b.getCurrentInsertedDirectory)(l??O,f,w))!==null&&p!==void 0?p:"/";try{let V=yield g({command:"ls",args:["-1ApL"],cwd:x}),te=H(V.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),B=[];for(let A of te)if(A){let P=A.endsWith("/")?"folders":"filepaths";(P==="filepaths"&&u!=="only"||P==="folders"&&u!=="never")&&B.push({type:P==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:y,context:{templateType:P}})}return S(h(B))}catch{return[]}})}}b.folders=Object.assign(()=>D({showFolders:"only"}),Object.freeze(D({showFolders:"only"})));b.filepaths=Object.assign(D,Object.freeze(D()))});var K=I(_=>{"use strict";var k=_&&_.__awaiter||function(e,n,t,i){function r(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(s){try{c(i.next(s))}catch(d){a(d)}}function u(s){try{c(i.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):r(s.value).then(l,u)}c((i=i.apply(e,n||[])).next())})};Object.defineProperty(_,"__esModule",{value:!0});_.valueList=ge;_.keyValue=he;_.keyValueList=ve;var W=new Map;function N(e,n){return e.length===0?n:n.map(t=>t.insertValue?t:Object.assign(Object.assign({},t),{insertValue:t.name+e}))}function X(e,n,t){return k(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...t);return N(n,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return N(n,i)}return N(n,e)})}function F(e,n,t,i){return k(this,void 0,void 0,function*(){if(t||Array.isArray(e)){let r=W.get(e);return r===void 0&&(r=yield X(e,n,i),W.set(e,r)),r}return X(e,n,i)})}function z(e,n){return typeof n=="string"?e&&n==="keys"||!e&&n==="values":n}function E(e,...n){return Math.max(...n.map(t=>e.lastIndexOf(t)))}function C(e,n){let t=new Set(e);return n.filter(i=>{var r;return typeof i.name=="string"?!t.has(i.name):!(!((r=i.name)===null||r===void 0)&&r.some(o=>t.has(o)))})}function ge({delimiter:e=",",values:n=[],cache:t=!1,insertDelimiter:i=!1,allowRepeatedValues:r=!1}){return{trigger:(o,a)=>o.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>k(this,void 0,void 0,function*(){var a;let l=yield F(n,i?e:"",t,o);if(r)return l;let[u]=o,c=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return C(c,l)})}}function he({separator:e="=",keys:n=[],values:t=[],cache:i=!1,insertSeparator:r=!0}){return{trigger:(o,a)=>o.indexOf(e)!==a.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>k(this,void 0,void 0,function*(){let[a]=o,u=!a[a.length-1].includes(e),c=u?n:t,s=z(u,i);return F(c,u&&r?e:"",s,o)})}}function ve({separator:e="=",delimiter:n=",",keys:t=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,s)=>{let d=E(c,e,n),h=E(s,e,n);return d!==h},getQueryTerm:c=>{let s=E(c,e,n);return c.slice(s+1)},custom:(...c)=>k(this,void 0,void 0,function*(){let[s]=c,d=s[s.length-1],h=E(d,e,n),S=h===-1||d.slice(h,h+e.length)!==e,m=S?t:i,g=z(S,r),p=yield F(m,S?o?e:"":a?n:"",g,c);if(S){if(l)return p;let O=d.split(n).map(f=>f.slice(0,f.indexOf(e)));return C(O,p)}if(u)return p;let y=d.split(n).map(O=>O.slice(O.indexOf(e)+e.length));return C(y,p)})}}});var Q=I(T=>{"use strict";var ye=T&&T.__awaiter||function(e,n,t,i){function r(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(s){try{c(i.next(s))}catch(d){a(d)}}function u(s){try{c(i.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):r(s.value).then(l,u)}c((i=i.apply(e,n||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.ai=xe;var be=4097,we=4,Oe=.8,Se=be*we*Oe;function xe({name:e,prompt:n,message:t,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(a,l,u)=>ye(this,void 0,void 0,function*(){var c,s;let d=yield l({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let h=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n,S=typeof t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let m=Se-((c=h?.length)!==null&&c!==void 0?c:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...h?[{role:"system",content:h}]:[],{role:"user",content:S.slice(0,m)}],temperature:r},w=JSON.stringify(g),p=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),y=JSON.parse(p.stdout);return(s=y?.choices.map(f=>{var x;return(x=f?.message)===null||x===void 0?void 0:x.content}).filter(f=>typeof f=="string").flatMap(f=>o?f.split(o).filter(x=>x.trim().length>0):[f]).map(f=>{if(i)return i(f);let x=f.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:x,insertValue:`'${x}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}});var Y=I(v=>{"use strict";var _e=v&&v.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(n,t);(!r||("get"in r?!n.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,r)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),je=v&&v.__exportStar||function(e,n){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&_e(n,e,t)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var Z=$();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return Z.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return Z.folders}});je(K(),v);var Ie=Q();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Ie.ai}})});var ee=ce(Y(),1),ke="https://raw.githubusercontent.com/vscode-icons/vscode-icons/master/icons/file_type_js.svg",Te="https://raw.githubusercontent.com/vscode-icons/vscode-icons/master/icons/file_type_gradle.svg",G="https://developer.apple.com/library/archive/Resources/1282/Images/apple2.png",R="https://www.android.com/static/images/fav/favicon.ico",M=(0,ee.filepaths)({extensions:["js"],editFileSuggestions:{icon:ke}}),J={script:["sysctl","-n","hw.ncpu"],postProcess:e=>Array.from({length:Number(e)},(n,t)=>({name:`${t}`}))},Ae={script:["bash","-c","xcodebuild -project ios/*.xcodeproj -list -json"],postProcess:e=>JSON.parse(e).project.configurations.map(t=>({name:t}))},Pe={script:["bash","-c","xcodebuild -project ios/*.xcodeproj -list -json"],postProcess:e=>JSON.parse(e).project.schemes.map(t=>({name:t}))},De={script:["adb","devices"],postProcess:e=>e.split(`
|
|
3
|
+
`).filter(t=>!t.match(/^(List)|\*/)).filter(Boolean).filter(t=>t.match(/device$/)).map(t=>t.split(/device/)[0].trim()).map(t=>({name:t,icon:R}))},Ee={script:["xcrun","simctl","list","--json","devices","available"],postProcess:e=>{let n=JSON.parse(e).devices;return Object.entries(n).map(([t,i])=>i).reduce((t,i)=>[...t,...i],[]).map(({name:t})=>({name:t,icon:G}))}},Re={script:["xcrun","xctrace","list","devices"],postProcess:e=>e.split(`
|
|
4
|
+
`).filter(t=>!t.match(/^=/)).filter(Boolean).map(t=>t.split(/\([\w\d\-]+\)$/)).map(([t])=>({name:t.trim()}))},Le={script:["xcrun","xctrace","list","devices"],postProcess:e=>e.split(`
|
|
5
5
|
`).filter(t=>!t.match(/^=/)).filter(Boolean).map(t=>t.split(" ")).map(t=>t[t.length-1].trim().replace("(","").replace(")","")).map(t=>({name:t}))},Ne={script:["bash","-c","cd android/ && ./gradlew tasks"],postProcess:e=>e.split(`
|
|
6
|
-
`).filter(t=>t.match(/^\w+ \- |\*/)).map(t=>t.split(" - ")).map(([t,i])=>({name:t,description:i}))},Ce={name:"react-native",description:"Command line tools that ship with react-native in form of the @react-native-community/cli package",subcommands:[{description:"[EXPERIMENTAL] Diagnose and fix common Node.js, iOS, Android & React Native issues",name:"doctor",options:[{name:"--fix",description:"Attempt to fix all diagnosed issues"},{name:"--contributor",description:"Add healthchecks required to installations required for contributing to React Native"},{name:["-h","--help"],description:"Output usage information"}]},{description:"Builds the javascript bundle for offline use",name:"bundle",options:[{name:"--entry-file",description:"Path to the root JS file, either absolute or relative to JS root",args:{name:"file",generators:M}},{name:"--platform",description:'Either "ios" or "android" (default: "ios")',args:{name:"platform",suggestions:[{name:"android",icon:L},{name:"ios",icon:G}]}},{name:"--transformer",description:"Specify a custom transformer to be used",args:{name:"transformer"}},{name:"--dev",description:"If false, warnings are disabled and the bundle is minified (default: true)",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--minify",description:"Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--bundle-output",description:"File name where to store the resulting bundle, ex. /tmp/groups.bundle",args:{name:"bundle file"}},{name:"--bundle-encoding",description:'Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: "utf8")',args:{name:"encoding",suggestions:[{name:"utf8"},{name:"utf16le"},{name:"latin1"}]}},{name:"--max-workers",description:"Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine",args:{name:"Number of workers",generators:J}},{name:"--sourcemap-output",description:"File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map",args:{name:"sourcemap-output"}},{name:"--sourcemap-sources-root",description:"Path to make sourcemap's sources entries relative to, ex. /root/dir",args:{template:"folders",name:"root"}},{name:"--sourcemap-use-absolute-path",description:"Report SourceMapURL using its full path"},{name:"--assets-dest",description:"Directory name where to store assets referenced in the bundle",args:{name:"directory",template:"folders"}},{name:"--unstable-transform-profile",description:"Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default",args:{name:"transform-profile",suggestions:[{name:"hermes",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"hermes-canary",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"default"}]}},{name:"--reset-cache",description:"Removes cached files"},{name:"--read-global-cache",description:"Try to fetch transformed JS code from the global cache, if configured"},{name:"--config",description:"Path to the CLI configuration file",icon:"\u{1F6E0}",args:{template:"filepaths",name:"string"}},{name:["-h","--help"],description:"Output usage information"}]},{description:"Initialize a new React Native project named <projectName> in a directory of the same name",name:"init",options:[{name:"--version",description:"Shortcut for `--template react-native@version`",args:{name:"version"}},{name:"--template",description:"Uses a custom template. Valid arguments are the ones supported by `yarn add [package]` or `npm install [package]`, if you are using `--npm` option",args:{name:"template"}},{name:"--npm",description:"Forces using npm for initialization",icon:"https://img.pngio.com/publishing-to-npm-from-kentcdodds-on-eggheadio-npm-png-800_800.png"},{name:"--directory",description:"Uses a custom directory instead of `<projectName>`",args:{template:"folders",name:"string"}},{name:"--title",description:"Uses a custom app title name for application",args:{name:"title"}},{name:"--skip-install",description:"Skips dependencies installation step",icon:"\u23ED\uFE0F"},{name:["-h","--help"],description:"Output usage information"}],args:{name:"projectName"}},{description:"Uninstall and unlink native dependencies",name:"uninstall",options:[{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName"}},{description:"Starts the webserver",name:"start",options:[{name:"--port",description:"Port on which to listen to",args:{name:"free port"}},{name:"--host",description:"Change the default host",args:{name:"new host"}},{name:"--projectRoot",description:"Path to a custom project root",args:{name:"path",template:"folders"}},{name:"--watchFolders",description:"Specify any additional folders to be added to the watch list",args:{template:"folders",name:"folders"}},{name:"--assetPlugins",description:"Specify any additional asset plugins to be used by the packager by full filepath",args:{template:"folders",name:"plugins"}},{name:"--sourceExts",description:"Specify any additional source extensions to be used by the packager",args:{name:"sourceExts",suggestions:[{name:"js"},{name:"css"},{name:"png"},{name:"xml"}]}},{name:"--max-workers",description:"Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine",args:{name:"Number of workers",generators:J}},{name:"--transformer",description:"Specify a custom transformer to be used",args:{name:"transformer"}},{name:["--reset-cache","--resetCache"],description:"Removes cached files"},{name:["--custom-log-reporter-path","--customLogReporterPath"],description:"Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter",args:{name:"logFile",generators:M}},{name:"--verbose",icon:"\u{1F50A}",description:"Enables logging"},{name:"--https",icon:"\u{1F310}",description:"Enables https connections to the server"},{name:"--key",description:"Path to custom SSL key",args:{template:"filepaths",name:"path"}},{name:"--cert",description:"Path to custom SSL cert",args:{template:"filepaths",name:"path"}},{name:"--config",icon:"\u{1F6E0}",description:"Path to the CLI configuration file",args:{name:"string"}},{name:"--no-interactive",description:"Disables interactive mode"},{name:["-h","--help"],description:"Output usage information"}]},{description:'Builds javascript as a "Random Access Module" bundle for offline use',name:"ram-bundle",options:[{name:"--entry-file",description:"Path to the root JS file, either absolute or relative to JS root",args:{name:"file",generators:M}},{name:"--platform",description:'Either "ios" or "android" (default: "ios")',args:{name:"platform",suggestions:[{name:"android",icon:L},{name:"ios",icon:G}]}},{name:"--transformer",description:"Specify a custom transformer to be used",args:{name:"transformer"}},{name:"--dev",description:"If false, warnings are disabled and the bundle is minified (default: true)",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--minify",description:"Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--bundle-output",description:"File name where to store the resulting bundle, ex. /tmp/groups.bundle",args:{name:"output file"}},{name:"--bundle-encoding",description:'Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: "utf8")',args:{name:"encoding",suggestions:[{name:"utf8"},{name:"utf16le"},{name:"latin1"}]}},{name:"--max-workers",description:"Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine",args:{name:"Number of workers",generators:J}},{name:"--sourcemap-output",description:"File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map",args:{name:"sourcemap-output"}},{name:"--sourcemap-sources-root",description:"Path to make sourcemap's sources entries relative to, ex. /root/dir",args:{template:"folders",name:"root"}},{name:"--sourcemap-use-absolute-path",description:"Report SourceMapURL using its full path"},{name:"--assets-dest",description:"Directory name where to store assets referenced in the bundle",args:{name:"directory",template:"folders"}},{name:"--unstable-transform-profile",description:"Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default",args:{name:"transform-profile",suggestions:[{name:"hermes",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"hermes-canary",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"default"}]}},{name:"--reset-cache",description:"Removes cached files"},{name:"--read-global-cache",description:"Try to fetch transformed JS code from the global cache, if configured"},{name:"--config",icon:"\u{1F6E0}",description:"Path to the CLI configuration file",args:{name:"string"}},{name:"--indexed-ram-bundle",description:'Force the "Indexed RAM" bundle file format, even when building for android'},{name:["-h","--help"],description:"Output usage information"}]},{description:"Links assets and optionally native modules",name:"link",options:[{name:"--platforms",description:"Scope linking to specified platforms",args:{name:"list",isOptional:!0}},{name:"--all",description:"Link all native modules and assets"},{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName",isOptional:!0}},{description:"Upgrade your app's template files to the specified or latest npm version using `rn-diff-purge` project. Only valid semver versions are allowed",name:"upgrade",options:[{name:["-h","--help"],description:"Output usage information"}],args:{name:"version",isOptional:!0}},{description:"Get relevant version info about OS, toolchain and libraries",name:"info",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Install and link native dependencies",name:"install",options:[{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName"}},{description:"Print CLI configuration",icon:"\u{1F6E0}",name:"config",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Unlink native dependency",name:"unlink",options:[{name:"--platforms",description:"Scope unlinking to specified platforms",args:{name:"list",isOptional:!0}},{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName"}},{description:"Starts iOS device syslog tail",name:"log-ios",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Pull and convert a Hermes tracing profile to Chrome tracing profile, then store it in the directory <destinationDir> of the local machine",name:"profile-hermes",options:[{name:"--filename",description:"File name of the profile to be downloaded, eg. sampling-profiler-trace8593107139682635366.cpuprofile",args:{template:"filepaths",name:"profile"}},{name:"--raw",description:"Pulls the original Hermes tracing profile without any transformation"},{name:"--sourcemap-path",description:"The local path to your source map file, eg. /tmp/sourcemap.json",args:{name:"sourcemap-path",template:"filepaths"}},{name:"--generate-sourcemap",description:"Generates the JS bundle and source map"},{name:"--port",description:'Default: "8081"',args:{name:"free port"}},{name:["-h","--help"],description:"Output usage information"}],args:{name:"destinationDir",template:"folders",isOptional:!0}},{description:"Starts logkitty",name:"log-android",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Builds your app and starts it on a connected Android emulator or device",name:"run-android",options:[{name:"--root",description:'[DEPRECATED - root is discovered automatically] Override the root directory for the android build (which contains the android directory) (default: "")',args:{name:"root",template:"folders"}},{name:"--variant",description:`Specify your app's build variant (default: "debug")`,args:{name:"variant",suggestions:[{name:"debug"},{name:"release"}]}},{name:"--appFolder",description:'[DEPRECATED \u2013 use "project.android.appName" in react-native.config.js] Specify a different application folder name for the android source. If not, we assume is "app"',args:{template:"folders",name:"string"}},{name:"--appId",description:'Specify an applicationId to launch after build. If not specified, `package` from AndroidManifest.xml will be used. (default: "")',args:{name:"appId"}},{name:"--appIdSuffix",description:'Specify an applicationIdSuffix to launch after build. (default: "")',args:{name:"appIdSuffix"}},{name:"--main-activity",description:'Name of the activity to start (default: "MainActivity")',args:{name:"main activity"}},{name:"--deviceId",icon:L,description:'Builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line)',args:{name:"deviceId",generators:De}},{name:"--no-packager",description:"Do not launch packager while building"},{name:"--port",description:"Default: 8081",args:{name:"free port"}},{name:"--terminal",description:'Launches the Metro Bundler in a new window using the specified terminal path. (default: "Apple_Terminal")',args:{name:"terminal path"}},{name:"--tasks",description:`Run custom Gradle tasks. By default it's "installDebug"`,icon:Ae,args:{name:"task list",generators:Ne}},{name:"--no-jetifier",description:`Do not run "jetifier" \u2013 the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier`},{name:["-h","--help"],description:"Output usage information"}]},{description:"Builds your app and starts it on iOS simulator",name:"run-ios",options:[{name:"--simulator",description:'Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: "iPhone 6 (10.0)" (default: "iPhone 12")',args:{name:"simulator",generators:Ee}},{name:"--configuration",icon:"\u{1F6E0}",description:'Explicitly set the scheme configuration to use (default: "Debug")',args:{name:"config scheme",generators:Te}},{name:"--scheme",description:"Explicitly set Xcode scheme to use",args:{name:"scheme",generators:Pe}},{name:"--project-path",description:'Path relative to project root where the Xcode project (.xcodeproj) lives. (default: "ios")',args:{template:"folders",name:"path"}},{name:"--device",description:"Explicitly set device to use by name",args:{name:"device name",isOptional:!0,generators:Le}},{name:"--udid",description:"Explicitly set device to use by udid",args:{name:"udid",generators:Re}},{name:"--no-packager",description:"Do not launch packager while building"},{name:"--verbose",icon:"\u{1F50A}",description:"Do not use xcpretty even if installed"},{name:"--port",description:"Default: 8081",args:{name:"free port"}},{name:"--terminal",description:'Launches the Metro Bundler in a new window using the specified terminal path. (default: "Apple_Terminal")',args:{name:"terminal path"}},{name:["-h","--help"],description:"Output usage information"}]}],options:[{name:"--version",description:"Print CLI version"},{name:"--verbose",icon:"\u{1F50A}",description:"Increase logging verbosity"},{name:["-h","--help"],description:"Output usage information"}]},qe=Ce;export{qe as default};
|
|
6
|
+
`).filter(t=>t.match(/^\w+ \- |\*/)).map(t=>t.split(" - ")).map(([t,i])=>({name:t,description:i}))},Ce={name:"react-native",description:"Command line tools that ship with react-native in form of the @react-native-community/cli package",subcommands:[{description:"[EXPERIMENTAL] Diagnose and fix common Node.js, iOS, Android & React Native issues",name:"doctor",options:[{name:"--fix",description:"Attempt to fix all diagnosed issues"},{name:"--contributor",description:"Add healthchecks required to installations required for contributing to React Native"},{name:["-h","--help"],description:"Output usage information"}]},{description:"Builds the javascript bundle for offline use",name:"bundle",options:[{name:"--entry-file",description:"Path to the root JS file, either absolute or relative to JS root",args:{name:"file",generators:M}},{name:"--platform",description:'Either "ios" or "android" (default: "ios")',args:{name:"platform",suggestions:[{name:"android",icon:R},{name:"ios",icon:G}]}},{name:"--transformer",description:"Specify a custom transformer to be used",args:{name:"transformer"}},{name:"--dev",description:"If false, warnings are disabled and the bundle is minified (default: true)",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--minify",description:"Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--bundle-output",description:"File name where to store the resulting bundle, ex. /tmp/groups.bundle",args:{name:"bundle file"}},{name:"--bundle-encoding",description:'Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: "utf8")',args:{name:"encoding",suggestions:[{name:"utf8"},{name:"utf16le"},{name:"latin1"}]}},{name:"--max-workers",description:"Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine",args:{name:"Number of workers",generators:J}},{name:"--sourcemap-output",description:"File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map",args:{name:"sourcemap-output"}},{name:"--sourcemap-sources-root",description:"Path to make sourcemap's sources entries relative to, ex. /root/dir",args:{template:"folders",name:"root"}},{name:"--sourcemap-use-absolute-path",description:"Report SourceMapURL using its full path"},{name:"--assets-dest",description:"Directory name where to store assets referenced in the bundle",args:{name:"directory",template:"folders"}},{name:"--unstable-transform-profile",description:"Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default",args:{name:"transform-profile",suggestions:[{name:"hermes",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"hermes-canary",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"default"}]}},{name:"--reset-cache",description:"Removes cached files"},{name:"--read-global-cache",description:"Try to fetch transformed JS code from the global cache, if configured"},{name:"--config",description:"Path to the CLI configuration file",icon:"\u{1F6E0}",args:{template:"filepaths",name:"string"}},{name:["-h","--help"],description:"Output usage information"}]},{description:"Initialize a new React Native project named <projectName> in a directory of the same name",name:"init",options:[{name:"--version",description:"Shortcut for `--template react-native@version`",args:{name:"version"}},{name:"--template",description:"Uses a custom template. Valid arguments are the ones supported by `yarn add [package]` or `npm install [package]`, if you are using `--npm` option",args:{name:"template"}},{name:"--npm",description:"Forces using npm for initialization",icon:"https://img.pngio.com/publishing-to-npm-from-kentcdodds-on-eggheadio-npm-png-800_800.png"},{name:"--directory",description:"Uses a custom directory instead of `<projectName>`",args:{template:"folders",name:"string"}},{name:"--title",description:"Uses a custom app title name for application",args:{name:"title"}},{name:"--skip-install",description:"Skips dependencies installation step",icon:"\u23ED\uFE0F"},{name:["-h","--help"],description:"Output usage information"}],args:{name:"projectName"}},{description:"Uninstall and unlink native dependencies",name:"uninstall",options:[{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName"}},{description:"Starts the webserver",name:"start",options:[{name:"--port",description:"Port on which to listen to",args:{name:"free port"}},{name:"--host",description:"Change the default host",args:{name:"new host"}},{name:"--projectRoot",description:"Path to a custom project root",args:{name:"path",template:"folders"}},{name:"--watchFolders",description:"Specify any additional folders to be added to the watch list",args:{template:"folders",name:"folders"}},{name:"--assetPlugins",description:"Specify any additional asset plugins to be used by the packager by full filepath",args:{template:"folders",name:"plugins"}},{name:"--sourceExts",description:"Specify any additional source extensions to be used by the packager",args:{name:"sourceExts",suggestions:[{name:"js"},{name:"css"},{name:"png"},{name:"xml"}]}},{name:"--max-workers",description:"Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine",args:{name:"Number of workers",generators:J}},{name:"--transformer",description:"Specify a custom transformer to be used",args:{name:"transformer"}},{name:["--reset-cache","--resetCache"],description:"Removes cached files"},{name:["--custom-log-reporter-path","--customLogReporterPath"],description:"Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter",args:{name:"logFile",generators:M}},{name:"--verbose",icon:"\u{1F50A}",description:"Enables logging"},{name:"--https",icon:"\u{1F310}",description:"Enables https connections to the server"},{name:"--key",description:"Path to custom SSL key",args:{template:"filepaths",name:"path"}},{name:"--cert",description:"Path to custom SSL cert",args:{template:"filepaths",name:"path"}},{name:"--config",icon:"\u{1F6E0}",description:"Path to the CLI configuration file",args:{name:"string"}},{name:"--no-interactive",description:"Disables interactive mode"},{name:["-h","--help"],description:"Output usage information"}]},{description:'Builds javascript as a "Random Access Module" bundle for offline use',name:"ram-bundle",options:[{name:"--entry-file",description:"Path to the root JS file, either absolute or relative to JS root",args:{name:"file",generators:M}},{name:"--platform",description:'Either "ios" or "android" (default: "ios")',args:{name:"platform",suggestions:[{name:"android",icon:R},{name:"ios",icon:G}]}},{name:"--transformer",description:"Specify a custom transformer to be used",args:{name:"transformer"}},{name:"--dev",description:"If false, warnings are disabled and the bundle is minified (default: true)",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--minify",description:"Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes",args:{name:"boolean",isOptional:!0,suggestions:[{name:"true",icon:"\u2705"},{name:"false",icon:"\u274C"}]}},{name:"--bundle-output",description:"File name where to store the resulting bundle, ex. /tmp/groups.bundle",args:{name:"output file"}},{name:"--bundle-encoding",description:'Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: "utf8")',args:{name:"encoding",suggestions:[{name:"utf8"},{name:"utf16le"},{name:"latin1"}]}},{name:"--max-workers",description:"Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine",args:{name:"Number of workers",generators:J}},{name:"--sourcemap-output",description:"File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map",args:{name:"sourcemap-output"}},{name:"--sourcemap-sources-root",description:"Path to make sourcemap's sources entries relative to, ex. /root/dir",args:{template:"folders",name:"root"}},{name:"--sourcemap-use-absolute-path",description:"Report SourceMapURL using its full path"},{name:"--assets-dest",description:"Directory name where to store assets referenced in the bundle",args:{name:"directory",template:"folders"}},{name:"--unstable-transform-profile",description:"Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default",args:{name:"transform-profile",suggestions:[{name:"hermes",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"hermes-canary",icon:"https://reactnative.dev/docs/assets/HermesLogo.svg"},{name:"default"}]}},{name:"--reset-cache",description:"Removes cached files"},{name:"--read-global-cache",description:"Try to fetch transformed JS code from the global cache, if configured"},{name:"--config",icon:"\u{1F6E0}",description:"Path to the CLI configuration file",args:{name:"string"}},{name:"--indexed-ram-bundle",description:'Force the "Indexed RAM" bundle file format, even when building for android'},{name:["-h","--help"],description:"Output usage information"}]},{description:"Links assets and optionally native modules",name:"link",options:[{name:"--platforms",description:"Scope linking to specified platforms",args:{name:"list",isOptional:!0}},{name:"--all",description:"Link all native modules and assets"},{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName",isOptional:!0}},{description:"Upgrade your app's template files to the specified or latest npm version using `rn-diff-purge` project. Only valid semver versions are allowed",name:"upgrade",options:[{name:["-h","--help"],description:"Output usage information"}],args:{name:"version",isOptional:!0}},{description:"Get relevant version info about OS, toolchain and libraries",name:"info",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Install and link native dependencies",name:"install",options:[{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName"}},{description:"Print CLI configuration",icon:"\u{1F6E0}",name:"config",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Unlink native dependency",name:"unlink",options:[{name:"--platforms",description:"Scope unlinking to specified platforms",args:{name:"list",isOptional:!0}},{name:["-h","--help"],description:"Output usage information"}],args:{name:"packageName"}},{description:"Starts iOS device syslog tail",name:"log-ios",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Pull and convert a Hermes tracing profile to Chrome tracing profile, then store it in the directory <destinationDir> of the local machine",name:"profile-hermes",options:[{name:"--filename",description:"File name of the profile to be downloaded, eg. sampling-profiler-trace8593107139682635366.cpuprofile",args:{template:"filepaths",name:"profile"}},{name:"--raw",description:"Pulls the original Hermes tracing profile without any transformation"},{name:"--sourcemap-path",description:"The local path to your source map file, eg. /tmp/sourcemap.json",args:{name:"sourcemap-path",template:"filepaths"}},{name:"--generate-sourcemap",description:"Generates the JS bundle and source map"},{name:"--port",description:'Default: "8081"',args:{name:"free port"}},{name:["-h","--help"],description:"Output usage information"}],args:{name:"destinationDir",template:"folders",isOptional:!0}},{description:"Starts logkitty",name:"log-android",options:[{name:["-h","--help"],description:"Output usage information"}]},{description:"Builds your app and starts it on a connected Android emulator or device",name:"run-android",options:[{name:"--root",description:'[DEPRECATED - root is discovered automatically] Override the root directory for the android build (which contains the android directory) (default: "")',args:{name:"root",template:"folders"}},{name:"--variant",description:`Specify your app's build variant (default: "debug")`,args:{name:"variant",suggestions:[{name:"debug"},{name:"release"}]}},{name:"--appFolder",description:'[DEPRECATED \u2013 use "project.android.appName" in react-native.config.js] Specify a different application folder name for the android source. If not, we assume is "app"',args:{template:"folders",name:"string"}},{name:"--appId",description:'Specify an applicationId to launch after build. If not specified, `package` from AndroidManifest.xml will be used. (default: "")',args:{name:"appId"}},{name:"--appIdSuffix",description:'Specify an applicationIdSuffix to launch after build. (default: "")',args:{name:"appIdSuffix"}},{name:"--main-activity",description:'Name of the activity to start (default: "MainActivity")',args:{name:"main activity"}},{name:"--deviceId",icon:R,description:'Builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line)',args:{name:"deviceId",generators:De}},{name:"--no-packager",description:"Do not launch packager while building"},{name:"--port",description:"Default: 8081",args:{name:"free port"}},{name:"--terminal",description:'Launches the Metro Bundler in a new window using the specified terminal path. (default: "Apple_Terminal")',args:{name:"terminal path"}},{name:"--tasks",description:`Run custom Gradle tasks. By default it's "installDebug"`,icon:Te,args:{name:"task list",generators:Ne}},{name:"--no-jetifier",description:`Do not run "jetifier" \u2013 the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier`},{name:["-h","--help"],description:"Output usage information"}]},{description:"Builds your app and starts it on iOS simulator",name:"run-ios",options:[{name:"--simulator",description:'Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: "iPhone 6 (10.0)" (default: "iPhone 12")',args:{name:"simulator",generators:Ee}},{name:"--configuration",icon:"\u{1F6E0}",description:'Explicitly set the scheme configuration to use (default: "Debug")',args:{name:"config scheme",generators:Ae}},{name:"--scheme",description:"Explicitly set Xcode scheme to use",args:{name:"scheme",generators:Pe}},{name:"--project-path",description:'Path relative to project root where the Xcode project (.xcodeproj) lives. (default: "ios")',args:{template:"folders",name:"path"}},{name:"--device",description:"Explicitly set device to use by name",args:{name:"device name",isOptional:!0,generators:Re}},{name:"--udid",description:"Explicitly set device to use by udid",args:{name:"udid",generators:Le}},{name:"--no-packager",description:"Do not launch packager while building"},{name:"--verbose",icon:"\u{1F50A}",description:"Do not use xcpretty even if installed"},{name:"--port",description:"Default: 8081",args:{name:"free port"}},{name:"--terminal",description:'Launches the Metro Bundler in a new window using the specified terminal path. (default: "Apple_Terminal")',args:{name:"terminal path"}},{name:["-h","--help"],description:"Output usage information"}]}],options:[{name:"--version",description:"Print CLI version"},{name:"--verbose",icon:"\u{1F50A}",description:"Increase logging verbosity"},{name:["-h","--help"],description:"Output usage information"}]},qe=Ce;export{qe as default};
|
package/build/robot.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ee=Object.create;var z=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),W=[];for(let E of Z)if(E){let V=E.endsWith("/")?"folders":"filepaths";(V==="filepaths"&&u!=="only"||V==="folders"&&u!=="never")&&W.push({type:V==="filepaths"?"file":"folder",name:E,insertValue:E,isDangerous:b,context:{templateType:V}})}return S(h(W))}catch{return[]}})}}y.folders=Object.assign(()=>D({showFolders:"only"}),Object.freeze(D({showFolders:"only"})));y.filepaths=Object.assign(D,Object.freeze(D()))});var B=I(_=>{"use strict";var F=_&&_.__awaiter||function(e,t,n,i){function s(o){return o instanceof n?o:new n(function(r){r(o)})}return new(n||(n=Promise))(function(o,r){function l(a){try{c(i.next(a))}catch(d){r(d)}}function u(a){try{c(i.throw(a))}catch(d){r(d)}}function c(a){a.done?o(a.value):s(a.value).then(l,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(_,"__esModule",{value:!0});_.keyValueList=_.keyValue=_.valueList=void 0;var H=new Map;function j(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function K(e,t,n){return F(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return j(t,i)}if(typeof e[0]=="string"){let i=e.map(s=>({name:s}));return j(t,i)}return j(t,e)})}function L(e,t,n,i){return F(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let s=H.get(e);return s===void 0&&(s=yield K(e,t,i),H.set(e,s)),s}return K(e,t,i)})}function U(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function M(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function C(e,t){let n=new Set(e);return t.filter(i=>{var s;return typeof i.name=="string"?!n.has(i.name):!(!((s=i.name)===null||s===void 0)&&s.some(o=>n.has(o)))})}function me({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:s=!1}){return{trigger:(o,r)=>o.lastIndexOf(e)!==r.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>F(this,void 0,void 0,function*(){var r;let l=yield L(t,i?e:"",n,o);if(s)return l;let[u]=o,c=(r=u[u.length-1])===null||r===void 0?void 0:r.split(e);return C(c,l)})}}_.valueList=me;function fe({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:s=!0}){return{trigger:(o,r)=>o.indexOf(e)!==r.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>F(this,void 0,void 0,function*(){let[r]=o,u=!r[r.length-1].includes(e),c=u?t:n,a=U(u,i);return L(c,u&&s?e:"",a,o)})}}_.keyValue=fe;function ge({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:s=!1,insertSeparator:o=!0,insertDelimiter:r=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,a)=>{let d=M(c,e,t),h=M(a,e,t);return d!==h},getQueryTerm:c=>{let a=M(c,e,t);return c.slice(a+1)},custom:(...c)=>F(this,void 0,void 0,function*(){let[a]=c,d=a[a.length-1],h=M(d,e,t),S=h===-1||d.slice(h,h+e.length)!==e,m=S?n:i,g=U(S,s),p=yield L(m,S?o?e:"":r?t:"",g,c);if(S){if(l)return p;let x=d.split(t).map(f=>f.slice(0,f.indexOf(e)));return C(x,p)}if(u)return p;let b=d.split(t).map(x=>x.slice(x.indexOf(e)+e.length));return C(b,p)})}}_.keyValueList=ge});var X=I(k=>{"use strict";var he=k&&k.__awaiter||function(e,t,n,i){function s(o){return o instanceof n?o:new n(function(r){r(o)})}return new(n||(n=Promise))(function(o,r){function l(a){try{c(i.next(a))}catch(d){r(d)}}function u(a){try{c(i.throw(a))}catch(d){r(d)}}function c(a){a.done?o(a.value):s(a.value).then(l,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(k,"__esModule",{value:!0});k.ai=void 0;var ye=4097,ve=4,be=.8,we=ye*ve*be;function xe({name:e,prompt:t,message:n,postProcess:i,temperature:s,splitOn:o}){return{scriptTimeout:15e3,custom:(r,l,u)=>he(this,void 0,void 0,function*(){var c,a;let d=yield l({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let h=typeof t=="function"?yield t({tokens:r,executeCommand:l,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:r,executeCommand:l,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let m=we-((c=h?.length)!==null&&c!==void 0?c:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...h?[{role:"system",content:h}]:[],{role:"user",content:S.slice(0,m)}],temperature:s},w=JSON.stringify(g),p=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),b=JSON.parse(p.stdout);return(a=b?.choices.map(f=>{var O;return(O=f?.message)===null||O===void 0?void 0:O.content}).filter(f=>typeof f=="string").flatMap(f=>o?f.split(o).filter(O=>O.trim().length>0):[f]).map(f=>{if(i)return i(f);let O=f.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:O,insertValue:`'${O}'`,description:"Generated by Fig AI"}}))!==null&&a!==void 0?a:[]})}}k.ai=xe});var J=I(v=>{"use strict";var Se=v&&v.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),Oe=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Se(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var Y=q();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return Y.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return Y.folders}});Oe(B(),v);var _e=X();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return _e.ai}})});var A=re(J(),1),T={script:["bash","-c",'for i in $(find -E . -regex ".*.robot" -type f); do cat -s $i ; done'],postProcess:e=>{let t=e.matchAll(/(?:^\s\s+\[Tags\])\s\s+(\w+ *)*(?!.\#.*)/gm),n=new Set,i=[];for(let[s]of t)for(let o of s.trim().substring(6).trim().split(/\s\s+/))n.has(o)||(n.add(o),i.push({name:o,description:"Tag",icon:"\u{1F3F7}"}));return i}},Te={trigger:":",custom:async(e,t)=>{if(!!e[e.length-1].includes(":"))return[];let{stdout:s}=await t({command:"bash",args:["-c",'for i in $(find -E . -regex ".*.(robot|resource)" -type f); do cat -s $i ; done']});return[...s.matchAll(/^\$\{(.*?)\}/gm)].map(r=>r[1]).map(r=>({name:r,description:"Variable"}))}},Q={script:["bash","-c",'for i in $(find -E . -regex ".*.robot" -type f); do cat -s $i ; done'],postProcess:e=>{let t=e.matchAll(/(?:\*{3} ?Test Cases ?\*{3})([\S\s]*)(?:\*{3}(\w+\s?)+\*{3})*/gim),n=new Set,i=[];for(let[s,o]of t){let r=o.matchAll(/^(\w+( |-)*)+(?!.\#.*)(?!.\#.*)/gm);for(let[l]of r)l=l.trim(),l.search(/\s\s+/)==-1&&(n.has(l)||(n.add(l),i.push({name:l,description:"Test case"})))}return i}},Ne={name:"robot",description:"CLI for running Robot Framework automation tests",args:{name:"robot script",isScript:!0,isVariadic:!0,generators:(0,A.filepaths)({extensions:["robot"],editFileSuggestions:{priority:76,icon:"fig://icon?type=txt"}})},options:[{name:["-h","-?","--help"],description:"Print usage instructions"},{name:"--rpa",description:'Turn on the generic automation mode. Mainly affects terminology so that "test" is replaced with "task" in logs and reports'},{name:["-F","--extension"],description:"Parse only files with this extension when executing a directory",args:{name:"extension",description:"File extensions divided by colon",suggestions:["txt","robot:txt"]}},{name:["-N","--name"],description:"Set a name of the top level suite",args:{name:"name"}},{name:["-D","--doc"],insertValue:"-D '{cursor}'",description:"Set a documentation of the top level suite"},{name:["-M","--metadata"],insertValue:"-M {cursor}:",description:"Set metadata of the top level suite",args:{name:"name:value"}},{name:["-G","--settag"],description:"Sets given tag to all executed tests",args:{name:"tag"}},{name:["-t","--test"],description:"Select tests by name or by long name containing also parent suite name like `Parent.Test`",args:{name:"name",generators:Q}},{name:"--task",description:"Alias to --test. Especially applicable with --rpa",args:{name:"name",generators:Q}},{name:["-s","--suite"],description:"Select suites by name",args:{name:"name"}},{name:["-i","--include"],description:"Select test cases by tag",args:{name:"tag",generators:T}},{name:["-e","--exclude"],description:"Select test cases not to run by tag",args:{name:"tag",generators:T}},{name:["-R","--rerunfailed"],description:"Select failed tests from an earlier output file to be re-executed",args:{name:"output file",generators:(0,A.filepaths)({extensions:["xml"]})}},{name:["-S","--rerunfailedsuites"],description:"Select failed suites from an earlier output file to be re-executed",args:{name:"output file",generators:(0,A.filepaths)({extensions:["xml"]})}},{name:"--runemptysuite",description:"Executes suite even if it contains no tests"},{name:"--skip",description:"Tests having given tag will be skipped",args:{name:"tag",generators:T}},{name:"--skiponfailure",description:"Tests having given tag will be skipped if they fail",args:{name:"tag",generators:T}},{name:["-v","--variable"],description:"Set variables in the test data",args:{name:"variable",generators:Te}},{name:["-V","--variablefile"],description:"Python or YAML file file to read variables from",args:{name:"file",generators:(0,A.filepaths)({extensions:["py","yaml"]})}},{name:["-d","--outputdir"],description:"Where to create output files. The default is the directory where tests are run from",args:{name:"directory",template:"folders"}},{name:["-o","--output"],description:"XML output file relative to --outputdir unless given as an absolute path. Default: output.xml",args:{name:"file",suggestions:["output.xml"]}},{name:["-l","--log"],description:"HTML log file. Can be disabled by giving a special value `NONE`. Default: log.html",args:{name:"file",suggestions:["log.html","NONE"]}},{name:["-r","--report"],description:"HTML report file. Can be disabled with `NONE` similarly as --log. Default: report.html",args:{name:"file",suggestions:["report.html","NONE"]}},{name:["-x","--xunit"],description:"XUnit compatible result file. Not created unless this option is specified",args:{name:"file",suggestions:["xunit.xml"]}},{name:["-b","--debugfile"],description:"Debug file written during execution. Not created unless this option is specified",args:{name:"file"}},{name:["-T","--timestampoutputs"],description:"Adds timestamp in a format `YYYYMMDD-hhmmss` to all generated output files between their basename and extension"},{name:"--splitlog",description:"Split the log file into smaller pieces that open in browsers transparently"},{name:"--logtitle",description:"Title for the generated log file. The default title is `<SuiteName> Log.`",args:{name:"title"}},{name:"--reporttitle",description:"Title for the generated report file. The default title is `<SuiteName> Report`",args:{name:"title"}},{name:"--reportbackground",description:"Background colors to use in the report file. Given in format `passed:failed:skipped` where the `:skipped` part can be omitted",args:{name:"colors"}},{name:"--maxerrorlines",description:"Maximum number of error message lines to show in report when tests fail. Default is 40, minimum is 10 and `NONE` can be used to show the full message",args:{name:"lines",suggestions:[{name:"40",displayName:"40 (default)",priority:76,description:"Default number of lines"},{name:"10",displayName:"10 (minimum)",description:"Minimum number of lines"},{name:"NONE",description:"Unlimited number of lines. Shows the full message"}]}},{name:"--maxassignlength",description:"Maximum number of characters to show in log when variables are assigned. Zero or negative values can be used to avoid showing assigned values at all. Default is 200",args:{name:"characters",suggestions:[{name:"200",displayName:"200 (default)",priority:76,description:"Default number of characters"},{name:"0",description:"No values at all"}]}},{name:["-L","--loglevel"],description:"Threshold level for logging",args:{name:"level",suggestions:[{name:"TRACE",type:"option"},{name:"DEBUG",type:"option"},{name:"INFO",displayName:"INFO (default)",priority:76,type:"option"},{name:"WARN",type:"option"},{name:"NONE",displayName:"NONE (no logging)",type:"option"}]}},{name:"--suitestatlevel",description:"How many levels to show in `Statistics by Suite` in log and report",args:{name:"level"}},{name:"--tagstatinclude",description:"Include only matching tags in `Statistics by Tag` in log and report",args:{name:"tag",generators:T}},{name:"--tagstatexclude",description:"Exclude matching tags from `Statistics by Tag`",args:{name:"tag",generators:T}},{name:"--tagstatcombine",description:"Create combined statistics based on tags. These statistics are added into `Statistics by Tag`",args:{name:"tags:name",generators:T}},{name:"--tagdoc",description:"Add documentation to tags matching the given pattern",args:{name:"pattern:doc",generators:T}},{name:"--tagstatlink",description:"Add external links into `Statistics by Tag`. Pattern can use `*`, `?` and `[]` as wildcards",args:{name:"pattern:link:title",generators:T}},{name:"--expandkeywords",description:"Matching keywords will be automatically expanded in the log file",args:{name:"pattern",suggestions:[{name:"name:<pattern>",insertValue:"name:{cursor}",type:"option"},{name:"tag:<pattern>",insertValue:"tag:{cursor}",type:"option"}]}},{name:"--removekeywords",description:"Remove keyword data from the generated log file",args:{name:"pattern",suggestions:[{name:"all",description:"Remove data from all keywords",type:"option"},{name:"passed",description:"Remove data only from keywords in passed test cases and suites",type:"option"},{name:"for",description:"Remove passed iterations from for loops",type:"option"},{name:"while",description:"Remove passed iterations from while loops",type:"option"},{name:"wuks",description:"Remove all but the last failing keyword inside `BuiltIn.Wait Until Keyword Succeeds`",type:"option"},{name:"name:<pattern>",insertValue:"name:{cursor}",type:"option"},{name:"tag:<pattern>",insertValue:"tag:{cursor}",type:"option"}]}},{name:"--flattenkeywords",description:"Flattens matching keywords in the generated log file",args:{name:"pattern",suggestions:[{name:"for",description:"Flatten FOR loops fully",type:"option"},{name:"while",description:"Flatten WHILE loops fully",type:"option"},{name:"iteration",description:"Flatten FOR/WHILE loop iterations",type:"option"},{name:"name:<pattern>",insertValue:"name:{cursor}",type:"option"},{name:"tag:<pattern>",insertValue:"tag:{cursor}",type:"option"}]}},{name:"--listener",description:"A class for monitoring test execution. Gets notifications e.g. when tests start and end",args:{name:"class"}},{name:"--nostatusrc",description:"Sets the return code to zero regardless of failures in test cases. Error codes are returned normally"},{name:"--dryrun",description:"Sets the return code to zero regardless of failures in test cases. Error codes are returned normally"},{name:["-X","--exitonfailure"],description:"Stops test execution if any test fails"},{name:"--exitonerror",description:"Stops test execution if any error occurs when parsing test data, importing libraries, and so on"},{name:"--skipteardownonexit",description:"Causes teardowns to be skipped if test execution is stopped prematurely"},{name:"--randomize",description:"Randomizes the test execution order",args:{name:"type",suggestions:[{name:"all",description:"Randomizes both suites and tests",type:"option"},{name:"suites",description:"Randomizes suites",type:"option"},{name:"tests",description:"Randomizes tests",type:"option"},{name:"none",displayName:"none (default)",priority:76,description:"No randomization (default)",type:"option"}]}},{name:"--prerunmodifier",description:"Class to programmatically modify the suite structure before execution",args:{name:"class"}},{name:"--prerebotmodifier",description:"Class to programmatically modify the result model before creating reports and logs",args:{name:"class"}},{name:"--console",description:"How to report execution on the console",args:{name:"type",suggestions:[{name:"verbose",displayName:"verbose (default)",priority:76,description:"Report every suite and test (default)",type:"option"},{name:"dotted",description:"Only show `.` for passed test, `s` for skipped tests, and `F` for failed tests",type:"option"},{name:"quiet",description:"No output except for errors and warnings",type:"option"},{name:"none",description:"No output whatsoever",type:"option"}]}},{name:["-.","--dotted"],description:"Shortcut for `--console dotted`"},{name:"--quiet",description:"Shortcut for `--console quiet`"},{name:["-W","--consolewidth"],description:"Width of the console output. Default is 78",args:{name:"chars",suggestions:[{name:"78",displayName:"78 (default)",priority:76}]}},{name:["-C","--consolecolors"],description:"Use colors on console output or not",args:{name:"option",suggestions:[{name:"auto",displayName:"auto (default)",priority:76,description:"Use colors when output not redirected (default)",type:"option"},{name:"on",description:"Always use colors",type:"option"},{name:"ansi",description:"Like `on` but use ANSI colors also on Windows",type:"option"},{name:"off",description:"Disable colors altogether",type:"option"}]}},{name:["-K","--consolemarkers"],description:"Show markers on the console when top level keywords in a test case end",args:{name:"option",suggestions:[{name:"auto",type:"option"},{name:"on",type:"option"},{name:"off",type:"option"}]}},{name:["-P","--pythonpath"],description:"Additional locations (directories, ZIPs) where to search libraries and other extensions when they are imported",args:{name:"path",generators:(0,A.filepaths)({extensions:["zip"]})}},{name:["-A","--argumentfile"],description:"Text file to read more arguments from. Use special path `STDIN` to read contents from the standard input stream",args:{name:"path",template:"filepaths"}},{name:"--version",description:"Print version information"}]},De=Ne;export{De as default};
|
|
1
|
+
var ee=Object.create;var z=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ne(t))!se.call(e,s)&&s!==n&&z(e,s,{get:()=>t[s],enumerable:!(i=te(t,s))||i.enumerable});return e};var re=(e,t,n)=>(n=e!=null?ee(ie(e)):{},oe(t||!e||!e.__esModule?z(n,"default",{value:e,enumerable:!0}):n,e));var $=k(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.shellExpand=N.ensureTrailingSlash=void 0;var ae=e=>e.endsWith("/")?e:`${e}/`;N.ensureTrailingSlash=ae;var le=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ce=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,s=>{var o;let r=s.slice(1);return(o=t[r])!==null&&o!==void 0?o:s}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(s,o,r)=>{var l,u;return(u=(l=t[o])!==null&&l!==void 0?l:r)!==null&&u!==void 0?u:s}),ue=(e,t)=>{var n;let{environmentVariables:i}=t;return ce(le(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};N.shellExpand=ue});var q=k(b=>{"use strict";var de=b&&b.__awaiter||function(e,t,n,i){function s(o){return o instanceof n?o:new n(function(r){r(o)})}return new(n||(n=Promise))(function(o,r){function l(a){try{c(i.next(a))}catch(d){r(d)}}function u(a){try{c(i.throw(a))}catch(d){r(d)}}function c(a){a.done?o(a.value):s(a.value).then(l,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=G;var R=$();function G(e,t=[]){let n=t.map(s=>s.toLowerCase()),i=e.filter(s=>!n.includes(s.toLowerCase()));return[...i.filter(s=>!s.startsWith(".")).sort((s,o)=>s.localeCompare(o)),...i.filter(s=>s.startsWith(".")).sort((s,o)=>s.localeCompare(o)),"../"]}var pe=(e,t,n)=>{if(e===null)return"/";let i=(0,R.shellExpand)(t,n),s=i.slice(0,i.lastIndexOf("/")+1);return s===""?(0,R.ensureTrailingSlash)(e):s.startsWith("/")?s:`${(0,R.ensureTrailingSlash)(e)}${s}`};b.getCurrentInsertedDirectory=pe;function M(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:s=!1,editFileSuggestions:o,editFolderSuggestions:r,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),a=new Set(n),d=()=>t.length>0||n.length>0||i,h=(m=[])=>d()?m.filter(({name:g="",type:w})=>{if(!s&&w==="folder"||a.has(g)||i&&g.match(i))return!0;let[,...p]=g.split(".");if(p.length>=1){let v=p.length-1,x=p[v];do{if(c.has(x))return!0;v-=1,x=[p[v],x].join(".")}while(v>=0)}return!1}):m,S=(m=[])=>!o&&!r?m:m.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:r)||{}));return{trigger:(m,g)=>{let w=m.lastIndexOf("/"),p=g.lastIndexOf("/");return w!==p?!0:w===-1&&p===-1?!1:m.slice(0,w)!==g.slice(0,p)},getQueryTerm:m=>m.slice(m.lastIndexOf("/")+1),custom:(m,g,w)=>de(this,void 0,void 0,function*(){var p;let{isDangerous:v,currentWorkingDirectory:x,searchTerm:f}=w,O=(p=(0,b.getCurrentInsertedDirectory)(l??x,f,w))!==null&&p!==void 0?p:"/";try{let P=yield g({command:"ls",args:["-1ApL"],cwd:O}),Z=G(P.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),W=[];for(let E of Z)if(E){let D=E.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&u!=="only"||D==="folders"&&u!=="never")&&W.push({type:D==="filepaths"?"file":"folder",name:E,insertValue:E,isDangerous:v,context:{templateType:D}})}return S(h(W))}catch{return[]}})}}b.folders=Object.assign(()=>M({showFolders:"only"}),Object.freeze(M({showFolders:"only"})));b.filepaths=Object.assign(M,Object.freeze(M()))});var B=k(T=>{"use strict";var A=T&&T.__awaiter||function(e,t,n,i){function s(o){return o instanceof n?o:new n(function(r){r(o)})}return new(n||(n=Promise))(function(o,r){function l(a){try{c(i.next(a))}catch(d){r(d)}}function u(a){try{c(i.throw(a))}catch(d){r(d)}}function c(a){a.done?o(a.value):s(a.value).then(l,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.valueList=me;T.keyValue=fe;T.keyValueList=ge;var H=new Map;function j(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function K(e,t,n){return A(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return j(t,i)}if(typeof e[0]=="string"){let i=e.map(s=>({name:s}));return j(t,i)}return j(t,e)})}function L(e,t,n,i){return A(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let s=H.get(e);return s===void 0&&(s=yield K(e,t,i),H.set(e,s)),s}return K(e,t,i)})}function U(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function V(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function C(e,t){let n=new Set(e);return t.filter(i=>{var s;return typeof i.name=="string"?!n.has(i.name):!(!((s=i.name)===null||s===void 0)&&s.some(o=>n.has(o)))})}function me({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:s=!1}){return{trigger:(o,r)=>o.lastIndexOf(e)!==r.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>A(this,void 0,void 0,function*(){var r;let l=yield L(t,i?e:"",n,o);if(s)return l;let[u]=o,c=(r=u[u.length-1])===null||r===void 0?void 0:r.split(e);return C(c,l)})}}function fe({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:s=!0}){return{trigger:(o,r)=>o.indexOf(e)!==r.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>A(this,void 0,void 0,function*(){let[r]=o,u=!r[r.length-1].includes(e),c=u?t:n,a=U(u,i);return L(c,u&&s?e:"",a,o)})}}function ge({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:s=!1,insertSeparator:o=!0,insertDelimiter:r=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,a)=>{let d=V(c,e,t),h=V(a,e,t);return d!==h},getQueryTerm:c=>{let a=V(c,e,t);return c.slice(a+1)},custom:(...c)=>A(this,void 0,void 0,function*(){let[a]=c,d=a[a.length-1],h=V(d,e,t),S=h===-1||d.slice(h,h+e.length)!==e,m=S?n:i,g=U(S,s),p=yield L(m,S?o?e:"":r?t:"",g,c);if(S){if(l)return p;let x=d.split(t).map(f=>f.slice(0,f.indexOf(e)));return C(x,p)}if(u)return p;let v=d.split(t).map(x=>x.slice(x.indexOf(e)+e.length));return C(v,p)})}}});var X=k(F=>{"use strict";var he=F&&F.__awaiter||function(e,t,n,i){function s(o){return o instanceof n?o:new n(function(r){r(o)})}return new(n||(n=Promise))(function(o,r){function l(a){try{c(i.next(a))}catch(d){r(d)}}function u(a){try{c(i.throw(a))}catch(d){r(d)}}function c(a){a.done?o(a.value):s(a.value).then(l,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0});F.ai=xe;var ye=4097,ve=4,be=.8,we=ye*ve*be;function xe({name:e,prompt:t,message:n,postProcess:i,temperature:s,splitOn:o}){return{scriptTimeout:15e3,custom:(r,l,u)=>he(this,void 0,void 0,function*(){var c,a;let d=yield l({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let h=typeof t=="function"?yield t({tokens:r,executeCommand:l,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:r,executeCommand:l,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let m=we-((c=h?.length)!==null&&c!==void 0?c:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...h?[{role:"system",content:h}]:[],{role:"user",content:S.slice(0,m)}],temperature:s},w=JSON.stringify(g),p=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),v=JSON.parse(p.stdout);return(a=v?.choices.map(f=>{var O;return(O=f?.message)===null||O===void 0?void 0:O.content}).filter(f=>typeof f=="string").flatMap(f=>o?f.split(o).filter(O=>O.trim().length>0):[f]).map(f=>{if(i)return i(f);let O=f.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:O,insertValue:`'${O}'`,description:"Generated by Fig AI"}}))!==null&&a!==void 0?a:[]})}}});var J=k(y=>{"use strict";var Se=y&&y.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),Oe=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Se(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var Y=q();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return Y.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return Y.folders}});Oe(B(),y);var _e=X();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return _e.ai}})});var I=re(J(),1),_={script:["bash","-c",'for i in $(find -E . -regex ".*.robot" -type f); do cat -s $i ; done'],postProcess:e=>{let t=e.matchAll(/(?:^\s\s+\[Tags\])\s\s+(\w+ *)*(?!.\#.*)/gm),n=new Set,i=[];for(let[s]of t)for(let o of s.trim().substring(6).trim().split(/\s\s+/))n.has(o)||(n.add(o),i.push({name:o,description:"Tag",icon:"\u{1F3F7}"}));return i}},Te={trigger:":",custom:async(e,t)=>{if(!!e[e.length-1].includes(":"))return[];let{stdout:s}=await t({command:"bash",args:["-c",'for i in $(find -E . -regex ".*.(robot|resource)" -type f); do cat -s $i ; done']});return[...s.matchAll(/^\$\{(.*?)\}/gm)].map(r=>r[1]).map(r=>({name:r,description:"Variable"}))}},Q={script:["bash","-c",'for i in $(find -E . -regex ".*.robot" -type f); do cat -s $i ; done'],postProcess:e=>{let t=e.matchAll(/(?:\*{3} ?Test Cases ?\*{3})([\S\s]*)(?:\*{3}(\w+\s?)+\*{3})*/gim),n=new Set,i=[];for(let[s,o]of t){let r=o.matchAll(/^(\w+( |-)*)+(?!.\#.*)(?!.\#.*)/gm);for(let[l]of r)l=l.trim(),l.search(/\s\s+/)==-1&&(n.has(l)||(n.add(l),i.push({name:l,description:"Test case"})))}return i}},Ne={name:"robot",description:"CLI for running Robot Framework automation tests",args:{name:"robot script",isScript:!0,isVariadic:!0,generators:(0,I.filepaths)({extensions:["robot"],editFileSuggestions:{priority:76,icon:"fig://icon?type=txt"}})},options:[{name:["-h","-?","--help"],description:"Print usage instructions"},{name:"--rpa",description:'Turn on the generic automation mode. Mainly affects terminology so that "test" is replaced with "task" in logs and reports'},{name:["-F","--extension"],description:"Parse only files with this extension when executing a directory",args:{name:"extension",description:"File extensions divided by colon",suggestions:["txt","robot:txt"]}},{name:["-N","--name"],description:"Set a name of the top level suite",args:{name:"name"}},{name:["-D","--doc"],insertValue:"-D '{cursor}'",description:"Set a documentation of the top level suite"},{name:["-M","--metadata"],insertValue:"-M {cursor}:",description:"Set metadata of the top level suite",args:{name:"name:value"}},{name:["-G","--settag"],description:"Sets given tag to all executed tests",args:{name:"tag"}},{name:["-t","--test"],description:"Select tests by name or by long name containing also parent suite name like `Parent.Test`",args:{name:"name",generators:Q}},{name:"--task",description:"Alias to --test. Especially applicable with --rpa",args:{name:"name",generators:Q}},{name:["-s","--suite"],description:"Select suites by name",args:{name:"name"}},{name:["-i","--include"],description:"Select test cases by tag",args:{name:"tag",generators:_}},{name:["-e","--exclude"],description:"Select test cases not to run by tag",args:{name:"tag",generators:_}},{name:["-R","--rerunfailed"],description:"Select failed tests from an earlier output file to be re-executed",args:{name:"output file",generators:(0,I.filepaths)({extensions:["xml"]})}},{name:["-S","--rerunfailedsuites"],description:"Select failed suites from an earlier output file to be re-executed",args:{name:"output file",generators:(0,I.filepaths)({extensions:["xml"]})}},{name:"--runemptysuite",description:"Executes suite even if it contains no tests"},{name:"--skip",description:"Tests having given tag will be skipped",args:{name:"tag",generators:_}},{name:"--skiponfailure",description:"Tests having given tag will be skipped if they fail",args:{name:"tag",generators:_}},{name:["-v","--variable"],description:"Set variables in the test data",args:{name:"variable",generators:Te}},{name:["-V","--variablefile"],description:"Python or YAML file file to read variables from",args:{name:"file",generators:(0,I.filepaths)({extensions:["py","yaml"]})}},{name:["-d","--outputdir"],description:"Where to create output files. The default is the directory where tests are run from",args:{name:"directory",template:"folders"}},{name:["-o","--output"],description:"XML output file relative to --outputdir unless given as an absolute path. Default: output.xml",args:{name:"file",suggestions:["output.xml"]}},{name:["-l","--log"],description:"HTML log file. Can be disabled by giving a special value `NONE`. Default: log.html",args:{name:"file",suggestions:["log.html","NONE"]}},{name:["-r","--report"],description:"HTML report file. Can be disabled with `NONE` similarly as --log. Default: report.html",args:{name:"file",suggestions:["report.html","NONE"]}},{name:["-x","--xunit"],description:"XUnit compatible result file. Not created unless this option is specified",args:{name:"file",suggestions:["xunit.xml"]}},{name:["-b","--debugfile"],description:"Debug file written during execution. Not created unless this option is specified",args:{name:"file"}},{name:["-T","--timestampoutputs"],description:"Adds timestamp in a format `YYYYMMDD-hhmmss` to all generated output files between their basename and extension"},{name:"--splitlog",description:"Split the log file into smaller pieces that open in browsers transparently"},{name:"--logtitle",description:"Title for the generated log file. The default title is `<SuiteName> Log.`",args:{name:"title"}},{name:"--reporttitle",description:"Title for the generated report file. The default title is `<SuiteName> Report`",args:{name:"title"}},{name:"--reportbackground",description:"Background colors to use in the report file. Given in format `passed:failed:skipped` where the `:skipped` part can be omitted",args:{name:"colors"}},{name:"--maxerrorlines",description:"Maximum number of error message lines to show in report when tests fail. Default is 40, minimum is 10 and `NONE` can be used to show the full message",args:{name:"lines",suggestions:[{name:"40",displayName:"40 (default)",priority:76,description:"Default number of lines"},{name:"10",displayName:"10 (minimum)",description:"Minimum number of lines"},{name:"NONE",description:"Unlimited number of lines. Shows the full message"}]}},{name:"--maxassignlength",description:"Maximum number of characters to show in log when variables are assigned. Zero or negative values can be used to avoid showing assigned values at all. Default is 200",args:{name:"characters",suggestions:[{name:"200",displayName:"200 (default)",priority:76,description:"Default number of characters"},{name:"0",description:"No values at all"}]}},{name:["-L","--loglevel"],description:"Threshold level for logging",args:{name:"level",suggestions:[{name:"TRACE",type:"option"},{name:"DEBUG",type:"option"},{name:"INFO",displayName:"INFO (default)",priority:76,type:"option"},{name:"WARN",type:"option"},{name:"NONE",displayName:"NONE (no logging)",type:"option"}]}},{name:"--suitestatlevel",description:"How many levels to show in `Statistics by Suite` in log and report",args:{name:"level"}},{name:"--tagstatinclude",description:"Include only matching tags in `Statistics by Tag` in log and report",args:{name:"tag",generators:_}},{name:"--tagstatexclude",description:"Exclude matching tags from `Statistics by Tag`",args:{name:"tag",generators:_}},{name:"--tagstatcombine",description:"Create combined statistics based on tags. These statistics are added into `Statistics by Tag`",args:{name:"tags:name",generators:_}},{name:"--tagdoc",description:"Add documentation to tags matching the given pattern",args:{name:"pattern:doc",generators:_}},{name:"--tagstatlink",description:"Add external links into `Statistics by Tag`. Pattern can use `*`, `?` and `[]` as wildcards",args:{name:"pattern:link:title",generators:_}},{name:"--expandkeywords",description:"Matching keywords will be automatically expanded in the log file",args:{name:"pattern",suggestions:[{name:"name:<pattern>",insertValue:"name:{cursor}",type:"option"},{name:"tag:<pattern>",insertValue:"tag:{cursor}",type:"option"}]}},{name:"--removekeywords",description:"Remove keyword data from the generated log file",args:{name:"pattern",suggestions:[{name:"all",description:"Remove data from all keywords",type:"option"},{name:"passed",description:"Remove data only from keywords in passed test cases and suites",type:"option"},{name:"for",description:"Remove passed iterations from for loops",type:"option"},{name:"while",description:"Remove passed iterations from while loops",type:"option"},{name:"wuks",description:"Remove all but the last failing keyword inside `BuiltIn.Wait Until Keyword Succeeds`",type:"option"},{name:"name:<pattern>",insertValue:"name:{cursor}",type:"option"},{name:"tag:<pattern>",insertValue:"tag:{cursor}",type:"option"}]}},{name:"--flattenkeywords",description:"Flattens matching keywords in the generated log file",args:{name:"pattern",suggestions:[{name:"for",description:"Flatten FOR loops fully",type:"option"},{name:"while",description:"Flatten WHILE loops fully",type:"option"},{name:"iteration",description:"Flatten FOR/WHILE loop iterations",type:"option"},{name:"name:<pattern>",insertValue:"name:{cursor}",type:"option"},{name:"tag:<pattern>",insertValue:"tag:{cursor}",type:"option"}]}},{name:"--listener",description:"A class for monitoring test execution. Gets notifications e.g. when tests start and end",args:{name:"class"}},{name:"--nostatusrc",description:"Sets the return code to zero regardless of failures in test cases. Error codes are returned normally"},{name:"--dryrun",description:"Sets the return code to zero regardless of failures in test cases. Error codes are returned normally"},{name:["-X","--exitonfailure"],description:"Stops test execution if any test fails"},{name:"--exitonerror",description:"Stops test execution if any error occurs when parsing test data, importing libraries, and so on"},{name:"--skipteardownonexit",description:"Causes teardowns to be skipped if test execution is stopped prematurely"},{name:"--randomize",description:"Randomizes the test execution order",args:{name:"type",suggestions:[{name:"all",description:"Randomizes both suites and tests",type:"option"},{name:"suites",description:"Randomizes suites",type:"option"},{name:"tests",description:"Randomizes tests",type:"option"},{name:"none",displayName:"none (default)",priority:76,description:"No randomization (default)",type:"option"}]}},{name:"--prerunmodifier",description:"Class to programmatically modify the suite structure before execution",args:{name:"class"}},{name:"--prerebotmodifier",description:"Class to programmatically modify the result model before creating reports and logs",args:{name:"class"}},{name:"--console",description:"How to report execution on the console",args:{name:"type",suggestions:[{name:"verbose",displayName:"verbose (default)",priority:76,description:"Report every suite and test (default)",type:"option"},{name:"dotted",description:"Only show `.` for passed test, `s` for skipped tests, and `F` for failed tests",type:"option"},{name:"quiet",description:"No output except for errors and warnings",type:"option"},{name:"none",description:"No output whatsoever",type:"option"}]}},{name:["-.","--dotted"],description:"Shortcut for `--console dotted`"},{name:"--quiet",description:"Shortcut for `--console quiet`"},{name:["-W","--consolewidth"],description:"Width of the console output. Default is 78",args:{name:"chars",suggestions:[{name:"78",displayName:"78 (default)",priority:76}]}},{name:["-C","--consolecolors"],description:"Use colors on console output or not",args:{name:"option",suggestions:[{name:"auto",displayName:"auto (default)",priority:76,description:"Use colors when output not redirected (default)",type:"option"},{name:"on",description:"Always use colors",type:"option"},{name:"ansi",description:"Like `on` but use ANSI colors also on Windows",type:"option"},{name:"off",description:"Disable colors altogether",type:"option"}]}},{name:["-K","--consolemarkers"],description:"Show markers on the console when top level keywords in a test case end",args:{name:"option",suggestions:[{name:"auto",type:"option"},{name:"on",type:"option"},{name:"off",type:"option"}]}},{name:["-P","--pythonpath"],description:"Additional locations (directories, ZIPs) where to search libraries and other extensions when they are imported",args:{name:"path",generators:(0,I.filepaths)({extensions:["zip"]})}},{name:["-A","--argumentfile"],description:"Text file to read more arguments from. Use special path `STDIN` to read contents from the standard input stream",args:{name:"path",template:"filepaths"}},{name:"--version",description:"Print version information"}]},Me=Ne;export{Me as default};
|
package/build/rojo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Z=Object.create;var q=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),
|
|
1
|
+
var Z=Object.create;var q=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oe=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ee(t))!ne.call(e,r)&&r!==n&&q(e,r,{get:()=>t[r],enumerable:!(o=Y(t,r))||o.enumerable});return e};var re=(e,t,n)=>(n=e!=null?Z(te(e)):{},oe(t||!e||!e.__esModule?q(n,"default",{value:e,enumerable:!0}):n,e));var N=w(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.shellExpand=I.ensureTrailingSlash=void 0;var ie=e=>e.endsWith("/")?e:`${e}/`;I.ensureTrailingSlash=ie;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var i;let a=r.slice(1);return(i=t[a])!==null&&i!==void 0?i:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,i,a)=>{var u,c;return(c=(u=t[i])!==null&&u!==void 0?u:a)!==null&&c!==void 0?c:r}),le=(e,t)=>{var n;let{environmentVariables:o}=t;return ae(se(e,(n=o?.HOME)!==null&&n!==void 0?n:"~"),o)};I.shellExpand=le});var J=w(b=>{"use strict";var ue=b&&b.__awaiter||function(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function u(s){try{l(o.next(s))}catch(d){a(d)}}function c(s){try{l(o.throw(s))}catch(d){a(d)}}function l(s){s.done?i(s.value):r(s.value).then(u,c)}l((o=o.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=U;var E=N();function U(e,t=[]){let n=t.map(r=>r.toLowerCase()),o=e.filter(r=>!n.includes(r.toLowerCase()));return[...o.filter(r=>!r.startsWith(".")).sort((r,i)=>r.localeCompare(i)),...o.filter(r=>r.startsWith(".")).sort((r,i)=>r.localeCompare(i)),"../"]}var ce=(e,t,n)=>{if(e===null)return"/";let o=(0,E.shellExpand)(t,n),r=o.slice(0,o.lastIndexOf("/")+1);return r===""?(0,E.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,E.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=ce;function D(e={}){let{extensions:t=[],equals:n=[],matches:o,filterFolders:r=!1,editFileSuggestions:i,editFolderSuggestions:a,rootDirectory:u,showFolders:c="always"}=e,l=new Set(t),s=new Set(n),d=()=>t.length>0||n.length>0||o,g=(p=[])=>d()?p.filter(({name:m="",type:O})=>{if(!r&&O==="folder"||s.has(m)||o&&m.match(o))return!0;let[,...f]=m.split(".");if(f.length>=1){let y=f.length-1,_=f[y];do{if(l.has(_))return!0;y-=1,_=[f[y],_].join(".")}while(y>=0)}return!1}):p,x=(p=[])=>!i&&!a?p:p.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?i:a)||{}));return{trigger:(p,m)=>{let O=p.lastIndexOf("/"),f=m.lastIndexOf("/");return O!==f?!0:O===-1&&f===-1?!1:p.slice(0,O)!==m.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,m,O)=>ue(this,void 0,void 0,function*(){var f;let{isDangerous:y,currentWorkingDirectory:_,searchTerm:h}=O,j=(f=(0,b.getCurrentInsertedDirectory)(u??_,h,O))!==null&&f!==void 0?f:"/";try{let W=yield m({command:"ls",args:["-1ApL"],cwd:j}),X=U(W.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),k=[];for(let P of X)if(P){let R=P.endsWith("/")?"folders":"filepaths";(R==="filepaths"&&c!=="only"||R==="folders"&&c!=="never")&&k.push({type:R==="filepaths"?"file":"folder",name:P,insertValue:P,isDangerous:y,context:{templateType:R}})}return x(g(k))}catch{return[]}})}}b.folders=Object.assign(()=>D({showFolders:"only"}),Object.freeze(D({showFolders:"only"})));b.filepaths=Object.assign(D,Object.freeze(D()))});var B=w(S=>{"use strict";var T=S&&S.__awaiter||function(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function u(s){try{l(o.next(s))}catch(d){a(d)}}function c(s){try{l(o.throw(s))}catch(d){a(d)}}function l(s){s.done?i(s.value):r(s.value).then(u,c)}l((o=o.apply(e,t||[])).next())})};Object.defineProperty(S,"__esModule",{value:!0});S.valueList=de;S.keyValue=fe;S.keyValueList=pe;var K=new Map;function V(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function $(e,t,n){return T(this,void 0,void 0,function*(){if(typeof e=="function"){let o=yield e(...n);return V(t,o)}if(typeof e[0]=="string"){let o=e.map(r=>({name:r}));return V(t,o)}return V(t,e)})}function F(e,t,n,o){return T(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=K.get(e);return r===void 0&&(r=yield $(e,t,o),K.set(e,r)),r}return $(e,t,o)})}function z(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function C(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function M(e,t){let n=new Set(e);return t.filter(o=>{var r;return typeof o.name=="string"?!n.has(o.name):!(!((r=o.name)===null||r===void 0)&&r.some(i=>n.has(i)))})}function de({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:o=!1,allowRepeatedValues:r=!1}){return{trigger:(i,a)=>i.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:i=>i.slice(i.lastIndexOf(e)+e.length),custom:(...i)=>T(this,void 0,void 0,function*(){var a;let u=yield F(t,o?e:"",n,i);if(r)return u;let[c]=i,l=(a=c[c.length-1])===null||a===void 0?void 0:a.split(e);return M(l,u)})}}function fe({separator:e="=",keys:t=[],values:n=[],cache:o=!1,insertSeparator:r=!0}){return{trigger:(i,a)=>i.indexOf(e)!==a.indexOf(e),getQueryTerm:i=>i.slice(i.indexOf(e)+1),custom:(...i)=>T(this,void 0,void 0,function*(){let[a]=i,c=!a[a.length-1].includes(e),l=c?t:n,s=z(c,o);return F(l,c&&r?e:"",s,i)})}}function pe({separator:e="=",delimiter:t=",",keys:n=[],values:o=[],cache:r=!1,insertSeparator:i=!0,insertDelimiter:a=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(l,s)=>{let d=C(l,e,t),g=C(s,e,t);return d!==g},getQueryTerm:l=>{let s=C(l,e,t);return l.slice(s+1)},custom:(...l)=>T(this,void 0,void 0,function*(){let[s]=l,d=s[s.length-1],g=C(d,e,t),x=g===-1||d.slice(g,g+e.length)!==e,p=x?n:o,m=z(x,r),f=yield F(p,x?i?e:"":a?t:"",m,l);if(x){if(u)return f;let _=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return M(_,f)}if(c)return f;let y=d.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return M(y,f)})}}});var G=w(A=>{"use strict";var he=A&&A.__awaiter||function(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function u(s){try{l(o.next(s))}catch(d){a(d)}}function c(s){try{l(o.throw(s))}catch(d){a(d)}}function l(s){s.done?i(s.value):r(s.value).then(u,c)}l((o=o.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=be;var me=4097,ge=4,ve=.8,ye=me*ge*ve;function be({name:e,prompt:t,message:n,postProcess:o,temperature:r,splitOn:i}){return{scriptTimeout:15e3,custom:(a,u,c)=>he(this,void 0,void 0,function*(){var l,s;let d=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof t=="function"?yield t({tokens:a,executeCommand:u,generatorContext:c}):t,x=typeof n=="function"?yield n({tokens:a,executeCommand:u,generatorContext:c}):n;if(x===null||x.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((l=g?.length)!==null&&l!==void 0?l:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:x.slice(0,p)}],temperature:r},O=JSON.stringify(m),f=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),y=JSON.parse(f.stdout);return(s=y?.choices.map(h=>{var j;return(j=h?.message)===null||j===void 0?void 0:j.content}).filter(h=>typeof h=="string").flatMap(h=>i?h.split(i).filter(j=>j.trim().length>0):[h]).map(h=>{if(o)return o(h);let j=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:j,insertValue:`'${j}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}});var Q=w(v=>{"use strict";var Oe=v&&v.__createBinding||(Object.create?function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]}),_e=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Oe(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var H=J();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return H.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return H.folders}});_e(B(),v);var xe=G();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return xe.ai}})});var L=re(Q(),1),je={name:"rojo",description:"Enables professional-grade development tools for Roblox developers",subcommands:[{name:"help",description:"Print this message or the help of the given subcommand(s)",args:{name:"SUBCOMMAND",template:"help"}},{name:"build",description:"Generates a model or place file from the Rojo project",options:[{name:["--output","-o"],description:"Where to output the result. Should end in .rbxm, .rbxl, .rbxmx, or .rbxlx",isRequired:!0,args:{name:"OUTPUT",description:"Where to output the result. Should end in .rbxm, .rbxl, .rbxmx, or .rbxlx",generators:(0,L.filepaths)({extensions:["rbxm","rbxl","rbxmx","rbxlx"]}),suggestCurrentToken:!0}},{name:"--watch",description:"Whether to automatically rebuild when any input files change"}],args:{name:"PROJECT",description:"Path to the project to serve. Defaults to the current directory [default: ]"}},{name:"doc",description:"Open Rojo's documentation in your browser"},{name:"fmt-project",description:"Reformat a Rojo project using the standard JSON formatting rules",args:{name:"PROJECT",description:"Path to the project to format. Defaults to the current directory [default: ]"}},{name:"init",description:"Initializes a new Rojo project",options:[{name:"--kind",description:"The kind of project to create, 'place' or 'model'. Defaults to place",args:{name:"KIND",description:"The kind of project to create, 'place' or 'model'. Defaults to place",suggestions:["place","model"]}}],args:{name:"PATH",description:"Path to the place to create the project. Defaults to the current directory [default: ]"}},{name:"plugin",description:"Install Rojo's plugin"},{name:"serve",description:"Expose a Rojo project to the Rojo Studio plugin",options:[{name:"address",description:"The IP address to listen on. Defaults to `127.0.0.1`",args:{name:"ADDRESS",description:"The IP address to listen on. Defaults to `127.0.0.1`"}}]},{name:"sourcemap",description:"Generates a sourcemap file from the Rojo project",options:[{name:"--include-non-scripts",description:"If non-script files should be included or not. Defaults to false"},{name:["--output","-o"],description:"Where to output the sourcemap. Omit this to use stdout instead of writing to a file. Should end in .json",args:{name:"OUTPUT",description:"Where to output the sourcemap. Omit this to use stdout instead of writing to a file. Should end in .json",generators:(0,L.filepaths)({extensions:["rbxm","rbxl","rbxmx","rbxlx"]}),suggestCurrentToken:!0}}],args:{name:"PROJECT",description:"Path to the project to use for the sourcemap. Defaults to the current directory [default: ]"}},{name:"upload",description:"Builds the project and uploads it to Roblox",options:[{name:"--api-key",description:"API key obtained from create.roblox.com/credentials. Rojo will use the Open Cloud API when this is provided. Only supports uploading to a place",args:{name:"API_KEY",description:"API key obtained from create.roblox.com/credentials. Rojo will use the Open Cloud API when this is provided. Only supports uploading to a place"}},{name:"--asset_id",description:"Asset ID to upload to",args:{name:"ASSET_ID",description:"Asset ID to upload to"}},{name:"--cookie",description:"Authenication cookie to use. If not specified, Rojo will attempt to find one from the system automatically",args:{name:"COOKIE",description:"Authenication cookie to use. If not specified, Rojo will attempt to find one from the system automatically"}},{name:"--universe_id",description:"The Universe ID of the given place. Required when using the Open Cloud API",args:{name:"UNIVERSE_ID",description:"The Universe ID of the given place. Required when using the Open Cloud API"}}],args:{}}],options:[{name:["--help","-h"],description:"Print help information",isPersistent:!0},{name:"--color",description:"Set color behavior. Valid values are auto, always, and never [default: auto]",isPersistent:!0,args:{name:"COLOR",suggestions:["auto","always","never"],default:"auto"}},{name:["--verbose","-v"],description:"Sets verbosity level. Can be specified multiple times",isRepeatable:4,isPersistent:!0},{name:["--version","-V"],description:"Print version information"}]},Re=je;export{Re as default};
|
package/build/rollup.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Z=Object.create;var W=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),P=[];for(let A of X)if(A){let k=A.endsWith("/")?"folders":"filepaths";(k==="filepaths"&&u!=="only"||k==="folders"&&u!=="never")&&P.push({type:k==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:b,context:{templateType:k}})}return _(g(P))}catch{return[]}})}}y.folders=Object.assign(()=>C({showFolders:"only"}),Object.freeze(C({showFolders:"only"})));y.filepaths=Object.assign(C,Object.freeze(C()))});var J=T(O=>{"use strict";var j=O&&O.__awaiter||function(e,n,t,i){function r(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function c(o){try{l(i.next(o))}catch(d){a(d)}}function u(o){try{l(i.throw(o))}catch(d){a(d)}}function l(o){o.done?s(o.value):r(o.value).then(c,u)}l((i=i.apply(e,n||[])).next())})};Object.defineProperty(O,"__esModule",{value:!0});O.keyValueList=O.keyValue=O.valueList=void 0;var G=new Map;function E(e,n){return e.length===0?n:n.map(t=>t.insertValue?t:Object.assign(Object.assign({},t),{insertValue:t.name+e}))}function U(e,n,t){return j(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...t);return E(n,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return E(n,i)}return E(n,e)})}function N(e,n,t,i){return j(this,void 0,void 0,function*(){if(t||Array.isArray(e)){let r=G.get(e);return r===void 0&&(r=yield U(e,n,i),G.set(e,r)),r}return U(e,n,i)})}function $(e,n){return typeof n=="string"?e&&n==="keys"||!e&&n==="values":n}function F(e,...n){return Math.max(...n.map(t=>e.lastIndexOf(t)))}function V(e,n){let t=new Set(e);return n.filter(i=>{var r;return typeof i.name=="string"?!t.has(i.name):!(!((r=i.name)===null||r===void 0)&&r.some(s=>t.has(s)))})}function de({delimiter:e=",",values:n=[],cache:t=!1,insertDelimiter:i=!1,allowRepeatedValues:r=!1}){return{trigger:(s,a)=>s.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:s=>s.slice(s.lastIndexOf(e)+e.length),custom:(...s)=>j(this,void 0,void 0,function*(){var a;let c=yield N(n,i?e:"",t,s);if(r)return c;let[u]=s,l=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return V(l,c)})}}O.valueList=de;function fe({separator:e="=",keys:n=[],values:t=[],cache:i=!1,insertSeparator:r=!0}){return{trigger:(s,a)=>s.indexOf(e)!==a.indexOf(e),getQueryTerm:s=>s.slice(s.indexOf(e)+1),custom:(...s)=>j(this,void 0,void 0,function*(){let[a]=s,u=!a[a.length-1].includes(e),l=u?n:t,o=$(u,i);return N(l,u&&r?e:"",o,s)})}}O.keyValue=fe;function pe({separator:e="=",delimiter:n=",",keys:t=[],values:i=[],cache:r=!1,insertSeparator:s=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:u=!0}){return{trigger:(l,o)=>{let d=F(l,e,n),g=F(o,e,n);return d!==g},getQueryTerm:l=>{let o=F(l,e,n);return l.slice(o+1)},custom:(...l)=>j(this,void 0,void 0,function*(){let[o]=l,d=o[o.length-1],g=F(d,e,n),_=g===-1||d.slice(g,g+e.length)!==e,p=_?t:i,h=$(_,r),f=yield N(p,_?s?e:"":a?n:"",h,l);if(_){if(c)return f;let S=d.split(n).map(m=>m.slice(0,m.indexOf(e)));return V(S,f)}if(u)return f;let b=d.split(n).map(S=>S.slice(S.indexOf(e)+e.length));return V(b,f)})}}O.keyValueList=pe});var K=T(I=>{"use strict";var me=I&&I.__awaiter||function(e,n,t,i){function r(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function c(o){try{l(i.next(o))}catch(d){a(d)}}function u(o){try{l(i.throw(o))}catch(d){a(d)}}function l(o){o.done?s(o.value):r(o.value).then(c,u)}l((i=i.apply(e,n||[])).next())})};Object.defineProperty(I,"__esModule",{value:!0});I.ai=void 0;var he=4097,ge=4,ye=.8,ve=he*ge*ye;function be({name:e,prompt:n,message:t,postProcess:i,temperature:r,splitOn:s}){return{scriptTimeout:15e3,custom:(a,c,u)=>me(this,void 0,void 0,function*(){var l,o;let d=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:u}):n,_=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:u}):t;if(_===null||_.length===0)return console.warn("No message provided to AI generator"),[];let p=ve-((l=g?.length)!==null&&l!==void 0?l:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:_.slice(0,p)}],temperature:r},w=JSON.stringify(h),f=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),b=JSON.parse(f.stdout);return(o=b?.choices.map(m=>{var x;return(x=m?.message)===null||x===void 0?void 0:x.content}).filter(m=>typeof m=="string").flatMap(m=>s?m.split(s).filter(x=>x.trim().length>0):[m]).map(m=>{if(i)return i(m);let x=m.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:x,insertValue:`'${x}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}I.ai=be});var Q=T(v=>{"use strict";var we=v&&v.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(n,t);(!r||("get"in r?!n.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,r)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),Se=v&&v.__exportStar||function(e,n){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&we(n,e,t)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var B=q();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return B.folders}});Se(J(),v);var _e=K();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return _e.ai}})});var H=re(Q(),1),xe={name:"rollup",description:"Next-generation ES module bundler",options:[{name:["-c","--config"],description:"Use this config file (if argument is used but value is unspecified, defaults to rollup.config.js)",args:{name:"filename",generators:(0,H.filepaths)({extensions:["config.js"]})}},{name:["-d","--dir"],args:{name:"dirname",description:"Directory for chunks (if absent, prints to stdout)",template:"folders"}},{name:["-e","--external"],args:{name:"ids",description:"Comma-separate list of module IDs to exclude"}},{name:["-f","--format"],args:{name:"format",description:"Type of output (amd, cjs, es, iife, umd, system)",suggestions:["amd","cjs","es","iife","umd","system"]}},{name:["-g","--globals"],args:{name:"pairs",description:"Comma-separate list of `moduleID:Global` pairs"}},{name:["-h","--help"],description:"Show help message"},{name:["-i","--input"],args:{name:"filename",description:"Input (alternative to <entry file>)",template:"filepaths"}},{name:["-m","--sourcemap"],description:"Generate sourcemap (`-m inline` for inline map)"},{name:["-n","--name"],args:{name:"name",description:"Name for UMD export"}},{name:["-o","--file"],args:{name:"output",description:"Single output file (if absent, prints to stdout)"}},{name:["-p","--plugin"],args:{name:"plugin",description:"Use the plugin specified (may be repeated)"}},{name:["-v","--version"],description:"Show version number"},{name:["-w","--watch"],description:"Watch files in bundle and rebuild on changes"},{name:"--amd.id",args:{name:"id",description:"ID for AMD module (default is anonymous)"}},{name:"--amd.autoId",description:"Generate the AMD ID based off the chunk name"},{name:"--amd.basePath",args:{name:"prefix",description:"Path to prepend to auto generated AMD ID"}},{name:"--amd.define",args:{name:"name",description:"Function to use in place of 'define'"}},{name:"--assetFileNames",args:{name:"pattern",description:"Name pattern for emitted assets"}},{name:"--banner",args:{name:"text",description:"Code to insert at top of bundle (outside wrapper)"}},{name:"--chunkFileNames",args:{name:"pattern",description:"Name pattern for emitted secondary chunks"}},{name:"--compact",description:"Minify wrapper code"},{name:"--context",args:{name:"variable",description:"Specify top-level 'this' value"}},{name:"--entryFileNames",args:{name:"pattern",description:"Name pattern for emitted entry chunks"}},{name:"--environment",args:{name:"values",description:"Settings passed to config file"}},{name:"--no-esModule",description:"Do not add __esmodule property"},{name:"--exports",args:{name:"mode",description:"Specify export mode (auto, default, named, none)"}},{name:"--extend",description:"Extend global variable defined by --name"},{name:"--no-externalLiveBindings",description:"Do not generate code to support live bindings"},{name:"--failAfterWarnings",description:"Exit with an error if the build produced warnings"},{name:"--footer",args:{name:"text",description:"Code to insert at end of bundle (outside wrapper)"}},{name:"--no-freeze",description:"Do not freeze namespace objects"},{name:"--no-hoistTransistiveImports",description:"Do not hoist transistive imports into entry chunks"},{name:"--no-indent",description:"Don't indent result"},{name:"--no-interop",description:"Do not include interop block"},{name:"--inlineDynamicImports",description:"Create a single bundle when using dynamic imports"},{name:"--intro",args:{name:"text",description:"Code to insert at top of bundle (inside wrapper)"}},{name:"--minifyInternalImports",description:"Force or disable minification of internal imports"},{name:"--namespaceToStringTag",description:"Create proper '.toString' methods for namespaces"},{name:"--noConflict",description:"Generate a noConflict method for UMD globals"},{name:"--outro",args:{name:"text",description:"Code to insert at end of bundle (inside wrapper)"}},{name:"--preferConst",description:"Use 'const' instead of 'var' for exports"},{name:"--no-preserveEntrySignatures",description:"Avoid facade chunks for entry points"},{name:"--preserveModules",description:"Preserve module structure"},{name:"--preserveModulesRoot",description:"Put preserved modules under this path at root level"},{name:"--preserveSymlinks",description:"Do not follow symlinks when resolving files"},{name:"--no-sanitizeFileName",description:"Do not replace invalid characters in file names"},{name:"--shimMissingExports",description:"Create shim variables for missing exports"},{name:"--silent",description:"Don't print warnings"},{name:"--sourcemapExcludeSources",description:"Do not include source code in source maps"},{name:"--sourcemapFile",description:"Specify bundle position for source maps",args:{name:"file"}},{name:"--stdin=ext",description:"Specify file extension used for stdin input"},{name:"--no-stdin",description:'Do not read "-" from stdin'},{name:"--no-strict",description:`Don't emit '"use strict"; in the generated modules`},{name:"--strictDeprecations",description:"Throw errors for deprecated features"},{name:"--systemNullSetters",description:"Replace empty SystemJS setters with 'null'"},{name:"--no-treeshake",description:"Disable tree-shaking optimizations"},{name:"--no-treeshake.annotations",description:"Ignore pure call annotations"},{name:"--no-treeshake.moduleSideEffects",description:"Assume modules have no side effects"},{name:"--no-treeshake.propertyReadSideEffects",description:"Ignore property access side-effects"},{name:"--no-treeshake.tryCatchDeoptimization",description:"Do not turn off try-catch-tree-shaking"},{name:"--no-treeshake.unknownGlobalSideEffects",description:"Assume unknown globals do not throw"},{name:"--waitForBuildInput",description:"Wait for bundle input files"},{name:"--watch.buildDelay",description:"Throttle watch rebuilds",args:{name:"number"}},{name:"--no-watch.clearScreen",description:"Do not clear the screen when rebuilding"},{name:"--watch.skipWrite",description:"Do not write files to disk when watching"},{name:"--watch.exclude",description:"Exclude files from being watched",args:{name:"files"}},{name:"--watch.include",description:"Limit watching to specified files",args:{name:"files"}},{name:"--validate",description:"Validate output"}]},ke=xe;export{ke as default};
|
|
1
|
+
var Z=Object.create;var W=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var I=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var ie=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ee(n))!te.call(e,r)&&r!==t&&W(e,r,{get:()=>n[r],enumerable:!(i=Y(n,r))||i.enumerable});return e};var re=(e,n,t)=>(t=e!=null?Z(ne(e)):{},ie(n||!e||!e.__esModule?W(t,"default",{value:e,enumerable:!0}):t,e));var z=I(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.shellExpand=D.ensureTrailingSlash=void 0;var se=e=>e.endsWith("/")?e:`${e}/`;D.ensureTrailingSlash=se;var oe=(e,n)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",n):e,ae=(e,n)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var s;let a=r.slice(1);return(s=n[a])!==null&&s!==void 0?s:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,s,a)=>{var l,u;return(u=(l=n[s])!==null&&l!==void 0?l:a)!==null&&u!==void 0?u:r}),ce=(e,n)=>{var t;let{environmentVariables:i}=n;return ae(oe(e,(t=i?.HOME)!==null&&t!==void 0?t:"~"),i)};D.shellExpand=ce});var q=I(b=>{"use strict";var le=b&&b.__awaiter||function(e,n,t,i){function r(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function l(o){try{c(i.next(o))}catch(d){a(d)}}function u(o){try{c(i.throw(o))}catch(d){a(d)}}function c(o){o.done?s(o.value):r(o.value).then(l,u)}c((i=i.apply(e,n||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=R;var F=z();function R(e,n=[]){let t=n.map(r=>r.toLowerCase()),i=e.filter(r=>!t.includes(r.toLowerCase()));return[...i.filter(r=>!r.startsWith(".")).sort((r,s)=>r.localeCompare(s)),...i.filter(r=>r.startsWith(".")).sort((r,s)=>r.localeCompare(s)),"../"]}var ue=(e,n,t)=>{if(e===null)return"/";let i=(0,F.shellExpand)(n,t),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,F.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,F.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=ue;function M(e={}){let{extensions:n=[],equals:t=[],matches:i,filterFolders:r=!1,editFileSuggestions:s,editFolderSuggestions:a,rootDirectory:l,showFolders:u="always"}=e,c=new Set(n),o=new Set(t),d=()=>n.length>0||t.length>0||i,g=(p=[])=>d()?p.filter(({name:h="",type:w})=>{if(!r&&w==="folder"||o.has(h)||i&&h.match(i))return!0;let[,...f]=h.split(".");if(f.length>=1){let v=f.length-1,S=f[v];do{if(c.has(S))return!0;v-=1,S=[f[v],S].join(".")}while(v>=0)}return!1}):p,_=(p=[])=>!s&&!a?p:p.map(h=>Object.assign(Object.assign({},h),(h.type==="file"?s:a)||{}));return{trigger:(p,h)=>{let w=p.lastIndexOf("/"),f=h.lastIndexOf("/");return w!==f?!0:w===-1&&f===-1?!1:p.slice(0,w)!==h.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,h,w)=>le(this,void 0,void 0,function*(){var f;let{isDangerous:v,currentWorkingDirectory:S,searchTerm:m}=w,x=(f=(0,b.getCurrentInsertedDirectory)(l??S,m,w))!==null&&f!==void 0?f:"/";try{let L=yield h({command:"ls",args:["-1ApL"],cwd:x}),X=R(L.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),P=[];for(let A of X)if(A){let C=A.endsWith("/")?"folders":"filepaths";(C==="filepaths"&&u!=="only"||C==="folders"&&u!=="never")&&P.push({type:C==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:v,context:{templateType:C}})}return _(g(P))}catch{return[]}})}}b.folders=Object.assign(()=>M({showFolders:"only"}),Object.freeze(M({showFolders:"only"})));b.filepaths=Object.assign(M,Object.freeze(M()))});var J=I(O=>{"use strict";var T=O&&O.__awaiter||function(e,n,t,i){function r(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function l(o){try{c(i.next(o))}catch(d){a(d)}}function u(o){try{c(i.throw(o))}catch(d){a(d)}}function c(o){o.done?s(o.value):r(o.value).then(l,u)}c((i=i.apply(e,n||[])).next())})};Object.defineProperty(O,"__esModule",{value:!0});O.valueList=de;O.keyValue=fe;O.keyValueList=pe;var G=new Map;function E(e,n){return e.length===0?n:n.map(t=>t.insertValue?t:Object.assign(Object.assign({},t),{insertValue:t.name+e}))}function U(e,n,t){return T(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...t);return E(n,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return E(n,i)}return E(n,e)})}function V(e,n,t,i){return T(this,void 0,void 0,function*(){if(t||Array.isArray(e)){let r=G.get(e);return r===void 0&&(r=yield U(e,n,i),G.set(e,r)),r}return U(e,n,i)})}function $(e,n){return typeof n=="string"?e&&n==="keys"||!e&&n==="values":n}function k(e,...n){return Math.max(...n.map(t=>e.lastIndexOf(t)))}function N(e,n){let t=new Set(e);return n.filter(i=>{var r;return typeof i.name=="string"?!t.has(i.name):!(!((r=i.name)===null||r===void 0)&&r.some(s=>t.has(s)))})}function de({delimiter:e=",",values:n=[],cache:t=!1,insertDelimiter:i=!1,allowRepeatedValues:r=!1}){return{trigger:(s,a)=>s.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:s=>s.slice(s.lastIndexOf(e)+e.length),custom:(...s)=>T(this,void 0,void 0,function*(){var a;let l=yield V(n,i?e:"",t,s);if(r)return l;let[u]=s,c=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return N(c,l)})}}function fe({separator:e="=",keys:n=[],values:t=[],cache:i=!1,insertSeparator:r=!0}){return{trigger:(s,a)=>s.indexOf(e)!==a.indexOf(e),getQueryTerm:s=>s.slice(s.indexOf(e)+1),custom:(...s)=>T(this,void 0,void 0,function*(){let[a]=s,u=!a[a.length-1].includes(e),c=u?n:t,o=$(u,i);return V(c,u&&r?e:"",o,s)})}}function pe({separator:e="=",delimiter:n=",",keys:t=[],values:i=[],cache:r=!1,insertSeparator:s=!0,insertDelimiter:a=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,o)=>{let d=k(c,e,n),g=k(o,e,n);return d!==g},getQueryTerm:c=>{let o=k(c,e,n);return c.slice(o+1)},custom:(...c)=>T(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],g=k(d,e,n),_=g===-1||d.slice(g,g+e.length)!==e,p=_?t:i,h=$(_,r),f=yield V(p,_?s?e:"":a?n:"",h,c);if(_){if(l)return f;let S=d.split(n).map(m=>m.slice(0,m.indexOf(e)));return N(S,f)}if(u)return f;let v=d.split(n).map(S=>S.slice(S.indexOf(e)+e.length));return N(v,f)})}}});var K=I(j=>{"use strict";var me=j&&j.__awaiter||function(e,n,t,i){function r(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function l(o){try{c(i.next(o))}catch(d){a(d)}}function u(o){try{c(i.throw(o))}catch(d){a(d)}}function c(o){o.done?s(o.value):r(o.value).then(l,u)}c((i=i.apply(e,n||[])).next())})};Object.defineProperty(j,"__esModule",{value:!0});j.ai=be;var he=4097,ge=4,ye=.8,ve=he*ge*ye;function be({name:e,prompt:n,message:t,postProcess:i,temperature:r,splitOn:s}){return{scriptTimeout:15e3,custom:(a,l,u)=>me(this,void 0,void 0,function*(){var c,o;let d=yield l({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n,_=typeof t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t;if(_===null||_.length===0)return console.warn("No message provided to AI generator"),[];let p=ve-((c=g?.length)!==null&&c!==void 0?c:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:_.slice(0,p)}],temperature:r},w=JSON.stringify(h),f=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),v=JSON.parse(f.stdout);return(o=v?.choices.map(m=>{var x;return(x=m?.message)===null||x===void 0?void 0:x.content}).filter(m=>typeof m=="string").flatMap(m=>s?m.split(s).filter(x=>x.trim().length>0):[m]).map(m=>{if(i)return i(m);let x=m.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:x,insertValue:`'${x}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var Q=I(y=>{"use strict";var we=y&&y.__createBinding||(Object.create?function(e,n,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(n,t);(!r||("get"in r?!n.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,r)}:function(e,n,t,i){i===void 0&&(i=t),e[i]=n[t]}),Se=y&&y.__exportStar||function(e,n){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&we(n,e,t)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var B=q();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return B.folders}});Se(J(),y);var _e=K();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return _e.ai}})});var H=re(Q(),1),xe={name:"rollup",description:"Next-generation ES module bundler",options:[{name:["-c","--config"],description:"Use this config file (if argument is used but value is unspecified, defaults to rollup.config.js)",args:{name:"filename",generators:(0,H.filepaths)({extensions:["config.js"]})}},{name:["-d","--dir"],args:{name:"dirname",description:"Directory for chunks (if absent, prints to stdout)",template:"folders"}},{name:["-e","--external"],args:{name:"ids",description:"Comma-separate list of module IDs to exclude"}},{name:["-f","--format"],args:{name:"format",description:"Type of output (amd, cjs, es, iife, umd, system)",suggestions:["amd","cjs","es","iife","umd","system"]}},{name:["-g","--globals"],args:{name:"pairs",description:"Comma-separate list of `moduleID:Global` pairs"}},{name:["-h","--help"],description:"Show help message"},{name:["-i","--input"],args:{name:"filename",description:"Input (alternative to <entry file>)",template:"filepaths"}},{name:["-m","--sourcemap"],description:"Generate sourcemap (`-m inline` for inline map)"},{name:["-n","--name"],args:{name:"name",description:"Name for UMD export"}},{name:["-o","--file"],args:{name:"output",description:"Single output file (if absent, prints to stdout)"}},{name:["-p","--plugin"],args:{name:"plugin",description:"Use the plugin specified (may be repeated)"}},{name:["-v","--version"],description:"Show version number"},{name:["-w","--watch"],description:"Watch files in bundle and rebuild on changes"},{name:"--amd.id",args:{name:"id",description:"ID for AMD module (default is anonymous)"}},{name:"--amd.autoId",description:"Generate the AMD ID based off the chunk name"},{name:"--amd.basePath",args:{name:"prefix",description:"Path to prepend to auto generated AMD ID"}},{name:"--amd.define",args:{name:"name",description:"Function to use in place of 'define'"}},{name:"--assetFileNames",args:{name:"pattern",description:"Name pattern for emitted assets"}},{name:"--banner",args:{name:"text",description:"Code to insert at top of bundle (outside wrapper)"}},{name:"--chunkFileNames",args:{name:"pattern",description:"Name pattern for emitted secondary chunks"}},{name:"--compact",description:"Minify wrapper code"},{name:"--context",args:{name:"variable",description:"Specify top-level 'this' value"}},{name:"--entryFileNames",args:{name:"pattern",description:"Name pattern for emitted entry chunks"}},{name:"--environment",args:{name:"values",description:"Settings passed to config file"}},{name:"--no-esModule",description:"Do not add __esmodule property"},{name:"--exports",args:{name:"mode",description:"Specify export mode (auto, default, named, none)"}},{name:"--extend",description:"Extend global variable defined by --name"},{name:"--no-externalLiveBindings",description:"Do not generate code to support live bindings"},{name:"--failAfterWarnings",description:"Exit with an error if the build produced warnings"},{name:"--footer",args:{name:"text",description:"Code to insert at end of bundle (outside wrapper)"}},{name:"--no-freeze",description:"Do not freeze namespace objects"},{name:"--no-hoistTransistiveImports",description:"Do not hoist transistive imports into entry chunks"},{name:"--no-indent",description:"Don't indent result"},{name:"--no-interop",description:"Do not include interop block"},{name:"--inlineDynamicImports",description:"Create a single bundle when using dynamic imports"},{name:"--intro",args:{name:"text",description:"Code to insert at top of bundle (inside wrapper)"}},{name:"--minifyInternalImports",description:"Force or disable minification of internal imports"},{name:"--namespaceToStringTag",description:"Create proper '.toString' methods for namespaces"},{name:"--noConflict",description:"Generate a noConflict method for UMD globals"},{name:"--outro",args:{name:"text",description:"Code to insert at end of bundle (inside wrapper)"}},{name:"--preferConst",description:"Use 'const' instead of 'var' for exports"},{name:"--no-preserveEntrySignatures",description:"Avoid facade chunks for entry points"},{name:"--preserveModules",description:"Preserve module structure"},{name:"--preserveModulesRoot",description:"Put preserved modules under this path at root level"},{name:"--preserveSymlinks",description:"Do not follow symlinks when resolving files"},{name:"--no-sanitizeFileName",description:"Do not replace invalid characters in file names"},{name:"--shimMissingExports",description:"Create shim variables for missing exports"},{name:"--silent",description:"Don't print warnings"},{name:"--sourcemapExcludeSources",description:"Do not include source code in source maps"},{name:"--sourcemapFile",description:"Specify bundle position for source maps",args:{name:"file"}},{name:"--stdin=ext",description:"Specify file extension used for stdin input"},{name:"--no-stdin",description:'Do not read "-" from stdin'},{name:"--no-strict",description:`Don't emit '"use strict"; in the generated modules`},{name:"--strictDeprecations",description:"Throw errors for deprecated features"},{name:"--systemNullSetters",description:"Replace empty SystemJS setters with 'null'"},{name:"--no-treeshake",description:"Disable tree-shaking optimizations"},{name:"--no-treeshake.annotations",description:"Ignore pure call annotations"},{name:"--no-treeshake.moduleSideEffects",description:"Assume modules have no side effects"},{name:"--no-treeshake.propertyReadSideEffects",description:"Ignore property access side-effects"},{name:"--no-treeshake.tryCatchDeoptimization",description:"Do not turn off try-catch-tree-shaking"},{name:"--no-treeshake.unknownGlobalSideEffects",description:"Assume unknown globals do not throw"},{name:"--waitForBuildInput",description:"Wait for bundle input files"},{name:"--watch.buildDelay",description:"Throttle watch rebuilds",args:{name:"number"}},{name:"--no-watch.clearScreen",description:"Do not clear the screen when rebuilding"},{name:"--watch.skipWrite",description:"Do not write files to disk when watching"},{name:"--watch.exclude",description:"Exclude files from being watched",args:{name:"files"}},{name:"--watch.include",description:"Limit watching to specified files",args:{name:"files"}},{name:"--validate",description:"Validate output"}]},Ce=xe;export{Ce as default};
|