@tabsmith/autocomplete-specs 1.0.0 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) 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/codeburn.js +1 -0
  14. package/build/codesign.js +2 -2
  15. package/build/dapr.js +2 -2
  16. package/build/deno/generators.js +4 -4
  17. package/build/deno.js +2 -2
  18. package/build/deployctl.js +2 -2
  19. package/build/direnv.js +2 -2
  20. package/build/docker.js +18 -18
  21. package/build/dotenv-vault.js +2 -2
  22. package/build/dotnet/dotnet-add.js +2 -2
  23. package/build/dotnet/dotnet-build.js +2 -2
  24. package/build/dotnet/dotnet-clean.js +2 -2
  25. package/build/dotnet/dotnet-format.js +2 -2
  26. package/build/dotnet/dotnet-list.js +2 -2
  27. package/build/dotnet/dotnet-migrate.js +2 -2
  28. package/build/dotnet/dotnet-nuget.js +3 -3
  29. package/build/dotnet/dotnet-pack.js +2 -2
  30. package/build/dotnet/dotnet-publish.js +2 -2
  31. package/build/dotnet/dotnet-remove.js +2 -2
  32. package/build/dotnet/dotnet-restore.js +2 -2
  33. package/build/dotnet/dotnet-sln.js +2 -2
  34. package/build/dotnet/dotnet-store.js +2 -2
  35. package/build/dotnet/dotnet-test.js +2 -2
  36. package/build/dotnet/dotnet-tool.js +3 -3
  37. package/build/dotnet.js +2 -2
  38. package/build/dsh.js +2 -0
  39. package/build/dtm.js +3 -3
  40. package/build/dynamic/index.js +1 -1
  41. package/build/elixir.js +2 -2
  42. package/build/elm-json.js +2 -2
  43. package/build/esbuild.js +3 -3
  44. package/build/file.js +2 -2
  45. package/build/flutter.js +5 -5
  46. package/build/gh.js +6 -37
  47. package/build/git.js +20 -20
  48. package/build/glow.js +2 -2
  49. package/build/hub.js +20 -20
  50. package/build/iex.js +2 -2
  51. package/build/index.js +1 -1
  52. package/build/index.json +1 -1
  53. package/build/java.js +2 -2
  54. package/build/julia.js +2 -2
  55. package/build/limactl.js +3 -3
  56. package/build/man.js +3 -3
  57. package/build/meteor.js +3 -3
  58. package/build/mgnl.js +2 -2
  59. package/build/mix.js +2 -2
  60. package/build/mongoimport.js +2 -2
  61. package/build/n.js +3 -3
  62. package/build/ni.js +2 -2
  63. package/build/node.js +2 -2
  64. package/build/npm.js +2 -2
  65. package/build/nr.js +3 -3
  66. package/build/nrm.js +2 -2
  67. package/build/opencode.js +2 -2
  68. package/build/osascript.js +2 -2
  69. package/build/osqueryi.js +2 -2
  70. package/build/pandoc.js +3 -3
  71. package/build/pdfunite.js +2 -2
  72. package/build/pi.js +2 -2
  73. package/build/pipenv.js +2 -2
  74. package/build/pm2.js +2 -2
  75. package/build/pnpm.js +23 -24
  76. package/build/pod.js +2 -2
  77. package/build/pre-commit.js +126 -126
  78. package/build/python.js +2 -2
  79. package/build/python3.js +2 -2
  80. package/build/r.js +3 -3
  81. package/build/rails.js +3 -3
  82. package/build/rancher.js +3 -3
  83. package/build/react-native.js +5 -5
  84. package/build/robot.js +2 -2
  85. package/build/rojo.js +2 -2
  86. package/build/rollup.js +2 -2
  87. package/build/rscript.js +2 -2
  88. package/build/rush.js +5 -5
  89. package/build/rushx.js +4 -4
  90. package/build/scc.js +2 -2
  91. package/build/shortcuts.js +2 -2
  92. package/build/sidekiq.js +2 -2
  93. package/build/sqlite3.js +2 -2
  94. package/build/streamlit.js +2 -2
  95. package/build/subl.js +2 -2
  96. package/build/swift.js +2 -2
  97. package/build/systemctl.js +2 -2
  98. package/build/ts-node.js +3 -3
  99. package/build/tsc.js +2 -2
  100. package/build/tsx.js +2 -2
  101. package/build/turbo.js +20 -20
  102. package/build/typst.js +2 -2
  103. package/build/vsce.js +20 -20
  104. package/build/wasm-bindgen.js +2 -2
  105. package/build/yarn.js +4 -4
  106. package/build/yomo.js +2 -2
  107. package/package.json +20 -20
  108. package/build/ai-agents specs.js +0 -1
