@tabsmith/autocomplete-specs 1.0.0 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/build/@magnolia/cli.js +2 -2
  2. package/build/@withfig/autocomplete-tools.js +2 -2
  3. package/build/airflow.js +2 -2
  4. package/build/ansible-playbook.js +2 -2
  5. package/build/apt.js +4 -4
  6. package/build/asr.js +2 -2
  7. package/build/bun.js +9 -9
  8. package/build/cargo.js +4 -4
  9. package/build/cd.js +2 -2
  10. package/build/chezmoi.js +2 -2
  11. package/build/cloudflared.js +2 -2
  12. package/build/coda.js +3 -3
  13. package/build/codesign.js +2 -2
  14. package/build/dapr.js +2 -2
  15. package/build/deno/generators.js +4 -4
  16. package/build/deno.js +2 -2
  17. package/build/deployctl.js +2 -2
  18. package/build/direnv.js +2 -2
  19. package/build/docker.js +18 -18
  20. package/build/dotenv-vault.js +2 -2
  21. package/build/dotnet/dotnet-add.js +2 -2
  22. package/build/dotnet/dotnet-build.js +2 -2
  23. package/build/dotnet/dotnet-clean.js +2 -2
  24. package/build/dotnet/dotnet-format.js +2 -2
  25. package/build/dotnet/dotnet-list.js +2 -2
  26. package/build/dotnet/dotnet-migrate.js +2 -2
  27. package/build/dotnet/dotnet-nuget.js +3 -3
  28. package/build/dotnet/dotnet-pack.js +2 -2
  29. package/build/dotnet/dotnet-publish.js +2 -2
  30. package/build/dotnet/dotnet-remove.js +2 -2
  31. package/build/dotnet/dotnet-restore.js +2 -2
  32. package/build/dotnet/dotnet-sln.js +2 -2
  33. package/build/dotnet/dotnet-store.js +2 -2
  34. package/build/dotnet/dotnet-test.js +2 -2
  35. package/build/dotnet/dotnet-tool.js +3 -3
  36. package/build/dotnet.js +2 -2
  37. package/build/dtm.js +3 -3
  38. package/build/dynamic/index.js +1 -1
  39. package/build/elixir.js +2 -2
  40. package/build/elm-json.js +2 -2
  41. package/build/esbuild.js +3 -3
  42. package/build/file.js +2 -2
  43. package/build/flutter.js +5 -5
  44. package/build/gh.js +4 -4
  45. package/build/git.js +20 -20
  46. package/build/glow.js +2 -2
  47. package/build/hub.js +20 -20
  48. package/build/iex.js +2 -2
  49. package/build/index.js +1 -1
  50. package/build/index.json +1 -1
  51. package/build/java.js +2 -2
  52. package/build/julia.js +2 -2
  53. package/build/limactl.js +3 -3
  54. package/build/man.js +3 -3
  55. package/build/meteor.js +3 -3
  56. package/build/mgnl.js +2 -2
  57. package/build/mix.js +2 -2
  58. package/build/mongoimport.js +2 -2
  59. package/build/n.js +3 -3
  60. package/build/ni.js +2 -2
  61. package/build/node.js +2 -2
  62. package/build/npm.js +2 -2
  63. package/build/nr.js +3 -3
  64. package/build/nrm.js +2 -2
  65. package/build/opencode.js +2 -2
  66. package/build/osascript.js +2 -2
  67. package/build/osqueryi.js +2 -2
  68. package/build/pandoc.js +3 -3
  69. package/build/pdfunite.js +2 -2
  70. package/build/pi.js +2 -2
  71. package/build/pipenv.js +2 -2
  72. package/build/pm2.js +2 -2
  73. package/build/pnpm.js +23 -24
  74. package/build/pod.js +2 -2
  75. package/build/pre-commit.js +126 -126
  76. package/build/python.js +2 -2
  77. package/build/python3.js +2 -2
  78. package/build/r.js +3 -3
  79. package/build/rails.js +3 -3
  80. package/build/rancher.js +3 -3
  81. package/build/react-native.js +5 -5
  82. package/build/robot.js +2 -2
  83. package/build/rojo.js +2 -2
  84. package/build/rollup.js +2 -2
  85. package/build/rscript.js +2 -2
  86. package/build/rush.js +5 -5
  87. package/build/rushx.js +4 -4
  88. package/build/scc.js +2 -2
  89. package/build/shortcuts.js +2 -2
  90. package/build/sidekiq.js +2 -2
  91. package/build/sqlite3.js +2 -2
  92. package/build/streamlit.js +2 -2
  93. package/build/subl.js +2 -2
  94. package/build/swift.js +2 -2
  95. package/build/systemctl.js +2 -2
  96. package/build/ts-node.js +3 -3
  97. package/build/tsc.js +2 -2
  98. package/build/tsx.js +2 -2
  99. package/build/turbo.js +20 -20
  100. package/build/typst.js +2 -2
  101. package/build/vsce.js +20 -20
  102. package/build/wasm-bindgen.js +2 -2
  103. package/build/yarn.js +4 -4
  104. package/build/yomo.js +2 -2
  105. package/package.json +20 -20
  106. package/build/ai-agents specs.js +0 -1
