@tabsmith/autocomplete-specs 1.0.0 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@magnolia/cli.js +2 -2
- package/build/@withfig/autocomplete-tools.js +2 -2
- package/build/airflow.js +2 -2
- package/build/ansible-playbook.js +2 -2
- package/build/apt.js +4 -4
- package/build/asr.js +2 -2
- package/build/bun.js +9 -9
- package/build/cargo.js +4 -4
- package/build/cd.js +2 -2
- package/build/chezmoi.js +2 -2
- package/build/cloudflared.js +2 -2
- package/build/coda.js +3 -3
- package/build/codeburn.js +1 -0
- package/build/codesign.js +2 -2
- package/build/dapr.js +2 -2
- package/build/deno/generators.js +4 -4
- package/build/deno.js +2 -2
- package/build/deployctl.js +2 -2
- package/build/direnv.js +2 -2
- package/build/docker.js +18 -18
- package/build/dotenv-vault.js +2 -2
- package/build/dotnet/dotnet-add.js +2 -2
- package/build/dotnet/dotnet-build.js +2 -2
- package/build/dotnet/dotnet-clean.js +2 -2
- package/build/dotnet/dotnet-format.js +2 -2
- package/build/dotnet/dotnet-list.js +2 -2
- package/build/dotnet/dotnet-migrate.js +2 -2
- package/build/dotnet/dotnet-nuget.js +3 -3
- package/build/dotnet/dotnet-pack.js +2 -2
- package/build/dotnet/dotnet-publish.js +2 -2
- package/build/dotnet/dotnet-remove.js +2 -2
- package/build/dotnet/dotnet-restore.js +2 -2
- package/build/dotnet/dotnet-sln.js +2 -2
- package/build/dotnet/dotnet-store.js +2 -2
- package/build/dotnet/dotnet-test.js +2 -2
- package/build/dotnet/dotnet-tool.js +3 -3
- package/build/dotnet.js +2 -2
- package/build/dsh.js +2 -0
- package/build/dtm.js +3 -3
- package/build/dynamic/index.js +1 -1
- package/build/elixir.js +2 -2
- package/build/elm-json.js +2 -2
- package/build/esbuild.js +3 -3
- package/build/file.js +2 -2
- package/build/flutter.js +5 -5
- package/build/gh.js +6 -37
- package/build/git.js +20 -20
- package/build/glow.js +2 -2
- package/build/hub.js +20 -20
- package/build/iex.js +2 -2
- package/build/index.js +1 -1
- package/build/index.json +1 -1
- package/build/java.js +2 -2
- package/build/julia.js +2 -2
- package/build/limactl.js +3 -3
- package/build/man.js +3 -3
- package/build/meteor.js +3 -3
- package/build/mgnl.js +2 -2
- package/build/mix.js +2 -2
- package/build/mongoimport.js +2 -2
- package/build/n.js +3 -3
- package/build/ni.js +2 -2
- package/build/node.js +2 -2
- package/build/npm.js +2 -2
- package/build/nr.js +3 -3
- package/build/nrm.js +2 -2
- package/build/opencode.js +2 -2
- package/build/osascript.js +2 -2
- package/build/osqueryi.js +2 -2
- package/build/pandoc.js +3 -3
- package/build/pdfunite.js +2 -2
- package/build/pi.js +2 -2
- package/build/pipenv.js +2 -2
- package/build/pm2.js +2 -2
- package/build/pnpm.js +23 -24
- package/build/pod.js +2 -2
- package/build/pre-commit.js +126 -126
- package/build/python.js +2 -2
- package/build/python3.js +2 -2
- package/build/r.js +3 -3
- package/build/rails.js +3 -3
- package/build/rancher.js +3 -3
- package/build/react-native.js +5 -5
- package/build/robot.js +2 -2
- package/build/rojo.js +2 -2
- package/build/rollup.js +2 -2
- package/build/rscript.js +2 -2
- package/build/rush.js +5 -5
- package/build/rushx.js +4 -4
- package/build/scc.js +2 -2
- package/build/shortcuts.js +2 -2
- package/build/sidekiq.js +2 -2
- package/build/sqlite3.js +2 -2
- package/build/streamlit.js +2 -2
- package/build/subl.js +2 -2
- package/build/swift.js +2 -2
- package/build/systemctl.js +2 -2
- package/build/ts-node.js +3 -3
- package/build/tsc.js +2 -2
- package/build/tsx.js +2 -2
- package/build/turbo.js +20 -20
- package/build/typst.js +2 -2
- package/build/vsce.js +20 -20
- package/build/wasm-bindgen.js +2 -2
- package/build/yarn.js +4 -4
- package/build/yomo.js +2 -2
- package/package.json +20 -20
- package/build/ai-agents specs.js +0 -1
package/build/typst.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var U=Object.create;var W=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),N=[];for(let A of Z)if(A){let V=A.endsWith("/")?"folders":"filepaths";(V==="filepaths"&&u!=="only"||V==="folders"&&u!=="never")&&N.push({type:V==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:b,context:{templateType:V}})}return x(g(N))}catch{return[]}})}}v.folders=Object.assign(()=>C({showFolders:"only"}),Object.freeze(C({showFolders:"only"})));v.filepaths=Object.assign(C,Object.freeze(C()))});var Q=j(S=>{"use strict";var I=S&&S.__awaiter||function(e,t,n,i){function o(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,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?r(s.value):o(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(S,"__esModule",{value:!0});S.keyValueList=S.keyValue=S.valueList=void 0;var K=new Map;function M(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function k(e,t,n){return I(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(o=>({name:o}));return M(t,i)}return M(t,e)})}function R(e,t,n,i){return I(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let o=K.get(e);return o===void 0&&(o=yield k(e,t,i),K.set(e,o)),o}return k(e,t,i)})}function J(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function F(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 o;return typeof i.name=="string"?!n.has(i.name):!(!((o=i.name)===null||o===void 0)&&o.some(r=>n.has(r)))})}function fe({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:o=!1}){return{trigger:(r,a)=>r.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:r=>r.slice(r.lastIndexOf(e)+e.length),custom:(...r)=>I(this,void 0,void 0,function*(){var a;let c=yield R(t,i?e:"",n,r);if(o)return c;let[u]=r,l=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return q(l,c)})}}S.valueList=fe;function de({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:o=!0}){return{trigger:(r,a)=>r.indexOf(e)!==a.indexOf(e),getQueryTerm:r=>r.slice(r.indexOf(e)+1),custom:(...r)=>I(this,void 0,void 0,function*(){let[a]=r,u=!a[a.length-1].includes(e),l=u?t:n,s=J(u,i);return R(l,u&&o?e:"",s,r)})}}S.keyValue=de;function pe({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:o=!1,insertSeparator:r=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:u=!0}){return{trigger:(l,s)=>{let f=F(l,e,t),g=F(s,e,t);return f!==g},getQueryTerm:l=>{let s=F(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],g=F(f,e,t),x=g===-1||f.slice(g,g+e.length)!==e,p=x?n:i,m=J(x,o),d=yield R(p,x?r?e:"":a?t:"",m,l);if(x){if(c)return d;let O=f.split(t).map(h=>h.slice(0,h.indexOf(e)));return q(O,d)}if(u)return d;let b=f.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return q(b,d)})}}S.keyValueList=pe});var H=j(P=>{"use strict";var he=P&&P.__awaiter||function(e,t,n,i){function o(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,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?r(s.value):o(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(P,"__esModule",{value:!0});P.ai=void 0;var me=4097,ge=4,ve=.8,ye=me*ge*ve;function be({name:e,prompt:t,message:n,postProcess:i,temperature:o,splitOn:r}){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 g=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:u}):t,x=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:u}):n;if(x===null||x.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((l=g?.length)!==null&&l!==void 0?l:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:x.slice(0,p)}],temperature:o},_=JSON.stringify(m),d=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),b=JSON.parse(d.stdout);return(s=b?.choices.map(h=>{var w;return(w=h?.message)===null||w===void 0?void 0:w.content}).filter(h=>typeof h=="string").flatMap(h=>r?h.split(r).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&&s!==void 0?s:[]})}}P.ai=be});var X=j(y=>{"use strict";var _e=y&&y.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),Oe=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&_e(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var B=z();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return B.folders}});Oe(Q(),y);var xe=H();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return xe.ai}})});var L=oe(X(),1),we={name:"typst",description:"The Typst compiler",icon:"\u{1F4C4}",subcommands:[{name:["compile","c"],description:"Compiles an input file into a supported output format",icon:"\u{1F4C4}",options:[{name:"--root",description:"Configures the project root (for absolute paths)",args:{name:"root",template:"folders"}},{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--diagnostic-format",description:"The format to emit diagnostics in",args:{name:"diagnostic_format",suggestions:["human","short"],default:"human"}},{name:["-f","--format"],description:"The format of the output file, inferred from the extension by default",args:{name:"format",suggestions:["pdf","png","svg"]}},{name:"--open",description:"Opens the output file using the default viewer after compilation",args:{name:"open",isVariadic:!0,isOptional:!0}},{name:"--ppi",description:"The PPI (pixels per inch) to use for PNG export",args:{name:"ppi",default:"144.0"}},{name:"--flamegraph",description:"Produces a flamegraph of the compilation process",args:{name:"flamegraph",isVariadic:!0,isOptional:!0,template:"filepaths"}},{name:["-h","--help"],description:"Print help"}],args:[{name:"input",description:"Path to input Typst file",generators:(0,L.filepaths)({extensions:["typ"]})},{name:"output",description:"Path to output file (PDF, PNG, or SVG)",isOptional:!0,template:"filepaths"}]},{name:["watch","w"],description:"Watches an input file and recompiles on changes",icon:"\u{1F504}",options:[{name:"--root",description:"Configures the project root (for absolute paths)",args:{name:"root",template:"folders"}},{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--diagnostic-format",description:"The format to emit diagnostics in",args:{name:"diagnostic_format",suggestions:["human","short"],default:"human"}},{name:["-f","--format"],description:"The format of the output file, inferred from the extension by default",args:{name:"format",suggestions:["pdf","png","svg"]}},{name:"--open",description:"Opens the output file using the default viewer after compilation",args:{name:"open",isVariadic:!0,isOptional:!0}},{name:"--ppi",description:"The PPI (pixels per inch) to use for PNG export",args:{name:"ppi",default:"144.0"}},{name:"--flamegraph",description:"Produces a flamegraph of the compilation process",args:{name:"flamegraph",isVariadic:!0,isOptional:!0,template:"filepaths"}},{name:["-h","--help"],description:"Print help"}],args:[{name:"input",description:"Path to input Typst file",generators:(0,L.filepaths)({extensions:["typ"]})},{name:"output",description:"Path to output file (PDF, PNG, or SVG)",isOptional:!0,template:"filepaths"}]},{name:"query",description:"Processes an input file to extract provided metadata",icon:"\u{1F50D}",options:[{name:"--root",description:"Configures the project root (for absolute paths)",args:{name:"root",template:"folders"}},{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--diagnostic-format",description:"The format to emit diagnostics in",args:{name:"diagnostic_format",suggestions:["human","short"],default:"human"}},{name:"--field",description:"Extracts just one field from all retrieved elements",args:{name:"field"}},{name:"--format",description:"The format to serialize in",args:{name:"format",suggestions:["json","yaml"],default:"json"}},{name:"--one",description:"Expects and retrieves exactly one element"},{name:["-h","--help"],description:"Print help"}],args:[{name:"input",description:"Path to input Typst file",generators:(0,L.filepaths)({extensions:["typ"]})},{name:"selector",description:"Defines which elements to retrieve"}]},{name:"fonts",description:"Lists all discovered fonts in system and custom font paths",icon:"\u{1F524}",options:[{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--variants",description:"Also lists style variants of each font family"},{name:["-h","--help"],description:"Print help"}]},{name:"update",description:"Self update the Typst CLI (disabled)",icon:"\u{1F199}",options:[{name:"--force",description:"Forces a downgrade to an older version (required for downgrading)",exclusiveOn:["--revert"]},{name:"--revert",description:"Reverts to the version from before the last update (only possible if `typst update` has previously ran)",exclusiveOn:["--force"]},{name:["-h","--help"],description:"Print help"}],args:{name:"version",description:"Which version to update to (defaults to latest)",isOptional:!0}},{name:"help",description:"Print this message or the help of the given subcommand(s)",icon:"\u2139\uFE0F",subcommands:[{name:"compile",description:"Compiles an input file into a supported output format",icon:"\u{1F4C4}"},{name:"watch",description:"Watches an input file and recompiles on changes",icon:"\u{1F504}"},{name:"query",description:"Processes an input file to extract provided metadata",icon:"\u{1F50D}"},{name:"fonts",description:"Lists all discovered fonts in system and custom font paths",icon:"\u{1F524}"},{name:"update",description:"Self update the Typst CLI (disabled)",icon:"\u{1F199}"},{name:"help",description:"Print this message or the help of the given subcommand(s)",icon:"\u2139\uFE0F"}]}],options:[{name:"--cert",description:"Path to a custom CA certificate to use when making network requests",args:{name:"cert",template:"filepaths"}},{name:["-v","--verbosity"],description:"Sets the level of logging verbosity: -v = warning & error, -vv = info, -vvv = debug, -vvvv = trace",isRepeatable:4},{name:["-h","--help"],description:"Print help"},{name:["-V","--version"],description:"Print version"}]},Ve=we;export{Ve as default};
|
|
1
|
+
var U=Object.create;var W=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var P=(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 o of ee(t))!ne.call(e,o)&&o!==n&&W(e,o,{get:()=>t[o],enumerable:!(i=Y(t,o))||i.enumerable});return e};var oe=(e,t,n)=>(n=e!=null?U(te(e)):{},ie(t||!e||!e.__esModule?W(n,"default",{value:e,enumerable:!0}):n,e));var G=P(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.shellExpand=T.ensureTrailingSlash=void 0;var re=e=>e.endsWith("/")?e:`${e}/`;T.ensureTrailingSlash=re;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,o=>{var r;let a=o.slice(1);return(r=t[a])!==null&&r!==void 0?r:o}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(o,r,a)=>{var c,u;return(u=(c=t[r])!==null&&c!==void 0?c:a)!==null&&u!==void 0?u:o}),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 z=P(b=>{"use strict";var ce=b&&b.__awaiter||function(e,t,n,i){function o(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,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?r(s.value):o(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=$;var D=G();function $(e,t=[]){let n=t.map(o=>o.toLowerCase()),i=e.filter(o=>!n.includes(o.toLowerCase()));return[...i.filter(o=>!o.startsWith(".")).sort((o,r)=>o.localeCompare(r)),...i.filter(o=>o.startsWith(".")).sort((o,r)=>o.localeCompare(r)),"../"]}var ue=(e,t,n)=>{if(e===null)return"/";let i=(0,D.shellExpand)(t,n),o=i.slice(0,i.lastIndexOf("/")+1);return o===""?(0,D.ensureTrailingSlash)(e):o.startsWith("/")?o:`${(0,D.ensureTrailingSlash)(e)}${o}`};b.getCurrentInsertedDirectory=ue;function C(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:o=!1,editFileSuggestions:r,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=(p=[])=>f()?p.filter(({name:m="",type:_})=>{if(!o&&_==="folder"||s.has(m)||i&&m.match(i))return!0;let[,...d]=m.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,x=(p=[])=>!r&&!a?p:p.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?r:a)||{}));return{trigger:(p,m)=>{let _=p.lastIndexOf("/"),d=m.lastIndexOf("/");return _!==d?!0:_===-1&&d===-1?!1:p.slice(0,_)!==m.slice(0,d)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,m,_)=>ce(this,void 0,void 0,function*(){var d;let{isDangerous:y,currentWorkingDirectory:O,searchTerm:h}=_,w=(d=(0,b.getCurrentInsertedDirectory)(c??O,h,_))!==null&&d!==void 0?d:"/";try{let E=yield m({command:"ls",args:["-1ApL"],cwd:w}),Z=$(E.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),N=[];for(let A of Z)if(A){let V=A.endsWith("/")?"folders":"filepaths";(V==="filepaths"&&u!=="only"||V==="folders"&&u!=="never")&&N.push({type:V==="filepaths"?"file":"folder",name:A,insertValue:A,isDangerous:y,context:{templateType:V}})}return x(g(N))}catch{return[]}})}}b.folders=Object.assign(()=>C({showFolders:"only"}),Object.freeze(C({showFolders:"only"})));b.filepaths=Object.assign(C,Object.freeze(C()))});var H=P(S=>{"use strict";var j=S&&S.__awaiter||function(e,t,n,i){function o(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,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?r(s.value):o(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(S,"__esModule",{value:!0});S.valueList=fe;S.keyValue=de;S.keyValueList=pe;var K=new Map;function M(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function J(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(o=>({name:o}));return M(t,i)}return M(t,e)})}function R(e,t,n,i){return j(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let o=K.get(e);return o===void 0&&(o=yield J(e,t,i),K.set(e,o)),o}return J(e,t,i)})}function Q(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function F(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 o;return typeof i.name=="string"?!n.has(i.name):!(!((o=i.name)===null||o===void 0)&&o.some(r=>n.has(r)))})}function fe({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:o=!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 R(t,i?e:"",n,r);if(o)return c;let[u]=r,l=(a=u[u.length-1])===null||a===void 0?void 0:a.split(e);return q(l,c)})}}function de({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:o=!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,s=Q(u,i);return R(l,u&&o?e:"",s,r)})}}function pe({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:o=!1,insertSeparator:r=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:u=!0}){return{trigger:(l,s)=>{let f=F(l,e,t),g=F(s,e,t);return f!==g},getQueryTerm:l=>{let s=F(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=F(f,e,t),x=g===-1||f.slice(g,g+e.length)!==e,p=x?n:i,m=Q(x,o),d=yield R(p,x?r?e:"":a?t:"",m,l);if(x){if(c)return d;let O=f.split(t).map(h=>h.slice(0,h.indexOf(e)));return q(O,d)}if(u)return d;let y=f.split(t).map(O=>O.slice(O.indexOf(e)+e.length));return q(y,d)})}}});var k=P(I=>{"use strict";var he=I&&I.__awaiter||function(e,t,n,i){function o(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,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?r(s.value):o(s.value).then(c,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(I,"__esModule",{value:!0});I.ai=be;var me=4097,ge=4,ve=.8,ye=me*ge*ve;function be({name:e,prompt:t,message:n,postProcess:i,temperature:o,splitOn:r}){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 g=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:u}):t,x=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:u}):n;if(x===null||x.length===0)return console.warn("No message provided to AI generator"),[];let p=ye-((l=g?.length)!==null&&l!==void 0?l:0),m={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:x.slice(0,p)}],temperature:o},_=JSON.stringify(m),d=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",_]}),y=JSON.parse(d.stdout);return(s=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=>r?h.split(r).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&&s!==void 0?s:[]})}}});var X=P(v=>{"use strict";var _e=v&&v.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}: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)&&_e(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var B=z();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return B.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return B.folders}});Oe(H(),v);var xe=k();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return xe.ai}})});var L=oe(X(),1),we={name:"typst",description:"The Typst compiler",icon:"\u{1F4C4}",subcommands:[{name:["compile","c"],description:"Compiles an input file into a supported output format",icon:"\u{1F4C4}",options:[{name:"--root",description:"Configures the project root (for absolute paths)",args:{name:"root",template:"folders"}},{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--diagnostic-format",description:"The format to emit diagnostics in",args:{name:"diagnostic_format",suggestions:["human","short"],default:"human"}},{name:["-f","--format"],description:"The format of the output file, inferred from the extension by default",args:{name:"format",suggestions:["pdf","png","svg"]}},{name:"--open",description:"Opens the output file using the default viewer after compilation",args:{name:"open",isVariadic:!0,isOptional:!0}},{name:"--ppi",description:"The PPI (pixels per inch) to use for PNG export",args:{name:"ppi",default:"144.0"}},{name:"--flamegraph",description:"Produces a flamegraph of the compilation process",args:{name:"flamegraph",isVariadic:!0,isOptional:!0,template:"filepaths"}},{name:["-h","--help"],description:"Print help"}],args:[{name:"input",description:"Path to input Typst file",generators:(0,L.filepaths)({extensions:["typ"]})},{name:"output",description:"Path to output file (PDF, PNG, or SVG)",isOptional:!0,template:"filepaths"}]},{name:["watch","w"],description:"Watches an input file and recompiles on changes",icon:"\u{1F504}",options:[{name:"--root",description:"Configures the project root (for absolute paths)",args:{name:"root",template:"folders"}},{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--diagnostic-format",description:"The format to emit diagnostics in",args:{name:"diagnostic_format",suggestions:["human","short"],default:"human"}},{name:["-f","--format"],description:"The format of the output file, inferred from the extension by default",args:{name:"format",suggestions:["pdf","png","svg"]}},{name:"--open",description:"Opens the output file using the default viewer after compilation",args:{name:"open",isVariadic:!0,isOptional:!0}},{name:"--ppi",description:"The PPI (pixels per inch) to use for PNG export",args:{name:"ppi",default:"144.0"}},{name:"--flamegraph",description:"Produces a flamegraph of the compilation process",args:{name:"flamegraph",isVariadic:!0,isOptional:!0,template:"filepaths"}},{name:["-h","--help"],description:"Print help"}],args:[{name:"input",description:"Path to input Typst file",generators:(0,L.filepaths)({extensions:["typ"]})},{name:"output",description:"Path to output file (PDF, PNG, or SVG)",isOptional:!0,template:"filepaths"}]},{name:"query",description:"Processes an input file to extract provided metadata",icon:"\u{1F50D}",options:[{name:"--root",description:"Configures the project root (for absolute paths)",args:{name:"root",template:"folders"}},{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--diagnostic-format",description:"The format to emit diagnostics in",args:{name:"diagnostic_format",suggestions:["human","short"],default:"human"}},{name:"--field",description:"Extracts just one field from all retrieved elements",args:{name:"field"}},{name:"--format",description:"The format to serialize in",args:{name:"format",suggestions:["json","yaml"],default:"json"}},{name:"--one",description:"Expects and retrieves exactly one element"},{name:["-h","--help"],description:"Print help"}],args:[{name:"input",description:"Path to input Typst file",generators:(0,L.filepaths)({extensions:["typ"]})},{name:"selector",description:"Defines which elements to retrieve"}]},{name:"fonts",description:"Lists all discovered fonts in system and custom font paths",icon:"\u{1F524}",options:[{name:"--font-path",description:"Adds additional directories to search for fonts",isRepeatable:!0,args:{name:"font_paths",template:"filepaths"}},{name:"--variants",description:"Also lists style variants of each font family"},{name:["-h","--help"],description:"Print help"}]},{name:"update",description:"Self update the Typst CLI (disabled)",icon:"\u{1F199}",options:[{name:"--force",description:"Forces a downgrade to an older version (required for downgrading)",exclusiveOn:["--revert"]},{name:"--revert",description:"Reverts to the version from before the last update (only possible if `typst update` has previously ran)",exclusiveOn:["--force"]},{name:["-h","--help"],description:"Print help"}],args:{name:"version",description:"Which version to update to (defaults to latest)",isOptional:!0}},{name:"help",description:"Print this message or the help of the given subcommand(s)",icon:"\u2139\uFE0F",subcommands:[{name:"compile",description:"Compiles an input file into a supported output format",icon:"\u{1F4C4}"},{name:"watch",description:"Watches an input file and recompiles on changes",icon:"\u{1F504}"},{name:"query",description:"Processes an input file to extract provided metadata",icon:"\u{1F50D}"},{name:"fonts",description:"Lists all discovered fonts in system and custom font paths",icon:"\u{1F524}"},{name:"update",description:"Self update the Typst CLI (disabled)",icon:"\u{1F199}"},{name:"help",description:"Print this message or the help of the given subcommand(s)",icon:"\u2139\uFE0F"}]}],options:[{name:"--cert",description:"Path to a custom CA certificate to use when making network requests",args:{name:"cert",template:"filepaths"}},{name:["-v","--verbosity"],description:"Sets the level of logging verbosity: -v = warning & error, -vv = info, -vvv = debug, -vvvv = trace",isRepeatable:4},{name:["-h","--help"],description:"Print help"},{name:["-V","--version"],description:"Print version"}]},Ve=we;export{Ve as default};
|