@@ -1,2 +1,2 @@
1
- var Z=Object.create;var q=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var se=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ee(t))!ne.call(e,i)&&i!==n&&q(e,i,{get:()=>t[i],enumerable:!(s=Y(t,i))||s.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Z(te(e)):{},se(t||!e||!e.__esModule?q(n,"default",{value:e,enumerable:!0}):n,e));var N=T(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.shellExpand=k.ensureTrailingSlash=void 0;var re=e=>e.endsWith("/")?e:`${e}/`;k.ensureTrailingSlash=re;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,i=>{var r;let a=i.slice(1);return(r=t[a])!==null&&r!==void 0?r:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,r,a)=>{var c,u;return(u=(c=t[r])!==null&&c!==void 0?c:a)!==null&&u!==void 0?u:i}),le=(e,t)=>{var n;let{environmentVariables:s}=t;return ae(oe(e,(n=s?.HOME)!==null&&n!==void 0?n:"~"),s)};k.shellExpand=le});var K=T(v=>{"use strict";var ce=v&&v.__awaiter||function(e,t,n,s){function i(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(d){a(d)}}function u(o){try{l(s.throw(o))}catch(d){a(d)}}function l(o){o.done?r(o.value):i(o.value).then(c,u)}l((s=s.apply(e,t||[])).next())})};Object.defineProperty(v,"__esModule",{value:!0});v.filepaths=v.folders=v.getCurrentInsertedDirectory=v.sortFilesAlphabetically=void 0;var C=N();function W(e,t=[]){let n=t.map(i=>i.toLowerCase()),s=e.filter(i=>!n.includes(i.toLowerCase()));return[...s.filter(i=>!i.startsWith(".")).sort((i,r)=>i.localeCompare(r)),...s.filter(i=>i.startsWith(".")).sort((i,r)=>i.localeCompare(r)),"../"]}v.sortFilesAlphabetically=W;var ue=(e,t,n)=>{if(e===null)return"/";let s=(0,C.shellExpand)(t,n),i=s.slice(0,s.lastIndexOf("/")+1);return i===""?(0,C.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,C.ensureTrailingSlash)(e)}${i}`};v.getCurrentInsertedDirectory=ue;function E(e={}){let{extensions:t=[],equals:n=[],matches:s,filterFolders:i=!1,editFileSuggestions:r,editFolderSuggestions:a,rootDirectory:c,showFolders:u="always"}=e,l=new Set(t),o=new Set(n),d=()=>t.length>0||n.length>0||s,g=(p=[])=>d()?p.filter(({name:m="",type:_})=>{if(!i&&_==="folder"||o.has(m)||s&&m.match(s))return!0;let[,...f]=m.split(".");if(f.length>=1){let b=f.length-1,O=f[b];do{if(l.has(O))return!0;b-=1,O=[f[b],O].join(".")}while(b>=0)}return!1}):p,S=(p=[])=>!r&&!a?p:p.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?r:a)||{}));return{trigger:(p,m)=>{let _=p.lastIndexOf("/"),f=m.lastIndexOf("/");return _!==f?!0:_===-1&&f===-1?!1:p.slice(0,_)!==m.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,m,_)=>ce(this,void 0,void 0,function*(){var f;let{isDangerous:b,currentWorkingDirectory:O,searchTerm:h}=_,x=(f=(0,v.getCurrentInsertedDirectory)(c??O,h,_))!==null&&f!==void 0?f:"/";try{let D=yield m({command:"ls",args:["-1ApL"],cwd:x}),X=W(D.stdout.split(`
2
- `),[".DS_Store"]),R=[];for(let A of X)if(A){let V=A.endsWith("/")?"folders":"filepaths";(V==="filepaths"&&u!=="only"||V==="folders"&&u!=="never")&&R.push({type:V==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:b,context:{templateType:V}})}return S(g(R))}catch{return[]}})}}v.folders=Object.assign(()=>E({showFolders:"only"}),Object.freeze(E({showFolders:"only"})));v.filepaths=Object.assign(E,Object.freeze(E()))});var J=T(w=>{"use strict";var j=w&&w.__awaiter||function(e,t,n,s){function i(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(d){a(d)}}function u(o){try{l(s.throw(o))}catch(d){a(d)}}function l(o){o.done?r(o.value):i(o.value).then(c,u)}l((s=s.apply(e,t||[])).next())})};Object.defineProperty(w,"__esModule",{value:!0});w.keyValueList=w.keyValue=w.valueList=void 0;var $=new Map;function F(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 s=yield e(...n);return F(t,s)}if(typeof e[0]=="string"){let s=e.map(i=>({name:i}));return F(t,s)}return F(t,e)})}function P(e,t,n,s){return j(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=$.get(e);return i===void 0&&(i=yield z(e,t,s),$.set(e,i)),i}return z(e,t,s)})}function H(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 M(e,t){let n=new Set(e);return t.filter(s=>{var i;return typeof s.name=="string"?!n.has(s.name):!(!((i=s.name)===null||i===void 0)&&i.some(r=>n.has(r)))})}function de({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:s=!1,allowRepeatedValues:i=!1}){return{trigger:(r,a)=>r.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:r=>r.slice(r.lastIndexOf(e)+e.length),custom:(...r)=>j(this,void 0,void 0,function*(){var a;let c=yield P(t,s?e:"",n,r);if(i)return c;let[u]=r,l=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return M(l,c)})}}w.valueList=de;function fe({separator:e="=",keys:t=[],values:n=[],cache:s=!1,insertSeparator:i=!0}){return{trigger:(r,a)=>r.indexOf(e)!==a.indexOf(e),getQueryTerm:r=>r.slice(r.indexOf(e)+1),custom:(...r)=>j(this,void 0,void 0,function*(){let[a]=r,u=!a[a.length-1].includes(e),l=u?t:n,o=H(u,s);return P(l,u&&i?e:"",o,r)})}}w.keyValue=fe;function pe({separator:e="=",delimiter:t=",",keys:n=[],values:s=[],cache:i=!1,insertSeparator:r=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:u=!0}){return{trigger:(l,o)=>{let d=L(l,e,t),g=L(o,e,t);return d!==g},getQueryTerm:l=>{let o=L(l,e,t);return l.slice(o+1)},custom:(...l)=>j(this,void 0,void 0,function*(){let[o]=l,d=o[o.length-1],g=L(d,e,t),S=g===-1||d.slice(g,g+e.length)!==e,p=S?n:s,m=H(S,i),f=yield P(p,S?r?e:"":a?t:"",m,l);if(S){if(c)return f;let O=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return M(O,f)}if(u)return f;let b=d.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return M(b,f)})}}w.keyValueList=pe});var Q=T(I=>{"use strict";var he=I&&I.__awaiter||function(e,t,n,s){function i(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(d){a(d)}}function u(o){try{l(s.throw(o))}catch(d){a(d)}}function l(o){o.done?r(o.value):i(o.value).then(c,u)}l((s=s.apply(e,t||[])).next())})};Object.defineProperty(I,"__esModule",{value:!0});I.ai=void 0;var me=4097,ge=4,ve=.8,ye=me*ge*ve;function be({name:e,prompt:t,message:n,postProcess:s,temperature:i,splitOn:r}){return{scriptTimeout:15e3,custom:(a,c,u)=>he(this,void 0,void 0,function*(){var l,o;let d=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((l=g?.length)!==null&&l!==void 0?l:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:S.slice(0,p)}],temperature:i},_=JSON.stringify(m),f=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),b=JSON.parse(f.stdout);return(o=b?.choices.map(h=>{var x;return(x=h?.message)===null||x===void 0?void 0:x.content}).filter(h=>typeof h=="string").flatMap(h=>r?h.split(r).filter(x=>x.trim().length>0):[h]).map(h=>{if(s)return s(h);let x=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:x,insertValue:`'${x}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}I.ai=be});var G=T(y=>{"use strict";var _e=y&&y.__createBinding||(Object.create?function(e,t,n,s){s===void 0&&(s=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,s,i)}:function(e,t,n,s){s===void 0&&(s=n),e[s]=t[n]}),Oe=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&_e(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var B=K();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return B.folders}});Oe(J(),y);var Se=Q();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Se.ai}})});var U=ie(G(),1),xe={name:"ansible-playbook",description:"Runs Ansible playbooks, executing the defined tasks on the targeted hosts",args:{name:"playbook",description:"Playbook(s)",isVariadic:!0,generators:(0,U.filepaths)({extensions:["yml","yaml"]})},options:[{name:"--ask-vault-pass",description:"Ask for vault password"},{name:"--flush-cache",description:"Clears the fact cache for every host in inventory"},{name:"--force-handlers",description:"Run handlers even if a task fails"},{name:"--list-hosts",description:"Outputs a list of matching hosts; does not execute"},{name:"--list-tags",description:"List all available tags"},{name:"--list-tasks",description:"List all tasks that would be executed"},{name:"--skip-tags",description:"Only run plays and tasks whose tags do not match these values",args:{name:"tags"}},{name:"--start-at-task",description:"Start the playbook at the task matching this name one-step-at-a-time",args:{name:"task name"}},{name:"--step",description:"Execute one-step-at-a-time"},{name:"--syntax-check",description:"Perform a syntax check on the playbook, but do not execute it"},{name:"--vault-id",description:"Specify the vault identity to use",args:{name:"vault ID"}},{name:"--vault-password-file",description:"Specify a vault password file",args:{name:"vault password file",template:["filepaths"]}},{name:"--version",description:"Show program's version number, config file location, configured module search path, module location and executable location"},{name:["--check","-C"],description:"Don't make any changes; instead, try to predict some of the changes that may occur"},{name:["--diff","-D"],description:"When changing (small) files and templates, show the differences in those files"},{name:["--module-path","-M"],description:"Prepend colon-separated path(s) to module library",args:{name:"module path",template:["folders"]}},{name:["--extra-vars","-e"],description:"Set additional variables as key=value or YAML/JSON, if filename prepend with @",args:{name:"extra vars"}},{name:["--forks","-f"],description:"Specify number of parallel processes to use",args:{name:"forks"}},{name:["--help","-h"],description:"Show help for ansible"},{name:["--inventory","-i"],description:"Specify inventory host path or comma separated host list",args:{name:"inventory"}},{name:["--limit","-l"],description:"Limit selected hosts to an additional pattern",args:{name:"subset"}},{name:["--tags","-t"],description:"Only run plays and tasks tagged with these values",args:{name:"tags"}},{name:["--verbose","-v"],description:"Enable verbose mode"},{name:"-vvv",description:"Enable very verbose mode"},{name:"-vvvv",description:"Enable connection debug mode"},{name:"--become-method",description:"Privilege escalation method to use",args:{name:"become method",suggestions:["sudo","su","pbrun","pfexec","doas","dzdo","ksu","runas","machinectl"]}},{name:"--become-user",description:"Privilege escalation user to use",args:{name:"become user"}},{name:["--ask-become-pass","-K"],description:"Prompt for privilege escalation password"},{name:["--become","-b"],description:"Run operations with become"},{name:["--private-key","--key-file"],description:"Use this fole to authenticate the connection",args:{name:"private key",template:["filepaths"]}},{name:"--scp-extra-args",description:"Extra arguments to pass to (only) scp",args:{name:"SCP extra args"}},{name:"--sftp-extra-args",description:"Extra arguments to pass to (only) sftp",args:{name:"SFTP extra args"}},{name:"-ssh-extra-args",description:"Extra arguments to pass to (only) ssh",args:{name:"SSH extra args"}},{name:"--ssh-common-args",description:"Extra arguments to pass to sftp/scp/ssh",args:{name:"SSH common args"}},{name:["--timeout","-T"],description:"Override the connection timeout in seconds",args:{name:"timeout"}},{name:["--connection","-c"],description:"Connection type to use",args:{name:"connection type"}},{name:["--ask-pass","-k"],description:"Ask for connection password"},{name:["--user","-u"],description:"Connect as this user",args:{name:"user"}}]},Ve=xe;export{Ve as default};
1
+ var Z=Object.create;var q=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var se=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ee(t))!ne.call(e,i)&&i!==n&&q(e,i,{get:()=>t[i],enumerable:!(s=Y(t,i))||s.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Z(te(e)):{},se(t||!e||!e.__esModule?q(n,"default",{value:e,enumerable:!0}):n,e));var N=I(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.shellExpand=k.ensureTrailingSlash=void 0;var re=e=>e.endsWith("/")?e:`${e}/`;k.ensureTrailingSlash=re;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,i=>{var r;let a=i.slice(1);return(r=t[a])!==null&&r!==void 0?r:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,r,a)=>{var c,u;return(u=(c=t[r])!==null&&c!==void 0?c:a)!==null&&u!==void 0?u:i}),le=(e,t)=>{var n;let{environmentVariables:s}=t;return ae(oe(e,(n=s?.HOME)!==null&&n!==void 0?n:"~"),s)};k.shellExpand=le});var K=I(b=>{"use strict";var ce=b&&b.__awaiter||function(e,t,n,s){function i(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(d){a(d)}}function u(o){try{l(s.throw(o))}catch(d){a(d)}}function l(o){o.done?r(o.value):i(o.value).then(c,u)}l((s=s.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=W;var F=N();function W(e,t=[]){let n=t.map(i=>i.toLowerCase()),s=e.filter(i=>!n.includes(i.toLowerCase()));return[...s.filter(i=>!i.startsWith(".")).sort((i,r)=>i.localeCompare(r)),...s.filter(i=>i.startsWith(".")).sort((i,r)=>i.localeCompare(r)),"../"]}var ue=(e,t,n)=>{if(e===null)return"/";let s=(0,F.shellExpand)(t,n),i=s.slice(0,s.lastIndexOf("/")+1);return i===""?(0,F.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,F.ensureTrailingSlash)(e)}${i}`};b.getCurrentInsertedDirectory=ue;function C(e={}){let{extensions:t=[],equals:n=[],matches:s,filterFolders:i=!1,editFileSuggestions:r,editFolderSuggestions:a,rootDirectory:c,showFolders:u="always"}=e,l=new Set(t),o=new Set(n),d=()=>t.length>0||n.length>0||s,g=(p=[])=>d()?p.filter(({name:m="",type:_})=>{if(!i&&_==="folder"||o.has(m)||s&&m.match(s))return!0;let[,...f]=m.split(".");if(f.length>=1){let y=f.length-1,O=f[y];do{if(l.has(O))return!0;y-=1,O=[f[y],O].join(".")}while(y>=0)}return!1}):p,S=(p=[])=>!r&&!a?p:p.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?r:a)||{}));return{trigger:(p,m)=>{let _=p.lastIndexOf("/"),f=m.lastIndexOf("/");return _!==f?!0:_===-1&&f===-1?!1:p.slice(0,_)!==m.slice(0,f)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,m,_)=>ce(this,void 0,void 0,function*(){var f;let{isDangerous:y,currentWorkingDirectory:O,searchTerm:h}=_,x=(f=(0,b.getCurrentInsertedDirectory)(c??O,h,_))!==null&&f!==void 0?f:"/";try{let D=yield m({command:"ls",args:["-1ApL"],cwd:x}),X=W(D.stdout.split(`
2
+ `),[".DS_Store"]),R=[];for(let A of X)if(A){let E=A.endsWith("/")?"folders":"filepaths";(E==="filepaths"&&u!=="only"||E==="folders"&&u!=="never")&&R.push({type:E==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:y,context:{templateType:E}})}return S(g(R))}catch{return[]}})}}b.folders=Object.assign(()=>C({showFolders:"only"}),Object.freeze(C({showFolders:"only"})));b.filepaths=Object.assign(C,Object.freeze(C()))});var J=I(w=>{"use strict";var T=w&&w.__awaiter||function(e,t,n,s){function i(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(d){a(d)}}function u(o){try{l(s.throw(o))}catch(d){a(d)}}function l(o){o.done?r(o.value):i(o.value).then(c,u)}l((s=s.apply(e,t||[])).next())})};Object.defineProperty(w,"__esModule",{value:!0});w.valueList=de;w.keyValue=fe;w.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 z(e,t,n){return T(this,void 0,void 0,function*(){if(typeof e=="function"){let s=yield e(...n);return L(t,s)}if(typeof e[0]=="string"){let s=e.map(i=>({name:i}));return L(t,s)}return L(t,e)})}function P(e,t,n,s){return T(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=$.get(e);return i===void 0&&(i=yield z(e,t,s),$.set(e,i)),i}return z(e,t,s)})}function H(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 M(e,t){let n=new Set(e);return t.filter(s=>{var i;return typeof s.name=="string"?!n.has(s.name):!(!((i=s.name)===null||i===void 0)&&i.some(r=>n.has(r)))})}function de({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:s=!1,allowRepeatedValues:i=!1}){return{trigger:(r,a)=>r.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:r=>r.slice(r.lastIndexOf(e)+e.length),custom:(...r)=>T(this,void 0,void 0,function*(){var a;let c=yield P(t,s?e:"",n,r);if(i)return c;let[u]=r,l=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return M(l,c)})}}function fe({separator:e="=",keys:t=[],values:n=[],cache:s=!1,insertSeparator:i=!0}){return{trigger:(r,a)=>r.indexOf(e)!==a.indexOf(e),getQueryTerm:r=>r.slice(r.indexOf(e)+1),custom:(...r)=>T(this,void 0,void 0,function*(){let[a]=r,u=!a[a.length-1].includes(e),l=u?t:n,o=H(u,s);return P(l,u&&i?e:"",o,r)})}}function pe({separator:e="=",delimiter:t=",",keys:n=[],values:s=[],cache:i=!1,insertSeparator:r=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:u=!0}){return{trigger:(l,o)=>{let d=V(l,e,t),g=V(o,e,t);return d!==g},getQueryTerm:l=>{let o=V(l,e,t);return l.slice(o+1)},custom:(...l)=>T(this,void 0,void 0,function*(){let[o]=l,d=o[o.length-1],g=V(d,e,t),S=g===-1||d.slice(g,g+e.length)!==e,p=S?n:s,m=H(S,i),f=yield P(p,S?r?e:"":a?t:"",m,l);if(S){if(c)return f;let O=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return M(O,f)}if(u)return f;let y=d.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return M(y,f)})}}});var Q=I(j=>{"use strict";var he=j&&j.__awaiter||function(e,t,n,s){function i(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(d){a(d)}}function u(o){try{l(s.throw(o))}catch(d){a(d)}}function l(o){o.done?r(o.value):i(o.value).then(c,u)}l((s=s.apply(e,t||[])).next())})};Object.defineProperty(j,"__esModule",{value:!0});j.ai=be;var me=4097,ge=4,ve=.8,ye=me*ge*ve;function be({name:e,prompt:t,message:n,postProcess:s,temperature:i,splitOn:r}){return{scriptTimeout:15e3,custom:(a,c,u)=>he(this,void 0,void 0,function*(){var l,o;let d=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(d.stdout))return[];let g=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((l=g?.length)!==null&&l!==void 0?l:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:S.slice(0,p)}],temperature:i},_=JSON.stringify(m),f=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),y=JSON.parse(f.stdout);return(o=y?.choices.map(h=>{var x;return(x=h?.message)===null||x===void 0?void 0:x.content}).filter(h=>typeof h=="string").flatMap(h=>r?h.split(r).filter(x=>x.trim().length>0):[h]).map(h=>{if(s)return s(h);let x=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:x,insertValue:`'${x}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var G=I(v=>{"use strict";var _e=v&&v.__createBinding||(Object.create?function(e,t,n,s){s===void 0&&(s=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,s,i)}:function(e,t,n,s){s===void 0&&(s=n),e[s]=t[n]}),Oe=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 B=K();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return B.folders}});Oe(J(),v);var Se=Q();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Se.ai}})});var U=ie(G(),1),xe={name:"ansible-playbook",description:"Runs Ansible playbooks, executing the defined tasks on the targeted hosts",args:{name:"playbook",description:"Playbook(s)",isVariadic:!0,generators:(0,U.filepaths)({extensions:["yml","yaml"]})},options:[{name:"--ask-vault-pass",description:"Ask for vault password"},{name:"--flush-cache",description:"Clears the fact cache for every host in inventory"},{name:"--force-handlers",description:"Run handlers even if a task fails"},{name:"--list-hosts",description:"Outputs a list of matching hosts; does not execute"},{name:"--list-tags",description:"List all available tags"},{name:"--list-tasks",description:"List all tasks that would be executed"},{name:"--skip-tags",description:"Only run plays and tasks whose tags do not match these values",args:{name:"tags"}},{name:"--start-at-task",description:"Start the playbook at the task matching this name one-step-at-a-time",args:{name:"task name"}},{name:"--step",description:"Execute one-step-at-a-time"},{name:"--syntax-check",description:"Perform a syntax check on the playbook, but do not execute it"},{name:"--vault-id",description:"Specify the vault identity to use",args:{name:"vault ID"}},{name:"--vault-password-file",description:"Specify a vault password file",args:{name:"vault password file",template:["filepaths"]}},{name:"--version",description:"Show program's version number, config file location, configured module search path, module location and executable location"},{name:["--check","-C"],description:"Don't make any changes; instead, try to predict some of the changes that may occur"},{name:["--diff","-D"],description:"When changing (small) files and templates, show the differences in those files"},{name:["--module-path","-M"],description:"Prepend colon-separated path(s) to module library",args:{name:"module path",template:["folders"]}},{name:["--extra-vars","-e"],description:"Set additional variables as key=value or YAML/JSON, if filename prepend with @",args:{name:"extra vars"}},{name:["--forks","-f"],description:"Specify number of parallel processes to use",args:{name:"forks"}},{name:["--help","-h"],description:"Show help for ansible"},{name:["--inventory","-i"],description:"Specify inventory host path or comma separated host list",args:{name:"inventory"}},{name:["--limit","-l"],description:"Limit selected hosts to an additional pattern",args:{name:"subset"}},{name:["--tags","-t"],description:"Only run plays and tasks tagged with these values",args:{name:"tags"}},{name:["--verbose","-v"],description:"Enable verbose mode"},{name:"-vvv",description:"Enable very verbose mode"},{name:"-vvvv",description:"Enable connection debug mode"},{name:"--become-method",description:"Privilege escalation method to use",args:{name:"become method",suggestions:["sudo","su","pbrun","pfexec","doas","dzdo","ksu","runas","machinectl"]}},{name:"--become-user",description:"Privilege escalation user to use",args:{name:"become user"}},{name:["--ask-become-pass","-K"],description:"Prompt for privilege escalation password"},{name:["--become","-b"],description:"Run operations with become"},{name:["--private-key","--key-file"],description:"Use this fole to authenticate the connection",args:{name:"private key",template:["filepaths"]}},{name:"--scp-extra-args",description:"Extra arguments to pass to (only) scp",args:{name:"SCP extra args"}},{name:"--sftp-extra-args",description:"Extra arguments to pass to (only) sftp",args:{name:"SFTP extra args"}},{name:"-ssh-extra-args",description:"Extra arguments to pass to (only) ssh",args:{name:"SSH extra args"}},{name:"--ssh-common-args",description:"Extra arguments to pass to sftp/scp/ssh",args:{name:"SSH common args"}},{name:["--timeout","-T"],description:"Override the connection timeout in seconds",args:{name:"timeout"}},{name:["--connection","-c"],description:"Connection type to use",args:{name:"connection type"}},{name:["--ask-pass","-k"],description:"Ask for connection password"},{name:["--user","-u"],description:"Connect as this user",args:{name:"user"}}]},Ee=xe;export{Ee as default};
package/build/apt.js CHANGED
@@ -1,5 +1,5 @@
1
- var ie=Object.create;var K=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ce=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of re(t))!se.call(e,i)&&i!==n&&K(e,i,{get:()=>t[i],enumerable:!(a=ae(t,i))||a.enumerable});return e};var le=(e,t,n)=>(n=e!=null?ie(oe(e)):{},ce(t||!e||!e.__esModule?K(n,"default",{value:e,enumerable:!0}):n,e));var z=F(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.shellExpand=j.ensureTrailingSlash=void 0;var ue=e=>e.endsWith("/")?e:`${e}/`;j.ensureTrailingSlash=ue;var de=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,pe=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var r;let s=i.slice(1);return(r=t[s])!==null&&r!==void 0?r:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,r,s)=>{var l,u;return(u=(l=t[r])!==null&&l!==void 0?l:s)!==null&&u!==void 0?u:i}),fe=(e,t)=>{var n;let{environmentVariables:a}=t;return pe(de(e,(n=a?.HOME)!==null&&n!==void 0?n:"~"),a)};j.shellExpand=fe});var Q=F(v=>{"use strict";var ge=v&&v.__awaiter||function(e,t,n,a){function i(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function l(o){try{c(a.next(o))}catch(d){s(d)}}function u(o){try{c(a.throw(o))}catch(d){s(d)}}function c(o){o.done?r(o.value):i(o.value).then(l,u)}c((a=a.apply(e,t||[])).next())})};Object.defineProperty(v,"__esModule",{value:!0});v.filepaths=v.folders=v.getCurrentInsertedDirectory=v.sortFilesAlphabetically=void 0;var R=z();function J(e,t=[]){let n=t.map(i=>i.toLowerCase()),a=e.filter(i=>!n.includes(i.toLowerCase()));return[...a.filter(i=>!i.startsWith(".")).sort((i,r)=>i.localeCompare(r)),...a.filter(i=>i.startsWith(".")).sort((i,r)=>i.localeCompare(r)),"../"]}v.sortFilesAlphabetically=J;var he=(e,t,n)=>{if(e===null)return"/";let a=(0,R.shellExpand)(t,n),i=a.slice(0,a.lastIndexOf("/")+1);return i===""?(0,R.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,R.ensureTrailingSlash)(e)}${i}`};v.getCurrentInsertedDirectory=he;function M(e={}){let{extensions:t=[],equals:n=[],matches:a,filterFolders:i=!1,editFileSuggestions:r,editFolderSuggestions:s,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),o=new Set(n),d=()=>t.length>0||n.length>0||a,y=(g=[])=>d()?g.filter(({name:m="",type:O})=>{if(!i&&O==="folder"||o.has(m)||a&&m.match(a))return!0;let[,...p]=m.split(".");if(p.length>=1){let k=p.length-1,_=p[k];do{if(c.has(_))return!0;k-=1,_=[p[k],_].join(".")}while(k>=0)}return!1}):g,S=(g=[])=>!r&&!s?g:g.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?r:s)||{}));return{trigger:(g,m)=>{let O=g.lastIndexOf("/"),p=m.lastIndexOf("/");return O!==p?!0:O===-1&&p===-1?!1:g.slice(0,O)!==m.slice(0,p)},getQueryTerm:g=>g.slice(g.lastIndexOf("/")+1),custom:(g,m,O)=>ge(this,void 0,void 0,function*(){var p;let{isDangerous:k,currentWorkingDirectory:_,searchTerm:h}=O,x=(p=(0,v.getCurrentInsertedDirectory)(l??_,h,O))!==null&&p!==void 0?p:"/";try{let $=yield m({command:"ls",args:["-1ApL"],cwd:x}),ne=J($.stdout.split(`
2
- `),[".DS_Store"]),G=[];for(let L of ne)if(L){let D=L.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&u!=="only"||D==="folders"&&u!=="never")&&G.push({type:D==="filepaths"?"file":"folder",name:L,insertValue:L,isDangerous:k,context:{templateType:D}})}return S(y(G))}catch{return[]}})}}v.folders=Object.assign(()=>M({showFolders:"only"}),Object.freeze(M({showFolders:"only"})));v.filepaths=Object.assign(M,Object.freeze(M()))});var X=F(T=>{"use strict";var P=T&&T.__awaiter||function(e,t,n,a){function i(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function l(o){try{c(a.next(o))}catch(d){s(d)}}function u(o){try{c(a.throw(o))}catch(d){s(d)}}function c(o){o.done?r(o.value):i(o.value).then(l,u)}c((a=a.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.keyValueList=T.keyValue=T.valueList=void 0;var H=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 B(e,t,n){return P(this,void 0,void 0,function*(){if(typeof e=="function"){let a=yield e(...n);return q(t,a)}if(typeof e[0]=="string"){let a=e.map(i=>({name:i}));return q(t,a)}return q(t,e)})}function N(e,t,n,a){return P(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=H.get(e);return i===void 0&&(i=yield B(e,t,a),H.set(e,i)),i}return B(e,t,a)})}function U(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 E(e,t){let n=new Set(e);return t.filter(a=>{var i;return typeof a.name=="string"?!n.has(a.name):!(!((i=a.name)===null||i===void 0)&&i.some(r=>n.has(r)))})}function me({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:a=!1,allowRepeatedValues:i=!1}){return{trigger:(r,s)=>r.lastIndexOf(e)!==s.lastIndexOf(e),getQueryTerm:r=>r.slice(r.lastIndexOf(e)+e.length),custom:(...r)=>P(this,void 0,void 0,function*(){var s;let l=yield N(t,a?e:"",n,r);if(i)return l;let[u]=r,c=(s=u[u.length-1])===null||s===void 0?void 0:s.split(e);return E(c,l)})}}T.valueList=me;function ye({separator:e="=",keys:t=[],values:n=[],cache:a=!1,insertSeparator:i=!0}){return{trigger:(r,s)=>r.indexOf(e)!==s.indexOf(e),getQueryTerm:r=>r.slice(r.indexOf(e)+1),custom:(...r)=>P(this,void 0,void 0,function*(){let[s]=r,u=!s[s.length-1].includes(e),c=u?t:n,o=U(u,a);return N(c,u&&i?e:"",o,r)})}}T.keyValue=ye;function ve({separator:e="=",delimiter:t=",",keys:n=[],values:a=[],cache:i=!1,insertSeparator:r=!0,insertDelimiter:s=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,o)=>{let d=C(c,e,t),y=C(o,e,t);return d!==y},getQueryTerm:c=>{let o=C(c,e,t);return c.slice(o+1)},custom:(...c)=>P(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],y=C(d,e,t),S=y===-1||d.slice(y,y+e.length)!==e,g=S?n:a,m=U(S,i),p=yield N(g,S?r?e:"":s?t:"",m,c);if(S){if(l)return p;let _=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return E(_,p)}if(u)return p;let k=d.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return E(k,p)})}}T.keyValueList=ve});var Z=F(A=>{"use strict";var be=A&&A.__awaiter||function(e,t,n,a){function i(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function l(o){try{c(a.next(o))}catch(d){s(d)}}function u(o){try{c(a.throw(o))}catch(d){s(d)}}function c(o){o.done?r(o.value):i(o.value).then(l,u)}c((a=a.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=void 0;var ke=4097,we=4,Oe=.8,_e=ke*we*Oe;function Se({name:e,prompt:t,message:n,postProcess:a,temperature:i,splitOn:r}){return{scriptTimeout:15e3,custom:(s,l,u)=>be(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 y=typeof t=="function"?yield t({tokens:s,executeCommand:l,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:s,executeCommand:l,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let g=_e-((c=y?.length)!==null&&c!==void 0?c:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...y?[{role:"system",content:y}]:[],{role:"user",content:S.slice(0,g)}],temperature:i},O=JSON.stringify(m),p=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),k=JSON.parse(p.stdout);return(o=k?.choices.map(h=>{var x;return(x=h?.message)===null||x===void 0?void 0:x.content}).filter(h=>typeof h=="string").flatMap(h=>r?h.split(r).filter(x=>x.trim().length>0):[h]).map(h=>{if(a)return a(h);let x=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:x,insertValue:`'${x}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}A.ai=Se});var ee=F(b=>{"use strict";var xe=b&&b.__createBinding||(Object.create?function(e,t,n,a){a===void 0&&(a=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,a,i)}:function(e,t,n,a){a===void 0&&(a=n),e[a]=t[n]}),Te=b&&b.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&xe(t,e,n)};Object.defineProperty(b,"__esModule",{value:!0});b.ai=b.folders=b.filepaths=void 0;var Y=Q();Object.defineProperty(b,"filepaths",{enumerable:!0,get:function(){return Y.filepaths}});Object.defineProperty(b,"folders",{enumerable:!0,get:function(){return Y.folders}});Te(X(),b);var Ie=Z();Object.defineProperty(b,"ai",{enumerable:!0,get:function(){return Ie.ai}})});var te=le(ee(),1),V={trigger:(e,t)=>e.length===0||t.length===0&&e.length>0,custom:async(e,t)=>{let n=e[e.length-1];if(n.length===0)return[];let{stdout:a}=await t({command:"apt",args:["list"]});return a.trim().split(`
1
+ var ie=Object.create;var K=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ce=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ae(t))!se.call(e,i)&&i!==n&&K(e,i,{get:()=>t[i],enumerable:!(r=re(t,i))||r.enumerable});return e};var le=(e,t,n)=>(n=e!=null?ie(oe(e)):{},ce(t||!e||!e.__esModule?K(n,"default",{value:e,enumerable:!0}):n,e));var z=A(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.shellExpand=V.ensureTrailingSlash=void 0;var ue=e=>e.endsWith("/")?e:`${e}/`;V.ensureTrailingSlash=ue;var de=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,pe=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var a;let s=i.slice(1);return(a=t[s])!==null&&a!==void 0?a:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,a,s)=>{var l,u;return(u=(l=t[a])!==null&&l!==void 0?l:s)!==null&&u!==void 0?u:i}),fe=(e,t)=>{var n;let{environmentVariables:r}=t;return pe(de(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};V.shellExpand=fe});var Q=A(k=>{"use strict";var ge=k&&k.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function l(o){try{c(r.next(o))}catch(d){s(d)}}function u(o){try{c(r.throw(o))}catch(d){s(d)}}function c(o){o.done?a(o.value):i(o.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(k,"__esModule",{value:!0});k.filepaths=k.folders=k.getCurrentInsertedDirectory=void 0;k.sortFilesAlphabetically=J;var R=z();function J(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,a)=>i.localeCompare(a)),...r.filter(i=>i.startsWith(".")).sort((i,a)=>i.localeCompare(a)),"../"]}var he=(e,t,n)=>{if(e===null)return"/";let r=(0,R.shellExpand)(t,n),i=r.slice(0,r.lastIndexOf("/")+1);return i===""?(0,R.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,R.ensureTrailingSlash)(e)}${i}`};k.getCurrentInsertedDirectory=he;function M(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:i=!1,editFileSuggestions:a,editFolderSuggestions:s,rootDirectory:l,showFolders:u="always"}=e,c=new Set(t),o=new Set(n),d=()=>t.length>0||n.length>0||r,y=(g=[])=>d()?g.filter(({name:m="",type:O})=>{if(!i&&O==="folder"||o.has(m)||r&&m.match(r))return!0;let[,...p]=m.split(".");if(p.length>=1){let b=p.length-1,_=p[b];do{if(c.has(_))return!0;b-=1,_=[p[b],_].join(".")}while(b>=0)}return!1}):g,S=(g=[])=>!a&&!s?g:g.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?a:s)||{}));return{trigger:(g,m)=>{let O=g.lastIndexOf("/"),p=m.lastIndexOf("/");return O!==p?!0:O===-1&&p===-1?!1:g.slice(0,O)!==m.slice(0,p)},getQueryTerm:g=>g.slice(g.lastIndexOf("/")+1),custom:(g,m,O)=>ge(this,void 0,void 0,function*(){var p;let{isDangerous:b,currentWorkingDirectory:_,searchTerm:h}=O,x=(p=(0,k.getCurrentInsertedDirectory)(l??_,h,O))!==null&&p!==void 0?p:"/";try{let $=yield m({command:"ls",args:["-1ApL"],cwd:x}),ne=J($.stdout.split(`
2
+ `),[".DS_Store"]),G=[];for(let L of ne)if(L){let D=L.endsWith("/")?"folders":"filepaths";(D==="filepaths"&&u!=="only"||D==="folders"&&u!=="never")&&G.push({type:D==="filepaths"?"file":"folder",name:L,insertValue:L,isDangerous:b,context:{templateType:D}})}return S(y(G))}catch{return[]}})}}k.folders=Object.assign(()=>M({showFolders:"only"}),Object.freeze(M({showFolders:"only"})));k.filepaths=Object.assign(M,Object.freeze(M()))});var X=A(I=>{"use strict";var F=I&&I.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function l(o){try{c(r.next(o))}catch(d){s(d)}}function u(o){try{c(r.throw(o))}catch(d){s(d)}}function c(o){o.done?a(o.value):i(o.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(I,"__esModule",{value:!0});I.valueList=me;I.keyValue=ye;I.keyValueList=ve;var H=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 B(e,t,n){return F(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 N(e,t,n,r){return F(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=H.get(e);return i===void 0&&(i=yield B(e,t,r),H.set(e,i)),i}return B(e,t,r)})}function U(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 E(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(a=>n.has(a)))})}function me({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:i=!1}){return{trigger:(a,s)=>a.lastIndexOf(e)!==s.lastIndexOf(e),getQueryTerm:a=>a.slice(a.lastIndexOf(e)+e.length),custom:(...a)=>F(this,void 0,void 0,function*(){var s;let l=yield N(t,r?e:"",n,a);if(i)return l;let[u]=a,c=(s=u[u.length-1])===null||s===void 0?void 0:s.split(e);return E(c,l)})}}function ye({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:i=!0}){return{trigger:(a,s)=>a.indexOf(e)!==s.indexOf(e),getQueryTerm:a=>a.slice(a.indexOf(e)+1),custom:(...a)=>F(this,void 0,void 0,function*(){let[s]=a,u=!s[s.length-1].includes(e),c=u?t:n,o=U(u,r);return N(c,u&&i?e:"",o,a)})}}function ve({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:i=!1,insertSeparator:a=!0,insertDelimiter:s=!1,allowRepeatedKeys:l=!1,allowRepeatedValues:u=!0}){return{trigger:(c,o)=>{let d=C(c,e,t),y=C(o,e,t);return d!==y},getQueryTerm:c=>{let o=C(c,e,t);return c.slice(o+1)},custom:(...c)=>F(this,void 0,void 0,function*(){let[o]=c,d=o[o.length-1],y=C(d,e,t),S=y===-1||d.slice(y,y+e.length)!==e,g=S?n:r,m=U(S,i),p=yield N(g,S?a?e:"":s?t:"",m,c);if(S){if(l)return p;let _=d.split(t).map(h=>h.slice(0,h.indexOf(e)));return E(_,p)}if(u)return p;let b=d.split(t).map(_=>_.slice(_.indexOf(e)+e.length));return E(b,p)})}}});var Z=A(P=>{"use strict";var be=P&&P.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function l(o){try{c(r.next(o))}catch(d){s(d)}}function u(o){try{c(r.throw(o))}catch(d){s(d)}}function c(o){o.done?a(o.value):i(o.value).then(l,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(P,"__esModule",{value:!0});P.ai=Se;var ke=4097,we=4,Oe=.8,_e=ke*we*Oe;function Se({name:e,prompt:t,message:n,postProcess:r,temperature:i,splitOn:a}){return{scriptTimeout:15e3,custom:(s,l,u)=>be(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 y=typeof t=="function"?yield t({tokens:s,executeCommand:l,generatorContext:u}):t,S=typeof n=="function"?yield n({tokens:s,executeCommand:l,generatorContext:u}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let g=_e-((c=y?.length)!==null&&c!==void 0?c:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...y?[{role:"system",content:y}]:[],{role:"user",content:S.slice(0,g)}],temperature:i},O=JSON.stringify(m),p=yield l({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),b=JSON.parse(p.stdout);return(o=b?.choices.map(h=>{var x;return(x=h?.message)===null||x===void 0?void 0:x.content}).filter(h=>typeof h=="string").flatMap(h=>a?h.split(a).filter(x=>x.trim().length>0):[h]).map(h=>{if(r)return r(h);let x=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:x,insertValue:`'${x}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var ee=A(v=>{"use strict";var xe=v&&v.__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]}),Te=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&xe(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var Y=Q();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return Y.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return Y.folders}});Te(X(),v);var Ie=Z();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Ie.ai}})});var te=le(ee(),1),j={trigger:(e,t)=>e.length===0||t.length===0&&e.length>0,custom:async(e,t)=>{let n=e[e.length-1];if(n.length===0)return[];let{stdout:r}=await t({command:"apt",args:["list"]});return r.trim().split(`
3
3
  `).filter(i=>i.startsWith(n)).map(i=>i.replace(/\/.*/,"")).map(i=>({name:i,description:"Package",icon:"\u{1F4E6}",priority:50}))}},W={script:["apt","list","--installed"],postProcess:function(e){return e.trim().split(`
4
- `).map(t=>({name:t.substring(0,t.indexOf("/")),description:"Package",icon:"\u{1F4E6}"}))}},Ve={script:["apt","list","--upgradable"],postProcess:function(e){return e.trim().split(`
5
- `).map(t=>({name:t.substring(0,t.indexOf("/")),description:"Package",icon:"\u{1F4E6}"}))}},f=[{name:"-y",description:"Assume yes to all prompts",exclusiveOn:["--assume-no"]},{name:"--assume-no",description:"Assume no to all prompts",exclusiveOn:["-y"]}],I=[{name:["-d","--download-only"],description:"For any operation that would download packages, download them, but do nothing else"},{name:"--no-download",description:"Do not download packages, attempt to use already downloaded packages"}],w=[{name:["-s","--simulate"],description:"Simulate running this command and show it's output, without actually changing anything"}],je={name:"apt",description:"Package manager for Debian-based Linux distributions",subcommands:[{name:"update",description:"Update the package database",options:[...f]},{name:"upgrade",description:"Install all available upgrades",args:{name:"package",description:"Package(s) to upgrade",isVariadic:!0,isOptional:!0,generators:Ve},options:[...I,...f,...w]},{name:"full-upgrade",description:"Install available upgrades, removing currently installed packages if needed to upgrade the system as a whole",options:[...I,...f,...w]},{name:"install",description:"Install package(s)",args:{name:"package",description:"The package you want to install",isVariadic:!0,generators:[V,(0,te.filepaths)({extensions:["deb"]})]},options:[...I,...f,...w,{name:"--reinstall",description:"Reinstall the package if it is already installed"},{name:["-f","--fix-broken"],description:"Attempt to fix broken packages"}]},{name:"reinstall",description:"Reinstall package(s)",args:{name:"package",description:"The package you want to reinstall",isVariadic:!0,generators:W},options:[...f,...w]},{name:"remove",description:"Remove package(s)",args:{name:"package",description:"The package you want to remove",isVariadic:!0,generators:W},options:[...f,...w,{name:["-f","--fix-broken"],description:"Attempt to fix broken packages"}]},{name:"purge",description:"Remove package(s) and their configuration files",args:{name:"package",description:"The package you want to purge",isVariadic:!0,generators:W},options:[...f,...w]},{name:["autoremove","auto-remove"],description:"Remove unused packages",options:[...f,...w]},{name:"list",description:"List packages",options:[{name:"--installed",description:"List installed packages"},{name:"--upgradable",description:"List upgradable packages"}]},{name:"search",description:"Search for packages",args:{name:"query",description:"The query to search for"},options:[...f]},{name:"show",description:"Show package details",args:{name:"package",description:"The package you want to show",generators:V}},{name:"satisfy",description:"Satisfy package dependencies",args:{name:"package",description:"The package you want to satisfy",isVariadic:!0,generators:V},options:[...I,...f,...w]},{name:"clean",description:"Remove downloaded package files",options:[...f,...w]},{name:"edit-sources",description:"Edit the list of package sources",options:[...f]},{name:"source",description:"Fetch package source files",args:{name:"package",description:"The package you want to get source files for",isVariadic:!0,generators:V},options:[...I,...f,...w,{name:"--compile",description:"Compile the package to a binary using dpkg-buildpackage"},{name:"--only-source"},{name:"--host-architecture",description:"The architecture to build for",args:{name:"architecture",description:"The architecture to build for"}}]},{name:"build-dep",description:"Install/remove packages in an attempt to satisfy the build dependencies for a source package",args:{name:"package",description:"The package you want to build dependencies for",generators:V},options:[...I,...f,...w,{name:"--host-architecture",description:"The architecture to build for",args:{name:"architecture",description:"The architecture to build for"}},{name:"--only-source"}]},{name:"download",description:"Download package binary into the current directory",args:{name:"package",description:"The package you want to download",generators:V},options:[...I,...f]},{name:["autoclean","auto-clean"],description:"Like clean, but only removes package files that can no longer be downloaded",options:[...I,...f,...w]},{name:"changelog",description:"Show the changelog for a package",args:{name:"package",description:"The package you want to show the changelog for",generators:V,isVariadic:!0},options:[...I,...f]}],options:[{name:["-h","--help"],description:"Print help message and exit",isPersistent:!0,priority:40},{name:["-v","--version"],description:"Print version information and exit",isPersistent:!0,priority:40}]},Ce=je;export{Ce as default};
4
+ `).map(t=>({name:t.substring(0,t.indexOf("/")),description:"Package",icon:"\u{1F4E6}"}))}},je={script:["apt","list","--upgradable"],postProcess:function(e){return e.trim().split(`
5
+ `).map(t=>({name:t.substring(0,t.indexOf("/")),description:"Package",icon:"\u{1F4E6}"}))}},f=[{name:"-y",description:"Assume yes to all prompts",exclusiveOn:["--assume-no"]},{name:"--assume-no",description:"Assume no to all prompts",exclusiveOn:["-y"]}],T=[{name:["-d","--download-only"],description:"For any operation that would download packages, download them, but do nothing else"},{name:"--no-download",description:"Do not download packages, attempt to use already downloaded packages"}],w=[{name:["-s","--simulate"],description:"Simulate running this command and show it's output, without actually changing anything"}],Ve={name:"apt",description:"Package manager for Debian-based Linux distributions",subcommands:[{name:"update",description:"Update the package database",options:[...f]},{name:"upgrade",description:"Install all available upgrades",args:{name:"package",description:"Package(s) to upgrade",isVariadic:!0,isOptional:!0,generators:je},options:[...T,...f,...w]},{name:"full-upgrade",description:"Install available upgrades, removing currently installed packages if needed to upgrade the system as a whole",options:[...T,...f,...w]},{name:"install",description:"Install package(s)",args:{name:"package",description:"The package you want to install",isVariadic:!0,generators:[j,(0,te.filepaths)({extensions:["deb"]})]},options:[...T,...f,...w,{name:"--reinstall",description:"Reinstall the package if it is already installed"},{name:["-f","--fix-broken"],description:"Attempt to fix broken packages"}]},{name:"reinstall",description:"Reinstall package(s)",args:{name:"package",description:"The package you want to reinstall",isVariadic:!0,generators:W},options:[...f,...w]},{name:"remove",description:"Remove package(s)",args:{name:"package",description:"The package you want to remove",isVariadic:!0,generators:W},options:[...f,...w,{name:["-f","--fix-broken"],description:"Attempt to fix broken packages"}]},{name:"purge",description:"Remove package(s) and their configuration files",args:{name:"package",description:"The package you want to purge",isVariadic:!0,generators:W},options:[...f,...w]},{name:["autoremove","auto-remove"],description:"Remove unused packages",options:[...f,...w]},{name:"list",description:"List packages",options:[{name:"--installed",description:"List installed packages"},{name:"--upgradable",description:"List upgradable packages"}]},{name:"search",description:"Search for packages",args:{name:"query",description:"The query to search for"},options:[...f]},{name:"show",description:"Show package details",args:{name:"package",description:"The package you want to show",generators:j}},{name:"satisfy",description:"Satisfy package dependencies",args:{name:"package",description:"The package you want to satisfy",isVariadic:!0,generators:j},options:[...T,...f,...w]},{name:"clean",description:"Remove downloaded package files",options:[...f,...w]},{name:"edit-sources",description:"Edit the list of package sources",options:[...f]},{name:"source",description:"Fetch package source files",args:{name:"package",description:"The package you want to get source files for",isVariadic:!0,generators:j},options:[...T,...f,...w,{name:"--compile",description:"Compile the package to a binary using dpkg-buildpackage"},{name:"--only-source"},{name:"--host-architecture",description:"The architecture to build for",args:{name:"architecture",description:"The architecture to build for"}}]},{name:"build-dep",description:"Install/remove packages in an attempt to satisfy the build dependencies for a source package",args:{name:"package",description:"The package you want to build dependencies for",generators:j},options:[...T,...f,...w,{name:"--host-architecture",description:"The architecture to build for",args:{name:"architecture",description:"The architecture to build for"}},{name:"--only-source"}]},{name:"download",description:"Download package binary into the current directory",args:{name:"package",description:"The package you want to download",generators:j},options:[...T,...f]},{name:["autoclean","auto-clean"],description:"Like clean, but only removes package files that can no longer be downloaded",options:[...T,...f,...w]},{name:"changelog",description:"Show the changelog for a package",args:{name:"package",description:"The package you want to show the changelog for",generators:j,isVariadic:!0},options:[...T,...f]}],options:[{name:["-h","--help"],description:"Print help message and exit",isPersistent:!0,priority:40},{name:["-v","--version"],description:"Print version information and exit",isPersistent:!0,priority:40}]},Ce=Ve;export{Ce as default};
package/build/asr.js CHANGED
@@ -1,2 +1,2 @@
1
- var Y=Object.create;var q=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ie=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of te(t))!re.call(e,i)&&i!==n&&q(e,i,{get:()=>t[i],enumerable:!(r=ee(t,i))||r.enumerable});return e};var se=(e,t,n)=>(n=e!=null?Y(ne(e)):{},ie(t||!e||!e.__esModule?q(n,"default",{value:e,enumerable:!0}):n,e));var N=A(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.shellExpand=F.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;F.ensureTrailingSlash=oe;var ae=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ue=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var s;let a=i.slice(1);return(s=t[a])!==null&&s!==void 0?s:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,s,a)=>{var c,l;return(l=(c=t[s])!==null&&c!==void 0?c:a)!==null&&l!==void 0?l:i}),ce=(e,t)=>{var n;let{environmentVariables:r}=t;return ue(ae(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};F.shellExpand=ce});var W=A(v=>{"use strict";var le=v&&v.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(o){try{u(r.next(o))}catch(f){a(f)}}function l(o){try{u(r.throw(o))}catch(f){a(f)}}function u(o){o.done?s(o.value):i(o.value).then(c,l)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(v,"__esModule",{value:!0});v.filepaths=v.folders=v.getCurrentInsertedDirectory=v.sortFilesAlphabetically=void 0;var P=N();function R(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,s)=>i.localeCompare(s)),...r.filter(i=>i.startsWith(".")).sort((i,s)=>i.localeCompare(s)),"../"]}v.sortFilesAlphabetically=R;var fe=(e,t,n)=>{if(e===null)return"/";let r=(0,P.shellExpand)(t,n),i=r.slice(0,r.lastIndexOf("/")+1);return i===""?(0,P.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,P.ensureTrailingSlash)(e)}${i}`};v.getCurrentInsertedDirectory=fe;function C(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:i=!1,editFileSuggestions:s,editFolderSuggestions:a,rootDirectory:c,showFolders:l="always"}=e,u=new Set(t),o=new Set(n),f=()=>t.length>0||n.length>0||r,g=(p=[])=>f()?p.filter(({name:h="",type:S})=>{if(!i&&S==="folder"||o.has(h)||r&&h.match(r))return!0;let[,...d]=h.split(".");if(d.length>=1){let b=d.length-1,O=d[b];do{if(u.has(O))return!0;b-=1,O=[d[b],O].join(".")}while(b>=0)}return!1}):p,_=(p=[])=>!s&&!a?p:p.map(h=>Object.assign(Object.assign({},h),(h.type==="file"?s:a)||{}));return{trigger:(p,h)=>{let S=p.lastIndexOf("/"),d=h.lastIndexOf("/");return S!==d?!0:S===-1&&d===-1?!1:p.slice(0,S)!==h.slice(0,d)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,h,S)=>le(this,void 0,void 0,function*(){var d;let{isDangerous:b,currentWorkingDirectory:O,searchTerm:m}=S,w=(d=(0,v.getCurrentInsertedDirectory)(c??O,m,S))!==null&&d!==void 0?d:"/";try{let E=yield h({command:"ls",args:["-1ApL"],cwd:w}),Z=R(E.stdout.split(`
2
- `),[".DS_Store"]),z=[];for(let j of Z)if(j){let k=j.endsWith("/")?"folders":"filepaths";(k==="filepaths"&&l!=="only"||k==="folders"&&l!=="never")&&z.push({type:k==="filepaths"?"file":"folder",name:j,insertValue:j,isDangerous:b,context:{templateType:k}})}return _(g(z))}catch{return[]}})}}v.folders=Object.assign(()=>C({showFolders:"only"}),Object.freeze(C({showFolders:"only"})));v.filepaths=Object.assign(C,Object.freeze(C()))});var U=A(x=>{"use strict";var I=x&&x.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(o){try{u(r.next(o))}catch(f){a(f)}}function l(o){try{u(r.throw(o))}catch(f){a(f)}}function u(o){o.done?s(o.value):i(o.value).then(c,l)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.keyValueList=x.keyValue=x.valueList=void 0;var H=new Map;function V(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function $(e,t,n){return I(this,void 0,void 0,function*(){if(typeof e=="function"){let r=yield e(...n);return V(t,r)}if(typeof e[0]=="string"){let r=e.map(i=>({name:i}));return V(t,r)}return V(t,e)})}function L(e,t,n,r){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=H.get(e);return i===void 0&&(i=yield $(e,t,r),H.set(e,i)),i}return $(e,t,r)})}function K(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 M(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(s=>n.has(s)))})}function de({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:i=!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 c=yield L(t,r?e:"",n,s);if(i)return c;let[l]=s,u=(a=l[l.length-1])===null||a===void 0?void 0:a.split(e);return M(u,c)})}}x.valueList=de;function pe({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:i=!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,l=!a[a.length-1].includes(e),u=l?t:n,o=K(l,r);return L(u,l&&i?e:"",o,s)})}}x.keyValue=pe;function me({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:i=!1,insertSeparator:s=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:l=!0}){return{trigger:(u,o)=>{let f=D(u,e,t),g=D(o,e,t);return f!==g},getQueryTerm:u=>{let o=D(u,e,t);return u.slice(o+1)},custom:(...u)=>I(this,void 0,void 0,function*(){let[o]=u,f=o[o.length-1],g=D(f,e,t),_=g===-1||f.slice(g,g+e.length)!==e,p=_?n:r,h=K(_,i),d=yield L(p,_?s?e:"":a?t:"",h,u);if(_){if(c)return d;let O=f.split(t).map(m=>m.slice(0,m.indexOf(e)));return M(O,d)}if(l)return d;let b=f.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return M(b,d)})}}x.keyValueList=me});var J=A(T=>{"use strict";var he=T&&T.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(o){try{u(r.next(o))}catch(f){a(f)}}function l(o){try{u(r.throw(o))}catch(f){a(f)}}function u(o){o.done?s(o.value):i(o.value).then(c,l)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.ai=void 0;var ge=4097,ve=4,ye=.8,be=ge*ve*ye;function Se({name:e,prompt:t,message:n,postProcess:r,temperature:i,splitOn:s}){return{scriptTimeout:15e3,custom:(a,c,l)=>he(this,void 0,void 0,function*(){var u,o;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:l}):t,_=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:l}):n;if(_===null||_.length===0)return console.warn("No message provided to AI generator"),[];let p=be-((u=g?.length)!==null&&u!==void 0?u:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:_.slice(0,p)}],temperature:i},S=JSON.stringify(h),d=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",S]}),b=JSON.parse(d.stdout);return(o=b?.choices.map(m=>{var w;return(w=m?.message)===null||w===void 0?void 0:w.content}).filter(m=>typeof m=="string").flatMap(m=>s?m.split(s).filter(w=>w.trim().length>0):[m]).map(m=>{if(r)return r(m);let w=m.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:w,insertValue:`'${w}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}T.ai=Se});var X=A(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]}),_e=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 Q=W();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return Q.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return Q.folders}});_e(U(),y);var we=J();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return we.ai}})});var G=se(X(),1),B=[{name:"--source",description:"Can be a disk image, /dev entry, or volume mountpoint",args:{name:"source",description:"Disk image, /dev entry, or volume mountpoint",template:"filepaths",suggestCurrentToken:!0},dependsOn:["--target","--file"]},{name:"--target",description:"Can be a /dev entry, or volume mountpoint",args:{name:"target",description:"/dev entry, or volume mountpoint",template:"filepaths",suggestCurrentToken:!0}},{name:"--file",description:"When performing a multicast restore, --file can be specified instead of --target",args:{name:"source",description:"Disk image, /dev entry, or volume mountpoint",template:"filepaths",suggestCurrentToken:!0},dependsOn:["--erase"]},{name:"--erase",description:"Erases target and is required. --erase must always be used, as file copies are no longer supported by asr"},{name:"--format",description:"Specifies the destination filesystem format",args:{name:"HFS+ | HFSX",description:"Specify the destination filesystem format",isOptional:!0}},{name:"--noprompt",description:"Suppresses the prompt which usually occurs before target"},{name:"--timeout",description:"Specifies num seconds that a multicast client should wait when no payload data has been received over a multicast stream before exiting",args:{name:"num",description:"Number of seconds that a multicast client should wait",default:"0",isOptional:!0,suggestions:["0"]}},{name:"--puppetstrings",description:"Provide progress output that is easy for another program to parse"},{name:"--noverify",description:"Skips the verification steps normally taken to ensure that a volume has been properly restored"},{name:"--allowfragmentedcatalog",description:"Allows restores to proceed even if the source's catalog file is fragmented"},{name:"--SHA256",description:"Forces the restore to use the SHA-256 hash in the image during verification"},{name:"--sourcevolumename",description:"Tells asr which volume in the source container to invert when doing an APFS restore"},{name:"--sourcevolumeUUID",description:"Tells asr which volume in the source container to invert when doing an APFS restore"},{name:"--useReplication",description:"Forces asr to use replication for restoring APFS volumes"},{name:"--useInverter",description:"Forces asr to use the inverter for restoring APFS volumes"},{name:"--toSnapshot",description:"Specifies the snapshot on the source APFS volume to restore to the target APFS volume"},{name:"--fromSnapshot",description:"Names a snapshot on the source APFS volume to use in combination with --toSnapshot to specify a snapshot delta to restore to the target APFS volume"}],xe=[{name:"--buffers",description:"One of the options that control how asr uses memory",args:{name:"num",description:"Specifies the num buffers should be used"}},{name:"--buffersize",description:"One of the options that control how asr uses memory",args:{name:"size",description:"Specifies the size of each buffer"}},{name:"--csumbuffers",description:"One of the options that control how asr uses memory",args:{name:"num",description:"Specifies that num buffers should be used for checksumming operations"}},{name:"--csumbuffersize",description:"One of the options that control how asr uses memory",args:{name:"size",description:"Specifies the size of each buffer used for checksumming"}}],Fe=[{name:"--verbose",description:"Enables verbose progress and error messages"},{name:"--debug",description:"Enables other progress and error messages"}],Te={name:"asr",description:"Asr efficiently copies disk images onto volumes, either directly or via a multicast network stream",subcommands:[{name:"help",description:"Displays asr usage information"},{name:"version",description:"Displays asr version"},{name:"restore",description:"Restores a disk image or volume to another volume",options:B},{name:"restoreexact",description:"Same as restore verb, except that for an HFS Plus volume, the target partition is resized to match the size of the source partition/ volume",options:B,displayName:"restore[exact]"},{name:"server",description:"Multicasts source over the network",options:[{name:"--source",description:"Source has to be a UDIF disk image",args:{name:"source",description:"UDIF disk image local/remote path",template:"filepaths",suggestCurrentToken:!0}},{name:"--interface",description:"The network interface to be used for multicasting",args:{name:"interface",description:"The network interface to be used for multicasting"}},{name:"--config",description:"Server requires a configuration file to be passed",args:{name:"configuration",description:"Configuration file in standard property list format",generators:(0,G.filepaths)({extensions:["plist"]})}}]},{name:"imagescan",description:"Calculate checksums of the data in the provided image and store them in the image"},{name:"info",description:"Report the image metadata which was placed in the image by a previous use of the imagescan verb",options:[{name:"--plist",description:"Writes its output as an XML-formatted plist"}]}],options:[...xe,...Fe]},Pe=Te;export{Pe as default};
1
+ var Y=Object.create;var q=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var se=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of te(t))!re.call(e,s)&&s!==n&&q(e,s,{get:()=>t[s],enumerable:!(r=ee(t,s))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Y(ne(e)):{},se(t||!e||!e.__esModule?q(n,"default",{value:e,enumerable:!0}):n,e));var N=T(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.shellExpand=F.ensureTrailingSlash=void 0;var oe=e=>e.endsWith("/")?e:`${e}/`;F.ensureTrailingSlash=oe;var ae=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ue=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,s=>{var i;let a=s.slice(1);return(i=t[a])!==null&&i!==void 0?i:s}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(s,i,a)=>{var c,l;return(l=(c=t[i])!==null&&c!==void 0?c:a)!==null&&l!==void 0?l:s}),ce=(e,t)=>{var n;let{environmentVariables:r}=t;return ue(ae(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};F.shellExpand=ce});var W=T(b=>{"use strict";var le=b&&b.__awaiter||function(e,t,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function c(o){try{u(r.next(o))}catch(f){a(f)}}function l(o){try{u(r.throw(o))}catch(f){a(f)}}function u(o){o.done?i(o.value):s(o.value).then(c,l)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=R;var P=N();function R(e,t=[]){let n=t.map(s=>s.toLowerCase()),r=e.filter(s=>!n.includes(s.toLowerCase()));return[...r.filter(s=>!s.startsWith(".")).sort((s,i)=>s.localeCompare(i)),...r.filter(s=>s.startsWith(".")).sort((s,i)=>s.localeCompare(i)),"../"]}var fe=(e,t,n)=>{if(e===null)return"/";let r=(0,P.shellExpand)(t,n),s=r.slice(0,r.lastIndexOf("/")+1);return s===""?(0,P.ensureTrailingSlash)(e):s.startsWith("/")?s:`${(0,P.ensureTrailingSlash)(e)}${s}`};b.getCurrentInsertedDirectory=fe;function C(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:s=!1,editFileSuggestions:i,editFolderSuggestions:a,rootDirectory:c,showFolders:l="always"}=e,u=new Set(t),o=new Set(n),f=()=>t.length>0||n.length>0||r,g=(p=[])=>f()?p.filter(({name:h="",type:S})=>{if(!s&&S==="folder"||o.has(h)||r&&h.match(r))return!0;let[,...d]=h.split(".");if(d.length>=1){let y=d.length-1,O=d[y];do{if(u.has(O))return!0;y-=1,O=[d[y],O].join(".")}while(y>=0)}return!1}):p,_=(p=[])=>!i&&!a?p:p.map(h=>Object.assign(Object.assign({},h),(h.type==="file"?i:a)||{}));return{trigger:(p,h)=>{let S=p.lastIndexOf("/"),d=h.lastIndexOf("/");return S!==d?!0:S===-1&&d===-1?!1:p.slice(0,S)!==h.slice(0,d)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,h,S)=>le(this,void 0,void 0,function*(){var d;let{isDangerous:y,currentWorkingDirectory:O,searchTerm:m}=S,w=(d=(0,b.getCurrentInsertedDirectory)(c??O,m,S))!==null&&d!==void 0?d:"/";try{let z=yield h({command:"ls",args:["-1ApL"],cwd:w}),Z=R(z.stdout.split(`
2
+ `),[".DS_Store"]),L=[];for(let j of Z)if(j){let k=j.endsWith("/")?"folders":"filepaths";(k==="filepaths"&&l!=="only"||k==="folders"&&l!=="never")&&L.push({type:k==="filepaths"?"file":"folder",name:j,insertValue:j,isDangerous:y,context:{templateType:k}})}return _(g(L))}catch{return[]}})}}b.folders=Object.assign(()=>C({showFolders:"only"}),Object.freeze(C({showFolders:"only"})));b.filepaths=Object.assign(C,Object.freeze(C()))});var U=T(x=>{"use strict";var A=x&&x.__awaiter||function(e,t,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function c(o){try{u(r.next(o))}catch(f){a(f)}}function l(o){try{u(r.throw(o))}catch(f){a(f)}}function u(o){o.done?i(o.value):s(o.value).then(c,l)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=de;x.keyValue=pe;x.keyValueList=me;var H=new Map;function M(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function $(e,t,n){return A(this,void 0,void 0,function*(){if(typeof e=="function"){let r=yield e(...n);return M(t,r)}if(typeof e[0]=="string"){let r=e.map(s=>({name:s}));return M(t,r)}return M(t,e)})}function E(e,t,n,r){return A(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let s=H.get(e);return s===void 0&&(s=yield $(e,t,r),H.set(e,s)),s}return $(e,t,r)})}function K(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 V(e,t){let n=new Set(e);return t.filter(r=>{var s;return typeof r.name=="string"?!n.has(r.name):!(!((s=r.name)===null||s===void 0)&&s.some(i=>n.has(i)))})}function de({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:s=!1}){return{trigger:(i,a)=>i.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:i=>i.slice(i.lastIndexOf(e)+e.length),custom:(...i)=>A(this,void 0,void 0,function*(){var a;let c=yield E(t,r?e:"",n,i);if(s)return c;let[l]=i,u=(a=l[l.length-1])===null||a===void 0?void 0:a.split(e);return V(u,c)})}}function pe({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:s=!0}){return{trigger:(i,a)=>i.indexOf(e)!==a.indexOf(e),getQueryTerm:i=>i.slice(i.indexOf(e)+1),custom:(...i)=>A(this,void 0,void 0,function*(){let[a]=i,l=!a[a.length-1].includes(e),u=l?t:n,o=K(l,r);return E(u,l&&s?e:"",o,i)})}}function me({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:s=!1,insertSeparator:i=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:l=!0}){return{trigger:(u,o)=>{let f=D(u,e,t),g=D(o,e,t);return f!==g},getQueryTerm:u=>{let o=D(u,e,t);return u.slice(o+1)},custom:(...u)=>A(this,void 0,void 0,function*(){let[o]=u,f=o[o.length-1],g=D(f,e,t),_=g===-1||f.slice(g,g+e.length)!==e,p=_?n:r,h=K(_,s),d=yield E(p,_?i?e:"":a?t:"",h,u);if(_){if(c)return d;let O=f.split(t).map(m=>m.slice(0,m.indexOf(e)));return V(O,d)}if(l)return d;let y=f.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return V(y,d)})}}});var J=T(I=>{"use strict";var he=I&&I.__awaiter||function(e,t,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function c(o){try{u(r.next(o))}catch(f){a(f)}}function l(o){try{u(r.throw(o))}catch(f){a(f)}}function u(o){o.done?i(o.value):s(o.value).then(c,l)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(I,"__esModule",{value:!0});I.ai=Se;var ge=4097,ve=4,ye=.8,be=ge*ve*ye;function Se({name:e,prompt:t,message:n,postProcess:r,temperature:s,splitOn:i}){return{scriptTimeout:15e3,custom:(a,c,l)=>he(this,void 0,void 0,function*(){var u,o;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:l}):t,_=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:l}):n;if(_===null||_.length===0)return console.warn("No message provided to AI generator"),[];let p=be-((u=g?.length)!==null&&u!==void 0?u:0),h={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:_.slice(0,p)}],temperature:s},S=JSON.stringify(h),d=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",S]}),y=JSON.parse(d.stdout);return(o=y?.choices.map(m=>{var w;return(w=m?.message)===null||w===void 0?void 0:w.content}).filter(m=>typeof m=="string").flatMap(m=>i?m.split(i).filter(w=>w.trim().length>0):[m]).map(m=>{if(r)return r(m);let w=m.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:w,insertValue:`'${w}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var X=T(v=>{"use strict";var Oe=v&&v.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),_e=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Oe(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var Q=W();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return Q.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return Q.folders}});_e(U(),v);var we=J();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return we.ai}})});var G=ie(X(),1),B=[{name:"--source",description:"Can be a disk image, /dev entry, or volume mountpoint",args:{name:"source",description:"Disk image, /dev entry, or volume mountpoint",template:"filepaths",suggestCurrentToken:!0},dependsOn:["--target","--file"]},{name:"--target",description:"Can be a /dev entry, or volume mountpoint",args:{name:"target",description:"/dev entry, or volume mountpoint",template:"filepaths",suggestCurrentToken:!0}},{name:"--file",description:"When performing a multicast restore, --file can be specified instead of --target",args:{name:"source",description:"Disk image, /dev entry, or volume mountpoint",template:"filepaths",suggestCurrentToken:!0},dependsOn:["--erase"]},{name:"--erase",description:"Erases target and is required. --erase must always be used, as file copies are no longer supported by asr"},{name:"--format",description:"Specifies the destination filesystem format",args:{name:"HFS+ | HFSX",description:"Specify the destination filesystem format",isOptional:!0}},{name:"--noprompt",description:"Suppresses the prompt which usually occurs before target"},{name:"--timeout",description:"Specifies num seconds that a multicast client should wait when no payload data has been received over a multicast stream before exiting",args:{name:"num",description:"Number of seconds that a multicast client should wait",default:"0",isOptional:!0,suggestions:["0"]}},{name:"--puppetstrings",description:"Provide progress output that is easy for another program to parse"},{name:"--noverify",description:"Skips the verification steps normally taken to ensure that a volume has been properly restored"},{name:"--allowfragmentedcatalog",description:"Allows restores to proceed even if the source's catalog file is fragmented"},{name:"--SHA256",description:"Forces the restore to use the SHA-256 hash in the image during verification"},{name:"--sourcevolumename",description:"Tells asr which volume in the source container to invert when doing an APFS restore"},{name:"--sourcevolumeUUID",description:"Tells asr which volume in the source container to invert when doing an APFS restore"},{name:"--useReplication",description:"Forces asr to use replication for restoring APFS volumes"},{name:"--useInverter",description:"Forces asr to use the inverter for restoring APFS volumes"},{name:"--toSnapshot",description:"Specifies the snapshot on the source APFS volume to restore to the target APFS volume"},{name:"--fromSnapshot",description:"Names a snapshot on the source APFS volume to use in combination with --toSnapshot to specify a snapshot delta to restore to the target APFS volume"}],xe=[{name:"--buffers",description:"One of the options that control how asr uses memory",args:{name:"num",description:"Specifies the num buffers should be used"}},{name:"--buffersize",description:"One of the options that control how asr uses memory",args:{name:"size",description:"Specifies the size of each buffer"}},{name:"--csumbuffers",description:"One of the options that control how asr uses memory",args:{name:"num",description:"Specifies that num buffers should be used for checksumming operations"}},{name:"--csumbuffersize",description:"One of the options that control how asr uses memory",args:{name:"size",description:"Specifies the size of each buffer used for checksumming"}}],Fe=[{name:"--verbose",description:"Enables verbose progress and error messages"},{name:"--debug",description:"Enables other progress and error messages"}],Te={name:"asr",description:"Asr efficiently copies disk images onto volumes, either directly or via a multicast network stream",subcommands:[{name:"help",description:"Displays asr usage information"},{name:"version",description:"Displays asr version"},{name:"restore",description:"Restores a disk image or volume to another volume",options:B},{name:"restoreexact",description:"Same as restore verb, except that for an HFS Plus volume, the target partition is resized to match the size of the source partition/ volume",options:B,displayName:"restore[exact]"},{name:"server",description:"Multicasts source over the network",options:[{name:"--source",description:"Source has to be a UDIF disk image",args:{name:"source",description:"UDIF disk image local/remote path",template:"filepaths",suggestCurrentToken:!0}},{name:"--interface",description:"The network interface to be used for multicasting",args:{name:"interface",description:"The network interface to be used for multicasting"}},{name:"--config",description:"Server requires a configuration file to be passed",args:{name:"configuration",description:"Configuration file in standard property list format",generators:(0,G.filepaths)({extensions:["plist"]})}}]},{name:"imagescan",description:"Calculate checksums of the data in the provided image and store them in the image"},{name:"info",description:"Report the image metadata which was placed in the image by a previous use of the imagescan verb",options:[{name:"--plist",description:"Writes its output as an XML-formatted plist"}]}],options:[...xe,...Fe]},Pe=Te;export{Pe as default};