@tabsmith/autocomplete-specs 1.0.0 → 1.0.15
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/codeburn.js +1 -0
- 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/dsh.js +2 -0
- 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 +6 -37
- 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/python.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var U=Object.create;var R=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),N=[];for(let A of G)if(A){let
|
|
1
|
+
var U=Object.create;var R=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ee(t))!ne.call(e,r)&&r!==n&&R(e,r,{get:()=>t[r],enumerable:!(i=Z(t,r))||i.enumerable});return e};var re=(e,t,n)=>(n=e!=null?U(te(e)):{},ie(t||!e||!e.__esModule?R(n,"default",{value:e,enumerable:!0}):n,e));var W=I(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.shellExpand=T.ensureTrailingSlash=void 0;var se=e=>e.endsWith("/")?e:`${e}/`;T.ensureTrailingSlash=se;var oe=(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 s;let a=r.slice(1);return(s=t[a])!==null&&s!==void 0?s:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,s,a)=>{var l,u;return(u=(l=t[s])!==null&&l!==void 0?l:a)!==null&&u!==void 0?u:r}),ce=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(oe(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};T.shellExpand=ce});var z=I(b=>{"use strict";var le=b&&b.__awaiter||function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=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,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=q;var V=W();function q(e,t=[]){let n=t.map(r=>r.toLowerCase()),i=e.filter(r=>!n.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,t,n)=>{if(e===null)return"/";let i=(0,V.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,V.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,V.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=ue;function F(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:s,editFolderSuggestions:a,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),o=new Set(n),d=()=>t.length>0||n.length>0||i,g=(h=[])=>d()?h.filter(({name:m="",type:_})=>{if(!r&&_==="folder"||o.has(m)||i&&m.match(i))return!0;let[,...f]=m.split(".");if(f.length>=1){let v=f.length-1,O=f[v];do{if(c.has(O))return!0;v-=1,O=[f[v],O].join(".")}while(v>=0)}return!1}):h,w=(h=[])=>!s&&!a?h:h.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?s:a)||{}));return{trigger:(h,m)=>{let _=h.lastIndexOf("/"),f=m.lastIndexOf("/");return _!==f?!0:_===-1&&f===-1?!1:h.slice(0,_)!==m.slice(0,f)},getQueryTerm:h=>h.slice(h.lastIndexOf("/")+1),custom:(h,m,_)=>le(this,void 0,void 0,function*(){var f;let{isDangerous:v,currentWorkingDirectory:O,searchTerm:p}=_,S=(f=(0,b.getCurrentInsertedDirectory)(l??O,p,_))!==null&&f!==void 0?f:"/";try{let L=yield m({command:"ls",args:["-1ApL"],cwd:S}),G=q(L.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),N=[];for(let A of G)if(A){let D=A.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&u!=="only"||D==="folders"&&u!=="never")&&N.push({type:D==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:v,context:{templateType:D}})}return w(g(N))}catch{return[]}})}}b.folders=Object.assign(()=>F({showFolders:"only"}),Object.freeze(F({showFolders:"only"})));b.filepaths=Object.assign(F,Object.freeze(F()))});var J=I(x=>{"use strict";var j=x&&x.__awaiter||function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=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,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=de;x.keyValue=fe;x.keyValueList=he;var k=new Map;function C(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 j(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return C(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return C(t,i)}return C(t,e)})}function H(e,t,n,i){return j(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=k.get(e);return r===void 0&&(r=yield $(e,t,i),k.set(e,r)),r}return $(e,t,i)})}function K(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 E(e,t){let n=new Set(e);return t.filter(i=>{var r;return typeof i.name=="string"?!n.has(i.name):!(!((r=i.name)===null||r===void 0)&&r.some(s=>n.has(s)))})}function de({delimiter:e=",",values:t=[],cache:n=!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 l=yield H(t,i?e:"",n,s);if(r)return l;let[u]=s,c=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return E(c,l)})}}function fe({separator:e="=",keys:t=[],values:n=[],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),c=u?t:n,o=K(u,i);return H(c,u&&r?e:"",o,s)})}}function he({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:s=!0,insertDelimiter:a=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,o)=>{let d=M(c,e,t),g=M(o,e,t);return d!==g},getQueryTerm:c=>{let o=M(c,e,t);return c.slice(o+1)},custom:(...c)=>j(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],g=M(d,e,t),w=g===-1||d.slice(g,g+e.length)!==e,h=w?n:i,m=K(w,r),f=yield H(h,w?s?e:"":a?t:"",m,c);if(w){if(l)return f;let O=d.split(t).map(p=>p.slice(0,p.indexOf(e)));return E(O,f)}if(u)return f;let v=d.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return E(v,f)})}}});var Q=I(P=>{"use strict";var pe=P&&P.__awaiter||function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=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,t||[])).next())})};Object.defineProperty(P,"__esModule",{value:!0});P.ai=be;var me=4097,ge=4,ye=.8,ve=me*ge*ye;function be({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:s}){return{scriptTimeout:15e3,custom:(a,l,u)=>pe(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 t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t,w=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let h=ve-((c=g?.length)!==null&&c!==void 0?c:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:w.slice(0,h)}],temperature:r},_=JSON.stringify(m),f=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),v=JSON.parse(f.stdout);return(o=v?.choices.map(p=>{var S;return(S=p?.message)===null||S===void 0?void 0:S.content}).filter(p=>typeof p=="string").flatMap(p=>s?p.split(s).filter(S=>S.trim().length>0):[p]).map(p=>{if(i)return i(p);let S=p.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var B=I(y=>{"use strict";var _e=y&&y.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=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,i,r)}: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)&&_e(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var Y=z();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return Y.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return Y.folders}});Oe(J(),y);var we=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return we.ai}})});var X=re(B(),1),Se={name:"python",description:"Run the python interpreter",generateSpec:async(e,t)=>{if((await t({command:"bash",args:["-c","cat manage.py | grep -q django"]})).status===0)return{name:"python",subcommands:[{name:"manage.py",loadSpec:"django-admin"}]}},args:{name:"python script",isScript:!0,generators:(0,X.filepaths)({extensions:["py"],editFileSuggestions:{priority:76}})},options:[{name:"-c",insertValue:"-c '{cursor}'",description:"Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code",args:{name:"command",isCommand:!0}},{name:"-m",description:"Module",args:{name:"python module",isModule:"python/",suggestions:["http.server"]}},{name:["-?","-h","--help"],description:"Print a short description of all command line options"},{name:["-V","--version"],description:"Print the Python version number and exit"},{name:"-b",description:"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)"},{name:"-B",description:"If given, Python won\u2019t try to write .pyc files on the import of source modules"},{name:"--check-hash-based-pycs",description:"Control the validation behavior of hash-based .pyc files. See Cached bytecode invalidation",args:{suggestions:[{name:"default"},{name:"always"},{name:"never"}]}},{name:"-d",description:"Turn on parser debugging output (for expert only, depending on compilation options)"},{name:"-E",description:"Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set"},{name:"-i",description:"When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command, even when sys.stdin does not appear to be a terminal"},{name:"-I",description:"Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script\u2019s directory nor the user\u2019s site-packages directory"},{name:"-O",description:"Remove assert statements and any code conditional on the value of __debug__"},{name:"-OO",description:"Do -O and also discard docstrings"},{name:"-g",description:"Don\u2019t display the copyright and version messages even in interactive mode"},{name:"-R",description:"Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled by default"},{name:"-s",description:"Don\u2019t add the user site-packages directory to sys.path"},{name:"-S",description:"Disable the import of the module site and the site-dependent manipulations of sys.path that it entails"},{name:"-u",description:"Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream"},{name:"-v",description:"Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded"},{name:"-W",description:"Warning control. Python\u2019s warning machinery by default prints warning messages to sys.stderr",args:{}},{name:"-x",description:"Skip the first line of the source, allowing use of non-Unix forms of #!cmd. This is intended for a DOS specific hack only"},{name:"-X",description:"Reserved for various implementation-specific options",args:{suggestions:[{name:"faulthandler"},{name:"showrefcount"},{name:"tracemalloc"},{name:"showalloccount"},{name:"importtime"},{name:"dev"},{name:"utf8"},{name:"pycache_prefix=PATH"}]}}]},De=Se;export{De as default};
|
package/build/python3.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var U=Object.create;var R=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),N=[];for(let A of G)if(A){let
|
|
1
|
+
var U=Object.create;var R=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ee(t))!ne.call(e,r)&&r!==n&&R(e,r,{get:()=>t[r],enumerable:!(i=Z(t,r))||i.enumerable});return e};var re=(e,t,n)=>(n=e!=null?U(te(e)):{},ie(t||!e||!e.__esModule?R(n,"default",{value:e,enumerable:!0}):n,e));var W=I(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.shellExpand=T.ensureTrailingSlash=void 0;var se=e=>e.endsWith("/")?e:`${e}/`;T.ensureTrailingSlash=se;var oe=(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 s;let a=r.slice(1);return(s=t[a])!==null&&s!==void 0?s:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,s,a)=>{var l,u;return(u=(l=t[s])!==null&&l!==void 0?l:a)!==null&&u!==void 0?u:r}),ce=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(oe(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};T.shellExpand=ce});var z=I(b=>{"use strict";var le=b&&b.__awaiter||function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=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,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=q;var C=W();function q(e,t=[]){let n=t.map(r=>r.toLowerCase()),i=e.filter(r=>!n.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,t,n)=>{if(e===null)return"/";let i=(0,C.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,C.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,C.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=ue;function F(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:s,editFolderSuggestions:a,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),o=new Set(n),d=()=>t.length>0||n.length>0||i,g=(h=[])=>d()?h.filter(({name:m="",type:_})=>{if(!r&&_==="folder"||o.has(m)||i&&m.match(i))return!0;let[,...f]=m.split(".");if(f.length>=1){let v=f.length-1,O=f[v];do{if(c.has(O))return!0;v-=1,O=[f[v],O].join(".")}while(v>=0)}return!1}):h,w=(h=[])=>!s&&!a?h:h.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?s:a)||{}));return{trigger:(h,m)=>{let _=h.lastIndexOf("/"),f=m.lastIndexOf("/");return _!==f?!0:_===-1&&f===-1?!1:h.slice(0,_)!==m.slice(0,f)},getQueryTerm:h=>h.slice(h.lastIndexOf("/")+1),custom:(h,m,_)=>le(this,void 0,void 0,function*(){var f;let{isDangerous:v,currentWorkingDirectory:O,searchTerm:p}=_,S=(f=(0,b.getCurrentInsertedDirectory)(l??O,p,_))!==null&&f!==void 0?f:"/";try{let L=yield m({command:"ls",args:["-1ApL"],cwd:S}),G=q(L.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),N=[];for(let A of G)if(A){let D=A.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&u!=="only"||D==="folders"&&u!=="never")&&N.push({type:D==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:v,context:{templateType:D}})}return w(g(N))}catch{return[]}})}}b.folders=Object.assign(()=>F({showFolders:"only"}),Object.freeze(F({showFolders:"only"})));b.filepaths=Object.assign(F,Object.freeze(F()))});var J=I(x=>{"use strict";var j=x&&x.__awaiter||function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=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,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=de;x.keyValue=fe;x.keyValueList=he;var k=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 j(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return M(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return M(t,i)}return M(t,e)})}function H(e,t,n,i){return j(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=k.get(e);return r===void 0&&(r=yield $(e,t,i),k.set(e,r)),r}return $(e,t,i)})}function K(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 E(e,t){let n=new Set(e);return t.filter(i=>{var r;return typeof i.name=="string"?!n.has(i.name):!(!((r=i.name)===null||r===void 0)&&r.some(s=>n.has(s)))})}function de({delimiter:e=",",values:t=[],cache:n=!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 l=yield H(t,i?e:"",n,s);if(r)return l;let[u]=s,c=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return E(c,l)})}}function fe({separator:e="=",keys:t=[],values:n=[],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),c=u?t:n,o=K(u,i);return H(c,u&&r?e:"",o,s)})}}function he({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:s=!0,insertDelimiter:a=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,o)=>{let d=V(c,e,t),g=V(o,e,t);return d!==g},getQueryTerm:c=>{let o=V(c,e,t);return c.slice(o+1)},custom:(...c)=>j(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],g=V(d,e,t),w=g===-1||d.slice(g,g+e.length)!==e,h=w?n:i,m=K(w,r),f=yield H(h,w?s?e:"":a?t:"",m,c);if(w){if(l)return f;let O=d.split(t).map(p=>p.slice(0,p.indexOf(e)));return E(O,f)}if(u)return f;let v=d.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return E(v,f)})}}});var Q=I(P=>{"use strict";var pe=P&&P.__awaiter||function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=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,t||[])).next())})};Object.defineProperty(P,"__esModule",{value:!0});P.ai=be;var me=4097,ge=4,ye=.8,ve=me*ge*ye;function be({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:s}){return{scriptTimeout:15e3,custom:(a,l,u)=>pe(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 t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t,w=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let h=ve-((c=g?.length)!==null&&c!==void 0?c:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:w.slice(0,h)}],temperature:r},_=JSON.stringify(m),f=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),v=JSON.parse(f.stdout);return(o=v?.choices.map(p=>{var S;return(S=p?.message)===null||S===void 0?void 0:S.content}).filter(p=>typeof p=="string").flatMap(p=>s?p.split(s).filter(S=>S.trim().length>0):[p]).map(p=>{if(i)return i(p);let S=p.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var B=I(y=>{"use strict";var _e=y&&y.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=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,i,r)}: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)&&_e(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var Y=z();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return Y.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return Y.folders}});Oe(J(),y);var we=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return we.ai}})});var X=re(B(),1),Se={name:"python3",description:"Run the python interpreter",generateSpec:async(e,t)=>{if((await t({command:"bash",args:["-c","cat manage.py | grep -q django"]})).status===0)return{name:"python3",subcommands:[{name:"manage.py",loadSpec:"django-admin"}]}},args:{name:"python script",isScript:!0,generators:(0,X.filepaths)({extensions:["py"],editFileSuggestions:{priority:76}})},options:[{name:"-c",insertValue:"-c '{cursor}'",description:"Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code",args:{name:"command",isCommand:!0}},{name:"-m",insertValue:"-m '{cursor}'",description:"Search sys.path for the named module and execute its contents as the __main__ module",args:{name:"command",isCommand:!0}},{name:["-?","-h","--help"],description:"Print a short description of all command line options"},{name:["-V","--version"],description:"Print the Python version number and exit"},{name:"-b",description:"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)"},{name:"-B",description:"If given, Python won\u2019t try to write .pyc files on the import of source modules"},{name:"--check-hash-based-pycs",description:"Control the validation behavior of hash-based .pyc files. See Cached bytecode invalidation",args:{suggestions:[{name:"default"},{name:"always"},{name:"never"}]}},{name:"-d",description:"Turn on parser debugging output (for expert only, depending on compilation options)"},{name:"-E",description:"Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set"},{name:"-i",description:"When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command, even when sys.stdin does not appear to be a terminal"},{name:"-I",description:"Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script\u2019s directory nor the user\u2019s site-packages directory"},{name:"-O",description:"Remove assert statements and any code conditional on the value of __debug__"},{name:"-OO",description:"Do -O and also discard docstrings"},{name:"-g",description:"Don\u2019t display the copyright and version messages even in interactive mode"},{name:"-R",description:"Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled by default"},{name:"-s",description:"Don\u2019t add the user site-packages directory to sys.path"},{name:"-S",description:"Disable the import of the module site and the site-dependent manipulations of sys.path that it entails"},{name:"-u",description:"Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream"},{name:"-v",description:"Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded"},{name:"-W",description:"Warning control. Python\u2019s warning machinery by default prints warning messages to sys.stderr",args:{}},{name:"-x",description:"Skip the first line of the source, allowing use of non-Unix forms of #!cmd. This is intended for a DOS specific hack only"},{name:"-X",description:"Reserved for various implementation-specific options",args:{suggestions:[{name:"faulthandler"},{name:"showrefcount"},{name:"tracemalloc"},{name:"showalloccount"},{name:"importtime"},{name:"dev"},{name:"utf8"},{name:"pycache_prefix=PATH"}]}}]},De=Se;export{De as default};
|
package/build/r.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var re=Object.create;var z=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),j=[];for(let
|
|
3
|
-
`).map(t=>({name:t.replace(/\d+/,"").replace("[]","").trim(),description:"Library"}))},m=[{name:["--help","-h"],description:"Print help message and exit",icon:"\u2754"},{name:["--version","-v"],description:"Print version info and exit",icon:"\u{1F4E3}"}],ne=[{name:["--clean","-c"],description:"Remove files created during compilation"},{name:"--preclean",description:"Remove files created during a previous run"}],Fe={name:"R",description:"Start R or invoke an R tool using CMD",icon:"https://www.r-project.org/favicon-32x32.png",subcommands:[{name:"RHOME",description:"Print path to R home directory and exit"},{name:"CMD",description:"Invoke an R tool",subcommands:[{name:"BATCH",description:"Batch Execution of R",options:m.concat([{name:"--no-timing",description:"Do not report the timings"},{name:"--",description:"End processing of options"}]),args:[{name:"infile",description:"A file with R code to be executed",generators:ee},{name:"outfile",description:"A file to which to write output. If not given, the name used is that of infile, with a possible .R extension stripped, and .Rout appended"}]},{name:"COMPILE",description:"Compile files for use with R (not available on Windows)",options:m,args:{name:"files",description:"Source files to be compiled",isVariadic:!0,generators:Y}},{name:"SHLIB",description:"Compile the given source files and then link all specified object files",options:m.concat(ne).concat([{name:["--output","-o"],description:"Name for the built library",requiresSeparator:!0,args:{name:"LIB",description:"Full name for the built library"}},{name:["--dry-run","-n"],description:"Dry run; shows commands that would be used"},{name:"--use-LTO",description:"Use Link-Time Optimization",exclusiveOn:["--no-use-LTO"]},{name:"--no-use-LTO",description:"Do not use Link-Time Optimization",exclusiveOn:["--use-LTO"]},{name:["--debug","-d"],description:"Build a debug DLL (Windows only)",icon:"\u{1FAB2}"}]),args:{name:"files",description:"The object files to be included in the shared object/DLL",isVariadic:!0,generators:Y}},{name:"INSTALL",description:"Utility for installing add-on packages",options:m.concat(ne).concat([{name:["--debug","-d"],description:"Turn on debugging messages",icon:"\u{1FAB2}"},{name:["--library","-l"],description:"Install packages to library tree LIB",requiresSeparator:!0,args:{name:"LIB",description:"Path to the R library tree to install to",generators:te}},{name:"--no-configure",description:"Do not use the package's configure script"},{name:"--no-docs",description:"Do not install HTML, LaTeX or examples help"},{name:"--html",description:"Build HTML help",exclusiveOn:["--no-html"]},{name:"--no-html",description:"Do not build HTML help",exclusiveOn:["--html"]},{name:"--latex",description:"Install LaTeX help"},{name:"--example",description:"Install R code for help examples"},{name:"--fake",description:"Do minimal install for testing purposes"},{name:"--no-lock",description:"Install on top of any existing installation without using a lock directory",exclusiveOn:["--lock","--pkglock"]},{name:"--lock",description:"Use a per-library lock directory (default)",exclusiveOn:["--no-lock","--pkglock"]},{name:"--pkglock",description:"Use a per-package lock directory (default for a single package)",exclusiveOn:["--no-lock","--lock"]},{name:"--build",description:"Build binaries of the installed package(s)",icon:"\u{1F6E0}"},{name:"--install-tests",description:"Install package-specific tests (if any)"},{name:"--no-R",description:"Suppress installation of the package R code"},{name:"--no-libs",description:"Suppress installation of the package libs"},{name:"--no-data",description:"Suppress installation of the package data"},{name:"--no-help",description:"Suppress installation of the package help"},{name:"--no-demo",description:"Suppress installation of the package demo"},{name:"--no-exec",description:"Suppress installation of the 'exec' directory"},{name:"--no-inst",description:"Suppress installation of the 'inst' directory"},{name:"--no-multiarch",description:"Build only the main architecture"},{name:"--libs-only",description:"Only install the libs directory"},{name:"--data-compress",description:"Compression to be used for lazy-loading of data",requiresSeparator:!0,args:{name:"compression",description:"Compression method",default:"gzip",suggestions:["gzip","none","bzip2","xz"]}},{name:"--resave-data",description:"Re-save data files as compactly as possible"},{name:"--compact-docs",description:"Re-compress PDF files under inst/doc"},{name:"--with-keep.source",description:"'keep.source' for R code",exclusiveOn:["--without-keep.source"]},{name:"--without-keep.source",description:"Do not use 'keep.source' for R code",exclusiveOn:["--with-keep.source"]},{name:"--with-keep.parse.data",description:"Use 'keep.parse.data' for R code",exclusiveOn:["--without-keep.parse.data"]},{name:"--without-keep.parse.data",description:"Do not 'keep.parse.data' for R code",exclusiveOn:["--with-keep.parse.data"]},{name:"--byte-compile",description:"Byte-compile R code",exclusiveOn:["--no-byte-compile"]},{name:"--no-byte-compile",description:"Do not byte-compile R code",exclusiveOn:["--byte-compile"]},{name:"--staged-install",description:"Install to a temporary directory and then move to the target directory (default)",exclusiveOn:["--staged-install"]},{name:"--no-staged-install",description:"Install directly to the target directory",exclusiveOn:["--no-staged-install"]},{name:"--no-test-load",description:"Skip test of loading installed package"},{name:"--no-clean-on-error",description:"Do not remove installed package on error"},{name:"--merge-multiarch",description:"Multi-arch by merging (from a single tarball only)"},{name:"--use-vanilla",description:"Do not read any Renviron or Rprofile files"},{name:"--use-LTO",description:"Use Link-Time Optimization",exclusiveOn:["--no-use-LTO"]},{name:"--no-use-LTO",description:"Do not use Link-Time Optimization",exclusiveOn:["--use-LTO"]},{name:"--configure-args",description:"Set arguments for the configure scripts",requiresSeparator:!0,args:{name:"ARGS",description:"Arguments for the configure script"}},{name:"--configure-vars",description:"Set variables for the configure scripts",requiresSeparator:!0,args:{name:"ARGS",description:"Variables for the configure scripts"}},{name:"--strip",description:"Strip shared object(s) (Unix only)"},{name:"--strip-lib",description:"Strip static/dynamic libraries under 'lib/' (Unix only)"},{name:"--dsym",description:"Generate dSYM directory (macOS only)"},{name:"--built-timestamp",description:"Set timestamp for 'Built' entry in DESCRIPTION (Unix only)",requiresSeparator:!0,args:{name:"STAMP",description:"A timestamp for the build (Unix only)"}},{name:"--force-biarch",description:"Attempt to build both architectures (Windows only)"},{name:"--compile-both",description:"Compile both architectures on 32-bit Windows (Windows only)"}]),args:{name:"packages",description:"Directories with the package sources",generators:{template:"folders"}}},{name:"REMOVE",description:"Remove add-on packages",icon:"\u{1F5D1}",args:{name:"packages",description:"Packages to remove",isDangerous:!0,isVariadic:!0},options:m.concat([{name:["--library","-l"],description:"The library tree to remove from",requiresSeparator:!0,args:{name:"LIB",description:"Library tree",generators:te}}])},{name:"build",description:"Build R packages from package sources",icon:"\u{1F6E0}",args:{name:"pakgdirs",description:"Package directories",isVariadic:!0,generators:{template:"folders"}},options:m.concat([{name:"--force",description:"Force removal of INDEX file",isDangerous:!0},{name:"--keep-empty-dirs",description:"Do not remove empty dirs"},{name:"--no-build-vignettes",description:"Do not (re)build package vignettes"},{name:"--no-manual",description:"Do not build the PDF manual"},{name:"--resave-data",description:"Re-save data files as compactly as possible",requiresSeparator:!0,args:{name:"Compression method",isOptional:!0,default:"best",suggestions:["best","gzip","no"]},exclusiveOn:["--no-resave-data"]},{name:"--no-resave-data",description:"Do not save data",exclusiveOn:["--resave-data"]},{name:"--compact-vignettes",description:"Try to compact PDF files under 'inst/doc'",requiresSeparator:!0,args:{name:"Compression method",isOptional:!0,default:"no",suggestions:["no","qpdf","gs","gs+qpdf","both"]}},{name:"--compression",description:"Type of compression to be used on tarball",requiresSeparator:!0,args:{name:"Compression method",isOptional:!0,default:"gzip",suggestions:["gzip","none","bzip2","xz"]}},{name:"--md5",description:"Add MD5 sums"},{name:"--log",description:"Log to file 'pkg-00build.log' when processing the pkgdir with basename 'pkg'"}])},{name:"check",description:"Check R packages from package sources",icon:"\u2705",options:m.concat([{name:["--library","-lib"],description:"Library used for test installation of packages",args:{name:"LIB",description:"Library tree",default:".",generators:{template:"folders"}}},{name:["--output","-o"],description:"Directory for output",requiresSeparator:!0,args:{name:"directory",description:"Directory for output",default:".",generators:{template:"folders"}}},{name:"--no-clean",description:"Do not clean 'outdir' before using it"},{name:"--no-codoc",description:"Do not check for code/documentation mismatches"},{name:"--no-examples",description:"Do not run the examples in the Rd files"},{name:"--no-install",description:"Skip installation and associated tests"},{name:"--no-tests",description:"Do not run code in 'tests' subdirectory"},{name:"--no-manual",description:"Do not produce the PDF manual"},{name:"--no-vignettes",description:"Do not run R code in vignettes nor build outputs"},{name:"--no-build-vignettes",description:"Do not build vignette outputs"},{name:"--ignore-vignettes",description:"Skip all tests on vignettes"},{name:"--run-dontrun",description:"Do run `dontrun{}` sections in the Rd files"},{name:"--run-donttest",description:"Do run `donttest{}` sections in the Rd files"},{name:"--use-gct",description:"Use `gctorture(TRUE)` when running examples, tests"},{name:"--use-valgrind",description:"Use `valgrind` when running examples, tests, vignettes"},{name:"--timings",description:"Record timings for examples",icon:"\u23F1"},{name:"--install-args",description:"Command-line args to be passed to INSTALL",requiresSeparator:!0,args:{name:"args",description:"Command-line args to be passed to INSTALL"}},{name:"--test-dir",description:"Look in this subdirectory for test scripts",requiresSeparator:!0,args:{name:"directory",description:"Directory with the tests directory",default:"tests",generators:{template:"folders"}}},{name:"--no-stop-on-test-error",description:"Do not stop running tests after first error"},{name:"--check-subdirs",description:"Run checks on the package subdirectories",requiresSeparator:!0,args:{name:"yes-or-no",description:"Run checks on subdirectories?",default:"default",suggestions:["default","yes","no"]}},{name:"--as-cran",description:"Select customizations similar to those used by CRAN",icon:"https://www.r-project.org/favicon-32x32.png"},{name:"--extra-arch",description:"Do only runtime tests needed for an additional sub-architecture"},{name:"--multiarch",description:"Do runtime tests on all installed sub-archs",exclusiveOn:["--no-multiarch"]},{name:"--no-multiarch",description:"Do runtime tests only on the main sub-architecture",exclusiveOn:["--multiarch"]},{name:"--force-multiarch",description:"Run tests on all sub-archs even for packages with no compiled code",exclusiveOn:["--no-multiarch"]}]),args:{name:"packages",description:"Packages to check",isVariadic:!0,generators:Ce}},{name:"LINK",description:"Perform the specified linkcmd",icon:"\u{1F517}",options:m,args:{name:"linkcmd",description:"Command for linkcmd"}},{name:"rprof",description:"Post-process profiling information from `Rprof()`",icon:"\u23F1",options:m.concat([{name:"--lines",description:"Print line information"},{name:"--total",description:"Print only by total"},{name:"--self",description:"Print only by self"},{name:"--linesonly",description:"Print only by line"},{name:"--min%total",description:"Minimum % to print for 'by total'",requiresSeparator:!0,args:{name:"min % total",description:"Minimum % to print for 'by total'",suggestions:["1","10","50"]}},{name:"--min%self",description:"Minimum % to print for 'by self'",requiresSeparator:!0,args:{name:"min % self",description:"Minimum % to print for 'by self'",suggestions:["1","10","50"]}}]),args:{name:"Rprof output file",description:"File generated by `Rprof()`",isOptional:!0,default:"Rprof.out",generators:{template:"filepaths"}}},{name:"Rdconv",description:"Convert R documentation to other formats",options:m.concat([{name:["--type","-t"],description:"Output format type",requiresSeparator:!0,isRequired:!0,args:{name:"type",description:"Output format type",suggestions:["txt","html","latex","example"]}},{name:"--encoding",description:"Encoding of the output",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:"--package",description:"Package name",requiresSeparator:!0,args:{name:"package",description:"Package name"}},{name:["--output","-o"],description:"The output file",requiresSeparator:!0,args:{name:"output file",description:`Name of the output file, '""' to use the input file without '.Rd'`,default:'""',suggestions:['""',"-"]}},{name:["--os","--OS"],description:"Set name of OS ('unix' or 'windows')",requiresSeparator:!0,args:{name:"OS",description:"Name of the OS",suggestions:["unix","windows"]}},{name:"--RdMacros",description:"Packages from which to get Rd macros",requiresSeparator:!0,args:{name:"package list",description:"List of packages"}}]),args:{name:"file",description:"R doc file to convert",generators:Z}},{name:"Rd2pdf",description:"Generate PDF output from R documentation files",options:m.concat([{name:"--batch",description:"No interaction between files"},{name:"--no-clean",description:"Do not remove created temporary files"},{name:"--no-preview",description:"Do not preview generated PDF file"},{name:"--encoding",description:"Set the default input encoding",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:"--outputEncoding",description:"Set the default output encoding",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:["--os","--OS"],description:"Set name of OS ('unix' or 'windows')",requiresSeparator:!0,args:{name:"OS",description:"Name of the OS",suggestions:["unix","windows"]}},{name:["--output","-o"],description:"Write output to a file",requiresSeparator:!0,args:{name:"file",description:"Name of output file"}},{name:"--force",description:"Overwrite output file if it exists",isDangerous:!0},{name:"--title",description:"Set the title of the document",requiresSeparator:!0,args:{name:"title",description:"Title of the document"}},{name:"--no-index",description:"Do not index output"},{name:"--no-description",description:"Do not typeset the description of a package"},{name:"--internals",description:"Typeset 'internal' documentation (usually skipped)"},{name:"--build_dir",description:"Set the working directory",requiresSeparator:!0,args:{name:"working dir",description:"Working directory for the build",generators:{template:"folders"}}},{name:"--RdMacros",description:"Packages from which to get Rd macros",requiresSeparator:!0,args:{name:"package list",description:"List of packages"}}]),args:{name:"files or pkgs",description:"Rd files, or a directory with the sources of a pkg, or an installed pkg",generators:{template:"folders"}}},{name:"Rd2txt",description:"Convert R documentation to text",options:m.concat([{name:["--type","-t"],description:"Output format type",requiresSeparator:!0,isRequired:!0,args:{name:"type",description:"Output format type",suggestions:["txt","html","latex","example"],default:"txt"}},{name:"--encoding",description:"Encoding of the output",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:"--package",description:"Package name",icon:"\u{1F4E6}",requiresSeparator:!0,args:{name:"package",description:"Package name"}},{name:["--output","-o"],description:"The output file",requiresSeparator:!0,args:{name:"output file",description:`Name of the output file, '""' to use the input file without '.Rd'`,default:'""',suggestions:['""',"-"]}},{name:["--os","--OS"],description:"Set name of OS ('unix' or 'windows')",requiresSeparator:!0,args:{name:"OS",description:"Name of the OS",suggestions:["unix","windows"]}},{name:"--RdMacros",description:"Packages from which to get Rd macros",requiresSeparator:!0,args:{name:"package list",description:"List of packages"}}]),args:{name:"file",description:"R doc file to convert",generators:Z}},{name:"Stangle",description:"A front-end for Stangle and other vignette engines",options:m.concat([{name:"--engine",description:"Use named vignette engine",requiresSeparator:!0,args:{name:"pkg::engine",description:"Vignette engine",suggestions:["Stangle","knitr::knit","utils::Sweave"],default:"Stangle"}},{name:"--encoding",description:"Set the encoding for file",requiresSeparator:!0,args:{name:"enc",description:"File encoding",default:"UTF-8"}},{name:"--options",description:"Comma-separated list of Stangle options",requiresSeparator:!0,args:{name:"options",description:"Options for Stangle"}}]),args:{name:"file",description:"File to process",generators:{template:"folders"}}},{name:"Sweave",description:"A front-end for Sweave and other vignette engines",options:m.concat([{name:"--driver",description:"Use named Sweave driver",requiresSeparator:!0,args:{name:"driver",description:"Sweave driver"}},{name:"--engine",description:"Use named vignette engine",requiresSeparator:!0,args:{name:"pkg::engine",description:"Vignette engine"}},{name:"--encoding=enc",description:"Default encoding 'enc' for file",requiresSeparator:!0,args:{name:"enc",description:"File encoding",default:"UTF-8"}},{name:"--clean",description:"Remove some of the created files",icon:"\u{1F9F9}",requiresSeparator:!0,args:{name:"method",description:"How to clean the results",isOptional:!0,default:"default",suggestions:["default","keepOuts"]}},{name:"--options",description:"Comma-separated list of Sweave/engine options",requiresSeparator:!0,args:{name:"options",description:"Options for Sweave/engine"}},{name:"--pdf",description:"Convert to PDF document"},{name:"--compact",description:"Try to compact PDF document",requiresSeparator:!0,args:{name:"Compacting method",description:"How to compact the PDF doc",isOptional:!0,default:"qpdf",suggestions:["no","qpdf","gs","gs+qpdf","both"]}}]),args:{name:"file",description:"Vignette to build",generators:{template:"filepaths"}}},{name:"Rdiff",description:"Diff R output files, discarding the R startup message",options:m,args:[{name:"from",description:"'From' R output file (or '-' for stdin)",generators:{template:"filepaths"}},{name:"to",description:"'To' R output file",generators:{template:"filepaths"}}]},{name:"config",description:"Get the value of a basic R configure variable",options:m.concat([{name:"--cppflags",description:"Print pre-processor flags required to compile a C/C++ file as part of a front-end using R as a library"},{name:"--ldflags",description:"Print linker flags needed for linking a front-end against the R library"},{name:"--no-user-files",description:"Ignore customization files under '~/.R'"},{name:"--no-site-files",description:"Ignore site customization files under 'R_HOME/etc'"},{name:"--all",description:"Print names and values of all variables"}]),args:{name:"variable",description:"R config variable",suggestions:["AR","BLAS_LIBS","CC","CFLAGS","CPICFLAGS","CPPFLAGS","CXX","CXXFLAGS","CXXPICFLAGS","CXX11","CXX11STD","CXX11FLAGS","CXX11PICFLAGS","CXX14","CXX14STD","CXX14FLAGS","CXX14PICFLAGS","CXX17","CXX17STD","CXX17FLAGS","CXX17PICFLAGS","CXX20","CXX20STD","CXX20FLAGS","CXX20PICFLAGS","DYLIB_EXT","DYLIB_LD","DYLIB_LDFLAGS","FC","FFLAGS","FCFLAGS","FLIBS","FPICFLAGS","JAR","JAVA","JAVAC","JAVAH","JAVA_HOME","JAVA_LIBS","JAVA_CPPFLAGS","LAPACK_LIBS","LIBnn","LDFLAGS","LTO","MAKE","NM","OBJC","OBJCFLAGS","RANLIB","SAFE_FFLAGS","SHLIB_CFLAGS","SHLIB_CXXFLAGS","SHLIB_CXXLD","SHLIB_CXXLDFLAGS","SHLIB_EXT","SHLIB_FFLAGS","SHLIB_LD","SHLIB_LDFLAGS","TCLTK_CPPFLAGS","TCLTK_LIBS"]}},{name:"javareconf",description:"Detect current Java setup and update the corresponding configuration in R",options:m.concat([{name:["-n","--dry-run"],description:"Perform Java detection, but don't touch any configuration files"},{name:"-e",description:"Same as -n but exports all detected variables and runs '<prog>'",args:{name:"program",description:"Program to run or '' to use shell"}}]),args:{name:"expression",description:"Evaluate the corresponding expression",isOptional:!0,suggestions:["JAVA_HOME=/usr/lib/java","JAVAC=/usr/bin/javac","JAR=/usr/bin/jar"]}},{name:"rtags",description:"Tag C, R, and Rd files under a directory",options:m.concat([{name:["--output","-o"],description:"Write output to a file",args:{name:"file",description:"Output file name",isOptional:!0}},{name:"--no-c",description:"Do not tag C (.c, .h) files"},{name:"--no-R",description:"Do not tag R (.R, .r, .S, .s) files"},{name:"--no-Rd",description:"Do not tag Rd (.Rd) files"},{name:"--ctags",description:"Write Ctags format (default is Etags)"},{name:["--append","-a"],description:"Append to output file (overwrites by default)"},{name:["--verbose","-V"],description:"Echo the name of files processed"}]),args:{name:"path",description:"Directory in which files will be tagged",isOptional:!0,default:"."}}]}],options:m.concat([{name:"--encoding",description:"Specify encoding to be used for stdin",requiresSeparator:!0,args:{name:"encoding",suggestions:["UTF-8"]}},{name:"--save",description:"Save workspace at the end of the session",exclusiveOn:["--no-save","--vanilla"]},{name:"--no-save",description:"Do not save workspace at the end of the session",exclusiveOn:["--save"]},{name:"--no-environ",description:"Do not read the site and user environment files"},{name:"--no-site-file",description:"Do not read the site-wide Rprofile"},{name:"--no-init-file",description:"Do not read the user R profile"},{name:"--restore",description:"Do restore previously saved objects at startup",exclusiveOn:["--no-restore-data","--vanilla"]},{name:"--no-restore-data",description:"Do not restore previously saved objects",exclusiveOn:["--restore"]},{name:"--no-restore-history",description:"Do not restore the R history file"},{name:"--no-restore",description:"Do not restore anything"},{name:"--vanilla",description:"Combine --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ",exclusiveOn:["--save","--restore"]},{name:"--no-readline",description:"Do not use readline for command-line editing"},{name:"--max-ppsize",description:"Set max size of protect stack",requiresSeparator:!0,args:{name:"max size",description:"Max size of protect stack"}},{name:"--min-nsize",description:"Set min number of fixed size obj's ('cons cells')",requiresSeparator:!0,args:{name:"min size",description:"Minimum number of fixed size objects"}},{name:"--min-vsize",description:"Set vector heap minimum (in bytes or '4M' = 4 MegaB)",requiresSeparator:!0,args:{name:"min vsize",description:"Minimum vector heap size"}},{name:["--quiet","--silent","-q"],description:"Do not print startup message",exclusiveOn:["--verbose"]},{name:["--no-echo","-s"],description:"Make R run as quietly as possible"},{name:"--interactive",description:"Force an interactive session"},{name:"--verbose",description:"Print more information about progress",icon:"\u{1F4E3}",exclusiveOn:["--quiet","--silent","-q","--no-echo","-s"]},{name:["--debugger","-d"],description:"Run R through a debugger",icon:"\u{1FAB2}",requiresSeparator:!0,args:{name:"debugger",description:"Debugger to use"}},{name:"--debugger-args",description:"Pass arguments to the debugger",requiresSeparator:!0,args:{name:"args",description:"Arguments for the debugger"}},{name:["--gui","-g"],description:"Type of GUI to use",requiresSeparator:!0,args:{name:"gui",description:"Type of GUI",suggestions:["X11","Tk"],default:"X11"}},{name:"--arch",description:"Specify a sub-architecture",requiresSeparator:!0,args:{name:"arch",description:"Sub-architecture"}},{name:"--args",description:"Skip the rest of the command line"},{name:["--file","-f"],description:"Take input from a file",requiresSeparator:!0,args:{name:"file",description:"File to run",generators:ee}},{name:"-e",description:"Execute and R expression and exit",requiresSeparator:!0,args:{name:"expr",description:"Expression to evaluate"}}])},Me=Fe;export{Me as default};
|
|
1
|
+
var re=Object.create;var z=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var de=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of se(t))!ce.call(e,r)&&r!==n&&z(e,r,{get:()=>t[r],enumerable:!(i=oe(t,r))||i.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?re(ae(e)):{},de(t||!e||!e.__esModule?z(n,"default",{value:e,enumerable:!0}):n,e));var V=D(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.shellExpand=w.ensureTrailingSlash=void 0;var pe=e=>e.endsWith("/")?e:`${e}/`;w.ensureTrailingSlash=pe;var le=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,me=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var o;let a=r.slice(1);return(o=t[a])!==null&&o!==void 0?o:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,o,a)=>{var d,u;return(u=(d=t[o])!==null&&d!==void 0?d:a)!==null&&u!==void 0?u:r}),fe=(e,t)=>{var n;let{environmentVariables:i}=t;return me(le(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};w.shellExpand=fe});var U=D(b=>{"use strict";var ge=b&&b.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function d(s){try{c(i.next(s))}catch(p){a(p)}}function u(s){try{c(i.throw(s))}catch(p){a(p)}}function c(s){s.done?o(s.value):r(s.value).then(d,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=E;var P=V();function E(e,t=[]){let n=t.map(r=>r.toLowerCase()),i=e.filter(r=>!n.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 he=(e,t,n)=>{if(e===null)return"/";let i=(0,P.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,P.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,P.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=he;function I(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:d,showFolders:u="always"}=e,c=new Set(t),s=new Set(n),p=()=>t.length>0||n.length>0||i,v=(f=[])=>p()?f.filter(({name:h="",type:O})=>{if(!r&&O==="folder"||s.has(h)||i&&h.match(i))return!0;let[,...l]=h.split(".");if(l.length>=1){let y=l.length-1,k=l[y];do{if(c.has(k))return!0;y-=1,k=[l[y],k].join(".")}while(y>=0)}return!1}):f,x=(f=[])=>!o&&!a?f:f.map(h=>Object.assign(Object.assign({},h),(h.type==="file"?o:a)||{}));return{trigger:(f,h)=>{let O=f.lastIndexOf("/"),l=h.lastIndexOf("/");return O!==l?!0:O===-1&&l===-1?!1:f.slice(0,O)!==h.slice(0,l)},getQueryTerm:f=>f.slice(f.lastIndexOf("/")+1),custom:(f,h,O)=>ge(this,void 0,void 0,function*(){var l;let{isDangerous:y,currentWorkingDirectory:k,searchTerm:g}=O,L=(l=(0,b.getCurrentInsertedDirectory)(d??k,g,O))!==null&&l!==void 0?l:"/";try{let B=yield h({command:"ls",args:["-1ApL"],cwd:L}),ie=E(B.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),j=[];for(let F of ie)if(F){let _=F.endsWith("/")?"folders":"filepaths";(_==="filepaths"&&u!=="only"||_==="folders"&&u!=="never")&&j.push({type:_==="filepaths"?"file":"folder",name:F,insertValue:F,isDangerous:y,context:{templateType:_}})}return x(v(j))}catch{return[]}})}}b.folders=Object.assign(()=>I({showFolders:"only"}),Object.freeze(I({showFolders:"only"})));b.filepaths=Object.assign(I,Object.freeze(I()))});var W=D(R=>{"use strict";var A=R&&R.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function d(s){try{c(i.next(s))}catch(p){a(p)}}function u(s){try{c(i.throw(s))}catch(p){a(p)}}function c(s){s.done?o(s.value):r(s.value).then(d,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(R,"__esModule",{value:!0});R.valueList=ve;R.keyValue=Se;R.keyValueList=ye;var N=new Map;function X(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function H(e,t,n){return A(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return X(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return X(t,i)}return X(t,e)})}function G(e,t,n,i){return A(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=N.get(e);return r===void 0&&(r=yield H(e,t,i),N.set(e,r)),r}return H(e,t,i)})}function J(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function q(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function M(e,t){let n=new Set(e);return t.filter(i=>{var r;return typeof i.name=="string"?!n.has(i.name):!(!((r=i.name)===null||r===void 0)&&r.some(o=>n.has(o)))})}function ve({delimiter:e=",",values:t=[],cache:n=!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)=>A(this,void 0,void 0,function*(){var a;let d=yield G(t,i?e:"",n,o);if(r)return d;let[u]=o,c=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return M(c,d)})}}function Se({separator:e="=",keys:t=[],values:n=[],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)=>A(this,void 0,void 0,function*(){let[a]=o,u=!a[a.length-1].includes(e),c=u?t:n,s=J(u,i);return G(c,u&&r?e:"",s,o)})}}function ye({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:d=!1,allowRepeatedValues:u=!0}){return{trigger:(c,s)=>{let p=q(c,e,t),v=q(s,e,t);return p!==v},getQueryTerm:c=>{let s=q(c,e,t);return c.slice(s+1)},custom:(...c)=>A(this,void 0,void 0,function*(){let[s]=c,p=s[s.length-1],v=q(p,e,t),x=v===-1||p.slice(v,v+e.length)!==e,f=x?n:i,h=J(x,r),l=yield G(f,x?o?e:"":a?t:"",h,c);if(x){if(d)return l;let k=p.split(t).map(g=>g.slice(0,g.indexOf(e)));return M(k,l)}if(u)return l;let y=p.split(t).map(k=>k.slice(k.indexOf(e)+e.length));return M(y,l)})}}});var K=D(C=>{"use strict";var be=C&&C.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function d(s){try{c(i.next(s))}catch(p){a(p)}}function u(s){try{c(i.throw(s))}catch(p){a(p)}}function c(s){s.done?o(s.value):r(s.value).then(d,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(C,"__esModule",{value:!0});C.ai=Re;var Oe=4097,ke=4,xe=.8,Le=Oe*ke*xe;function Re({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(a,d,u)=>be(this,void 0,void 0,function*(){var c,s;let p=yield d({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(p.stdout))return[];let v=typeof t=="function"?yield t({tokens:a,executeCommand:d,generatorContext:u}):t,x=typeof n=="function"?yield n({tokens:a,executeCommand:d,generatorContext:u}):n;if(x===null||x.length===0)return console.warn("No message provided to AI generator"),[];let f=Le-((c=v?.length)!==null&&c!==void 0?c:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...v?[{role:"system",content:v}]:[],{role:"user",content:x.slice(0,f)}],temperature:r},O=JSON.stringify(h),l=yield d({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),y=JSON.parse(l.stdout);return(s=y?.choices.map(g=>{var L;return(L=g?.message)===null||L===void 0?void 0:L.content}).filter(g=>typeof g=="string").flatMap(g=>o?g.split(o).filter(L=>L.trim().length>0):[g]).map(g=>{if(i)return i(g);let L=g.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:L,insertValue:`'${L}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}});var Q=D(S=>{"use strict";var we=S&&S.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=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,i,r)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),De=S&&S.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&we(t,e,n)};Object.defineProperty(S,"__esModule",{value:!0});S.ai=S.folders=S.filepaths=void 0;var $=U();Object.defineProperty(S,"filepaths",{enumerable:!0,get:function(){return $.filepaths}});Object.defineProperty(S,"folders",{enumerable:!0,get:function(){return $.folders}});De(W(),S);var Ae=K();Object.defineProperty(S,"ai",{enumerable:!0,get:function(){return Ae.ai}})});var T=ue(Q(),1),Y=(0,T.filepaths)({extensions:["c","cc","cpp","m","mm","M","f","f90","f95"]}),Ce=(0,T.filepaths)({extensions:["tar","tar.gz","tzr.bz2","tar.xz","tgz"]}),Z=(0,T.filepaths)({extensions:["Rd"],editFileSuggestions:{priority:76}}),ee=(0,T.filepaths)({extensions:["R"],editFileSuggestions:{priority:76}}),te={script:["Rscript","-e",".libPaths()"],postProcess:e=>e.includes("not found")?[]:e.split(`
|
|
3
|
+
`).map(t=>({name:t.replace(/\d+/,"").replace("[]","").trim(),description:"Library"}))},m=[{name:["--help","-h"],description:"Print help message and exit",icon:"\u2754"},{name:["--version","-v"],description:"Print version info and exit",icon:"\u{1F4E3}"}],ne=[{name:["--clean","-c"],description:"Remove files created during compilation"},{name:"--preclean",description:"Remove files created during a previous run"}],Te={name:"R",description:"Start R or invoke an R tool using CMD",icon:"https://www.r-project.org/favicon-32x32.png",subcommands:[{name:"RHOME",description:"Print path to R home directory and exit"},{name:"CMD",description:"Invoke an R tool",subcommands:[{name:"BATCH",description:"Batch Execution of R",options:m.concat([{name:"--no-timing",description:"Do not report the timings"},{name:"--",description:"End processing of options"}]),args:[{name:"infile",description:"A file with R code to be executed",generators:ee},{name:"outfile",description:"A file to which to write output. If not given, the name used is that of infile, with a possible .R extension stripped, and .Rout appended"}]},{name:"COMPILE",description:"Compile files for use with R (not available on Windows)",options:m,args:{name:"files",description:"Source files to be compiled",isVariadic:!0,generators:Y}},{name:"SHLIB",description:"Compile the given source files and then link all specified object files",options:m.concat(ne).concat([{name:["--output","-o"],description:"Name for the built library",requiresSeparator:!0,args:{name:"LIB",description:"Full name for the built library"}},{name:["--dry-run","-n"],description:"Dry run; shows commands that would be used"},{name:"--use-LTO",description:"Use Link-Time Optimization",exclusiveOn:["--no-use-LTO"]},{name:"--no-use-LTO",description:"Do not use Link-Time Optimization",exclusiveOn:["--use-LTO"]},{name:["--debug","-d"],description:"Build a debug DLL (Windows only)",icon:"\u{1FAB2}"}]),args:{name:"files",description:"The object files to be included in the shared object/DLL",isVariadic:!0,generators:Y}},{name:"INSTALL",description:"Utility for installing add-on packages",options:m.concat(ne).concat([{name:["--debug","-d"],description:"Turn on debugging messages",icon:"\u{1FAB2}"},{name:["--library","-l"],description:"Install packages to library tree LIB",requiresSeparator:!0,args:{name:"LIB",description:"Path to the R library tree to install to",generators:te}},{name:"--no-configure",description:"Do not use the package's configure script"},{name:"--no-docs",description:"Do not install HTML, LaTeX or examples help"},{name:"--html",description:"Build HTML help",exclusiveOn:["--no-html"]},{name:"--no-html",description:"Do not build HTML help",exclusiveOn:["--html"]},{name:"--latex",description:"Install LaTeX help"},{name:"--example",description:"Install R code for help examples"},{name:"--fake",description:"Do minimal install for testing purposes"},{name:"--no-lock",description:"Install on top of any existing installation without using a lock directory",exclusiveOn:["--lock","--pkglock"]},{name:"--lock",description:"Use a per-library lock directory (default)",exclusiveOn:["--no-lock","--pkglock"]},{name:"--pkglock",description:"Use a per-package lock directory (default for a single package)",exclusiveOn:["--no-lock","--lock"]},{name:"--build",description:"Build binaries of the installed package(s)",icon:"\u{1F6E0}"},{name:"--install-tests",description:"Install package-specific tests (if any)"},{name:"--no-R",description:"Suppress installation of the package R code"},{name:"--no-libs",description:"Suppress installation of the package libs"},{name:"--no-data",description:"Suppress installation of the package data"},{name:"--no-help",description:"Suppress installation of the package help"},{name:"--no-demo",description:"Suppress installation of the package demo"},{name:"--no-exec",description:"Suppress installation of the 'exec' directory"},{name:"--no-inst",description:"Suppress installation of the 'inst' directory"},{name:"--no-multiarch",description:"Build only the main architecture"},{name:"--libs-only",description:"Only install the libs directory"},{name:"--data-compress",description:"Compression to be used for lazy-loading of data",requiresSeparator:!0,args:{name:"compression",description:"Compression method",default:"gzip",suggestions:["gzip","none","bzip2","xz"]}},{name:"--resave-data",description:"Re-save data files as compactly as possible"},{name:"--compact-docs",description:"Re-compress PDF files under inst/doc"},{name:"--with-keep.source",description:"'keep.source' for R code",exclusiveOn:["--without-keep.source"]},{name:"--without-keep.source",description:"Do not use 'keep.source' for R code",exclusiveOn:["--with-keep.source"]},{name:"--with-keep.parse.data",description:"Use 'keep.parse.data' for R code",exclusiveOn:["--without-keep.parse.data"]},{name:"--without-keep.parse.data",description:"Do not 'keep.parse.data' for R code",exclusiveOn:["--with-keep.parse.data"]},{name:"--byte-compile",description:"Byte-compile R code",exclusiveOn:["--no-byte-compile"]},{name:"--no-byte-compile",description:"Do not byte-compile R code",exclusiveOn:["--byte-compile"]},{name:"--staged-install",description:"Install to a temporary directory and then move to the target directory (default)",exclusiveOn:["--staged-install"]},{name:"--no-staged-install",description:"Install directly to the target directory",exclusiveOn:["--no-staged-install"]},{name:"--no-test-load",description:"Skip test of loading installed package"},{name:"--no-clean-on-error",description:"Do not remove installed package on error"},{name:"--merge-multiarch",description:"Multi-arch by merging (from a single tarball only)"},{name:"--use-vanilla",description:"Do not read any Renviron or Rprofile files"},{name:"--use-LTO",description:"Use Link-Time Optimization",exclusiveOn:["--no-use-LTO"]},{name:"--no-use-LTO",description:"Do not use Link-Time Optimization",exclusiveOn:["--use-LTO"]},{name:"--configure-args",description:"Set arguments for the configure scripts",requiresSeparator:!0,args:{name:"ARGS",description:"Arguments for the configure script"}},{name:"--configure-vars",description:"Set variables for the configure scripts",requiresSeparator:!0,args:{name:"ARGS",description:"Variables for the configure scripts"}},{name:"--strip",description:"Strip shared object(s) (Unix only)"},{name:"--strip-lib",description:"Strip static/dynamic libraries under 'lib/' (Unix only)"},{name:"--dsym",description:"Generate dSYM directory (macOS only)"},{name:"--built-timestamp",description:"Set timestamp for 'Built' entry in DESCRIPTION (Unix only)",requiresSeparator:!0,args:{name:"STAMP",description:"A timestamp for the build (Unix only)"}},{name:"--force-biarch",description:"Attempt to build both architectures (Windows only)"},{name:"--compile-both",description:"Compile both architectures on 32-bit Windows (Windows only)"}]),args:{name:"packages",description:"Directories with the package sources",generators:{template:"folders"}}},{name:"REMOVE",description:"Remove add-on packages",icon:"\u{1F5D1}",args:{name:"packages",description:"Packages to remove",isDangerous:!0,isVariadic:!0},options:m.concat([{name:["--library","-l"],description:"The library tree to remove from",requiresSeparator:!0,args:{name:"LIB",description:"Library tree",generators:te}}])},{name:"build",description:"Build R packages from package sources",icon:"\u{1F6E0}",args:{name:"pakgdirs",description:"Package directories",isVariadic:!0,generators:{template:"folders"}},options:m.concat([{name:"--force",description:"Force removal of INDEX file",isDangerous:!0},{name:"--keep-empty-dirs",description:"Do not remove empty dirs"},{name:"--no-build-vignettes",description:"Do not (re)build package vignettes"},{name:"--no-manual",description:"Do not build the PDF manual"},{name:"--resave-data",description:"Re-save data files as compactly as possible",requiresSeparator:!0,args:{name:"Compression method",isOptional:!0,default:"best",suggestions:["best","gzip","no"]},exclusiveOn:["--no-resave-data"]},{name:"--no-resave-data",description:"Do not save data",exclusiveOn:["--resave-data"]},{name:"--compact-vignettes",description:"Try to compact PDF files under 'inst/doc'",requiresSeparator:!0,args:{name:"Compression method",isOptional:!0,default:"no",suggestions:["no","qpdf","gs","gs+qpdf","both"]}},{name:"--compression",description:"Type of compression to be used on tarball",requiresSeparator:!0,args:{name:"Compression method",isOptional:!0,default:"gzip",suggestions:["gzip","none","bzip2","xz"]}},{name:"--md5",description:"Add MD5 sums"},{name:"--log",description:"Log to file 'pkg-00build.log' when processing the pkgdir with basename 'pkg'"}])},{name:"check",description:"Check R packages from package sources",icon:"\u2705",options:m.concat([{name:["--library","-lib"],description:"Library used for test installation of packages",args:{name:"LIB",description:"Library tree",default:".",generators:{template:"folders"}}},{name:["--output","-o"],description:"Directory for output",requiresSeparator:!0,args:{name:"directory",description:"Directory for output",default:".",generators:{template:"folders"}}},{name:"--no-clean",description:"Do not clean 'outdir' before using it"},{name:"--no-codoc",description:"Do not check for code/documentation mismatches"},{name:"--no-examples",description:"Do not run the examples in the Rd files"},{name:"--no-install",description:"Skip installation and associated tests"},{name:"--no-tests",description:"Do not run code in 'tests' subdirectory"},{name:"--no-manual",description:"Do not produce the PDF manual"},{name:"--no-vignettes",description:"Do not run R code in vignettes nor build outputs"},{name:"--no-build-vignettes",description:"Do not build vignette outputs"},{name:"--ignore-vignettes",description:"Skip all tests on vignettes"},{name:"--run-dontrun",description:"Do run `dontrun{}` sections in the Rd files"},{name:"--run-donttest",description:"Do run `donttest{}` sections in the Rd files"},{name:"--use-gct",description:"Use `gctorture(TRUE)` when running examples, tests"},{name:"--use-valgrind",description:"Use `valgrind` when running examples, tests, vignettes"},{name:"--timings",description:"Record timings for examples",icon:"\u23F1"},{name:"--install-args",description:"Command-line args to be passed to INSTALL",requiresSeparator:!0,args:{name:"args",description:"Command-line args to be passed to INSTALL"}},{name:"--test-dir",description:"Look in this subdirectory for test scripts",requiresSeparator:!0,args:{name:"directory",description:"Directory with the tests directory",default:"tests",generators:{template:"folders"}}},{name:"--no-stop-on-test-error",description:"Do not stop running tests after first error"},{name:"--check-subdirs",description:"Run checks on the package subdirectories",requiresSeparator:!0,args:{name:"yes-or-no",description:"Run checks on subdirectories?",default:"default",suggestions:["default","yes","no"]}},{name:"--as-cran",description:"Select customizations similar to those used by CRAN",icon:"https://www.r-project.org/favicon-32x32.png"},{name:"--extra-arch",description:"Do only runtime tests needed for an additional sub-architecture"},{name:"--multiarch",description:"Do runtime tests on all installed sub-archs",exclusiveOn:["--no-multiarch"]},{name:"--no-multiarch",description:"Do runtime tests only on the main sub-architecture",exclusiveOn:["--multiarch"]},{name:"--force-multiarch",description:"Run tests on all sub-archs even for packages with no compiled code",exclusiveOn:["--no-multiarch"]}]),args:{name:"packages",description:"Packages to check",isVariadic:!0,generators:Ce}},{name:"LINK",description:"Perform the specified linkcmd",icon:"\u{1F517}",options:m,args:{name:"linkcmd",description:"Command for linkcmd"}},{name:"rprof",description:"Post-process profiling information from `Rprof()`",icon:"\u23F1",options:m.concat([{name:"--lines",description:"Print line information"},{name:"--total",description:"Print only by total"},{name:"--self",description:"Print only by self"},{name:"--linesonly",description:"Print only by line"},{name:"--min%total",description:"Minimum % to print for 'by total'",requiresSeparator:!0,args:{name:"min % total",description:"Minimum % to print for 'by total'",suggestions:["1","10","50"]}},{name:"--min%self",description:"Minimum % to print for 'by self'",requiresSeparator:!0,args:{name:"min % self",description:"Minimum % to print for 'by self'",suggestions:["1","10","50"]}}]),args:{name:"Rprof output file",description:"File generated by `Rprof()`",isOptional:!0,default:"Rprof.out",generators:{template:"filepaths"}}},{name:"Rdconv",description:"Convert R documentation to other formats",options:m.concat([{name:["--type","-t"],description:"Output format type",requiresSeparator:!0,isRequired:!0,args:{name:"type",description:"Output format type",suggestions:["txt","html","latex","example"]}},{name:"--encoding",description:"Encoding of the output",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:"--package",description:"Package name",requiresSeparator:!0,args:{name:"package",description:"Package name"}},{name:["--output","-o"],description:"The output file",requiresSeparator:!0,args:{name:"output file",description:`Name of the output file, '""' to use the input file without '.Rd'`,default:'""',suggestions:['""',"-"]}},{name:["--os","--OS"],description:"Set name of OS ('unix' or 'windows')",requiresSeparator:!0,args:{name:"OS",description:"Name of the OS",suggestions:["unix","windows"]}},{name:"--RdMacros",description:"Packages from which to get Rd macros",requiresSeparator:!0,args:{name:"package list",description:"List of packages"}}]),args:{name:"file",description:"R doc file to convert",generators:Z}},{name:"Rd2pdf",description:"Generate PDF output from R documentation files",options:m.concat([{name:"--batch",description:"No interaction between files"},{name:"--no-clean",description:"Do not remove created temporary files"},{name:"--no-preview",description:"Do not preview generated PDF file"},{name:"--encoding",description:"Set the default input encoding",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:"--outputEncoding",description:"Set the default output encoding",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:["--os","--OS"],description:"Set name of OS ('unix' or 'windows')",requiresSeparator:!0,args:{name:"OS",description:"Name of the OS",suggestions:["unix","windows"]}},{name:["--output","-o"],description:"Write output to a file",requiresSeparator:!0,args:{name:"file",description:"Name of output file"}},{name:"--force",description:"Overwrite output file if it exists",isDangerous:!0},{name:"--title",description:"Set the title of the document",requiresSeparator:!0,args:{name:"title",description:"Title of the document"}},{name:"--no-index",description:"Do not index output"},{name:"--no-description",description:"Do not typeset the description of a package"},{name:"--internals",description:"Typeset 'internal' documentation (usually skipped)"},{name:"--build_dir",description:"Set the working directory",requiresSeparator:!0,args:{name:"working dir",description:"Working directory for the build",generators:{template:"folders"}}},{name:"--RdMacros",description:"Packages from which to get Rd macros",requiresSeparator:!0,args:{name:"package list",description:"List of packages"}}]),args:{name:"files or pkgs",description:"Rd files, or a directory with the sources of a pkg, or an installed pkg",generators:{template:"folders"}}},{name:"Rd2txt",description:"Convert R documentation to text",options:m.concat([{name:["--type","-t"],description:"Output format type",requiresSeparator:!0,isRequired:!0,args:{name:"type",description:"Output format type",suggestions:["txt","html","latex","example"],default:"txt"}},{name:"--encoding",description:"Encoding of the output",requiresSeparator:!0,args:{name:"enc",description:"Output encoding",default:"UTF-8"}},{name:"--package",description:"Package name",icon:"\u{1F4E6}",requiresSeparator:!0,args:{name:"package",description:"Package name"}},{name:["--output","-o"],description:"The output file",requiresSeparator:!0,args:{name:"output file",description:`Name of the output file, '""' to use the input file without '.Rd'`,default:'""',suggestions:['""',"-"]}},{name:["--os","--OS"],description:"Set name of OS ('unix' or 'windows')",requiresSeparator:!0,args:{name:"OS",description:"Name of the OS",suggestions:["unix","windows"]}},{name:"--RdMacros",description:"Packages from which to get Rd macros",requiresSeparator:!0,args:{name:"package list",description:"List of packages"}}]),args:{name:"file",description:"R doc file to convert",generators:Z}},{name:"Stangle",description:"A front-end for Stangle and other vignette engines",options:m.concat([{name:"--engine",description:"Use named vignette engine",requiresSeparator:!0,args:{name:"pkg::engine",description:"Vignette engine",suggestions:["Stangle","knitr::knit","utils::Sweave"],default:"Stangle"}},{name:"--encoding",description:"Set the encoding for file",requiresSeparator:!0,args:{name:"enc",description:"File encoding",default:"UTF-8"}},{name:"--options",description:"Comma-separated list of Stangle options",requiresSeparator:!0,args:{name:"options",description:"Options for Stangle"}}]),args:{name:"file",description:"File to process",generators:{template:"folders"}}},{name:"Sweave",description:"A front-end for Sweave and other vignette engines",options:m.concat([{name:"--driver",description:"Use named Sweave driver",requiresSeparator:!0,args:{name:"driver",description:"Sweave driver"}},{name:"--engine",description:"Use named vignette engine",requiresSeparator:!0,args:{name:"pkg::engine",description:"Vignette engine"}},{name:"--encoding=enc",description:"Default encoding 'enc' for file",requiresSeparator:!0,args:{name:"enc",description:"File encoding",default:"UTF-8"}},{name:"--clean",description:"Remove some of the created files",icon:"\u{1F9F9}",requiresSeparator:!0,args:{name:"method",description:"How to clean the results",isOptional:!0,default:"default",suggestions:["default","keepOuts"]}},{name:"--options",description:"Comma-separated list of Sweave/engine options",requiresSeparator:!0,args:{name:"options",description:"Options for Sweave/engine"}},{name:"--pdf",description:"Convert to PDF document"},{name:"--compact",description:"Try to compact PDF document",requiresSeparator:!0,args:{name:"Compacting method",description:"How to compact the PDF doc",isOptional:!0,default:"qpdf",suggestions:["no","qpdf","gs","gs+qpdf","both"]}}]),args:{name:"file",description:"Vignette to build",generators:{template:"filepaths"}}},{name:"Rdiff",description:"Diff R output files, discarding the R startup message",options:m,args:[{name:"from",description:"'From' R output file (or '-' for stdin)",generators:{template:"filepaths"}},{name:"to",description:"'To' R output file",generators:{template:"filepaths"}}]},{name:"config",description:"Get the value of a basic R configure variable",options:m.concat([{name:"--cppflags",description:"Print pre-processor flags required to compile a C/C++ file as part of a front-end using R as a library"},{name:"--ldflags",description:"Print linker flags needed for linking a front-end against the R library"},{name:"--no-user-files",description:"Ignore customization files under '~/.R'"},{name:"--no-site-files",description:"Ignore site customization files under 'R_HOME/etc'"},{name:"--all",description:"Print names and values of all variables"}]),args:{name:"variable",description:"R config variable",suggestions:["AR","BLAS_LIBS","CC","CFLAGS","CPICFLAGS","CPPFLAGS","CXX","CXXFLAGS","CXXPICFLAGS","CXX11","CXX11STD","CXX11FLAGS","CXX11PICFLAGS","CXX14","CXX14STD","CXX14FLAGS","CXX14PICFLAGS","CXX17","CXX17STD","CXX17FLAGS","CXX17PICFLAGS","CXX20","CXX20STD","CXX20FLAGS","CXX20PICFLAGS","DYLIB_EXT","DYLIB_LD","DYLIB_LDFLAGS","FC","FFLAGS","FCFLAGS","FLIBS","FPICFLAGS","JAR","JAVA","JAVAC","JAVAH","JAVA_HOME","JAVA_LIBS","JAVA_CPPFLAGS","LAPACK_LIBS","LIBnn","LDFLAGS","LTO","MAKE","NM","OBJC","OBJCFLAGS","RANLIB","SAFE_FFLAGS","SHLIB_CFLAGS","SHLIB_CXXFLAGS","SHLIB_CXXLD","SHLIB_CXXLDFLAGS","SHLIB_EXT","SHLIB_FFLAGS","SHLIB_LD","SHLIB_LDFLAGS","TCLTK_CPPFLAGS","TCLTK_LIBS"]}},{name:"javareconf",description:"Detect current Java setup and update the corresponding configuration in R",options:m.concat([{name:["-n","--dry-run"],description:"Perform Java detection, but don't touch any configuration files"},{name:"-e",description:"Same as -n but exports all detected variables and runs '<prog>'",args:{name:"program",description:"Program to run or '' to use shell"}}]),args:{name:"expression",description:"Evaluate the corresponding expression",isOptional:!0,suggestions:["JAVA_HOME=/usr/lib/java","JAVAC=/usr/bin/javac","JAR=/usr/bin/jar"]}},{name:"rtags",description:"Tag C, R, and Rd files under a directory",options:m.concat([{name:["--output","-o"],description:"Write output to a file",args:{name:"file",description:"Output file name",isOptional:!0}},{name:"--no-c",description:"Do not tag C (.c, .h) files"},{name:"--no-R",description:"Do not tag R (.R, .r, .S, .s) files"},{name:"--no-Rd",description:"Do not tag Rd (.Rd) files"},{name:"--ctags",description:"Write Ctags format (default is Etags)"},{name:["--append","-a"],description:"Append to output file (overwrites by default)"},{name:["--verbose","-V"],description:"Echo the name of files processed"}]),args:{name:"path",description:"Directory in which files will be tagged",isOptional:!0,default:"."}}]}],options:m.concat([{name:"--encoding",description:"Specify encoding to be used for stdin",requiresSeparator:!0,args:{name:"encoding",suggestions:["UTF-8"]}},{name:"--save",description:"Save workspace at the end of the session",exclusiveOn:["--no-save","--vanilla"]},{name:"--no-save",description:"Do not save workspace at the end of the session",exclusiveOn:["--save"]},{name:"--no-environ",description:"Do not read the site and user environment files"},{name:"--no-site-file",description:"Do not read the site-wide Rprofile"},{name:"--no-init-file",description:"Do not read the user R profile"},{name:"--restore",description:"Do restore previously saved objects at startup",exclusiveOn:["--no-restore-data","--vanilla"]},{name:"--no-restore-data",description:"Do not restore previously saved objects",exclusiveOn:["--restore"]},{name:"--no-restore-history",description:"Do not restore the R history file"},{name:"--no-restore",description:"Do not restore anything"},{name:"--vanilla",description:"Combine --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ",exclusiveOn:["--save","--restore"]},{name:"--no-readline",description:"Do not use readline for command-line editing"},{name:"--max-ppsize",description:"Set max size of protect stack",requiresSeparator:!0,args:{name:"max size",description:"Max size of protect stack"}},{name:"--min-nsize",description:"Set min number of fixed size obj's ('cons cells')",requiresSeparator:!0,args:{name:"min size",description:"Minimum number of fixed size objects"}},{name:"--min-vsize",description:"Set vector heap minimum (in bytes or '4M' = 4 MegaB)",requiresSeparator:!0,args:{name:"min vsize",description:"Minimum vector heap size"}},{name:["--quiet","--silent","-q"],description:"Do not print startup message",exclusiveOn:["--verbose"]},{name:["--no-echo","-s"],description:"Make R run as quietly as possible"},{name:"--interactive",description:"Force an interactive session"},{name:"--verbose",description:"Print more information about progress",icon:"\u{1F4E3}",exclusiveOn:["--quiet","--silent","-q","--no-echo","-s"]},{name:["--debugger","-d"],description:"Run R through a debugger",icon:"\u{1FAB2}",requiresSeparator:!0,args:{name:"debugger",description:"Debugger to use"}},{name:"--debugger-args",description:"Pass arguments to the debugger",requiresSeparator:!0,args:{name:"args",description:"Arguments for the debugger"}},{name:["--gui","-g"],description:"Type of GUI to use",requiresSeparator:!0,args:{name:"gui",description:"Type of GUI",suggestions:["X11","Tk"],default:"X11"}},{name:"--arch",description:"Specify a sub-architecture",requiresSeparator:!0,args:{name:"arch",description:"Sub-architecture"}},{name:"--args",description:"Skip the rest of the command line"},{name:["--file","-f"],description:"Take input from a file",requiresSeparator:!0,args:{name:"file",description:"File to run",generators:ee}},{name:"-e",description:"Execute and R expression and exit",requiresSeparator:!0,args:{name:"expr",description:"Expression to evaluate"}}])},Me=Te;export{Me as default};
|
package/build/rails.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var te=Object.create;var M=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),V=[];for(let I of ee)if(I){let D=I.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&l!=="only"||D==="folders"&&l!=="never")&&V.push({type:D==="filepaths"?"file":"folder",name:I,insertValue:I,isDangerous:v,context:{templateType:D}})}return w(h(V))}catch{return[]}})}}y.folders=Object.assign(()=>P({showFolders:"only"}),Object.freeze(P({showFolders:"only"})));y.filepaths=Object.assign(P,Object.freeze(P()))});var z=T(x=>{"use strict";var A=x&&x.__awaiter||function(e,t,i,n){function s(r){return r instanceof i?r:new i(function(a){a(r)})}return new(i||(i=Promise))(function(r,a){function u(o){try{c(n.next(o))}catch(d){a(d)}}function l(o){try{c(n.throw(o))}catch(d){a(d)}}function c(o){o.done?r(o.value):s(o.value).then(u,l)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.keyValueList=x.keyValue=x.valueList=void 0;var B=new Map;function E(e,t){return e.length===0?t:t.map(i=>i.insertValue?i:Object.assign(Object.assign({},i),{insertValue:i.name+e}))}function U(e,t,i){return A(this,void 0,void 0,function*(){if(typeof e=="function"){let n=yield e(...i);return E(t,n)}if(typeof e[0]=="string"){let n=e.map(s=>({name:s}));return E(t,n)}return E(t,e)})}function C(e,t,i,n){return A(this,void 0,void 0,function*(){if(i||Array.isArray(e)){let s=B.get(e);return s===void 0&&(s=yield U(e,t,n),B.set(e,s)),s}return U(e,t,n)})}function $(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function j(e,...t){return Math.max(...t.map(i=>e.lastIndexOf(i)))}function L(e,t){let i=new Set(e);return t.filter(n=>{var s;return typeof n.name=="string"?!i.has(n.name):!(!((s=n.name)===null||s===void 0)&&s.some(r=>i.has(r)))})}function fe({delimiter:e=",",values:t=[],cache:i=!1,insertDelimiter:n=!1,allowRepeatedValues:s=!1}){return{trigger:(r,a)=>r.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:r=>r.slice(r.lastIndexOf(e)+e.length),custom:(...r)=>A(this,void 0,void 0,function*(){var a;let u=yield C(t,n?e:"",i,r);if(s)return u;let[l]=r,c=(a=l[l.length-1])===null||a===void 0?void 0:a.split(e);return L(c,u)})}}x.valueList=fe;function ge({separator:e="=",keys:t=[],values:i=[],cache:n=!1,insertSeparator:s=!0}){return{trigger:(r,a)=>r.indexOf(e)!==a.indexOf(e),getQueryTerm:r=>r.slice(r.indexOf(e)+1),custom:(...r)=>A(this,void 0,void 0,function*(){let[a]=r,l=!a[a.length-1].includes(e),c=l?t:i,o=$(l,n);return C(c,l&&s?e:"",o,r)})}}x.keyValue=ge;function he({separator:e="=",delimiter:t=",",keys:i=[],values:n=[],cache:s=!1,insertSeparator:r=!0,insertDelimiter:a=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:l=!0}){return{trigger:(c,o)=>{let d=j(c,e,t),h=j(o,e,t);return d!==h},getQueryTerm:c=>{let o=j(c,e,t);return c.slice(o+1)},custom:(...c)=>A(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],h=j(d,e,t),w=h===-1||d.slice(h,h+e.length)!==e,m=w?i:n,g=$(w,s),p=yield C(m,w?r?e:"":a?t:"",g,c);if(w){if(u)return p;let k=d.split(t).map(f=>f.slice(0,f.indexOf(e)));return L(k,p)}if(l)return p;let v=d.split(t).map(k=>k.slice(k.indexOf(e)+e.length));return L(v,p)})}}x.keyValueList=he});var Q=T(R=>{"use strict";var ye=R&&R.__awaiter||function(e,t,i,n){function s(r){return r instanceof i?r:new i(function(a){a(r)})}return new(i||(i=Promise))(function(r,a){function u(o){try{c(n.next(o))}catch(d){a(d)}}function l(o){try{c(n.throw(o))}catch(d){a(d)}}function c(o){o.done?r(o.value):s(o.value).then(u,l)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(R,"__esModule",{value:!0});R.ai=void 0;var be=4097,ve=4,Se=.8,ke=be*ve*Se;function we({name:e,prompt:t,message:i,postProcess:n,temperature:s,splitOn:r}){return{scriptTimeout:15e3,custom:(a,u,l)=>ye(this,void 0,void 0,function*(){var c,o;let d=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let h=typeof t=="function"?yield t({tokens:a,executeCommand:u,generatorContext:l}):t,w=typeof i=="function"?yield i({tokens:a,executeCommand:u,generatorContext:l}):i;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let m=ke-((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:w.slice(0,m)}],temperature:s},S=JSON.stringify(g),p=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",S]}),v=JSON.parse(p.stdout);return(o=v?.choices.map(f=>{var _;return(_=f?.message)===null||_===void 0?void 0:_.content}).filter(f=>typeof f=="string").flatMap(f=>r?f.split(r).filter(_=>_.trim().length>0):[f]).map(f=>{if(n)return n(f);let _=f.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:_,insertValue:`'${_}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}R.ai=we});var K=T(b=>{"use strict";var _e=b&&b.__createBinding||(Object.create?function(e,t,i,n){n===void 0&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){n===void 0&&(n=i),e[n]=t[i]}),xe=b&&b.__exportStar||function(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&_e(t,e,i)};Object.defineProperty(b,"__esModule",{value:!0});b.ai=b.folders=b.filepaths=void 0;var J=W();Object.defineProperty(b,"filepaths",{enumerable:!0,get:function(){return J.filepaths}});Object.defineProperty(b,"folders",{enumerable:!0,get:function(){return J.folders}});xe(z(),b);var Oe=Q();Object.defineProperty(b,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var Z=oe(K(),1),Re="https://raw.githubusercontent.com/vscode-icons/vscode-icons/master/icons/file_type_ruby.svg",X={name:"new",description:"Create a new rails application",args:{name:"path",description:"Path to directory to be created containing the new application"},options:[{name:"-skip-namespace",description:"Skip namespace (affects only isolated applications)",args:{}},{name:["-r","--ruby"],description:"Path to the Ruby binary of your choice",args:{}},{name:"-m",description:"Path to some application template (can be a filesystem path or URL)"},{name:"-d",description:"Preconfigure for selected database - defaults to sqlite3",args:{name:"database",suggestions:["mysql","postgresql","sqlite3","oracle","frontbase","ibm_db","sqlserver","jdbcmysql","jdbcsqlite3","jdbcpostgresql","jdbc"]}},{name:"--skip-gemfile",description:"Don't create a Gemfile"},{name:"-G",description:"Skip .gitignore file"},{name:"--skip-keeps",description:"Skip source control .keep files"},{name:"-M",description:"Skip Action Mailer files"},{name:"--skip-action-mailbox",description:"Skip Action Mailbox gem"},{name:"--skip-action-text",description:"Skip Action Text gem"},{name:"-O",description:"Skip Active Record files"},{name:"--skip-active-storage",description:"Skip Active Storage files"},{name:"-P",description:"Skip Puma related files"},{name:"-C",description:"Skip Action Cable files"},{name:"-S",description:"Skip Sprockets files"},{name:"--skip-spring",description:"Don't install Spring application preloader"},{name:"--skip-listen",description:"Don't generate configuration that depends on the listen gem"},{name:"-J",description:"Skip JavaScript files"},{name:"--skip-turbolinks",description:"Skip turbolinks gem"},{name:"-T",description:"Skip test files"},{name:"--skip-system-test",description:"Skip system test files"},{name:"--skip-bootsnap",description:"Skip bootsnap gem"},{name:"--dev",description:"Setup the application with Gemfile pointing to your Rails checkout"},{name:"--edge",description:"Setup the application with Gemfile pointing to Rails repository"},{name:"--rc",description:"Path to file containing extra configuration options for rails command",args:{name:"path"}},{name:"--no-rc",description:"Skip loading of extra configuration options from .railsrc file"},{name:"--api",description:"Preconfigure smaller stack for API only apps"},{name:"-B",description:"Don't run bundle install"},{name:"--webpacker",description:"Preconfigure Webpack with a particular framework",args:{name:"framework",suggestions:["react","vue","angular","elm","stimulus"]}},{name:"--skip-webpack-install]",description:"Don't run Webpack install"},{name:["--f","--force"],description:"Overwrite files that already exist"},{name:["--p","--pretend"],description:"Run but do not make any changes"},{name:["--q","--quiet"],description:"Suppress status output"},{name:["--s","--skip"],description:"Skip files that already exist"},{name:["--h","--help"],description:"Show this help message and quit"},{name:["--v","--version"],description:"Show Rails version number and quit"}]},H=[{name:"--backtrace",description:"Enable full backtrace. OUT can be stderr (default) or stdout"},{name:"--comments",description:"Show commented tasks only"},{name:"--job-stats",description:"Display job statistics. LEVEL=history displays a complete job list"},{name:"--rules",description:"Trace the rules resolution"},{name:"--suppress-backtrace",description:"Suppress backtrace lines matching regexp PATTERN. Ignored if --trace is on",args:{name:"pattern"}},{name:["-A","--all"],description:"Show all tasks, even uncommented ones (in combination with -T or -D)"},{name:["-B","--build-all"],description:"Build all prerequisites, including those which are up-to-date"},{name:["-D","--describe"],description:"Describe the tasks (matching optional PATTERN), then exit",args:{name:"pattern",isOptional:!0}},{name:["-e","--execute"],description:"Execute some Ruby code and exit",args:{name:"code"}},{name:["-E","--execute-continue"],description:"Execute some Ruby code, then continue with normal task processing",args:{name:"code"}},{name:["-f","--rakefile"],description:"Use FILENAME as the rakefile to search for",args:{name:"filename"}},{name:"-G",description:"Use standard project Rakefile search paths, ignore system wide rakefiles"},{name:["-g","--system"],description:"Using system wide (global) rakefiles (usually '~/.rake/*.rake')"},{name:["-I","--libdir"],description:"Include LIBDIR in the search path for required modules",args:{name:"libdir"}},{name:["-j","--jobs"],description:"Specifies the maximum number of tasks to execute in parallel. (default is number of CPU cores + 4)",args:{name:"number"}},{name:["-m","--multitask"],description:"Treat all tasks as multitasks",args:{}},{name:["-n","--dry-run"],description:"Do a dry run without executing actions",args:{}},{name:"-N",description:"Do not search parent directories for the Rakefile",args:{}},{name:["-P","--prereqs"],description:"Display the tasks and dependencies, then exit",args:{}},{name:["-p","--execute-print"],description:"Execute some Ruby code, print the result, then exit",args:{}},{name:["-q","--quiet"],description:"Do not log messages to standard output",args:{}},{name:["-r","--require"],description:"Require MODULE before executing rakefile",args:{name:"module"}},{name:["-R","--rakelibdir"],description:"Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')",args:{name:"rakelibdir"}},{name:"--rakelib",description:"-s, --silent Like --quiet, but also suppresses the 'in directory' announcement",args:{}},{name:["-t","--trace"],description:"Turn on invoke/execute tracing, enable full backtrace. OUT can be stderr (default) or stdout",args:{}},{name:["-T","--tasks"],description:"Display the tasks (matching optional PATTERN) with descriptions, then exit. -AT combination displays all of tasks contained no description",args:{}},{name:["-v","--verbose"],description:"Log message to standard output",args:{}},{name:["-V","--version"],description:"Display the program version",args:{}},{name:["-W","--where"],description:"Describe the tasks (matching optional PATTERN), then exit",args:{name:"pattern"}},{name:["-X","--no-deprecation-warnings"],description:"Disable the deprecation warnings",args:{}},{name:["-h","--help"],description:"Display this help message",args:{}}],Y=[{name:["c","console"],description:"Interact with your Rails application from the command line",options:[{name:["-s","--sandbox"],description:"Rollback database modifications on exit"},{name:["-e","--environment"],description:"Specifies the environment to run this console under",args:{name:"environment"}}]},{name:"server",description:"Launch a web server to access your application through a browser",options:[{name:["-e","--environment"],description:"Specifies the environment to run this server under (e.g. test/development/production)",args:{name:"environment"}},{name:["-p","--port"],description:"Runs Rails on the specified port - defaults to 3000",args:{name:"port"}},{name:["-b","--binding"],description:"Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'",args:{name:"IP"}},{name:["-c","--config"],description:"Uses a custom rackup configuration - defaults to config.ru",args:{name:"file"}},{name:["-d","--daemon"],description:"Runs server as a Daemon"},{name:["-u","--using"],description:"Specifies the Rack server used to run the application (thin/puma/webrick)",args:{name:"server"}},{name:["-P","--pid"],description:"Specifies the PID file - defaults to tmp/pids/server.pid",args:{name:"PID"}},{name:["-C","--dev-caching"],description:"Specifies whether to perform caching in development"},{name:"--early-hints",description:"Enables HTTP/2 early hints"},{name:"--log-to-stdout",description:"Whether to log to stdout. Enabled by default in development when not daemonized"}]},{name:"db:create",description:"Create your database",options:H},{name:"db:migrate",description:"Run any pending database migrations",options:H},{name:"dbconsole",description:"Opens a console to your database (supports MySQL, PostgreSQL, and SQLite3)",options:[{name:"-e",description:"Specifies the environment to run this dbconsole under (e.g. test/development/production)",args:{}},{name:"--mode",description:"Automatically put the sqlite3 database in the specified mode",args:{name:"mode",suggestions:["html","list","line","column"]}},{name:"-p",description:"Automatically provide the password from database.yml",args:{}},{name:"-c",description:"Specifies the connection to use",args:{name:"connection"}},{name:["-db","--database"],description:"Specifies the database to use"}]},{name:"notes",description:"Enumerate all annotations",options:[{name:["-a","--annotations"],requiresSeparator:!0,args:{name:"annotations",isVariadic:!0,description:"Filter by specific annotations, e.g. Foobar TODO"}}]},{name:"generate",description:"Use templates to generate Rails resources",args:[{name:"generator",filterStrategy:"fuzzy",suggestions:["model","resource","scaffold","controller","migration"],generators:{script:["rails","g","--help"],cache:{cacheByDirectory:!0,strategy:"stale-while-revalidate"},postProcess(e){return["Rails:",...e.split("Rails:")[1].trim().split(`
|
|
3
|
-
`)].reduce((n,s)=>s.endsWith(":")?[...n,[s.replace(":",""),[]]]:(s.trim().length&&n[n.length-1][1].push(s.trim()),n),[]).reduce((n,[s,r])=>[...n,...r.map(a=>({insertValue:a,name:`${a} (${s})`}))],[])}}},{name:"args",isVariadic:!0}],options:[{name:"-h",description:"Print generator's options and usage",args:{}},{name:"-p",description:"Run but do not make any changes",args:{}},{name:"-f",description:"Overwrite files that already exist",args:{}},{name:"-s",description:"Skip files that already exist",args:{}},{name:"-q",description:"Suppress status output",args:{}}]},{name:"routes",description:"List all of the routes defined in your application",options:[{name:"-c",description:"Filter by a specific controller, e.g. PostsController or Admin::PostsController",args:{}},{name:"-g",description:"Grep routes by a specific pattern",args:{}},{name:"-E",description:"Print routes expanded vertically with parts explained",args:{}}]},{name:"test",description:"Run your test suite",args:{name:"files or directories",generators:(0,Z.filepaths)({extensions:["rb"],editFileSuggestions:{icon:Re}}),isOptional:!0},async generateSpec(e,t){let{stdout:i}=await t({command:"rails",args:["test","--help"]}),n=/(?:(-[a-zA-Z]), )?(--[^ ]+?)[ =]([A-Z_]+)?[ \r\n]+([^\n]+)/g;return{name:"test",options:Array.from(i.matchAll(n)).map(r=>{let[a,u,l,c,o]=r;return{name:l.replace(/\[.+\]/g,""),description:o,args:{name:c}}})}}},X],Te={custom:async(e,t)=>{let i=[];try{let{stdout:n}=await t({command:"rails",args:["--tasks"]}),s=Y.map(a=>a.name);i=Array.from(n.matchAll(/rails ([^ ]+)/g)).map(a=>({name:a[1]})).filter(a=>!s.includes(a.name))}catch(n){console.log("ERROR",n)}return i},cache:{strategy:"stale-while-revalidate",ttl:1e3*60*60*24*3,cacheByDirectory:!0}},Ae={name:"rails",description:"Ruby on Rails CLI",icon:"https://avatars.githubusercontent.com/u/4223?s=48&v=4",generateSpec:async(e,t)=>(await t({command:"bash",args:["-c",`until [[ -f Gemfile ]] || [[ $PWD = '/' ]]; do cd ..; done; if [ -f Gemfile ]; then cat Gemfile | \\grep "gem ['\\"]rails['\\"]"; fi`]})).status===0?{name:"rails",subcommands:Y,args:{generators:Te,isOptional:!0}}:{name:"rails",subcommands:[X]}},
|
|
1
|
+
var te=Object.create;var M=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ae=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ie(t))!re.call(e,s)&&s!==i&&M(e,s,{get:()=>t[s],enumerable:!(n=ne(t,s))||n.enumerable});return e};var oe=(e,t,i)=>(i=e!=null?te(se(e)):{},ae(t||!e||!e.__esModule?M(i,"default",{value:e,enumerable:!0}):i,e));var G=R(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.shellExpand=O.ensureTrailingSlash=void 0;var ce=e=>e.endsWith("/")?e:`${e}/`;O.ensureTrailingSlash=ce;var le=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ue=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,s=>{var r;let a=s.slice(1);return(r=t[a])!==null&&r!==void 0?r:s}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(s,r,a)=>{var u,l;return(l=(u=t[r])!==null&&u!==void 0?u:a)!==null&&l!==void 0?l:s}),de=(e,t)=>{var i;let{environmentVariables:n}=t;return ue(le(e,(i=n?.HOME)!==null&&i!==void 0?i:"~"),n)};O.shellExpand=de});var W=R(v=>{"use strict";var pe=v&&v.__awaiter||function(e,t,i,n){function s(r){return r instanceof i?r:new i(function(a){a(r)})}return new(i||(i=Promise))(function(r,a){function u(o){try{c(n.next(o))}catch(d){a(d)}}function l(o){try{c(n.throw(o))}catch(d){a(d)}}function c(o){o.done?r(o.value):s(o.value).then(u,l)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(v,"__esModule",{value:!0});v.filepaths=v.folders=v.getCurrentInsertedDirectory=void 0;v.sortFilesAlphabetically=N;var q=G();function N(e,t=[]){let i=t.map(s=>s.toLowerCase()),n=e.filter(s=>!i.includes(s.toLowerCase()));return[...n.filter(s=>!s.startsWith(".")).sort((s,r)=>s.localeCompare(r)),...n.filter(s=>s.startsWith(".")).sort((s,r)=>s.localeCompare(r)),"../"]}var me=(e,t,i)=>{if(e===null)return"/";let n=(0,q.shellExpand)(t,i),s=n.slice(0,n.lastIndexOf("/")+1);return s===""?(0,q.ensureTrailingSlash)(e):s.startsWith("/")?s:`${(0,q.ensureTrailingSlash)(e)}${s}`};v.getCurrentInsertedDirectory=me;function P(e={}){let{extensions:t=[],equals:i=[],matches:n,filterFolders:s=!1,editFileSuggestions:r,editFolderSuggestions:a,rootDirectory:u,showFolders:l="always"}=e,c=new Set(t),o=new Set(i),d=()=>t.length>0||i.length>0||n,h=(m=[])=>d()?m.filter(({name:g="",type:S})=>{if(!s&&S==="folder"||o.has(g)||n&&g.match(n))return!0;let[,...p]=g.split(".");if(p.length>=1){let b=p.length-1,k=p[b];do{if(c.has(k))return!0;b-=1,k=[p[b],k].join(".")}while(b>=0)}return!1}):m,w=(m=[])=>!r&&!a?m:m.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?r:a)||{}));return{trigger:(m,g)=>{let S=m.lastIndexOf("/"),p=g.lastIndexOf("/");return S!==p?!0:S===-1&&p===-1?!1:m.slice(0,S)!==g.slice(0,p)},getQueryTerm:m=>m.slice(m.lastIndexOf("/")+1),custom:(m,g,S)=>pe(this,void 0,void 0,function*(){var p;let{isDangerous:b,currentWorkingDirectory:k,searchTerm:f}=S,_=(p=(0,v.getCurrentInsertedDirectory)(u??k,f,S))!==null&&p!==void 0?p:"/";try{let F=yield g({command:"ls",args:["-1ApL"],cwd:_}),ee=N(F.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),V=[];for(let I of ee)if(I){let D=I.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&l!=="only"||D==="folders"&&l!=="never")&&V.push({type:D==="filepaths"?"file":"folder",name:I,insertValue:I,isDangerous:b,context:{templateType:D}})}return w(h(V))}catch{return[]}})}}v.folders=Object.assign(()=>P({showFolders:"only"}),Object.freeze(P({showFolders:"only"})));v.filepaths=Object.assign(P,Object.freeze(P()))});var z=R(x=>{"use strict";var T=x&&x.__awaiter||function(e,t,i,n){function s(r){return r instanceof i?r:new i(function(a){a(r)})}return new(i||(i=Promise))(function(r,a){function u(o){try{c(n.next(o))}catch(d){a(d)}}function l(o){try{c(n.throw(o))}catch(d){a(d)}}function c(o){o.done?r(o.value):s(o.value).then(u,l)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=fe;x.keyValue=ge;x.keyValueList=he;var B=new Map;function E(e,t){return e.length===0?t:t.map(i=>i.insertValue?i:Object.assign(Object.assign({},i),{insertValue:i.name+e}))}function U(e,t,i){return T(this,void 0,void 0,function*(){if(typeof e=="function"){let n=yield e(...i);return E(t,n)}if(typeof e[0]=="string"){let n=e.map(s=>({name:s}));return E(t,n)}return E(t,e)})}function L(e,t,i,n){return T(this,void 0,void 0,function*(){if(i||Array.isArray(e)){let s=B.get(e);return s===void 0&&(s=yield U(e,t,n),B.set(e,s)),s}return U(e,t,n)})}function $(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function j(e,...t){return Math.max(...t.map(i=>e.lastIndexOf(i)))}function C(e,t){let i=new Set(e);return t.filter(n=>{var s;return typeof n.name=="string"?!i.has(n.name):!(!((s=n.name)===null||s===void 0)&&s.some(r=>i.has(r)))})}function fe({delimiter:e=",",values:t=[],cache:i=!1,insertDelimiter:n=!1,allowRepeatedValues:s=!1}){return{trigger:(r,a)=>r.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:r=>r.slice(r.lastIndexOf(e)+e.length),custom:(...r)=>T(this,void 0,void 0,function*(){var a;let u=yield L(t,n?e:"",i,r);if(s)return u;let[l]=r,c=(a=l[l.length-1])===null||a===void 0?void 0:a.split(e);return C(c,u)})}}function ge({separator:e="=",keys:t=[],values:i=[],cache:n=!1,insertSeparator:s=!0}){return{trigger:(r,a)=>r.indexOf(e)!==a.indexOf(e),getQueryTerm:r=>r.slice(r.indexOf(e)+1),custom:(...r)=>T(this,void 0,void 0,function*(){let[a]=r,l=!a[a.length-1].includes(e),c=l?t:i,o=$(l,n);return L(c,l&&s?e:"",o,r)})}}function he({separator:e="=",delimiter:t=",",keys:i=[],values:n=[],cache:s=!1,insertSeparator:r=!0,insertDelimiter:a=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:l=!0}){return{trigger:(c,o)=>{let d=j(c,e,t),h=j(o,e,t);return d!==h},getQueryTerm:c=>{let o=j(c,e,t);return c.slice(o+1)},custom:(...c)=>T(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],h=j(d,e,t),w=h===-1||d.slice(h,h+e.length)!==e,m=w?i:n,g=$(w,s),p=yield L(m,w?r?e:"":a?t:"",g,c);if(w){if(u)return p;let k=d.split(t).map(f=>f.slice(0,f.indexOf(e)));return C(k,p)}if(l)return p;let b=d.split(t).map(k=>k.slice(k.indexOf(e)+e.length));return C(b,p)})}}});var Q=R(A=>{"use strict";var ye=A&&A.__awaiter||function(e,t,i,n){function s(r){return r instanceof i?r:new i(function(a){a(r)})}return new(i||(i=Promise))(function(r,a){function u(o){try{c(n.next(o))}catch(d){a(d)}}function l(o){try{c(n.throw(o))}catch(d){a(d)}}function c(o){o.done?r(o.value):s(o.value).then(u,l)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=we;var be=4097,ve=4,Se=.8,ke=be*ve*Se;function we({name:e,prompt:t,message:i,postProcess:n,temperature:s,splitOn:r}){return{scriptTimeout:15e3,custom:(a,u,l)=>ye(this,void 0,void 0,function*(){var c,o;let d=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let h=typeof t=="function"?yield t({tokens:a,executeCommand:u,generatorContext:l}):t,w=typeof i=="function"?yield i({tokens:a,executeCommand:u,generatorContext:l}):i;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let m=ke-((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:w.slice(0,m)}],temperature:s},S=JSON.stringify(g),p=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",S]}),b=JSON.parse(p.stdout);return(o=b?.choices.map(f=>{var _;return(_=f?.message)===null||_===void 0?void 0:_.content}).filter(f=>typeof f=="string").flatMap(f=>r?f.split(r).filter(_=>_.trim().length>0):[f]).map(f=>{if(n)return n(f);let _=f.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:_,insertValue:`'${_}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var K=R(y=>{"use strict";var _e=y&&y.__createBinding||(Object.create?function(e,t,i,n){n===void 0&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){n===void 0&&(n=i),e[n]=t[i]}),xe=y&&y.__exportStar||function(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&_e(t,e,i)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var J=W();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return J.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return J.folders}});xe(z(),y);var Oe=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var Z=oe(K(),1),Re="https://raw.githubusercontent.com/vscode-icons/vscode-icons/master/icons/file_type_ruby.svg",X={name:"new",description:"Create a new rails application",args:{name:"path",description:"Path to directory to be created containing the new application"},options:[{name:"-skip-namespace",description:"Skip namespace (affects only isolated applications)",args:{}},{name:["-r","--ruby"],description:"Path to the Ruby binary of your choice",args:{}},{name:"-m",description:"Path to some application template (can be a filesystem path or URL)"},{name:"-d",description:"Preconfigure for selected database - defaults to sqlite3",args:{name:"database",suggestions:["mysql","postgresql","sqlite3","oracle","frontbase","ibm_db","sqlserver","jdbcmysql","jdbcsqlite3","jdbcpostgresql","jdbc"]}},{name:"--skip-gemfile",description:"Don't create a Gemfile"},{name:"-G",description:"Skip .gitignore file"},{name:"--skip-keeps",description:"Skip source control .keep files"},{name:"-M",description:"Skip Action Mailer files"},{name:"--skip-action-mailbox",description:"Skip Action Mailbox gem"},{name:"--skip-action-text",description:"Skip Action Text gem"},{name:"-O",description:"Skip Active Record files"},{name:"--skip-active-storage",description:"Skip Active Storage files"},{name:"-P",description:"Skip Puma related files"},{name:"-C",description:"Skip Action Cable files"},{name:"-S",description:"Skip Sprockets files"},{name:"--skip-spring",description:"Don't install Spring application preloader"},{name:"--skip-listen",description:"Don't generate configuration that depends on the listen gem"},{name:"-J",description:"Skip JavaScript files"},{name:"--skip-turbolinks",description:"Skip turbolinks gem"},{name:"-T",description:"Skip test files"},{name:"--skip-system-test",description:"Skip system test files"},{name:"--skip-bootsnap",description:"Skip bootsnap gem"},{name:"--dev",description:"Setup the application with Gemfile pointing to your Rails checkout"},{name:"--edge",description:"Setup the application with Gemfile pointing to Rails repository"},{name:"--rc",description:"Path to file containing extra configuration options for rails command",args:{name:"path"}},{name:"--no-rc",description:"Skip loading of extra configuration options from .railsrc file"},{name:"--api",description:"Preconfigure smaller stack for API only apps"},{name:"-B",description:"Don't run bundle install"},{name:"--webpacker",description:"Preconfigure Webpack with a particular framework",args:{name:"framework",suggestions:["react","vue","angular","elm","stimulus"]}},{name:"--skip-webpack-install]",description:"Don't run Webpack install"},{name:["--f","--force"],description:"Overwrite files that already exist"},{name:["--p","--pretend"],description:"Run but do not make any changes"},{name:["--q","--quiet"],description:"Suppress status output"},{name:["--s","--skip"],description:"Skip files that already exist"},{name:["--h","--help"],description:"Show this help message and quit"},{name:["--v","--version"],description:"Show Rails version number and quit"}]},H=[{name:"--backtrace",description:"Enable full backtrace. OUT can be stderr (default) or stdout"},{name:"--comments",description:"Show commented tasks only"},{name:"--job-stats",description:"Display job statistics. LEVEL=history displays a complete job list"},{name:"--rules",description:"Trace the rules resolution"},{name:"--suppress-backtrace",description:"Suppress backtrace lines matching regexp PATTERN. Ignored if --trace is on",args:{name:"pattern"}},{name:["-A","--all"],description:"Show all tasks, even uncommented ones (in combination with -T or -D)"},{name:["-B","--build-all"],description:"Build all prerequisites, including those which are up-to-date"},{name:["-D","--describe"],description:"Describe the tasks (matching optional PATTERN), then exit",args:{name:"pattern",isOptional:!0}},{name:["-e","--execute"],description:"Execute some Ruby code and exit",args:{name:"code"}},{name:["-E","--execute-continue"],description:"Execute some Ruby code, then continue with normal task processing",args:{name:"code"}},{name:["-f","--rakefile"],description:"Use FILENAME as the rakefile to search for",args:{name:"filename"}},{name:"-G",description:"Use standard project Rakefile search paths, ignore system wide rakefiles"},{name:["-g","--system"],description:"Using system wide (global) rakefiles (usually '~/.rake/*.rake')"},{name:["-I","--libdir"],description:"Include LIBDIR in the search path for required modules",args:{name:"libdir"}},{name:["-j","--jobs"],description:"Specifies the maximum number of tasks to execute in parallel. (default is number of CPU cores + 4)",args:{name:"number"}},{name:["-m","--multitask"],description:"Treat all tasks as multitasks",args:{}},{name:["-n","--dry-run"],description:"Do a dry run without executing actions",args:{}},{name:"-N",description:"Do not search parent directories for the Rakefile",args:{}},{name:["-P","--prereqs"],description:"Display the tasks and dependencies, then exit",args:{}},{name:["-p","--execute-print"],description:"Execute some Ruby code, print the result, then exit",args:{}},{name:["-q","--quiet"],description:"Do not log messages to standard output",args:{}},{name:["-r","--require"],description:"Require MODULE before executing rakefile",args:{name:"module"}},{name:["-R","--rakelibdir"],description:"Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')",args:{name:"rakelibdir"}},{name:"--rakelib",description:"-s, --silent Like --quiet, but also suppresses the 'in directory' announcement",args:{}},{name:["-t","--trace"],description:"Turn on invoke/execute tracing, enable full backtrace. OUT can be stderr (default) or stdout",args:{}},{name:["-T","--tasks"],description:"Display the tasks (matching optional PATTERN) with descriptions, then exit. -AT combination displays all of tasks contained no description",args:{}},{name:["-v","--verbose"],description:"Log message to standard output",args:{}},{name:["-V","--version"],description:"Display the program version",args:{}},{name:["-W","--where"],description:"Describe the tasks (matching optional PATTERN), then exit",args:{name:"pattern"}},{name:["-X","--no-deprecation-warnings"],description:"Disable the deprecation warnings",args:{}},{name:["-h","--help"],description:"Display this help message",args:{}}],Y=[{name:["c","console"],description:"Interact with your Rails application from the command line",options:[{name:["-s","--sandbox"],description:"Rollback database modifications on exit"},{name:["-e","--environment"],description:"Specifies the environment to run this console under",args:{name:"environment"}}]},{name:"server",description:"Launch a web server to access your application through a browser",options:[{name:["-e","--environment"],description:"Specifies the environment to run this server under (e.g. test/development/production)",args:{name:"environment"}},{name:["-p","--port"],description:"Runs Rails on the specified port - defaults to 3000",args:{name:"port"}},{name:["-b","--binding"],description:"Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'",args:{name:"IP"}},{name:["-c","--config"],description:"Uses a custom rackup configuration - defaults to config.ru",args:{name:"file"}},{name:["-d","--daemon"],description:"Runs server as a Daemon"},{name:["-u","--using"],description:"Specifies the Rack server used to run the application (thin/puma/webrick)",args:{name:"server"}},{name:["-P","--pid"],description:"Specifies the PID file - defaults to tmp/pids/server.pid",args:{name:"PID"}},{name:["-C","--dev-caching"],description:"Specifies whether to perform caching in development"},{name:"--early-hints",description:"Enables HTTP/2 early hints"},{name:"--log-to-stdout",description:"Whether to log to stdout. Enabled by default in development when not daemonized"}]},{name:"db:create",description:"Create your database",options:H},{name:"db:migrate",description:"Run any pending database migrations",options:H},{name:"dbconsole",description:"Opens a console to your database (supports MySQL, PostgreSQL, and SQLite3)",options:[{name:"-e",description:"Specifies the environment to run this dbconsole under (e.g. test/development/production)",args:{}},{name:"--mode",description:"Automatically put the sqlite3 database in the specified mode",args:{name:"mode",suggestions:["html","list","line","column"]}},{name:"-p",description:"Automatically provide the password from database.yml",args:{}},{name:"-c",description:"Specifies the connection to use",args:{name:"connection"}},{name:["-db","--database"],description:"Specifies the database to use"}]},{name:"notes",description:"Enumerate all annotations",options:[{name:["-a","--annotations"],requiresSeparator:!0,args:{name:"annotations",isVariadic:!0,description:"Filter by specific annotations, e.g. Foobar TODO"}}]},{name:"generate",description:"Use templates to generate Rails resources",args:[{name:"generator",filterStrategy:"fuzzy",suggestions:["model","resource","scaffold","controller","migration"],generators:{script:["rails","g","--help"],cache:{cacheByDirectory:!0,strategy:"stale-while-revalidate"},postProcess(e){return["Rails:",...e.split("Rails:")[1].trim().split(`
|
|
3
|
+
`)].reduce((n,s)=>s.endsWith(":")?[...n,[s.replace(":",""),[]]]:(s.trim().length&&n[n.length-1][1].push(s.trim()),n),[]).reduce((n,[s,r])=>[...n,...r.map(a=>({insertValue:a,name:`${a} (${s})`}))],[])}}},{name:"args",isVariadic:!0}],options:[{name:"-h",description:"Print generator's options and usage",args:{}},{name:"-p",description:"Run but do not make any changes",args:{}},{name:"-f",description:"Overwrite files that already exist",args:{}},{name:"-s",description:"Skip files that already exist",args:{}},{name:"-q",description:"Suppress status output",args:{}}]},{name:"routes",description:"List all of the routes defined in your application",options:[{name:"-c",description:"Filter by a specific controller, e.g. PostsController or Admin::PostsController",args:{}},{name:"-g",description:"Grep routes by a specific pattern",args:{}},{name:"-E",description:"Print routes expanded vertically with parts explained",args:{}}]},{name:"test",description:"Run your test suite",args:{name:"files or directories",generators:(0,Z.filepaths)({extensions:["rb"],editFileSuggestions:{icon:Re}}),isOptional:!0},async generateSpec(e,t){let{stdout:i}=await t({command:"rails",args:["test","--help"]}),n=/(?:(-[a-zA-Z]), )?(--[^ ]+?)[ =]([A-Z_]+)?[ \r\n]+([^\n]+)/g;return{name:"test",options:Array.from(i.matchAll(n)).map(r=>{let[a,u,l,c,o]=r;return{name:l.replace(/\[.+\]/g,""),description:o,args:{name:c}}})}}},X],Te={custom:async(e,t)=>{let i=[];try{let{stdout:n}=await t({command:"rails",args:["--tasks"]}),s=Y.map(a=>a.name);i=Array.from(n.matchAll(/rails ([^ ]+)/g)).map(a=>({name:a[1]})).filter(a=>!s.includes(a.name))}catch(n){console.log("ERROR",n)}return i},cache:{strategy:"stale-while-revalidate",ttl:1e3*60*60*24*3,cacheByDirectory:!0}},Ae={name:"rails",description:"Ruby on Rails CLI",icon:"https://avatars.githubusercontent.com/u/4223?s=48&v=4",generateSpec:async(e,t)=>(await t({command:"bash",args:["-c",`until [[ -f Gemfile ]] || [[ $PWD = '/' ]]; do cd ..; done; if [ -f Gemfile ]; then cat Gemfile | \\grep "gem ['\\"]rails['\\"]"; fi`]})).status===0?{name:"rails",subcommands:Y,args:{generators:Te,isOptional:!0}}:{name:"rails",subcommands:[X]}},Ce=Ae;export{Ce as default,Te as railsCommandsGenerator};
|