@@ -1,2 +1,2 @@
1
- var ne=Object.create;var z=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var le=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of re(t))!se.call(e,r)&&r!==n&&z(e,r,{get:()=>t[r],enumerable:!(i=ie(t,r))||i.enumerable});return e};var ae=(e,t,n)=>(n=e!=null?ne(oe(e)):{},le(t||!e||!e.__esModule?z(n,"default",{value:e,enumerable:!0}):n,e));var J=j(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.shellExpand=x.ensureTrailingSlash=void 0;var ue=e=>e.endsWith("/")?e:`${e}/`;x.ensureTrailingSlash=ue;var ce=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,de=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var o;let l=r.slice(1);return(o=t[l])!==null&&o!==void 0?o:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,o,l)=>{var u,c;return(c=(u=t[o])!==null&&u!==void 0?u:l)!==null&&c!==void 0?c:r}),fe=(e,t)=>{var n;let{environmentVariables:i}=t;return de(ce(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};x.shellExpand=fe});var k=j(y=>{"use strict";var pe=y&&y.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(i.next(s))}catch(d){l(d)}}function c(s){try{a(i.throw(s))}catch(d){l(d)}}function a(s){s.done?o(s.value):r(s.value).then(u,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(y,"__esModule",{value:!0});y.filepaths=y.folders=y.getCurrentInsertedDirectory=y.sortFilesAlphabetically=void 0;var C=J();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,o)=>r.localeCompare(o)),...i.filter(r=>r.startsWith(".")).sort((r,o)=>r.localeCompare(o)),"../"]}y.sortFilesAlphabetically=Q;var ve=(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}`};y.getCurrentInsertedDirectory=ve;function D(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:l,rootDirectory:u,showFolders:c="always"}=e,a=new Set(t),s=new Set(n),d=()=>t.length>0||n.length>0||i,g=(p=[])=>d()?p.filter(({name:h="",type:_})=>{if(!r&&_==="folder"||s.has(h)||i&&h.match(i))return!0;let[,...f]=h.split(".");if(f.length>=1){let O=f.length-1,b=f[O];do{if(a.has(b))return!0;O-=1,b=[f[O],b].join(".")}while(O>=0)}return!1}):p,S=(p=[])=>!o&&!l?p:p.map(h=>Object.assign(Object.assign({},h),(h.type==="file"?o:l)||{}));return{trigger:(p,h)=>{let _=p.lastIndexOf("/"),f=h.lastIndexOf("/");return _!==f?!0:_===-1&&f===-1?!1:p.slice(0,_)!==h.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,h,_)=>pe(this,void 0,void 0,function*(){var f;let{isDangerous:O,currentWorkingDirectory:b,searchTerm:v}=_,w=(f=(0,y.getCurrentInsertedDirectory)(u??b,v,_))!==null&&f!==void 0?f:"/";try{let $=yield h({command:"ls",args:["-1ApL"],cwd:w}),te=Q($.stdout.split(`
2
- `),[".DS_Store"]),K=[];for(let E of te)if(E){let M=E.endsWith("/")?"folders":"filepaths";(M==="filepaths"&&c!=="only"||M==="folders"&&c!=="never")&&K.push({type:M==="filepaths"?"file":"folder",name:E,insertValue:E,isDangerous:O,context:{templateType:M}})}return S(g(K))}catch{return[]}})}}y.folders=Object.assign(()=>D({showFolders:"only"}),Object.freeze(D({showFolders:"only"})));y.filepaths=Object.assign(D,Object.freeze(D()))});var B=j(T=>{"use strict";var V=T&&T.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(i.next(s))}catch(d){l(d)}}function c(s){try{a(i.throw(s))}catch(d){l(d)}}function a(s){s.done?o(s.value):r(s.value).then(u,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.keyValueList=T.keyValue=T.valueList=void 0;var G=new Map;function P(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 V(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return P(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return P(t,i)}return P(t,e)})}function R(e,t,n,i){return V(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=G.get(e);return r===void 0&&(r=yield H(e,t,i),G.set(e,r)),r}return H(e,t,i)})}function U(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function L(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function q(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 he({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:r=!1}){return{trigger:(o,l)=>o.lastIndexOf(e)!==l.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>V(this,void 0,void 0,function*(){var l;let u=yield R(t,i?e:"",n,o);if(r)return u;let[c]=o,a=(l=c[c.length-1])===null||l===void 0?void 0:l.split(e);return q(a,u)})}}T.valueList=he;function ge({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:r=!0}){return{trigger:(o,l)=>o.indexOf(e)!==l.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>V(this,void 0,void 0,function*(){let[l]=o,c=!l[l.length-1].includes(e),a=c?t:n,s=U(c,i);return R(a,c&&r?e:"",s,o)})}}T.keyValue=ge;function ye({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:l=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(a,s)=>{let d=L(a,e,t),g=L(s,e,t);return d!==g},getQueryTerm:a=>{let s=L(a,e,t);return a.slice(s+1)},custom:(...a)=>V(this,void 0,void 0,function*(){let[s]=a,d=s[s.length-1],g=L(d,e,t),S=g===-1||d.slice(g,g+e.length)!==e,p=S?n:i,h=U(S,r),f=yield R(p,S?o?e:"":l?t:"",h,a);if(S){if(u)return f;let b=d.split(t).map(v=>v.slice(0,v.indexOf(e)));return q(b,f)}if(c)return f;let O=d.split(t).map(b=>b.slice(b.indexOf(e)+e.length));return q(O,f)})}}T.keyValueList=ye});var X=j(A=>{"use strict";var me=A&&A.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(i.next(s))}catch(d){l(d)}}function c(s){try{a(i.throw(s))}catch(d){l(d)}}function a(s){s.done?o(s.value):r(s.value).then(u,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=void 0;var Oe=4097,_e=4,be=.8,Se=Oe*_e*be;function we({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(l,u,c)=>me(this,void 0,void 0,function*(){var a,s;let d=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof t=="function"?yield t({tokens:l,executeCommand:u,generatorContext:c}):t,S=typeof n=="function"?yield n({tokens:l,executeCommand:u,generatorContext:c}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=Se-((a=g?.length)!==null&&a!==void 0?a:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:S.slice(0,p)}],temperature:r},_=JSON.stringify(h),f=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),O=JSON.parse(f.stdout);return(s=O?.choices.map(v=>{var w;return(w=v?.message)===null||w===void 0?void 0:w.content}).filter(v=>typeof v=="string").flatMap(v=>o?v.split(o).filter(w=>w.trim().length>0):[v]).map(v=>{if(i)return i(v);let w=v.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:w,insertValue:`'${w}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}A.ai=we});var Y=j(m=>{"use strict";var Te=m&&m.__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]}),Ie=m&&m.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Te(t,e,n)};Object.defineProperty(m,"__esModule",{value:!0});m.ai=m.folders=m.filepaths=void 0;var Z=k();Object.defineProperty(m,"filepaths",{enumerable:!0,get:function(){return Z.filepaths}});Object.defineProperty(m,"folders",{enumerable:!0,get:function(){return Z.folders}});Ie(B(),m);var xe=X();Object.defineProperty(m,"ai",{enumerable:!0,get:function(){return xe.ai}})});var ee=ae(Y(),1),I={name:["--yes","-y"],description:"Automatic yes to prompts. Assume yes to all prompts and run non-interactively"},F={name:["-m","--dotenvMe"],description:"Pass .env.me (DOTENV_ME) credential directly (rather than reading from .env.me file)",args:{name:"DOTENV_ME",description:"Pass .env.me (DOTENV_ME) credential directly"}},Ae={name:"DOTENV_VAULT",description:"Set .env.vault identifier. Defaults to generated value",isOptional:!0},je={name:"DOTENV_ME",description:"Set .env.me credential. Defaults to generated value",isOptional:!0},N={name:"ENVIRONMENT",description:"Set environment to open to. Defaults to development",isOptional:!0},W={name:"FILENAME",description:"Set input filename. Defaults to .env for development and .env.{environment} for other environments",isOptional:!0,generators:(0,ee.filepaths)({matches:/^\.env.*$/})},Ve={name:"dotenv-vault",description:"CLI for dotenv-vault",options:[{name:"--help",description:"Get documentation for the command",isPersistent:!0}],subcommands:[{name:"new",description:"Create your project",options:[I],args:Ae},{name:"login",description:"Log in to dotenv-vault",options:[I],args:je},{name:"logout",description:"Log out from dotenv-vault",options:[I]},{name:"open",description:"Opens project page in a browser",options:[I],args:N},{name:"push",description:"Push .env securely",options:[I,F],args:[N,W]},{name:"pull",description:"Pull .env securely",options:[I,F],args:[N,W]},{name:"versions",description:"List version history",options:[I,F],args:[N,W]},{name:"whoami",description:"Display the current logged in user",options:[F]},{name:"status",description:"Check dotenv-operational status",options:[I]},{name:"help",description:"Display help for dotenv-vault"},{name:"update",description:"Update the dotenv-vault CLI",options:[I]}]},Ce=Ve;export{Ce as default};
1
+ var ne=Object.create;var z=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var le=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of re(t))!se.call(e,r)&&r!==n&&z(e,r,{get:()=>t[r],enumerable:!(i=ie(t,r))||i.enumerable});return e};var ae=(e,t,n)=>(n=e!=null?ne(oe(e)):{},le(t||!e||!e.__esModule?z(n,"default",{value:e,enumerable:!0}):n,e));var J=A(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.shellExpand=x.ensureTrailingSlash=void 0;var ue=e=>e.endsWith("/")?e:`${e}/`;x.ensureTrailingSlash=ue;var ce=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,de=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var o;let l=r.slice(1);return(o=t[l])!==null&&o!==void 0?o:r}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(r,o,l)=>{var u,c;return(c=(u=t[o])!==null&&u!==void 0?u:l)!==null&&c!==void 0?c:r}),fe=(e,t)=>{var n;let{environmentVariables:i}=t;return de(ce(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};x.shellExpand=fe});var G=A(O=>{"use strict";var pe=O&&O.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(i.next(s))}catch(d){l(d)}}function c(s){try{a(i.throw(s))}catch(d){l(d)}}function a(s){s.done?o(s.value):r(s.value).then(u,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(O,"__esModule",{value:!0});O.filepaths=O.folders=O.getCurrentInsertedDirectory=void 0;O.sortFilesAlphabetically=Q;var C=J();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,o)=>r.localeCompare(o)),...i.filter(r=>r.startsWith(".")).sort((r,o)=>r.localeCompare(o)),"../"]}var ve=(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}`};O.getCurrentInsertedDirectory=ve;function D(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:l,rootDirectory:u,showFolders:c="always"}=e,a=new Set(t),s=new Set(n),d=()=>t.length>0||n.length>0||i,g=(p=[])=>d()?p.filter(({name:h="",type:_})=>{if(!r&&_==="folder"||s.has(h)||i&&h.match(i))return!0;let[,...f]=h.split(".");if(f.length>=1){let m=f.length-1,b=f[m];do{if(a.has(b))return!0;m-=1,b=[f[m],b].join(".")}while(m>=0)}return!1}):p,S=(p=[])=>!o&&!l?p:p.map(h=>Object.assign(Object.assign({},h),(h.type==="file"?o:l)||{}));return{trigger:(p,h)=>{let _=p.lastIndexOf("/"),f=h.lastIndexOf("/");return _!==f?!0:_===-1&&f===-1?!1:p.slice(0,_)!==h.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,h,_)=>pe(this,void 0,void 0,function*(){var f;let{isDangerous:m,currentWorkingDirectory:b,searchTerm:v}=_,w=(f=(0,O.getCurrentInsertedDirectory)(u??b,v,_))!==null&&f!==void 0?f:"/";try{let $=yield h({command:"ls",args:["-1ApL"],cwd:w}),te=Q($.stdout.split(`
2
+ `),[".DS_Store"]),K=[];for(let E of te)if(E){let M=E.endsWith("/")?"folders":"filepaths";(M==="filepaths"&&c!=="only"||M==="folders"&&c!=="never")&&K.push({type:M==="filepaths"?"file":"folder",name:E,insertValue:E,isDangerous:m,context:{templateType:M}})}return S(g(K))}catch{return[]}})}}O.folders=Object.assign(()=>D({showFolders:"only"}),Object.freeze(D({showFolders:"only"})));O.filepaths=Object.assign(D,Object.freeze(D()))});var X=A(I=>{"use strict";var j=I&&I.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(i.next(s))}catch(d){l(d)}}function c(s){try{a(i.throw(s))}catch(d){l(d)}}function a(s){s.done?o(s.value):r(s.value).then(u,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(I,"__esModule",{value:!0});I.valueList=he;I.keyValue=ge;I.keyValueList=ye;var H=new Map;function P(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function U(e,t,n){return j(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return P(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return P(t,i)}return P(t,e)})}function R(e,t,n,i){return j(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=H.get(e);return r===void 0&&(r=yield U(e,t,i),H.set(e,r)),r}return U(e,t,i)})}function B(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function L(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function q(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 he({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:r=!1}){return{trigger:(o,l)=>o.lastIndexOf(e)!==l.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>j(this,void 0,void 0,function*(){var l;let u=yield R(t,i?e:"",n,o);if(r)return u;let[c]=o,a=(l=c[c.length-1])===null||l===void 0?void 0:l.split(e);return q(a,u)})}}function ge({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:r=!0}){return{trigger:(o,l)=>o.indexOf(e)!==l.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>j(this,void 0,void 0,function*(){let[l]=o,c=!l[l.length-1].includes(e),a=c?t:n,s=B(c,i);return R(a,c&&r?e:"",s,o)})}}function ye({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:l=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(a,s)=>{let d=L(a,e,t),g=L(s,e,t);return d!==g},getQueryTerm:a=>{let s=L(a,e,t);return a.slice(s+1)},custom:(...a)=>j(this,void 0,void 0,function*(){let[s]=a,d=s[s.length-1],g=L(d,e,t),S=g===-1||d.slice(g,g+e.length)!==e,p=S?n:i,h=B(S,r),f=yield R(p,S?o?e:"":l?t:"",h,a);if(S){if(u)return f;let b=d.split(t).map(v=>v.slice(0,v.indexOf(e)));return q(b,f)}if(c)return f;let m=d.split(t).map(b=>b.slice(b.indexOf(e)+e.length));return q(m,f)})}}});var Z=A(V=>{"use strict";var me=V&&V.__awaiter||function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(i.next(s))}catch(d){l(d)}}function c(s){try{a(i.throw(s))}catch(d){l(d)}}function a(s){s.done?o(s.value):r(s.value).then(u,c)}a((i=i.apply(e,t||[])).next())})};Object.defineProperty(V,"__esModule",{value:!0});V.ai=we;var Oe=4097,_e=4,be=.8,Se=Oe*_e*be;function we({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(l,u,c)=>me(this,void 0,void 0,function*(){var a,s;let d=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof t=="function"?yield t({tokens:l,executeCommand:u,generatorContext:c}):t,S=typeof n=="function"?yield n({tokens:l,executeCommand:u,generatorContext:c}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=Se-((a=g?.length)!==null&&a!==void 0?a:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:S.slice(0,p)}],temperature:r},_=JSON.stringify(h),f=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),m=JSON.parse(f.stdout);return(s=m?.choices.map(v=>{var w;return(w=v?.message)===null||w===void 0?void 0:w.content}).filter(v=>typeof v=="string").flatMap(v=>o?v.split(o).filter(w=>w.trim().length>0):[v]).map(v=>{if(i)return i(v);let w=v.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:w,insertValue:`'${w}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}});var Y=A(y=>{"use strict";var Te=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]}),Ie=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Te(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var k=G();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return k.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return k.folders}});Ie(X(),y);var xe=Z();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return xe.ai}})});var ee=ae(Y(),1),T={name:["--yes","-y"],description:"Automatic yes to prompts. Assume yes to all prompts and run non-interactively"},F={name:["-m","--dotenvMe"],description:"Pass .env.me (DOTENV_ME) credential directly (rather than reading from .env.me file)",args:{name:"DOTENV_ME",description:"Pass .env.me (DOTENV_ME) credential directly"}},Ae={name:"DOTENV_VAULT",description:"Set .env.vault identifier. Defaults to generated value",isOptional:!0},je={name:"DOTENV_ME",description:"Set .env.me credential. Defaults to generated value",isOptional:!0},N={name:"ENVIRONMENT",description:"Set environment to open to. Defaults to development",isOptional:!0},W={name:"FILENAME",description:"Set input filename. Defaults to .env for development and .env.{environment} for other environments",isOptional:!0,generators:(0,ee.filepaths)({matches:/^\.env.*$/})},Ve={name:"dotenv-vault",description:"CLI for dotenv-vault",options:[{name:"--help",description:"Get documentation for the command",isPersistent:!0}],subcommands:[{name:"new",description:"Create your project",options:[T],args:Ae},{name:"login",description:"Log in to dotenv-vault",options:[T],args:je},{name:"logout",description:"Log out from dotenv-vault",options:[T]},{name:"open",description:"Opens project page in a browser",options:[T],args:N},{name:"push",description:"Push .env securely",options:[T,F],args:[N,W]},{name:"pull",description:"Pull .env securely",options:[T,F],args:[N,W]},{name:"versions",description:"List version history",options:[T,F],args:[N,W]},{name:"whoami",description:"Display the current logged in user",options:[F]},{name:"status",description:"Check dotenv-operational status",options:[T]},{name:"help",description:"Display help for dotenv-vault"},{name:"update",description:"Update the dotenv-vault CLI",options:[T]}]},Ce=Ve;export{Ce as default};
@@ -1,2 +1,2 @@
1
- var Z=Object.create;var E=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var re=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ee(t))!ne.call(e,r)&&r!==n&&E(e,r,{get:()=>t[r],enumerable:!(i=Y(t,r))||i.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Z(te(e)):{},re(t||!e||!e.__esModule?E(n,"default",{value:e,enumerable:!0}):n,e));var W=A(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.shellExpand=j.ensureTrailingSlash=void 0;var se=e=>e.endsWith("/")?e:`${e}/`;j.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)};j.shellExpand=ce});var G=A(v=>{"use strict";var le=v&&v.__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(v,"__esModule",{value:!0});v.filepaths=v.folders=v.getCurrentInsertedDirectory=v.sortFilesAlphabetically=void 0;var D=W();function $(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)),"../"]}v.sortFilesAlphabetically=$;var ue=(e,t,n)=>{if(e===null)return"/";let i=(0,D.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,D.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,D.ensureTrailingSlash)(e)}${r}`};v.getCurrentInsertedDirectory=ue;function V(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,m=(p=[])=>d()?p.filter(({name:g="",type:O})=>{if(!r&&O==="folder"||o.has(g)||i&&g.match(i))return!0;let[,...f]=g.split(".");if(f.length>=1){let _=f.length-1,b=f[_];do{if(c.has(b))return!0;_-=1,b=[f[_],b].join(".")}while(_>=0)}return!1}):p,S=(p=[])=>!s&&!a?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?s:a)||{}));return{trigger:(p,g)=>{let O=p.lastIndexOf("/"),f=g.lastIndexOf("/");return O!==f?!0:O===-1&&f===-1?!1:p.slice(0,O)!==g.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,O)=>le(this,void 0,void 0,function*(){var f;let{isDangerous:_,currentWorkingDirectory:b,searchTerm:h}=O,w=(f=(0,v.getCurrentInsertedDirectory)(l??b,h,O))!==null&&f!==void 0?f:"/";try{let N=yield g({command:"ls",args:["-1ApL"],cwd:w}),X=$(N.stdout.split(`
2
- `),[".DS_Store"]),q=[];for(let k of X)if(k){let F=k.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&u!=="only"||F==="folders"&&u!=="never")&&q.push({type:F==="filepaths"?"file":"folder",name:k,insertValue:k,isDangerous:_,context:{templateType:F}})}return S(m(q))}catch{return[]}})}}v.folders=Object.assign(()=>V({showFolders:"only"}),Object.freeze(V({showFolders:"only"})));v.filepaths=Object.assign(V,Object.freeze(V()))});var H=A(T=>{"use strict";var I=T&&T.__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(T,"__esModule",{value:!0});T.keyValueList=T.keyValue=T.valueList=void 0;var J=new Map;function R(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function K(e,t,n){return I(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return R(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return R(t,i)}return R(t,e)})}function M(e,t,n,i){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=J.get(e);return r===void 0&&(r=yield K(e,t,i),J.set(e,r)),r}return K(e,t,i)})}function z(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function L(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function C(e,t){let n=new Set(e);return t.filter(i=>{var 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)=>I(this,void 0,void 0,function*(){var a;let l=yield M(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 C(c,l)})}}T.valueList=de;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)=>I(this,void 0,void 0,function*(){let[a]=s,u=!a[a.length-1].includes(e),c=u?t:n,o=z(u,i);return M(c,u&&r?e:"",o,s)})}}T.keyValue=fe;function pe({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=L(c,e,t),m=L(o,e,t);return d!==m},getQueryTerm:c=>{let o=L(c,e,t);return c.slice(o+1)},custom:(...c)=>I(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],m=L(d,e,t),S=m===-1||d.slice(m,m+e.length)!==e,p=S?n:i,g=z(S,r),f=yield M(p,S?s?e:"":a?t:"",g,c);if(S){if(l)return f;let b=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return C(b,f)}if(u)return f;let _=d.split(t).map(b=>b.slice(b.indexOf(e)+e.length));return C(_,f)})}}T.keyValueList=pe});var Q=A(x=>{"use strict";var he=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.ai=void 0;var ge=4097,me=4,ve=.8,ye=ge*me*ve;function _e({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:s}){return{scriptTimeout:15e3,custom:(a,l,u)=>he(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 m=typeof t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((c=m?.length)!==null&&c!==void 0?c:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...m?[{role:"system",content:m}]:[],{role:"user",content:S.slice(0,p)}],temperature:r},O=JSON.stringify(g),f=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),_=JSON.parse(f.stdout);return(o=_?.choices.map(h=>{var w;return(w=h?.message)===null||w===void 0?void 0:w.content}).filter(h=>typeof h=="string").flatMap(h=>s?h.split(s).filter(w=>w.trim().length>0):[h]).map(h=>{if(i)return i(h);let w=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:w,insertValue:`'${w}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}x.ai=_e});var U=A(y=>{"use strict";var Oe=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]}),be=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Oe(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var B=G();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return B.folders}});be(H(),y);var Se=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Se.ai}})});var P=ie(U(),1),we={script(e){return["curl","-s","-H","Accept: application/json",`https://azuresearch-usnc.nuget.org/query?packageType=Dependency&q=${e[e.length-1]}`]},postProcess(e){return JSON.parse(e).data.map(n=>({name:n.title,insertValue:n.id,description:n.description}))}},Te={script(e){let t=e.filter(r=>!r.startsWith("-")),n=t.findIndex(r=>r==="package");return["curl","-s","-H","Accept: application/json",`https://api.nuget.org/v3-flatcontainer/${t[n+1].toLowerCase()}/index.json`]},postProcess(e){return JSON.parse(e).versions.reverse().map(n=>({name:n}))}},je={name:"add",args:{name:"project",description:"Specifies the project file. If not specified, the command searches the current directory for one",isOptional:!0,generators:(0,P.filepaths)({extensions:["csproj"]})},subcommands:[{name:"package",description:"The package reference to add",args:{name:"id",debounce:!0,generators:we},options:[{name:["-f","--framework"],description:"Adds a package reference only when targeting a specific framework",args:{name:"framework"}},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication"},{name:["-n","--no-restore"],description:"Adds a package reference without performing a restore preview and compatibility check"},{name:"--package-directory",description:"The directory where to restore the packages. The default package restore location is %userprofile%.nugetpackages on Windows and ~/.nuget/packages on macOS and Linux",args:{name:"directory",template:"folders"}},{name:"--prerelease",description:"Allows prerelease packages to be installed. Available since .NET Core 5 SDK"},{name:["-s","--source"],description:"The URI of the NuGet package source to use during the restore operation"},{name:["-v","--version"],description:"Version of the package",args:{name:"version",debounce:!0,generators:Te}}]},{name:"reference",description:"The dotnet add reference command provides a convenient option to add project references to a project. After running the command, the <ProjectReference> elements are added to the project file",args:{name:"path",isVariadic:!0,generators:(0,P.filepaths)({extensions:["csproj"]})},options:[{name:["-f","--framework"],description:"Adds a package reference only when targeting a specific framework",args:{name:"framework"}}]}]},Le=je;export{Le as default};
1
+ var Z=Object.create;var E=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var re=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ee(t))!ne.call(e,r)&&r!==n&&E(e,r,{get:()=>t[r],enumerable:!(i=Y(t,r))||i.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Z(te(e)):{},re(t||!e||!e.__esModule?E(n,"default",{value:e,enumerable:!0}):n,e));var W=x(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.shellExpand=j.ensureTrailingSlash=void 0;var se=e=>e.endsWith("/")?e:`${e}/`;j.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)};j.shellExpand=ce});var G=x(_=>{"use strict";var le=_&&_.__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(_,"__esModule",{value:!0});_.filepaths=_.folders=_.getCurrentInsertedDirectory=void 0;_.sortFilesAlphabetically=$;var R=W();function $(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,R.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,R.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,R.ensureTrailingSlash)(e)}${r}`};_.getCurrentInsertedDirectory=ue;function V(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,m=(p=[])=>d()?p.filter(({name:g="",type:O})=>{if(!r&&O==="folder"||o.has(g)||i&&g.match(i))return!0;let[,...f]=g.split(".");if(f.length>=1){let y=f.length-1,b=f[y];do{if(c.has(b))return!0;y-=1,b=[f[y],b].join(".")}while(y>=0)}return!1}):p,S=(p=[])=>!s&&!a?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?s:a)||{}));return{trigger:(p,g)=>{let O=p.lastIndexOf("/"),f=g.lastIndexOf("/");return O!==f?!0:O===-1&&f===-1?!1:p.slice(0,O)!==g.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,O)=>le(this,void 0,void 0,function*(){var f;let{isDangerous:y,currentWorkingDirectory:b,searchTerm:h}=O,w=(f=(0,_.getCurrentInsertedDirectory)(l??b,h,O))!==null&&f!==void 0?f:"/";try{let N=yield g({command:"ls",args:["-1ApL"],cwd:w}),X=$(N.stdout.split(`
2
+ `),[".DS_Store"]),q=[];for(let k of X)if(k){let F=k.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&u!=="only"||F==="folders"&&u!=="never")&&q.push({type:F==="filepaths"?"file":"folder",name:k,insertValue:k,isDangerous:y,context:{templateType:F}})}return S(m(q))}catch{return[]}})}}_.folders=Object.assign(()=>V({showFolders:"only"}),Object.freeze(V({showFolders:"only"})));_.filepaths=Object.assign(V,Object.freeze(V()))});var H=x(T=>{"use strict";var I=T&&T.__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(T,"__esModule",{value:!0});T.valueList=de;T.keyValue=fe;T.keyValueList=pe;var J=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 K(e,t,n){return I(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 M(e,t,n,i){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=J.get(e);return r===void 0&&(r=yield K(e,t,i),J.set(e,r)),r}return K(e,t,i)})}function z(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function D(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function L(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)=>I(this,void 0,void 0,function*(){var a;let l=yield M(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 L(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)=>I(this,void 0,void 0,function*(){let[a]=s,u=!a[a.length-1].includes(e),c=u?t:n,o=z(u,i);return M(c,u&&r?e:"",o,s)})}}function pe({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=D(c,e,t),m=D(o,e,t);return d!==m},getQueryTerm:c=>{let o=D(c,e,t);return c.slice(o+1)},custom:(...c)=>I(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],m=D(d,e,t),S=m===-1||d.slice(m,m+e.length)!==e,p=S?n:i,g=z(S,r),f=yield M(p,S?s?e:"":a?t:"",g,c);if(S){if(l)return f;let b=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return L(b,f)}if(u)return f;let y=d.split(t).map(b=>b.slice(b.indexOf(e)+e.length));return L(y,f)})}}});var Q=x(A=>{"use strict";var he=A&&A.__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(A,"__esModule",{value:!0});A.ai=_e;var ge=4097,me=4,ve=.8,ye=ge*me*ve;function _e({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:s}){return{scriptTimeout:15e3,custom:(a,l,u)=>he(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 m=typeof t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((c=m?.length)!==null&&c!==void 0?c:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...m?[{role:"system",content:m}]:[],{role:"user",content:S.slice(0,p)}],temperature:r},O=JSON.stringify(g),f=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),y=JSON.parse(f.stdout);return(o=y?.choices.map(h=>{var w;return(w=h?.message)===null||w===void 0?void 0:w.content}).filter(h=>typeof h=="string").flatMap(h=>s?h.split(s).filter(w=>w.trim().length>0):[h]).map(h=>{if(i)return i(h);let w=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:w,insertValue:`'${w}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var U=x(v=>{"use strict";var Oe=v&&v.__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]}),be=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Oe(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var B=G();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return B.folders}});be(H(),v);var Se=Q();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Se.ai}})});var P=ie(U(),1),we={script(e){return["curl","-s","-H","Accept: application/json",`https://azuresearch-usnc.nuget.org/query?packageType=Dependency&q=${e[e.length-1]}`]},postProcess(e){return JSON.parse(e).data.map(n=>({name:n.title,insertValue:n.id,description:n.description}))}},Te={script(e){let t=e.filter(r=>!r.startsWith("-")),n=t.findIndex(r=>r==="package");return["curl","-s","-H","Accept: application/json",`https://api.nuget.org/v3-flatcontainer/${t[n+1].toLowerCase()}/index.json`]},postProcess(e){return JSON.parse(e).versions.reverse().map(n=>({name:n}))}},je={name:"add",args:{name:"project",description:"Specifies the project file. If not specified, the command searches the current directory for one",isOptional:!0,generators:(0,P.filepaths)({extensions:["csproj"]})},subcommands:[{name:"package",description:"The package reference to add",args:{name:"id",debounce:!0,generators:we},options:[{name:["-f","--framework"],description:"Adds a package reference only when targeting a specific framework",args:{name:"framework"}},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication"},{name:["-n","--no-restore"],description:"Adds a package reference without performing a restore preview and compatibility check"},{name:"--package-directory",description:"The directory where to restore the packages. The default package restore location is %userprofile%.nugetpackages on Windows and ~/.nuget/packages on macOS and Linux",args:{name:"directory",template:"folders"}},{name:"--prerelease",description:"Allows prerelease packages to be installed. Available since .NET Core 5 SDK"},{name:["-s","--source"],description:"The URI of the NuGet package source to use during the restore operation"},{name:["-v","--version"],description:"Version of the package",args:{name:"version",debounce:!0,generators:Te}}]},{name:"reference",description:"The dotnet add reference command provides a convenient option to add project references to a project. After running the command, the <ProjectReference> elements are added to the project file",args:{name:"path",isVariadic:!0,generators:(0,P.filepaths)({extensions:["csproj"]})},options:[{name:["-f","--framework"],description:"Adds a package reference only when targeting a specific framework",args:{name:"framework"}}]}]},De=je;export{De as default};
@@ -1,2 +1,2 @@
1
- var Z=Object.create;var L=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var j=(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&&L(e,r,{get:()=>t[r],enumerable:!(i=Y(t,r))||i.enumerable});return e};var re=(e,t,n)=>(n=e!=null?Z(te(e)):{},ie(t||!e||!e.__esModule?L(n,"default",{value:e,enumerable:!0}):n,e));var $=j(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.shellExpand=I.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;I.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var 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 u,c;return(c=(u=t[o])!==null&&u!==void 0?u:a)!==null&&c!==void 0?c:r}),le=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(se(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};I.shellExpand=le});var K=j(y=>{"use strict";var ue=y&&y.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(y,"__esModule",{value:!0});y.filepaths=y.folders=y.getCurrentInsertedDirectory=y.sortFilesAlphabetically=void 0;var E=$();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,o)=>r.localeCompare(o)),...i.filter(r=>r.startsWith(".")).sort((r,o)=>r.localeCompare(o)),"../"]}y.sortFilesAlphabetically=q;var ce=(e,t,n)=>{if(e===null)return"/";let i=(0,E.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,E.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,E.ensureTrailingSlash)(e)}${r}`};y.getCurrentInsertedDirectory=ce;function V(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:u,showFolders:c="always"}=e,l=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||i,g=(h=[])=>f()?h.filter(({name:m="",type:w})=>{if(!r&&w==="folder"||s.has(m)||i&&m.match(i))return!0;let[,...d]=m.split(".");if(d.length>=1){let b=d.length-1,_=d[b];do{if(l.has(_))return!0;b-=1,_=[d[b],_].join(".")}while(b>=0)}return!1}):h,O=(h=[])=>!o&&!a?h:h.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?o:a)||{}));return{trigger:(h,m)=>{let w=h.lastIndexOf("/"),d=m.lastIndexOf("/");return w!==d?!0:w===-1&&d===-1?!1:h.slice(0,w)!==m.slice(0,d)},getQueryTerm:h=>h.slice(h.lastIndexOf("/")+1),custom:(h,m,w)=>ue(this,void 0,void 0,function*(){var d;let{isDangerous:b,currentWorkingDirectory:_,searchTerm:p}=w,S=(d=(0,y.getCurrentInsertedDirectory)(u??_,p,w))!==null&&d!==void 0?d:"/";try{let C=yield m({command:"ls",args:["-1ApL"],cwd:S}),X=q(C.stdout.split(`
2
- `),[".DS_Store"]),P=[];for(let D of X)if(D){let F=D.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&c!=="only"||F==="folders"&&c!=="never")&&P.push({type:F==="filepaths"?"file":"folder",name:D,insertValue:D,isDangerous:b,context:{templateType:F}})}return O(g(P))}catch{return[]}})}}y.folders=Object.assign(()=>V({showFolders:"only"}),Object.freeze(V({showFolders:"only"})));y.filepaths=Object.assign(V,Object.freeze(V()))});var Q=j(x=>{"use strict";var A=x&&x.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.keyValueList=x.keyValue=x.valueList=void 0;var W=new Map;function M(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function z(e,t,n){return A(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 k(e,t,n,i){return A(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=W.get(e);return r===void 0&&(r=yield z(e,t,i),W.set(e,r)),r}return z(e,t,i)})}function J(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function R(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function N(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 fe({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 u=yield k(t,i?e:"",n,o);if(r)return u;let[c]=o,l=(a=c[c.length-1])===null||a===void 0?void 0:a.split(e);return N(l,u)})}}x.valueList=fe;function de({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,c=!a[a.length-1].includes(e),l=c?t:n,s=J(c,i);return k(l,c&&r?e:"",s,o)})}}x.keyValue=de;function he({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(l,s)=>{let f=R(l,e,t),g=R(s,e,t);return f!==g},getQueryTerm:l=>{let s=R(l,e,t);return l.slice(s+1)},custom:(...l)=>A(this,void 0,void 0,function*(){let[s]=l,f=s[s.length-1],g=R(f,e,t),O=g===-1||f.slice(g,g+e.length)!==e,h=O?n:i,m=J(O,r),d=yield k(h,O?o?e:"":a?t:"",m,l);if(O){if(u)return d;let _=f.split(t).map(p=>p.slice(0,p.indexOf(e)));return N(_,d)}if(c)return d;let b=f.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return N(b,d)})}}x.keyValueList=he});var B=j(T=>{"use strict";var pe=T&&T.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.ai=void 0;var me=4097,ge=4,ye=.8,ve=me*ge*ye;function be({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(a,u,c)=>pe(this,void 0,void 0,function*(){var l,s;let f=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let g=typeof t=="function"?yield t({tokens:a,executeCommand:u,generatorContext:c}):t,O=typeof n=="function"?yield n({tokens:a,executeCommand:u,generatorContext:c}):n;if(O===null||O.length===0)return console.warn("No message provided to AI generator"),[];let h=ve-((l=g?.length)!==null&&l!==void 0?l:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:O.slice(0,h)}],temperature:r},w=JSON.stringify(m),d=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),b=JSON.parse(d.stdout);return(s=b?.choices.map(p=>{var S;return(S=p?.message)===null||S===void 0?void 0:S.content}).filter(p=>typeof p=="string").flatMap(p=>o?p.split(o).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&&s!==void 0?s:[]})}}T.ai=be});var H=j(v=>{"use strict";var we=v&&v.__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]}),_e=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&we(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var G=K();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return G.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return G.folders}});_e(Q(),v);var Oe=B();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var U=re(H(),1),Se={name:"build",args:{name:"project",description:"The project or solution file to build. If a project or solution file isn't specified, MSBuild searches the current working directory for a file that has a file extension that ends in either proj or sln and uses that file",isOptional:!0,generators:(0,U.filepaths)({extensions:["csproj","sln"]})},options:[{name:["-a","--arch"],description:"Specifies the target architecture. This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. For example, on a win-x64 machine, specifying --arch x86 sets the RID to win-x86. If you use this option, don't use the -r|--runtime option. Available since .NET 6 Preview 7",args:{name:"arch",suggestions:["x86","x64","arm","arm64"]}},{name:["-c","--configuration"],description:"Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project",args:{name:"config"}},{name:["-f","--framework"],description:"Compiles for a specific framework. The framework must be defined in the project file"},{name:"--force",description:"Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json file"},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK"},{name:"--no-dependencies",description:"Ignores project-to-project (P2P) references and only builds the specified root project"},{name:"--no-incremental",description:"Marks the build as unsafe for incremental build. This flag turns off incremental compilation and forces a clean rebuild of the project's dependency graph"},{name:"--no-restore",description:"Doesn't execute an implicit restore during build"},{name:"--nologo",description:"Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK"},{name:"--no-self-contained",description:"Publishes the application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run the application"},{name:["-o","--output"],description:"Directory in which to place the built binaries. If not specified, the default path is ./bin/<configuration>/<framework>/. For projects with multiple target frameworks (via the TargetFrameworks property), you also need to define --framework when you specify this option",args:{name:"directory",template:"folders"}},{name:"--os",description:"Specifies the target operating system (OS). This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. For example, on a win-x64 machine, specifying --os os sets the RID to os-x64. If you use this option, don't use the -r|--runtime option. Available since .NET 6 Preview 7",args:{name:"os"}},{name:["-r","--runtime"],description:"Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the RID catalog. If you use this option, use --self-contained or --no-self-contained also",args:{name:"runtime"}},{name:"--self-contained",description:"Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is true if a runtime identifier is specified",args:{name:"self-contained",isOptional:!0,default:"true",suggestions:["true","false"]}},{name:"--source",description:"The URI of the NuGet package source to use during the restore operation",args:{name:"source"}},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}},{name:"--version-suffix",description:"Sets the value of the $(VersionSuffix) property to use when building the project. This only works if the $(Version) property isn't set. Then, $(Version) is set to the $(VersionPrefix) combined with the $(VersionSuffix), separated by a dash",args:{name:"suffix"}}]},Fe=Se;export{Fe as default};
1
+ var Z=Object.create;var L=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var T=(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&&L(e,r,{get:()=>t[r],enumerable:!(i=Y(t,r))||i.enumerable});return e};var re=(e,t,n)=>(n=e!=null?Z(te(e)):{},ie(t||!e||!e.__esModule?L(n,"default",{value:e,enumerable:!0}):n,e));var $=T(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.shellExpand=I.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;I.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var 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 c,u;return(u=(c=t[o])!==null&&c!==void 0?c:a)!==null&&u!==void 0?u:r}),le=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(se(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};I.shellExpand=le});var K=T(b=>{"use strict";var ce=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 c(s){try{l(i.next(s))}catch(f){a(f)}}function u(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=q;var E=$();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,o)=>r.localeCompare(o)),...i.filter(r=>r.startsWith(".")).sort((r,o)=>r.localeCompare(o)),"../"]}var ue=(e,t,n)=>{if(e===null)return"/";let i=(0,E.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,E.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,E.ensureTrailingSlash)(e)}${r}`};b.getCurrentInsertedDirectory=ue;function V(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:c,showFolders:u="always"}=e,l=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||i,g=(h=[])=>f()?h.filter(({name:m="",type:w})=>{if(!r&&w==="folder"||s.has(m)||i&&m.match(i))return!0;let[,...d]=m.split(".");if(d.length>=1){let v=d.length-1,_=d[v];do{if(l.has(_))return!0;v-=1,_=[d[v],_].join(".")}while(v>=0)}return!1}):h,O=(h=[])=>!o&&!a?h:h.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?o:a)||{}));return{trigger:(h,m)=>{let w=h.lastIndexOf("/"),d=m.lastIndexOf("/");return w!==d?!0:w===-1&&d===-1?!1:h.slice(0,w)!==m.slice(0,d)},getQueryTerm:h=>h.slice(h.lastIndexOf("/")+1),custom:(h,m,w)=>ce(this,void 0,void 0,function*(){var d;let{isDangerous:v,currentWorkingDirectory:_,searchTerm:p}=w,S=(d=(0,b.getCurrentInsertedDirectory)(c??_,p,w))!==null&&d!==void 0?d:"/";try{let P=yield m({command:"ls",args:["-1ApL"],cwd:S}),X=q(P.stdout.split(`
2
+ `),[".DS_Store"]),k=[];for(let D of X)if(D){let F=D.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&u!=="only"||F==="folders"&&u!=="never")&&k.push({type:F==="filepaths"?"file":"folder",name:D,insertValue:D,isDangerous:v,context:{templateType:F}})}return O(g(k))}catch{return[]}})}}b.folders=Object.assign(()=>V({showFolders:"only"}),Object.freeze(V({showFolders:"only"})));b.filepaths=Object.assign(V,Object.freeze(V()))});var Q=T(x=>{"use strict";var j=x&&x.__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 c(s){try{l(i.next(s))}catch(f){a(f)}}function u(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=fe;x.keyValue=de;x.keyValueList=he;var W=new Map;function M(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function z(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 C(e,t,n,i){return j(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=W.get(e);return r===void 0&&(r=yield z(e,t,i),W.set(e,r)),r}return z(e,t,i)})}function J(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function R(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function N(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 fe({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)=>j(this,void 0,void 0,function*(){var a;let c=yield C(t,i?e:"",n,o);if(r)return c;let[u]=o,l=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return N(l,c)})}}function de({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)=>j(this,void 0,void 0,function*(){let[a]=o,u=!a[a.length-1].includes(e),l=u?t:n,s=J(u,i);return C(l,u&&r?e:"",s,o)})}}function he({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:u=!0}){return{trigger:(l,s)=>{let f=R(l,e,t),g=R(s,e,t);return f!==g},getQueryTerm:l=>{let s=R(l,e,t);return l.slice(s+1)},custom:(...l)=>j(this,void 0,void 0,function*(){let[s]=l,f=s[s.length-1],g=R(f,e,t),O=g===-1||f.slice(g,g+e.length)!==e,h=O?n:i,m=J(O,r),d=yield C(h,O?o?e:"":a?t:"",m,l);if(O){if(c)return d;let _=f.split(t).map(p=>p.slice(0,p.indexOf(e)));return N(_,d)}if(u)return d;let v=f.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return N(v,d)})}}});var B=T(A=>{"use strict";var pe=A&&A.__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 c(s){try{l(i.next(s))}catch(f){a(f)}}function u(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.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:o}){return{scriptTimeout:15e3,custom:(a,c,u)=>pe(this,void 0,void 0,function*(){var l,s;let f=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let g=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:u}):t,O=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:u}):n;if(O===null||O.length===0)return console.warn("No message provided to AI generator"),[];let h=ve-((l=g?.length)!==null&&l!==void 0?l:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:O.slice(0,h)}],temperature:r},w=JSON.stringify(m),d=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),v=JSON.parse(d.stdout);return(s=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=>o?p.split(o).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&&s!==void 0?s:[]})}}});var H=T(y=>{"use strict";var we=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]}),_e=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&we(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var G=K();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return G.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return G.folders}});_e(Q(),y);var Oe=B();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var U=re(H(),1),Se={name:"build",args:{name:"project",description:"The project or solution file to build. If a project or solution file isn't specified, MSBuild searches the current working directory for a file that has a file extension that ends in either proj or sln and uses that file",isOptional:!0,generators:(0,U.filepaths)({extensions:["csproj","sln"]})},options:[{name:["-a","--arch"],description:"Specifies the target architecture. This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. For example, on a win-x64 machine, specifying --arch x86 sets the RID to win-x86. If you use this option, don't use the -r|--runtime option. Available since .NET 6 Preview 7",args:{name:"arch",suggestions:["x86","x64","arm","arm64"]}},{name:["-c","--configuration"],description:"Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project",args:{name:"config"}},{name:["-f","--framework"],description:"Compiles for a specific framework. The framework must be defined in the project file"},{name:"--force",description:"Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json file"},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK"},{name:"--no-dependencies",description:"Ignores project-to-project (P2P) references and only builds the specified root project"},{name:"--no-incremental",description:"Marks the build as unsafe for incremental build. This flag turns off incremental compilation and forces a clean rebuild of the project's dependency graph"},{name:"--no-restore",description:"Doesn't execute an implicit restore during build"},{name:"--nologo",description:"Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK"},{name:"--no-self-contained",description:"Publishes the application as a framework dependent application. A compatible .NET runtime must be installed on the target machine to run the application"},{name:["-o","--output"],description:"Directory in which to place the built binaries. If not specified, the default path is ./bin/<configuration>/<framework>/. For projects with multiple target frameworks (via the TargetFrameworks property), you also need to define --framework when you specify this option",args:{name:"directory",template:"folders"}},{name:"--os",description:"Specifies the target operating system (OS). This is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. For example, on a win-x64 machine, specifying --os os sets the RID to os-x64. If you use this option, don't use the -r|--runtime option. Available since .NET 6 Preview 7",args:{name:"os"}},{name:["-r","--runtime"],description:"Specifies the target runtime. For a list of Runtime Identifiers (RIDs), see the RID catalog. If you use this option, use --self-contained or --no-self-contained also",args:{name:"runtime"}},{name:"--self-contained",description:"Publishes the .NET runtime with the application so the runtime doesn't need to be installed on the target machine. The default is true if a runtime identifier is specified",args:{name:"self-contained",isOptional:!0,default:"true",suggestions:["true","false"]}},{name:"--source",description:"The URI of the NuGet package source to use during the restore operation",args:{name:"source"}},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}},{name:"--version-suffix",description:"Sets the value of the $(VersionSuffix) property to use when building the project. This only works if the $(Version) property isn't set. Then, $(Version) is set to the $(VersionPrefix) combined with the $(VersionSuffix), separated by a dash",args:{name:"suffix"}}]},Fe=Se;export{Fe as default};
@@ -1,2 +1,2 @@
1
- var U=Object.create;var R=Object.defineProperty;var Y=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=Y(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 K=I(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.shellExpand=T.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;T.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var 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 u,c;return(c=(u=t[o])!==null&&u!==void 0?u:a)!==null&&c!==void 0?c:r}),le=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(se(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};T.shellExpand=le});var P=I(m=>{"use strict";var ue=m&&m.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(m,"__esModule",{value:!0});m.filepaths=m.folders=m.getCurrentInsertedDirectory=m.sortFilesAlphabetically=void 0;var C=K();function W(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)),"../"]}m.sortFilesAlphabetically=W;var ce=(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}`};m.getCurrentInsertedDirectory=ce;function V(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:u,showFolders:c="always"}=e,l=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||i,y=(h=[])=>f()?h.filter(({name:g="",type:_})=>{if(!r&&_==="folder"||s.has(g)||i&&g.match(i))return!0;let[,...d]=g.split(".");if(d.length>=1){let b=d.length-1,w=d[b];do{if(l.has(w))return!0;b-=1,w=[d[b],w].join(".")}while(b>=0)}return!1}):h,O=(h=[])=>!o&&!a?h:h.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:a)||{}));return{trigger:(h,g)=>{let _=h.lastIndexOf("/"),d=g.lastIndexOf("/");return _!==d?!0:_===-1&&d===-1?!1:h.slice(0,_)!==g.slice(0,d)},getQueryTerm:h=>h.slice(h.lastIndexOf("/")+1),custom:(h,g,_)=>ue(this,void 0,void 0,function*(){var d;let{isDangerous:b,currentWorkingDirectory:w,searchTerm:p}=_,S=(d=(0,m.getCurrentInsertedDirectory)(u??w,p,_))!==null&&d!==void 0?d:"/";try{let q=yield g({command:"ls",args:["-1ApL"],cwd:S}),Z=W(q.stdout.split(`
2
- `),[".DS_Store"]),N=[];for(let F of Z)if(F){let M=F.endsWith("/")?"folders":"filepaths";(M==="filepaths"&&c!=="only"||M==="folders"&&c!=="never")&&N.push({type:M==="filepaths"?"file":"folder",name:F,insertValue:F,isDangerous:b,context:{templateType:M}})}return O(y(N))}catch{return[]}})}}m.folders=Object.assign(()=>V({showFolders:"only"}),Object.freeze(V({showFolders:"only"})));m.filepaths=Object.assign(V,Object.freeze(V()))});var J=I(j=>{"use strict";var A=j&&j.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(j,"__esModule",{value:!0});j.keyValueList=j.keyValue=j.valueList=void 0;var B=new Map;function L(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 A(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return L(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return L(t,i)}return L(t,e)})}function k(e,t,n,i){return A(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=B.get(e);return r===void 0&&(r=yield $(e,t,i),B.set(e,r)),r}return $(e,t,i)})}function z(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function D(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(o=>n.has(o)))})}function fe({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 u=yield k(t,i?e:"",n,o);if(r)return u;let[c]=o,l=(a=c[c.length-1])===null||a===void 0?void 0:a.split(e);return E(l,u)})}}j.valueList=fe;function de({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,c=!a[a.length-1].includes(e),l=c?t:n,s=z(c,i);return k(l,c&&r?e:"",s,o)})}}j.keyValue=de;function he({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(l,s)=>{let f=D(l,e,t),y=D(s,e,t);return f!==y},getQueryTerm:l=>{let s=D(l,e,t);return l.slice(s+1)},custom:(...l)=>A(this,void 0,void 0,function*(){let[s]=l,f=s[s.length-1],y=D(f,e,t),O=y===-1||f.slice(y,y+e.length)!==e,h=O?n:i,g=z(O,r),d=yield k(h,O?o?e:"":a?t:"",g,l);if(O){if(u)return d;let w=f.split(t).map(p=>p.slice(0,p.indexOf(e)));return E(w,d)}if(c)return d;let b=f.split(t).map(w=>w.slice(w.indexOf(e)+e.length));return E(b,d)})}}j.keyValueList=he});var Q=I(x=>{"use strict";var pe=x&&x.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.ai=void 0;var ge=4097,ye=4,me=.8,ve=ge*ye*me;function be({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(a,u,c)=>pe(this,void 0,void 0,function*(){var l,s;let f=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let y=typeof t=="function"?yield t({tokens:a,executeCommand:u,generatorContext:c}):t,O=typeof n=="function"?yield n({tokens:a,executeCommand:u,generatorContext:c}):n;if(O===null||O.length===0)return console.warn("No message provided to AI generator"),[];let h=ve-((l=y?.length)!==null&&l!==void 0?l:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...y?[{role:"system",content:y}]:[],{role:"user",content:O.slice(0,h)}],temperature:r},_=JSON.stringify(g),d=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),b=JSON.parse(d.stdout);return(s=b?.choices.map(p=>{var S;return(S=p?.message)===null||S===void 0?void 0:S.content}).filter(p=>typeof p=="string").flatMap(p=>o?p.split(o).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&&s!==void 0?s:[]})}}x.ai=be});var G=I(v=>{"use strict";var _e=v&&v.__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]}),we=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&_e(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var H=P();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return H.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return H.folders}});we(J(),v);var Oe=Q();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var X=re(G(),1),Se={name:"clean",description:"The dotnet clean command cleans the output of the previous build. It's implemented as an MSBuild target, so the project is evaluated when the command is run. Only the outputs created during the build are cleaned. Both intermediate (obj) and final output (bin) folders are cleaned",args:{name:"project",description:"The MSBuild project or solution to clean. If a project or solution file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj or sln, and uses that file",isOptional:!0,generators:(0,X.filepaths)({extensions:["csproj","sln"]})},options:[{name:["-c","--configuration"],description:"Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project. This option is only required when cleaning if you specified it during build time",args:{name:"configuration",suggestions:["Debug","Release"]}},{name:["-f","--framework"],description:"The framework that was specified at build time. The framework must be defined in the project file. If you specified the framework at build time, you must specify the framework when cleaning",args:{name:"framework"}},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK"},{name:"--nologo",description:"Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK"},{name:["-o","--output"],description:"The directory that contains the build artifacts to clean. Specify the -f|--framework <FRAMEWORK> switch with the output directory switch if you specified the framework when the project was built",args:{name:"directory",template:"folders"}},{name:["-r","--runtime"],description:"Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created"},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}}]},Me=Se;export{Me as default};
1
+ var U=Object.create;var R=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var x=(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=Y(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 K=x(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.shellExpand=T.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;T.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var 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 u,c;return(c=(u=t[o])!==null&&u!==void 0?u:a)!==null&&c!==void 0?c:r}),le=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(se(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};T.shellExpand=le});var P=x(b=>{"use strict";var ue=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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=W;var C=K();function W(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 ce=(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=ce;function F(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:u,showFolders:c="always"}=e,l=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||i,m=(h=[])=>f()?h.filter(({name:g="",type:_})=>{if(!r&&_==="folder"||s.has(g)||i&&g.match(i))return!0;let[,...d]=g.split(".");if(d.length>=1){let v=d.length-1,w=d[v];do{if(l.has(w))return!0;v-=1,w=[d[v],w].join(".")}while(v>=0)}return!1}):h,O=(h=[])=>!o&&!a?h:h.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:a)||{}));return{trigger:(h,g)=>{let _=h.lastIndexOf("/"),d=g.lastIndexOf("/");return _!==d?!0:_===-1&&d===-1?!1:h.slice(0,_)!==g.slice(0,d)},getQueryTerm:h=>h.slice(h.lastIndexOf("/")+1),custom:(h,g,_)=>ue(this,void 0,void 0,function*(){var d;let{isDangerous:v,currentWorkingDirectory:w,searchTerm:p}=_,S=(d=(0,b.getCurrentInsertedDirectory)(u??w,p,_))!==null&&d!==void 0?d:"/";try{let N=yield g({command:"ls",args:["-1ApL"],cwd:S}),Z=W(N.stdout.split(`
2
+ `),[".DS_Store"]),k=[];for(let M of Z)if(M){let D=M.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&c!=="only"||D==="folders"&&c!=="never")&&k.push({type:D==="filepaths"?"file":"folder",name:M,insertValue:M,isDangerous:v,context:{templateType:D}})}return O(m(k))}catch{return[]}})}}b.folders=Object.assign(()=>F({showFolders:"only"}),Object.freeze(F({showFolders:"only"})));b.filepaths=Object.assign(F,Object.freeze(F()))});var J=x(j=>{"use strict";var I=j&&j.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(j,"__esModule",{value:!0});j.valueList=fe;j.keyValue=de;j.keyValueList=he;var B=new Map;function E(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 I(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return E(t,i)}if(typeof e[0]=="string"){let i=e.map(r=>({name:r}));return E(t,i)}return E(t,e)})}function L(e,t,n,i){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=B.get(e);return r===void 0&&(r=yield $(e,t,i),B.set(e,r)),r}return $(e,t,i)})}function z(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 q(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 fe({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)=>I(this,void 0,void 0,function*(){var a;let u=yield L(t,i?e:"",n,o);if(r)return u;let[c]=o,l=(a=c[c.length-1])===null||a===void 0?void 0:a.split(e);return q(l,u)})}}function de({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)=>I(this,void 0,void 0,function*(){let[a]=o,c=!a[a.length-1].includes(e),l=c?t:n,s=z(c,i);return L(l,c&&r?e:"",s,o)})}}function he({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(l,s)=>{let f=V(l,e,t),m=V(s,e,t);return f!==m},getQueryTerm:l=>{let s=V(l,e,t);return l.slice(s+1)},custom:(...l)=>I(this,void 0,void 0,function*(){let[s]=l,f=s[s.length-1],m=V(f,e,t),O=m===-1||f.slice(m,m+e.length)!==e,h=O?n:i,g=z(O,r),d=yield L(h,O?o?e:"":a?t:"",g,l);if(O){if(u)return d;let w=f.split(t).map(p=>p.slice(0,p.indexOf(e)));return q(w,d)}if(c)return d;let v=f.split(t).map(w=>w.slice(w.indexOf(e)+e.length));return q(v,d)})}}});var Q=x(A=>{"use strict";var pe=A&&A.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=be;var ge=4097,me=4,ye=.8,ve=ge*me*ye;function be({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(a,u,c)=>pe(this,void 0,void 0,function*(){var l,s;let f=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let m=typeof t=="function"?yield t({tokens:a,executeCommand:u,generatorContext:c}):t,O=typeof n=="function"?yield n({tokens:a,executeCommand:u,generatorContext:c}):n;if(O===null||O.length===0)return console.warn("No message provided to AI generator"),[];let h=ve-((l=m?.length)!==null&&l!==void 0?l:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...m?[{role:"system",content:m}]:[],{role:"user",content:O.slice(0,h)}],temperature:r},_=JSON.stringify(g),d=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),v=JSON.parse(d.stdout);return(s=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=>o?p.split(o).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&&s!==void 0?s:[]})}}});var G=x(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]}),we=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 H=P();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return H.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return H.folders}});we(J(),y);var Oe=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var X=re(G(),1),Se={name:"clean",description:"The dotnet clean command cleans the output of the previous build. It's implemented as an MSBuild target, so the project is evaluated when the command is run. Only the outputs created during the build are cleaned. Both intermediate (obj) and final output (bin) folders are cleaned",args:{name:"project",description:"The MSBuild project or solution to clean. If a project or solution file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj or sln, and uses that file",isOptional:!0,generators:(0,X.filepaths)({extensions:["csproj","sln"]})},options:[{name:["-c","--configuration"],description:"Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project. This option is only required when cleaning if you specified it during build time",args:{name:"configuration",suggestions:["Debug","Release"]}},{name:["-f","--framework"],description:"The framework that was specified at build time. The framework must be defined in the project file. If you specified the framework at build time, you must specify the framework when cleaning",args:{name:"framework"}},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK"},{name:"--nologo",description:"Doesn't display the startup banner or the copyright message. Available since .NET Core 3.0 SDK"},{name:["-o","--output"],description:"The directory that contains the build artifacts to clean. Specify the -f|--framework <FRAMEWORK> switch with the output directory switch if you specified the framework when the project was built",args:{name:"directory",template:"folders"}},{name:["-r","--runtime"],description:"Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created"},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}}]},De=Se;export{De as default};
@@ -1,2 +1,2 @@
1
- var U=Object.create;var R=Object.defineProperty;var Y=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=Y(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(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.shellExpand=j.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;j.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var 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 u,c;return(c=(u=t[o])!==null&&u!==void 0?u:a)!==null&&c!==void 0?c:r}),le=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(se(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};j.shellExpand=le});var $=I(m=>{"use strict";var ue=m&&m.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(m,"__esModule",{value:!0});m.filepaths=m.folders=m.getCurrentInsertedDirectory=m.sortFilesAlphabetically=void 0;var L=W();function K(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)),"../"]}m.sortFilesAlphabetically=K;var ce=(e,t,n)=>{if(e===null)return"/";let i=(0,L.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,L.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,L.ensureTrailingSlash)(e)}${r}`};m.getCurrentInsertedDirectory=ce;function F(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:u,showFolders:c="always"}=e,l=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||i,v=(p=[])=>f()?p.filter(({name:g="",type:b})=>{if(!r&&b==="folder"||s.has(g)||i&&g.match(i))return!0;let[,...d]=g.split(".");if(d.length>=1){let _=d.length-1,O=d[_];do{if(l.has(O))return!0;_-=1,O=[d[_],O].join(".")}while(_>=0)}return!1}):p,w=(p=[])=>!o&&!a?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:a)||{}));return{trigger:(p,g)=>{let b=p.lastIndexOf("/"),d=g.lastIndexOf("/");return b!==d?!0:b===-1&&d===-1?!1:p.slice(0,b)!==g.slice(0,d)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,b)=>ue(this,void 0,void 0,function*(){var d;let{isDangerous:_,currentWorkingDirectory:O,searchTerm:h}=b,S=(d=(0,m.getCurrentInsertedDirectory)(u??O,h,b))!==null&&d!==void 0?d:"/";try{let E=yield g({command:"ls",args:["-1ApL"],cwd:S}),Z=K(E.stdout.split(`
2
- `),[".DS_Store"]),N=[];for(let V of Z)if(V){let D=V.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&c!=="only"||D==="folders"&&c!=="never")&&N.push({type:D==="filepaths"?"file":"folder",name:V,insertValue:V,isDangerous:_,context:{templateType:D}})}return w(v(N))}catch{return[]}})}}m.folders=Object.assign(()=>F({showFolders:"only"}),Object.freeze(F({showFolders:"only"})));m.filepaths=Object.assign(F,Object.freeze(F()))});var H=I(x=>{"use strict";var A=x&&x.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.keyValueList=x.keyValue=x.valueList=void 0;var z=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 J(e,t,n){return A(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 q(e,t,n,i){return A(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=z.get(e);return r===void 0&&(r=yield J(e,t,i),z.set(e,r)),r}return J(e,t,i)})}function B(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 P(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 fe({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 u=yield q(t,i?e:"",n,o);if(r)return u;let[c]=o,l=(a=c[c.length-1])===null||a===void 0?void 0:a.split(e);return P(l,u)})}}x.valueList=fe;function de({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,c=!a[a.length-1].includes(e),l=c?t:n,s=B(c,i);return q(l,c&&r?e:"",s,o)})}}x.keyValue=de;function pe({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(l,s)=>{let f=M(l,e,t),v=M(s,e,t);return f!==v},getQueryTerm:l=>{let s=M(l,e,t);return l.slice(s+1)},custom:(...l)=>A(this,void 0,void 0,function*(){let[s]=l,f=s[s.length-1],v=M(f,e,t),w=v===-1||f.slice(v,v+e.length)!==e,p=w?n:i,g=B(w,r),d=yield q(p,w?o?e:"":a?t:"",g,l);if(w){if(u)return d;let O=f.split(t).map(h=>h.slice(0,h.indexOf(e)));return P(O,d)}if(c)return d;let _=f.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return P(_,d)})}}x.keyValueList=pe});var Q=I(T=>{"use strict";var he=T&&T.__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 u(s){try{l(i.next(s))}catch(f){a(f)}}function c(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(u,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.ai=void 0;var ge=4097,ve=4,me=.8,ye=ge*ve*me;function _e({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(a,u,c)=>he(this,void 0,void 0,function*(){var l,s;let f=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let v=typeof t=="function"?yield t({tokens:a,executeCommand:u,generatorContext:c}):t,w=typeof n=="function"?yield n({tokens:a,executeCommand:u,generatorContext:c}):n;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((l=v?.length)!==null&&l!==void 0?l:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...v?[{role:"system",content:v}]:[],{role:"user",content:w.slice(0,p)}],temperature:r},b=JSON.stringify(g),d=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",b]}),_=JSON.parse(d.stdout);return(s=_?.choices.map(h=>{var S;return(S=h?.message)===null||S===void 0?void 0:S.content}).filter(h=>typeof h=="string").flatMap(h=>o?h.split(o).filter(S=>S.trim().length>0):[h]).map(h=>{if(i)return i(h);let S=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}T.ai=_e});var G=I(y=>{"use strict";var be=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)&&be(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var k=$();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return k.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return k.folders}});Oe(H(),y);var we=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return we.ai}})});var X=re(G(),1),Se={name:"format",description:"Dotnet format is a code formatter that applies style preferences to a project or solution. Preferences will be read from an .editorconfig file, if present, otherwise a default set of preferences will be used",args:{name:"project",description:"The MSBuild project or solution to run code formatting on. If a project or solution file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj or sln, and uses that file",isOptional:!0,generators:(0,X.filepaths)({extensions:["csproj","sln"]})},options:[{name:"--diagnostics",description:"A space-separated list of diagnostic IDs to use as a filter when fixing code style or third party issues. Default value is whichever IDs are listed in the editorconfig file",args:{name:"diagnostics"}},{name:"--severity",description:"The minimum severity of diagnostics to fix. Allowed values are info, warn, and error. The default value is warn",args:{name:"severity",isOptional:!0,default:"warn",suggestions:["info","warn","error"]}},{name:"--no-restore",description:"Doesn't execute an implicit restore before formatting. Default is to do implicit restore"},{name:"--verify-no-changes",description:"Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted"},{name:"--include",description:"A space-separated list of relative file or folder paths to include in formatting. All files in the solution or project are formatted if empty",args:{name:"paths",template:["folders","filepaths"]}},{name:"--exclude",description:"A space-separated list of relative file or folder paths to exclude from formatting. The default is none",args:{name:"paths",template:["folders","filepaths"]}},{name:"--include-generated",description:"Formats files generated by the SDK"},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}},{name:"--binarylog",description:"Logs all project or solution load information to a binary log file",args:{name:"log",template:"filepaths"}},{name:"--report",description:"Produces a JSON report in the directory specified by <REPORT_PATH>",args:{name:"path",template:"folders"}}]},De=Se;export{De as default};
1
+ var U=Object.create;var R=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var T=(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=Y(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=T(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.shellExpand=j.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;j.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,r=>{var 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 c,u;return(u=(c=t[o])!==null&&c!==void 0?c:a)!==null&&u!==void 0?u:r}),le=(e,t)=>{var n;let{environmentVariables:i}=t;return ae(se(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};j.shellExpand=le});var $=T(_=>{"use strict";var ce=_&&_.__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 c(s){try{l(i.next(s))}catch(f){a(f)}}function u(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(_,"__esModule",{value:!0});_.filepaths=_.folders=_.getCurrentInsertedDirectory=void 0;_.sortFilesAlphabetically=K;var L=W();function K(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 ue=(e,t,n)=>{if(e===null)return"/";let i=(0,L.shellExpand)(t,n),r=i.slice(0,i.lastIndexOf("/")+1);return r===""?(0,L.ensureTrailingSlash)(e):r.startsWith("/")?r:`${(0,L.ensureTrailingSlash)(e)}${r}`};_.getCurrentInsertedDirectory=ue;function F(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:r=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:c,showFolders:u="always"}=e,l=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||i,m=(p=[])=>f()?p.filter(({name:g="",type:b})=>{if(!r&&b==="folder"||s.has(g)||i&&g.match(i))return!0;let[,...d]=g.split(".");if(d.length>=1){let y=d.length-1,O=d[y];do{if(l.has(O))return!0;y-=1,O=[d[y],O].join(".")}while(y>=0)}return!1}):p,w=(p=[])=>!o&&!a?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:a)||{}));return{trigger:(p,g)=>{let b=p.lastIndexOf("/"),d=g.lastIndexOf("/");return b!==d?!0:b===-1&&d===-1?!1:p.slice(0,b)!==g.slice(0,d)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,b)=>ce(this,void 0,void 0,function*(){var d;let{isDangerous:y,currentWorkingDirectory:O,searchTerm:h}=b,S=(d=(0,_.getCurrentInsertedDirectory)(c??O,h,b))!==null&&d!==void 0?d:"/";try{let E=yield g({command:"ls",args:["-1ApL"],cwd:S}),k=K(E.stdout.split(`
2
+ `),[".DS_Store"]),N=[];for(let D of k)if(D){let V=D.endsWith("/")?"folders":"filepaths";(V==="filepaths"&&u!=="only"||V==="folders"&&u!=="never")&&N.push({type:V==="filepaths"?"file":"folder",name:D,insertValue:D,isDangerous:y,context:{templateType:V}})}return w(m(N))}catch{return[]}})}}_.folders=Object.assign(()=>F({showFolders:"only"}),Object.freeze(F({showFolders:"only"})));_.filepaths=Object.assign(F,Object.freeze(F()))});var H=T(x=>{"use strict";var I=x&&x.__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 c(s){try{l(i.next(s))}catch(f){a(f)}}function u(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=fe;x.keyValue=de;x.keyValueList=pe;var z=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 J(e,t,n){return I(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 q(e,t,n,i){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let r=z.get(e);return r===void 0&&(r=yield J(e,t,i),z.set(e,r)),r}return J(e,t,i)})}function B(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 P(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 fe({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)=>I(this,void 0,void 0,function*(){var a;let c=yield q(t,i?e:"",n,o);if(r)return c;let[u]=o,l=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return P(l,c)})}}function de({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)=>I(this,void 0,void 0,function*(){let[a]=o,u=!a[a.length-1].includes(e),l=u?t:n,s=B(u,i);return q(l,u&&r?e:"",s,o)})}}function pe({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:r=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:u=!0}){return{trigger:(l,s)=>{let f=M(l,e,t),m=M(s,e,t);return f!==m},getQueryTerm:l=>{let s=M(l,e,t);return l.slice(s+1)},custom:(...l)=>I(this,void 0,void 0,function*(){let[s]=l,f=s[s.length-1],m=M(f,e,t),w=m===-1||f.slice(m,m+e.length)!==e,p=w?n:i,g=B(w,r),d=yield q(p,w?o?e:"":a?t:"",g,l);if(w){if(c)return d;let O=f.split(t).map(h=>h.slice(0,h.indexOf(e)));return P(O,d)}if(u)return d;let y=f.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return P(y,d)})}}});var Q=T(A=>{"use strict";var he=A&&A.__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 c(s){try{l(i.next(s))}catch(f){a(f)}}function u(s){try{l(i.throw(s))}catch(f){a(f)}}function l(s){s.done?o(s.value):r(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=_e;var ge=4097,me=4,ve=.8,ye=ge*me*ve;function _e({name:e,prompt:t,message:n,postProcess:i,temperature:r,splitOn:o}){return{scriptTimeout:15e3,custom:(a,c,u)=>he(this,void 0,void 0,function*(){var l,s;let f=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let m=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:u}):t,w=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:u}):n;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((l=m?.length)!==null&&l!==void 0?l:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...m?[{role:"system",content:m}]:[],{role:"user",content:w.slice(0,p)}],temperature:r},b=JSON.stringify(g),d=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",b]}),y=JSON.parse(d.stdout);return(s=y?.choices.map(h=>{var S;return(S=h?.message)===null||S===void 0?void 0:S.content}).filter(h=>typeof h=="string").flatMap(h=>o?h.split(o).filter(S=>S.trim().length>0):[h]).map(h=>{if(i)return i(h);let S=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}});var X=T(v=>{"use strict";var be=v&&v.__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=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&be(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var G=$();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return G.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return G.folders}});Oe(H(),v);var we=Q();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return we.ai}})});var Z=re(X(),1),Se={name:"format",description:"Dotnet format is a code formatter that applies style preferences to a project or solution. Preferences will be read from an .editorconfig file, if present, otherwise a default set of preferences will be used",args:{name:"project",description:"The MSBuild project or solution to run code formatting on. If a project or solution file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj or sln, and uses that file",isOptional:!0,generators:(0,Z.filepaths)({extensions:["csproj","sln"]})},options:[{name:"--diagnostics",description:"A space-separated list of diagnostic IDs to use as a filter when fixing code style or third party issues. Default value is whichever IDs are listed in the editorconfig file",args:{name:"diagnostics"}},{name:"--severity",description:"The minimum severity of diagnostics to fix. Allowed values are info, warn, and error. The default value is warn",args:{name:"severity",isOptional:!0,default:"warn",suggestions:["info","warn","error"]}},{name:"--no-restore",description:"Doesn't execute an implicit restore before formatting. Default is to do implicit restore"},{name:"--verify-no-changes",description:"Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted"},{name:"--include",description:"A space-separated list of relative file or folder paths to include in formatting. All files in the solution or project are formatted if empty",args:{name:"paths",template:["folders","filepaths"]}},{name:"--exclude",description:"A space-separated list of relative file or folder paths to exclude from formatting. The default is none",args:{name:"paths",template:["folders","filepaths"]}},{name:"--include-generated",description:"Formats files generated by the SDK"},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}},{name:"--binarylog",description:"Logs all project or solution load information to a binary log file",args:{name:"log",template:"filepaths"}},{name:"--report",description:"Produces a JSON report in the directory specified by <REPORT_PATH>",args:{name:"path",template:"folders"}}]},Ve=Se;export{Ve as default};
@@ -1,2 +1,2 @@
1
- var U=Object.create;var E=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var re=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ee(t))!ne.call(e,i)&&i!==n&&E(e,i,{get:()=>t[i],enumerable:!(r=Y(t,i))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?U(te(e)):{},re(t||!e||!e.__esModule?E(n,"default",{value:e,enumerable:!0}):n,e));var W=k(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.shellExpand=x.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;x.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var o;let a=i.slice(1);return(o=t[a])!==null&&o!==void 0?o:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,o,a)=>{var l,u;return(u=(l=t[o])!==null&&l!==void 0?l:a)!==null&&u!==void 0?u:i}),ce=(e,t)=>{var n;let{environmentVariables:r}=t;return ae(se(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};x.shellExpand=ce});var K=k(m=>{"use strict";var le=m&&m.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(s){try{c(r.next(s))}catch(d){a(d)}}function u(s){try{c(r.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):i(s.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(m,"__esModule",{value:!0});m.filepaths=m.folders=m.getCurrentInsertedDirectory=m.sortFilesAlphabetically=void 0;var L=W();function P(e,t=[]){let n=t.map(i=>i.toLowerCase()),r=e.filter(i=>!n.includes(i.toLowerCase()));return[...r.filter(i=>!i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),...r.filter(i=>i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),"../"]}m.sortFilesAlphabetically=P;var ue=(e,t,n)=>{if(e===null)return"/";let r=(0,L.shellExpand)(t,n),i=r.slice(0,r.lastIndexOf("/")+1);return i===""?(0,L.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,L.ensureTrailingSlash)(e)}${i}`};m.getCurrentInsertedDirectory=ue;function V(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:i=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),s=new Set(n),d=()=>t.length>0||n.length>0||r,v=(p=[])=>d()?p.filter(({name:g="",type:w})=>{if(!i&&w==="folder"||s.has(g)||r&&g.match(r))return!0;let[,...f]=g.split(".");if(f.length>=1){let b=f.length-1,_=f[b];do{if(c.has(_))return!0;b-=1,_=[f[b],_].join(".")}while(b>=0)}return!1}):p,O=(p=[])=>!o&&!a?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:a)||{}));return{trigger:(p,g)=>{let w=p.lastIndexOf("/"),f=g.lastIndexOf("/");return w!==f?!0:w===-1&&f===-1?!1:p.slice(0,w)!==g.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,w)=>le(this,void 0,void 0,function*(){var f;let{isDangerous:b,currentWorkingDirectory:_,searchTerm:h}=w,S=(f=(0,m.getCurrentInsertedDirectory)(l??_,h,w))!==null&&f!==void 0?f:"/";try{let N=yield g({command:"ls",args:["-1ApL"],cwd:S}),Z=P(N.stdout.split(`
2
- `),[".DS_Store"]),R=[];for(let A of Z)if(A){let F=A.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&u!=="only"||F==="folders"&&u!=="never")&&R.push({type:F==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:b,context:{templateType:F}})}return O(v(R))}catch{return[]}})}}m.folders=Object.assign(()=>V({showFolders:"only"}),Object.freeze(V({showFolders:"only"})));m.filepaths=Object.assign(V,Object.freeze(V()))});var J=k(j=>{"use strict";var I=j&&j.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(s){try{c(r.next(s))}catch(d){a(d)}}function u(s){try{c(r.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):i(s.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(j,"__esModule",{value:!0});j.keyValueList=j.keyValue=j.valueList=void 0;var $=new Map;function q(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function G(e,t,n){return I(this,void 0,void 0,function*(){if(typeof e=="function"){let r=yield e(...n);return q(t,r)}if(typeof e[0]=="string"){let r=e.map(i=>({name:i}));return q(t,r)}return q(t,e)})}function M(e,t,n,r){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=$.get(e);return i===void 0&&(i=yield G(e,t,r),$.set(e,i)),i}return G(e,t,r)})}function z(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function C(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function D(e,t){let n=new Set(e);return t.filter(r=>{var i;return typeof r.name=="string"?!n.has(r.name):!(!((i=r.name)===null||i===void 0)&&i.some(o=>n.has(o)))})}function de({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:i=!1}){return{trigger:(o,a)=>o.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>I(this,void 0,void 0,function*(){var a;let l=yield M(t,r?e:"",n,o);if(i)return l;let[u]=o,c=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return D(c,l)})}}j.valueList=de;function fe({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:i=!0}){return{trigger:(o,a)=>o.indexOf(e)!==a.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>I(this,void 0,void 0,function*(){let[a]=o,u=!a[a.length-1].includes(e),c=u?t:n,s=z(u,r);return M(c,u&&i?e:"",s,o)})}}j.keyValue=fe;function pe({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:i=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,s)=>{let d=C(c,e,t),v=C(s,e,t);return d!==v},getQueryTerm:c=>{let s=C(c,e,t);return c.slice(s+1)},custom:(...c)=>I(this,void 0,void 0,function*(){let[s]=c,d=s[s.length-1],v=C(d,e,t),O=v===-1||d.slice(v,v+e.length)!==e,p=O?n:r,g=z(O,i),f=yield M(p,O?o?e:"":a?t:"",g,c);if(O){if(l)return f;let _=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return D(_,f)}if(u)return f;let b=d.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return D(b,f)})}}j.keyValueList=pe});var Q=k(T=>{"use strict";var he=T&&T.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(s){try{c(r.next(s))}catch(d){a(d)}}function u(s){try{c(r.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):i(s.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.ai=void 0;var ge=4097,ve=4,me=.8,ye=ge*ve*me;function be({name:e,prompt:t,message:n,postProcess:r,temperature:i,splitOn:o}){return{scriptTimeout:15e3,custom:(a,l,u)=>he(this,void 0,void 0,function*(){var c,s;let d=yield l({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let v=typeof t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t,O=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n;if(O===null||O.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((c=v?.length)!==null&&c!==void 0?c:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...v?[{role:"system",content:v}]:[],{role:"user",content:O.slice(0,p)}],temperature:i},w=JSON.stringify(g),f=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),b=JSON.parse(f.stdout);return(s=b?.choices.map(h=>{var S;return(S=h?.message)===null||S===void 0?void 0:S.content}).filter(h=>typeof h=="string").flatMap(h=>o?h.split(o).filter(S=>S.trim().length>0):[h]).map(h=>{if(r)return r(h);let S=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}T.ai=be});var B=k(y=>{"use strict";var we=y&&y.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),_e=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&we(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var H=K();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return H.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return H.folders}});_e(J(),y);var Oe=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var X=ie(B(),1),Se={name:"list",args:{name:"project",description:"The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown",isOptional:!0,generators:(0,X.filepaths)({extensions:["csproj","sln"]})},subcommands:[{name:"package",description:"The dotnet list package command provides a convenient option to list all NuGet package references for a specific project or a solution. You first need to build the project in order to have the assets needed for this command to process",options:[{name:"--config",description:"The NuGet sources to use when searching for newer packages. Requires the --outdated option",args:{name:"source"}},{name:"--deprecated",description:"Displays packages that have been deprecated"},{name:"--framework",description:"Displays only the packages applicable for the specified target framework. To specify multiple frameworks, repeat the option multiple times. For example: --framework netcoreapp2.2 --framework netstandard2.0",args:{name:"framework"}},{name:"--highest-minor",description:"Considers only the packages with a matching major version number when searching for newer packages. Requires the --outdated or --deprecated option"},{name:"--highest-patch",description:"Considers only the packages with a matching major and minor version numbers when searching for newer packages. Requires the --outdated or --deprecated option"},{name:"--include-prerelease",description:"Considers packages with prerelease versions when searching for newer packages. Requires the --outdated or --deprecated option"},{name:"--include-transitive",description:"Lists transitive packages, in addition to the top-level packages. When specifying this option, you get a list of packages that the top-level packages depend on"},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK"},{name:"--outdated",description:"Lists packages that have newer versions available"},{name:["-s","--source"],description:"The NuGet sources to use when searching for newer packages. Requires the --outdated or --deprecated option"},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}},{name:"--vulnerable",description:"Lists packages that have known vulnerabilities. Cannot be combined with --deprecated or --outdated options"}]},{name:"reference",description:"The dotnet list reference command provides a convenient option to list project references for a given project"}]},Fe=Se;export{Fe as default};
1
+ var U=Object.create;var E=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var re=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ee(t))!ne.call(e,i)&&i!==n&&E(e,i,{get:()=>t[i],enumerable:!(r=Y(t,i))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?U(te(e)):{},re(t||!e||!e.__esModule?E(n,"default",{value:e,enumerable:!0}):n,e));var W=T(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.shellExpand=x.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;x.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ae=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var o;let a=i.slice(1);return(o=t[a])!==null&&o!==void 0?o:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,o,a)=>{var l,u;return(u=(l=t[o])!==null&&l!==void 0?l:a)!==null&&u!==void 0?u:i}),ce=(e,t)=>{var n;let{environmentVariables:r}=t;return ae(se(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};x.shellExpand=ce});var K=T(b=>{"use strict";var le=b&&b.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(s){try{c(r.next(s))}catch(d){a(d)}}function u(s){try{c(r.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):i(s.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=P;var V=W();function P(e,t=[]){let n=t.map(i=>i.toLowerCase()),r=e.filter(i=>!n.includes(i.toLowerCase()));return[...r.filter(i=>!i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),...r.filter(i=>i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),"../"]}var ue=(e,t,n)=>{if(e===null)return"/";let r=(0,V.shellExpand)(t,n),i=r.slice(0,r.lastIndexOf("/")+1);return i===""?(0,V.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,V.ensureTrailingSlash)(e)}${i}`};b.getCurrentInsertedDirectory=ue;function F(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:i=!1,editFileSuggestions:o,editFolderSuggestions:a,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),s=new Set(n),d=()=>t.length>0||n.length>0||r,v=(p=[])=>d()?p.filter(({name:g="",type:w})=>{if(!i&&w==="folder"||s.has(g)||r&&g.match(r))return!0;let[,...f]=g.split(".");if(f.length>=1){let y=f.length-1,_=f[y];do{if(c.has(_))return!0;y-=1,_=[f[y],_].join(".")}while(y>=0)}return!1}):p,O=(p=[])=>!o&&!a?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:a)||{}));return{trigger:(p,g)=>{let w=p.lastIndexOf("/"),f=g.lastIndexOf("/");return w!==f?!0:w===-1&&f===-1?!1:p.slice(0,w)!==g.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,w)=>le(this,void 0,void 0,function*(){var f;let{isDangerous:y,currentWorkingDirectory:_,searchTerm:h}=w,S=(f=(0,b.getCurrentInsertedDirectory)(l??_,h,w))!==null&&f!==void 0?f:"/";try{let N=yield g({command:"ls",args:["-1ApL"],cwd:S}),Z=P(N.stdout.split(`
2
+ `),[".DS_Store"]),R=[];for(let A of Z)if(A){let C=A.endsWith("/")?"folders":"filepaths";(C==="filepaths"&&u!=="only"||C==="folders"&&u!=="never")&&R.push({type:C==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:y,context:{templateType:C}})}return O(v(R))}catch{return[]}})}}b.folders=Object.assign(()=>F({showFolders:"only"}),Object.freeze(F({showFolders:"only"})));b.filepaths=Object.assign(F,Object.freeze(F()))});var J=T(j=>{"use strict";var I=j&&j.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(s){try{c(r.next(s))}catch(d){a(d)}}function u(s){try{c(r.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):i(s.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(j,"__esModule",{value:!0});j.valueList=de;j.keyValue=fe;j.keyValueList=pe;var $=new Map;function L(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function G(e,t,n){return I(this,void 0,void 0,function*(){if(typeof e=="function"){let r=yield e(...n);return L(t,r)}if(typeof e[0]=="string"){let r=e.map(i=>({name:i}));return L(t,r)}return L(t,e)})}function M(e,t,n,r){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=$.get(e);return i===void 0&&(i=yield G(e,t,r),$.set(e,i)),i}return G(e,t,r)})}function z(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 D(e,t){let n=new Set(e);return t.filter(r=>{var i;return typeof r.name=="string"?!n.has(r.name):!(!((i=r.name)===null||i===void 0)&&i.some(o=>n.has(o)))})}function de({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:i=!1}){return{trigger:(o,a)=>o.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>I(this,void 0,void 0,function*(){var a;let l=yield M(t,r?e:"",n,o);if(i)return l;let[u]=o,c=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return D(c,l)})}}function fe({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:i=!0}){return{trigger:(o,a)=>o.indexOf(e)!==a.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>I(this,void 0,void 0,function*(){let[a]=o,u=!a[a.length-1].includes(e),c=u?t:n,s=z(u,r);return M(c,u&&i?e:"",s,o)})}}function pe({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:i=!1,insertSeparator:o=!0,insertDelimiter:a=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,s)=>{let d=q(c,e,t),v=q(s,e,t);return d!==v},getQueryTerm:c=>{let s=q(c,e,t);return c.slice(s+1)},custom:(...c)=>I(this,void 0,void 0,function*(){let[s]=c,d=s[s.length-1],v=q(d,e,t),O=v===-1||d.slice(v,v+e.length)!==e,p=O?n:r,g=z(O,i),f=yield M(p,O?o?e:"":a?t:"",g,c);if(O){if(l)return f;let _=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return D(_,f)}if(u)return f;let y=d.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return D(y,f)})}}});var Q=T(k=>{"use strict";var he=k&&k.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(s){try{c(r.next(s))}catch(d){a(d)}}function u(s){try{c(r.throw(s))}catch(d){a(d)}}function c(s){s.done?o(s.value):i(s.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(k,"__esModule",{value:!0});k.ai=be;var ge=4097,ve=4,me=.8,ye=ge*ve*me;function be({name:e,prompt:t,message:n,postProcess:r,temperature:i,splitOn:o}){return{scriptTimeout:15e3,custom:(a,l,u)=>he(this,void 0,void 0,function*(){var c,s;let d=yield l({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let v=typeof t=="function"?yield t({tokens:a,executeCommand:l,generatorContext:u}):t,O=typeof n=="function"?yield n({tokens:a,executeCommand:l,generatorContext:u}):n;if(O===null||O.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((c=v?.length)!==null&&c!==void 0?c:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...v?[{role:"system",content:v}]:[],{role:"user",content:O.slice(0,p)}],temperature:i},w=JSON.stringify(g),f=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),y=JSON.parse(f.stdout);return(s=y?.choices.map(h=>{var S;return(S=h?.message)===null||S===void 0?void 0:S.content}).filter(h=>typeof h=="string").flatMap(h=>o?h.split(o).filter(S=>S.trim().length>0):[h]).map(h=>{if(r)return r(h);let S=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}});var B=T(m=>{"use strict";var we=m&&m.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),_e=m&&m.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&we(t,e,n)};Object.defineProperty(m,"__esModule",{value:!0});m.ai=m.folders=m.filepaths=void 0;var H=K();Object.defineProperty(m,"filepaths",{enumerable:!0,get:function(){return H.filepaths}});Object.defineProperty(m,"folders",{enumerable:!0,get:function(){return H.folders}});_e(J(),m);var Oe=Q();Object.defineProperty(m,"ai",{enumerable:!0,get:function(){return Oe.ai}})});var X=ie(B(),1),Se={name:"list",args:{name:"project",description:"The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown",isOptional:!0,generators:(0,X.filepaths)({extensions:["csproj","sln"]})},subcommands:[{name:"package",description:"The dotnet list package command provides a convenient option to list all NuGet package references for a specific project or a solution. You first need to build the project in order to have the assets needed for this command to process",options:[{name:"--config",description:"The NuGet sources to use when searching for newer packages. Requires the --outdated option",args:{name:"source"}},{name:"--deprecated",description:"Displays packages that have been deprecated"},{name:"--framework",description:"Displays only the packages applicable for the specified target framework. To specify multiple frameworks, repeat the option multiple times. For example: --framework netcoreapp2.2 --framework netstandard2.0",args:{name:"framework"}},{name:"--highest-minor",description:"Considers only the packages with a matching major version number when searching for newer packages. Requires the --outdated or --deprecated option"},{name:"--highest-patch",description:"Considers only the packages with a matching major and minor version numbers when searching for newer packages. Requires the --outdated or --deprecated option"},{name:"--include-prerelease",description:"Considers packages with prerelease versions when searching for newer packages. Requires the --outdated or --deprecated option"},{name:"--include-transitive",description:"Lists transitive packages, in addition to the top-level packages. When specifying this option, you get a list of packages that the top-level packages depend on"},{name:"--interactive",description:"Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK"},{name:"--outdated",description:"Lists packages that have newer versions available"},{name:["-s","--source"],description:"The NuGet sources to use when searching for newer packages. Requires the --outdated or --deprecated option"},{name:["-v","--verbosity"],description:"Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available",args:{name:"verbosity",suggestions:["quiet","minimal","normal","detailed","diagnostic"]}},{name:"--vulnerable",description:"Lists packages that have known vulnerabilities. Cannot be combined with --deprecated or --outdated options"}]},{name:"reference",description:"The dotnet list reference command provides a convenient option to list project references for a given project"}]},Ce=Se;export{Ce as default};
@@ -1,2 +1,2 @@
1
- var U=Object.create;var P=Object.defineProperty;var Y=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 re=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ee(t))!ne.call(e,i)&&i!==n&&P(e,i,{get:()=>t[i],enumerable:!(r=Y(t,i))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?U(te(e)):{},re(t||!e||!e.__esModule?P(n,"default",{value:e,enumerable:!0}):n,e));var W=I(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.shellExpand=x.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;x.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,le=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var o;let l=i.slice(1);return(o=t[l])!==null&&o!==void 0?o:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,o,l)=>{var u,c;return(c=(u=t[o])!==null&&u!==void 0?u:l)!==null&&c!==void 0?c:i}),ae=(e,t)=>{var n;let{environmentVariables:r}=t;return le(se(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};x.shellExpand=ae});var $=I(y=>{"use strict";var ue=y&&y.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(r.next(s))}catch(f){l(f)}}function c(s){try{a(r.throw(s))}catch(f){l(f)}}function a(s){s.done?o(s.value):i(s.value).then(u,c)}a((r=r.apply(e,t||[])).next())})};Object.defineProperty(y,"__esModule",{value:!0});y.filepaths=y.folders=y.getCurrentInsertedDirectory=y.sortFilesAlphabetically=void 0;var k=W();function K(e,t=[]){let n=t.map(i=>i.toLowerCase()),r=e.filter(i=>!n.includes(i.toLowerCase()));return[...r.filter(i=>!i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),...r.filter(i=>i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),"../"]}y.sortFilesAlphabetically=K;var ce=(e,t,n)=>{if(e===null)return"/";let r=(0,k.shellExpand)(t,n),i=r.slice(0,r.lastIndexOf("/")+1);return i===""?(0,k.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,k.ensureTrailingSlash)(e)}${i}`};y.getCurrentInsertedDirectory=ce;function L(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:i=!1,editFileSuggestions:o,editFolderSuggestions:l,rootDirectory:u,showFolders:c="always"}=e,a=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||r,v=(p=[])=>f()?p.filter(({name:g="",type:O})=>{if(!i&&O==="folder"||s.has(g)||r&&g.match(r))return!0;let[,...d]=g.split(".");if(d.length>=1){let _=d.length-1,b=d[_];do{if(a.has(b))return!0;_-=1,b=[d[_],b].join(".")}while(_>=0)}return!1}):p,j=(p=[])=>!o&&!l?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:l)||{}));return{trigger:(p,g)=>{let O=p.lastIndexOf("/"),d=g.lastIndexOf("/");return O!==d?!0:O===-1&&d===-1?!1:p.slice(0,O)!==g.slice(0,d)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,O)=>ue(this,void 0,void 0,function*(){var d;let{isDangerous:_,currentWorkingDirectory:b,searchTerm:h}=O,S=(d=(0,y.getCurrentInsertedDirectory)(u??b,h,O))!==null&&d!==void 0?d:"/";try{let N=yield g({command:"ls",args:["-1ApL"],cwd:S}),Z=K(N.stdout.split(`
2
- `),[".DS_Store"]),R=[];for(let V of Z)if(V){let F=V.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&c!=="only"||F==="folders"&&c!=="never")&&R.push({type:F==="filepaths"?"file":"folder",name:V,insertValue:V,isDangerous:_,context:{templateType:F}})}return j(v(R))}catch{return[]}})}}y.folders=Object.assign(()=>L({showFolders:"only"}),Object.freeze(L({showFolders:"only"})));y.filepaths=Object.assign(L,Object.freeze(L()))});var Q=I(w=>{"use strict";var A=w&&w.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(r.next(s))}catch(f){l(f)}}function c(s){try{a(r.throw(s))}catch(f){l(f)}}function a(s){s.done?o(s.value):i(s.value).then(u,c)}a((r=r.apply(e,t||[])).next())})};Object.defineProperty(w,"__esModule",{value:!0});w.keyValueList=w.keyValue=w.valueList=void 0;var J=new Map;function D(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function z(e,t,n){return A(this,void 0,void 0,function*(){if(typeof e=="function"){let r=yield e(...n);return D(t,r)}if(typeof e[0]=="string"){let r=e.map(i=>({name:i}));return D(t,r)}return D(t,e)})}function q(e,t,n,r){return A(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=J.get(e);return i===void 0&&(i=yield z(e,t,r),J.set(e,i)),i}return z(e,t,r)})}function B(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function M(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function C(e,t){let n=new Set(e);return t.filter(r=>{var i;return typeof r.name=="string"?!n.has(r.name):!(!((i=r.name)===null||i===void 0)&&i.some(o=>n.has(o)))})}function fe({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:i=!1}){return{trigger:(o,l)=>o.lastIndexOf(e)!==l.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>A(this,void 0,void 0,function*(){var l;let u=yield q(t,r?e:"",n,o);if(i)return u;let[c]=o,a=(l=c[c.length-1])===null||l===void 0?void 0:l.split(e);return C(a,u)})}}w.valueList=fe;function de({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:i=!0}){return{trigger:(o,l)=>o.indexOf(e)!==l.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>A(this,void 0,void 0,function*(){let[l]=o,c=!l[l.length-1].includes(e),a=c?t:n,s=B(c,r);return q(a,c&&i?e:"",s,o)})}}w.keyValue=de;function pe({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:i=!1,insertSeparator:o=!0,insertDelimiter:l=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(a,s)=>{let f=M(a,e,t),v=M(s,e,t);return f!==v},getQueryTerm:a=>{let s=M(a,e,t);return a.slice(s+1)},custom:(...a)=>A(this,void 0,void 0,function*(){let[s]=a,f=s[s.length-1],v=M(f,e,t),j=v===-1||f.slice(v,v+e.length)!==e,p=j?n:r,g=B(j,i),d=yield q(p,j?o?e:"":l?t:"",g,a);if(j){if(u)return d;let b=f.split(t).map(h=>h.slice(0,h.indexOf(e)));return C(b,d)}if(c)return d;let _=f.split(t).map(b=>b.slice(b.indexOf(e)+e.length));return C(_,d)})}}w.keyValueList=pe});var H=I(T=>{"use strict";var he=T&&T.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(r.next(s))}catch(f){l(f)}}function c(s){try{a(r.throw(s))}catch(f){l(f)}}function a(s){s.done?o(s.value):i(s.value).then(u,c)}a((r=r.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.ai=void 0;var ge=4097,ve=4,ye=.8,me=ge*ve*ye;function _e({name:e,prompt:t,message:n,postProcess:r,temperature:i,splitOn:o}){return{scriptTimeout:15e3,custom:(l,u,c)=>he(this,void 0,void 0,function*(){var a,s;let f=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let v=typeof t=="function"?yield t({tokens:l,executeCommand:u,generatorContext:c}):t,j=typeof n=="function"?yield n({tokens:l,executeCommand:u,generatorContext:c}):n;if(j===null||j.length===0)return console.warn("No message provided to AI generator"),[];let p=me-((a=v?.length)!==null&&a!==void 0?a:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...v?[{role:"system",content:v}]:[],{role:"user",content:j.slice(0,p)}],temperature:i},O=JSON.stringify(g),d=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),_=JSON.parse(d.stdout);return(s=_?.choices.map(h=>{var S;return(S=h?.message)===null||S===void 0?void 0:S.content}).filter(h=>typeof h=="string").flatMap(h=>o?h.split(o).filter(S=>S.trim().length>0):[h]).map(h=>{if(r)return r(h);let S=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}T.ai=_e});var X=I(m=>{"use strict";var Oe=m&&m.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),be=m&&m.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Oe(t,e,n)};Object.defineProperty(m,"__esModule",{value:!0});m.ai=m.folders=m.filepaths=void 0;var G=$();Object.defineProperty(m,"filepaths",{enumerable:!0,get:function(){return G.filepaths}});Object.defineProperty(m,"folders",{enumerable:!0,get:function(){return G.folders}});be(Q(),m);var je=H();Object.defineProperty(m,"ai",{enumerable:!0,get:function(){return je.ai}})});var E=ie(X(),1),Se={name:"migrate",args:{name:"project",description:"The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown",isOptional:!0,generators:(0,E.filepaths)({extensions:["sln"],equals:["project.json","global.json"]})},options:[{name:"--format-report-file-json",description:"Output migration report file as JSON rather than user messages",args:{name:"file",template:"filepaths"}},{name:["-r","--report"],description:"Output migration report to a file in addition to the console",args:{name:"report_file",template:"filepaths"}},{name:["-s","--skip-project-references"],description:"Skip migrating project references. By default, project references are migrated recursively",args:{name:"type",isOptional:!0,suggestions:["Debug","Release"]}},{name:"--skip-backup",description:"Skip moving project.json, global.json, and *.xproj to a backup directory after successful migration"},{name:["-t","--template-file"],description:"Template csproj file to use for migration. By default, the same template as the one dropped by dotnet new console is used",args:{name:"file",generators:(0,E.filepaths)({extensions:["csproj"]})}},{name:["-v","--sdk-package-version"],description:"The version of the sdk package that's referenced in the migrated app. The default is the version of the SDK in dotnet new",args:{name:"version"}},{name:["-x","--xproj-file"],description:"The path to the xproj file to use. Required when there is more than one xproj in a project directory",args:{name:"file",template:"filepaths"}}]},Fe=Se;export{Fe as default};
1
+ var U=Object.create;var P=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var re=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ee(t))!ne.call(e,i)&&i!==n&&P(e,i,{get:()=>t[i],enumerable:!(r=Y(t,i))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?U(te(e)):{},re(t||!e||!e.__esModule?P(n,"default",{value:e,enumerable:!0}):n,e));var W=T(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.shellExpand=x.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;x.ensureTrailingSlash=oe;var se=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,le=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var o;let l=i.slice(1);return(o=t[l])!==null&&o!==void 0?o:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,o,l)=>{var u,c;return(c=(u=t[o])!==null&&u!==void 0?u:l)!==null&&c!==void 0?c:i}),ae=(e,t)=>{var n;let{environmentVariables:r}=t;return le(se(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};x.shellExpand=ae});var $=T(_=>{"use strict";var ue=_&&_.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(r.next(s))}catch(f){l(f)}}function c(s){try{a(r.throw(s))}catch(f){l(f)}}function a(s){s.done?o(s.value):i(s.value).then(u,c)}a((r=r.apply(e,t||[])).next())})};Object.defineProperty(_,"__esModule",{value:!0});_.filepaths=_.folders=_.getCurrentInsertedDirectory=void 0;_.sortFilesAlphabetically=K;var C=W();function K(e,t=[]){let n=t.map(i=>i.toLowerCase()),r=e.filter(i=>!n.includes(i.toLowerCase()));return[...r.filter(i=>!i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),...r.filter(i=>i.startsWith(".")).sort((i,o)=>i.localeCompare(o)),"../"]}var ce=(e,t,n)=>{if(e===null)return"/";let r=(0,C.shellExpand)(t,n),i=r.slice(0,r.lastIndexOf("/")+1);return i===""?(0,C.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,C.ensureTrailingSlash)(e)}${i}`};_.getCurrentInsertedDirectory=ce;function M(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:i=!1,editFileSuggestions:o,editFolderSuggestions:l,rootDirectory:u,showFolders:c="always"}=e,a=new Set(t),s=new Set(n),f=()=>t.length>0||n.length>0||r,v=(p=[])=>f()?p.filter(({name:g="",type:O})=>{if(!i&&O==="folder"||s.has(g)||r&&g.match(r))return!0;let[,...d]=g.split(".");if(d.length>=1){let m=d.length-1,b=d[m];do{if(a.has(b))return!0;m-=1,b=[d[m],b].join(".")}while(m>=0)}return!1}):p,j=(p=[])=>!o&&!l?p:p.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?o:l)||{}));return{trigger:(p,g)=>{let O=p.lastIndexOf("/"),d=g.lastIndexOf("/");return O!==d?!0:O===-1&&d===-1?!1:p.slice(0,O)!==g.slice(0,d)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,g,O)=>ue(this,void 0,void 0,function*(){var d;let{isDangerous:m,currentWorkingDirectory:b,searchTerm:h}=O,S=(d=(0,_.getCurrentInsertedDirectory)(u??b,h,O))!==null&&d!==void 0?d:"/";try{let N=yield g({command:"ls",args:["-1ApL"],cwd:S}),Z=K(N.stdout.split(`
2
+ `),[".DS_Store"]),R=[];for(let V of Z)if(V){let F=V.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&c!=="only"||F==="folders"&&c!=="never")&&R.push({type:F==="filepaths"?"file":"folder",name:V,insertValue:V,isDangerous:m,context:{templateType:F}})}return j(v(R))}catch{return[]}})}}_.folders=Object.assign(()=>M({showFolders:"only"}),Object.freeze(M({showFolders:"only"})));_.filepaths=Object.assign(M,Object.freeze(M()))});var Q=T(w=>{"use strict";var I=w&&w.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(r.next(s))}catch(f){l(f)}}function c(s){try{a(r.throw(s))}catch(f){l(f)}}function a(s){s.done?o(s.value):i(s.value).then(u,c)}a((r=r.apply(e,t||[])).next())})};Object.defineProperty(w,"__esModule",{value:!0});w.valueList=fe;w.keyValue=de;w.keyValueList=pe;var J=new Map;function L(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function z(e,t,n){return I(this,void 0,void 0,function*(){if(typeof e=="function"){let r=yield e(...n);return L(t,r)}if(typeof e[0]=="string"){let r=e.map(i=>({name:i}));return L(t,r)}return L(t,e)})}function q(e,t,n,r){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=J.get(e);return i===void 0&&(i=yield z(e,t,r),J.set(e,i)),i}return z(e,t,r)})}function B(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function D(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function k(e,t){let n=new Set(e);return t.filter(r=>{var i;return typeof r.name=="string"?!n.has(r.name):!(!((i=r.name)===null||i===void 0)&&i.some(o=>n.has(o)))})}function fe({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:i=!1}){return{trigger:(o,l)=>o.lastIndexOf(e)!==l.lastIndexOf(e),getQueryTerm:o=>o.slice(o.lastIndexOf(e)+e.length),custom:(...o)=>I(this,void 0,void 0,function*(){var l;let u=yield q(t,r?e:"",n,o);if(i)return u;let[c]=o,a=(l=c[c.length-1])===null||l===void 0?void 0:l.split(e);return k(a,u)})}}function de({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:i=!0}){return{trigger:(o,l)=>o.indexOf(e)!==l.indexOf(e),getQueryTerm:o=>o.slice(o.indexOf(e)+1),custom:(...o)=>I(this,void 0,void 0,function*(){let[l]=o,c=!l[l.length-1].includes(e),a=c?t:n,s=B(c,r);return q(a,c&&i?e:"",s,o)})}}function pe({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:i=!1,insertSeparator:o=!0,insertDelimiter:l=!1,allowRepeatedKeys:u=!1,allowRepeatedValues:c=!0}){return{trigger:(a,s)=>{let f=D(a,e,t),v=D(s,e,t);return f!==v},getQueryTerm:a=>{let s=D(a,e,t);return a.slice(s+1)},custom:(...a)=>I(this,void 0,void 0,function*(){let[s]=a,f=s[s.length-1],v=D(f,e,t),j=v===-1||f.slice(v,v+e.length)!==e,p=j?n:r,g=B(j,i),d=yield q(p,j?o?e:"":l?t:"",g,a);if(j){if(u)return d;let b=f.split(t).map(h=>h.slice(0,h.indexOf(e)));return k(b,d)}if(c)return d;let m=f.split(t).map(b=>b.slice(b.indexOf(e)+e.length));return k(m,d)})}}});var H=T(A=>{"use strict";var he=A&&A.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(s){try{a(r.next(s))}catch(f){l(f)}}function c(s){try{a(r.throw(s))}catch(f){l(f)}}function a(s){s.done?o(s.value):i(s.value).then(u,c)}a((r=r.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=_e;var ge=4097,ve=4,ye=.8,me=ge*ve*ye;function _e({name:e,prompt:t,message:n,postProcess:r,temperature:i,splitOn:o}){return{scriptTimeout:15e3,custom:(l,u,c)=>he(this,void 0,void 0,function*(){var a,s;let f=yield u({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(f.stdout))return[];let v=typeof t=="function"?yield t({tokens:l,executeCommand:u,generatorContext:c}):t,j=typeof n=="function"?yield n({tokens:l,executeCommand:u,generatorContext:c}):n;if(j===null||j.length===0)return console.warn("No message provided to AI generator"),[];let p=me-((a=v?.length)!==null&&a!==void 0?a:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...v?[{role:"system",content:v}]:[],{role:"user",content:j.slice(0,p)}],temperature:i},O=JSON.stringify(g),d=yield u({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),m=JSON.parse(d.stdout);return(s=m?.choices.map(h=>{var S;return(S=h?.message)===null||S===void 0?void 0:S.content}).filter(h=>typeof h=="string").flatMap(h=>o?h.split(o).filter(S=>S.trim().length>0):[h]).map(h=>{if(r)return r(h);let S=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&s!==void 0?s:[]})}}});var X=T(y=>{"use strict";var Oe=y&&y.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),be=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Oe(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var G=$();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return G.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return G.folders}});be(Q(),y);var je=H();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return je.ai}})});var E=ie(X(),1),Se={name:"migrate",args:{name:"project",description:"The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown",isOptional:!0,generators:(0,E.filepaths)({extensions:["sln"],equals:["project.json","global.json"]})},options:[{name:"--format-report-file-json",description:"Output migration report file as JSON rather than user messages",args:{name:"file",template:"filepaths"}},{name:["-r","--report"],description:"Output migration report to a file in addition to the console",args:{name:"report_file",template:"filepaths"}},{name:["-s","--skip-project-references"],description:"Skip migrating project references. By default, project references are migrated recursively",args:{name:"type",isOptional:!0,suggestions:["Debug","Release"]}},{name:"--skip-backup",description:"Skip moving project.json, global.json, and *.xproj to a backup directory after successful migration"},{name:["-t","--template-file"],description:"Template csproj file to use for migration. By default, the same template as the one dropped by dotnet new console is used",args:{name:"file",generators:(0,E.filepaths)({extensions:["csproj"]})}},{name:["-v","--sdk-package-version"],description:"The version of the sdk package that's referenced in the migrated app. The default is the version of the SDK in dotnet new",args:{name:"version"}},{name:["-x","--xproj-file"],description:"The path to the xproj file to use. Required when there is more than one xproj in a project directory",args:{name:"file",template:"filepaths"}}]},Fe=Se;export{Fe as default};