@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/osqueryi.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Y=Object.create;var W=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),N=[];for(let L of Z)if(L){let P=L.endsWith("/")?"folders":"filepaths";(P==="filepaths"&&d!=="only"||P==="folders"&&d!=="never")&&N.push({type:P==="filepaths"?"file":"folder",name:L,insertValue:L,isDangerous:b,context:{templateType:P}})}return S(g(N))}catch{return[]}})}}h.folders=Object.assign(()=>I({showFolders:"only"}),Object.freeze(I({showFolders:"only"})));h.filepaths=Object.assign(I,Object.freeze(I()))});var J=A(x=>{"use strict";var q=x&&x.__awaiter||function(e,n,t,s){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function c(r){try{l(s.next(r))}catch(u){o(u)}}function d(r){try{l(s.throw(r))}catch(u){o(u)}}function l(r){r.done?a(r.value):i(r.value).then(c,d)}l((s=s.apply(e,n||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.keyValueList=x.keyValue=x.valueList=void 0;var U=new Map;function M(e,n){return e.length===0?n:n.map(t=>t.insertValue?t:Object.assign(Object.assign({},t),{insertValue:t.name+e}))}function K(e,n,t){return q(this,void 0,void 0,function*(){if(typeof e=="function"){let s=yield e(...t);return M(n,s)}if(typeof e[0]=="string"){let s=e.map(i=>({name:i}));return M(n,s)}return M(n,e)})}function z(e,n,t,s){return q(this,void 0,void 0,function*(){if(t||Array.isArray(e)){let i=U.get(e);return i===void 0&&(i=yield K(e,n,s),U.set(e,i)),i}return K(e,n,s)})}function B(e,n){return typeof n=="string"?e&&n==="keys"||!e&&n==="values":n}function D(e,...n){return Math.max(...n.map(t=>e.lastIndexOf(t)))}function j(e,n){let t=new Set(e);return n.filter(s=>{var i;return typeof s.name=="string"?!t.has(s.name):!(!((i=s.name)===null||i===void 0)&&i.some(a=>t.has(a)))})}function me({delimiter:e=",",values:n=[],cache:t=!1,insertDelimiter:s=!1,allowRepeatedValues:i=!1}){return{trigger:(a,o)=>a.lastIndexOf(e)!==o.lastIndexOf(e),getQueryTerm:a=>a.slice(a.lastIndexOf(e)+e.length),custom:(...a)=>q(this,void 0,void 0,function*(){var o;let c=yield z(n,s?e:"",t,a);if(i)return c;let[d]=a,l=(o=d[d.length-1])===null||o===void 0?void 0:o.split(e);return j(l,c)})}}x.valueList=me;function pe({separator:e="=",keys:n=[],values:t=[],cache:s=!1,insertSeparator:i=!0}){return{trigger:(a,o)=>a.indexOf(e)!==o.indexOf(e),getQueryTerm:a=>a.slice(a.indexOf(e)+1),custom:(...a)=>q(this,void 0,void 0,function*(){let[o]=a,d=!o[o.length-1].includes(e),l=d?n:t,r=B(d,s);return z(l,d&&i?e:"",r,a)})}}x.keyValue=pe;function _e({separator:e="=",delimiter:n=",",keys:t=[],values:s=[],cache:i=!1,insertSeparator:a=!0,insertDelimiter:o=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:d=!0}){return{trigger:(l,r)=>{let u=D(l,e,n),g=D(r,e,n);return u!==g},getQueryTerm:l=>{let r=D(l,e,n);return l.slice(r+1)},custom:(...l)=>q(this,void 0,void 0,function*(){let[r]=l,u=r[r.length-1],g=D(u,e,n),S=g===-1||u.slice(g,g+e.length)!==e,p=S?t:s,f=B(S,i),m=yield z(p,S?a?e:"":o?n:"",f,l);if(S){if(c)return m;let w=u.split(n).map(_=>_.slice(0,_.indexOf(e)));return j(w,m)}if(d)return m;let b=u.split(n).map(w=>w.slice(w.indexOf(e)+e.length));return j(b,m)})}}x.keyValueList=_e});var X=A(O=>{"use strict";var fe=O&&O.__awaiter||function(e,n,t,s){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function c(r){try{l(s.next(r))}catch(u){o(u)}}function d(r){try{l(s.throw(r))}catch(u){o(u)}}function l(r){r.done?a(r.value):i(r.value).then(c,d)}l((s=s.apply(e,n||[])).next())})};Object.defineProperty(O,"__esModule",{value:!0});O.ai=void 0;var ge=4097,he=4,ve=.8,be=ge*he*ve;function ye({name:e,prompt:n,message:t,postProcess:s,temperature:i,splitOn:a}){return{scriptTimeout:15e3,custom:(o,c,d)=>fe(this,void 0,void 0,function*(){var l,r;let u=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(u.stdout))return[];let g=typeof n=="function"?yield n({tokens:o,executeCommand:c,generatorContext:d}):n,S=typeof t=="function"?yield t({tokens:o,executeCommand:c,generatorContext:d}):t;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=be-((l=g?.length)!==null&&l!==void 0?l:0),f={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:S.slice(0,p)}],temperature:i},y=JSON.stringify(f),m=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",y]}),b=JSON.parse(m.stdout);return(r=b?.choices.map(_=>{var k;return(k=_?.message)===null||k===void 0?void 0:k.content}).filter(_=>typeof _=="string").flatMap(_=>a?_.split(a).filter(k=>k.trim().length>0):[_]).map(_=>{if(s)return s(_);let k=_.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:k,insertValue:`'${k}'`,description:"Generated by Fig AI"}}))!==null&&r!==void 0?r:[]})}}O.ai=ye});var Q=A(v=>{"use strict";var we=v&&v.__createBinding||(Object.create?function(e,n,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(n,t);(!i||("get"in i?!n.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,s,i)}:function(e,n,t,s){s===void 0&&(s=t),e[s]=n[t]}),Se=v&&v.__exportStar||function(e,n){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&we(n,e,t)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var $=V();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return $.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return $.folders}});Se(J(),v);var ke=X();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return ke.ai}})});var C=ae(Q(),1),G=["account_policy_data","acpi_tables","ad_config","alf","alf_exceptions","alf_explicit_auths","app_schemes","apps","arp_cache","asl","atom_packages","augeas","authorization_mechanisms","authorizations","authorized_keys","azure_instance_metadata","azure_instance_tags","battery","block_devices","browser_plugins","carbon_black_info","carves","certificates","chrome_extension_content_scripts","chrome_extensions","cpu_time","crashes","crontab","cups_destinations","cups_jobs","curl","curl_certificate","device_file","device_firmware","device_hash","device_partitions","disk_encryption","disk_events","dns_resolvers","docker_container_envs","docker_container_fs_changes","docker_container_labels","docker_container_mounts","docker_container_networks","docker_container_ports","docker_container_processes","docker_container_stats","docker_containers","docker_image_history","docker_image_labels","docker_image_layers","docker_images","docker_info","docker_network_labels","docker_networks","docker_version","docker_volume_labels","docker_volumes","ec2_instance_metadata","ec2_instance_tags","es_process_events","es_process_file_events","etc_hosts","etc_protocols","etc_services","event_taps","extended_attributes","fan_speed_sensors","file","file_events","firefox_addons","gatekeeper","gatekeeper_approved_apps","groups","hardware_events","hash","homebrew_packages","ibridge_info","interface_addresses","interface_details","interface_ipv6","iokit_devicetree","iokit_registry","kernel_extensions","kernel_info","kernel_panics","keychain_acls","keychain_items","known_hosts","last","launchd","launchd_overrides","listening_ports","load_average","location_services","logged_in_users","magic","managed_policies","mdfind","mdls","memory_array_mapped_addresses","memory_arrays","memory_device_mapped_addresses","memory_devices","memory_error_info","mounts","nfs_shares","npm_packages","nvram","oem_strings","os_version","osquery_events","osquery_extensions","osquery_flags","osquery_info","osquery_packs","osquery_registry","osquery_schedule","package_bom","package_install_history","package_receipts","password_policy","pci_devices","platform_info","plist","power_sensors","preferences","process_envs","process_events","process_memory_map","process_open_files","process_open_sockets","processes","prometheus_metrics","python_packages","quicklook_cache","routes","running_apps","safari_extensions","sandboxes","screenlock","shared_folders","sharing_preferences","shell_history","signature","sip_config","smbios_tables","smc_keys","socket_events","ssh_configs","startup_items","sudoers","suid_bin","system_controls","system_extensions","system_info","temperature_sensors","time","time_machine_backups","time_machine_destinations","ulimit_info","uptime","usb_devices","user_events","user_groups","user_interaction_events","user_ssh_keys","users","virtual_memory_info","wifi_networks","wifi_status","wifi_survey","xprotect_entries","xprotect_meta","xprotect_reports","yara","yara_events","ycloud_instance_metadata"],xe={name:"osqueryi",description:"Your OS as a high-performance relational database",options:[{name:"--flagfile",args:{name:"path",template:"filepaths"},description:"Line-delimited file of additional flags"},{name:"--D",description:"Run as a daemon process"},{name:"--S",description:"Run as a shell process"},{name:"--alarm_timeout",args:{name:"value"},description:"Seconds to allow for shutdown. Minimum is 10"},{name:"--carver_block_size",args:{name:"value"},description:"Size of blocks used for POSTing data back to remote endpoints"},{name:"--carver_compression",description:"Compress archives using zstd prior to upload (default false)"},{name:"--carver_continue_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint that receives carved content after session creation"},{name:"--carver_disable_function",description:"Disable the osquery file carver function (default true)"},{name:"--carver_expiry",args:{name:"value"},description:"Seconds to store successful carve result metadata (in carves table)"},{name:"--carver_start_endpoint",args:{name:"value"},description:"TLS/HTTPS init endpoint for forensic carver"},{name:"--config_accelerated_refresh",args:{name:"value"},description:"Interval to wait if reading a configuration fails"},{name:"--config_check",description:"Check the format of an osquery config and exit"},{name:"--config_dump",description:"Dump the contents of the configuration, then exit"},{name:"--config_enable_backup",description:"Backup config and use it when refresh fails"},{name:"--config_path",args:{name:"value",template:"filepaths"},description:"Path to JSON config file"},{name:"--config_plugin",args:{name:"value"},description:"Config plugin name"},{name:"--config_refresh",args:{name:"value"},description:"Optional interval in seconds to re-read configuration"},{name:"--config_tls_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for config retrieval"},{name:"--config_tls_max_attempts",args:{name:"value"},description:"Number of attempts to retry a TLS config request"},{name:"--daemonize",description:"Attempt to daemonize (POSIX only)"},{name:"--database_dump",description:"Dump the contents of the backing store"},{name:"--database_path",args:{name:"value",template:"filepaths"},description:"If using a disk-based backing store, specify a path"},{name:"--disable_carver",description:"Disable the osquery file carver (default true)"},{name:"--disable_enrollment",description:"Disable enrollment functions on related config/logger plugins"},{name:"--disable_extensions",description:"Disable extension API"},{name:"--disable_reenrollment",description:"Disable re-enrollment attempts if related plugins return invalid"},{name:"--disable_tables",args:{name:"value",generators:(0,C.valueList)({values:G})},description:"Comma-delimited list of table names to be disabled"},{name:"--disable_watchdog",description:"Disable userland watchdog process"},{name:"--enable_extensions_watchdog",description:"Enable userland watchdog for extensions processes"},{name:"--enable_tables",args:{name:"value",generators:(0,C.valueList)({values:G})},description:"Comma-delimited list of table names to be enabled"},{name:"--enroll_always",description:"On startup, send a new enrollment request"},{name:"--enroll_secret_env",args:{name:"value"},description:"Name of environment variable holding enrollment-auth secret"},{name:"--enroll_secret_path",args:{name:"value",template:"filepaths"},description:"Path to an optional client enrollment-auth secret"},{name:"--enroll_tls_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for client enrollment"},{name:"--extensions_autoload",args:{name:"value",template:"filepaths"},description:"Optional path to a list of autoloaded & managed extensions"},{name:"--extensions_interval",args:{name:"value"},description:"Seconds delay between connectivity checks"},{name:"--extensions_require",args:{name:"value"},description:"Comma-separated list of required extensions"},{name:"--extensions_socket",args:{name:"value",template:"filepaths"},description:"Path to the extensions UNIX domain socket"},{name:"--extensions_timeout",args:{name:"value"},description:"Seconds to wait for autoloaded extensions"},{name:"--force",description:"Force osqueryd to kill previously-running daemons"},{name:"--install",description:"Install osqueryd as a service"},{name:"--logger_mode",args:{name:"value"},description:"Octal mode for log files (default '0640')"},{name:"--logger_plugin",args:{name:"value"},description:"Logger plugin name"},{name:"--logger_stderr",description:"Write status logs to stderr"},{name:"--logtostderr",description:"Log messages to stderr in addition to the logger plugin(s)"},{name:"--pidfile",args:{name:"value",template:"filepaths"},description:"Path to the daemon pidfile mutex"},{name:"--proxy_hostname",args:{name:"value"},description:"Optional HTTP proxy hostname"},{name:"--stderrthreshold",args:{name:"value"},description:"Stderr log level threshold"},{name:"--tls_client_cert",args:{name:"value",template:"filepaths"},description:"Optional path to a TLS client-auth PEM certificate"},{name:"--tls_client_key",args:{name:"value",template:"filepaths"},description:"Optional path to a TLS client-auth PEM private key"},{name:"--tls_enroll_max_attempts",args:{name:"value"},description:"The total number of attempts that will be made to the enroll endpoint if a request fails, 0 for infinite"},{name:"--tls_enroll_max_interval",args:{name:"value"},description:"Maximum wait time in seconds between enroll retry attempts"},{name:"--tls_hostname",args:{name:"value"},description:"TLS/HTTPS hostname for Config, Logger, and Enroll plugins"},{name:"--tls_server_certs",args:{name:"value",template:"filepaths"},description:"Optional path to a TLS server PEM certificate(s) bundle"},{name:"--tls_session_reuse",description:"Reuse TLS session sockets"},{name:"--tls_session_timeout",args:{name:"value"},description:"TLS session keep alive timeout in seconds"},{name:"--uninstall",description:"Uninstall osqueryd as a service"},{name:"--watchdog_delay",args:{name:"value"},description:"Initial delay in seconds before watchdog starts"},{name:"--watchdog_forced_shutdown_delay",args:{name:"value"},description:"Seconds that the watchdog will wait to do a forced shutdown after a graceful shutdown request, when a resource limit is hit"},{name:"--watchdog_latency_limit",args:{name:"value"},description:"Override watchdog profile CPU utilization latency limit"},{name:"--watchdog_level",args:{name:"value",suggestions:[{name:"0",description:"Normal"},{name:"1",description:"Restrictive"},{name:"-1",description:"Off"}]},description:"Performance limit level"},{name:"--watchdog_memory_limit",args:{name:"value"},description:"Override watchdog profile memory limit (e.g., 300, for 300MB)"},{name:"--watchdog_utilization_limit",args:{name:"value"},description:"Override watchdog profile CPU utilization limit"},{name:"--audit_allow_config",description:"Allow the audit publisher to change auditing configuration"},{name:"--audit_allow_fim_events",description:"Allow the audit publisher to install filesystem-related rules"},{name:"--audit_allow_process_events",description:"Allow the audit publisher to install process-related rules"},{name:"--audit_allow_sockets",description:"Allow the audit publisher to install socket-related rules"},{name:"--audit_allow_user_events",description:"Allow the audit publisher to install user-related rules"},{name:"--augeas_lenses",args:{name:"value"},description:"Directory that contains augeas lenses files"},{name:"--aws_access_key_id",args:{name:"value"},description:"AWS access key ID"},{name:"--aws_debug",description:"Enable AWS SDK debug logging"},{name:"--aws_enable_proxy",description:"Enable proxying of HTTP/HTTPS requests in AWS client config"},{name:"--aws_firehose_endpoint",args:{name:"value"},description:"Custom Firehose endpoint"},{name:"--aws_firehose_period",args:{name:"value"},description:"Seconds between flushing logs to Firehose (default 10)"},{name:"--aws_firehose_stream",args:{name:"value"},description:"Name of Firehose stream for logging"},{name:"--aws_kinesis_disable_log_status",description:"Disable status logs processing"},{name:"--aws_kinesis_endpoint",args:{name:"value"},description:"Custom Kinesis endpoint"},{name:"--aws_kinesis_period",args:{name:"value"},description:"Seconds between flushing logs to Kinesis (default 10)"},{name:"--aws_kinesis_random_partition_key",description:"Enable random kinesis partition keys"},{name:"--aws_kinesis_stream",args:{name:"value"},description:"Name of Kinesis stream for logging"},{name:"--aws_profile_name",args:{name:"value"},description:"AWS profile for authentication and region configuration"},{name:"--aws_proxy_host",args:{name:"value"},description:"Proxy host for use in AWS client config"},{name:"--aws_proxy_password",args:{name:"value"},description:"Proxy password for use in AWS client config"},{name:"--aws_proxy_port",args:{name:"value"},description:"Proxy port for use in AWS client config"},{name:"--aws_proxy_scheme",args:{name:"value"},description:"Proxy HTTP scheme for use in AWS client config (http or https, default https)"},{name:"--aws_proxy_username",args:{name:"value"},description:"Proxy username for use in AWS client config"},{name:"--aws_region",args:{name:"value"},description:"AWS region"},{name:"--aws_secret_access_key",args:{name:"value"},description:"AWS secret access key"},{name:"--aws_session_token",args:{name:"value"},description:"AWS STS session token"},{name:"--aws_sts_arn_role",args:{name:"value"},description:"AWS STS ARN role"},{name:"--aws_sts_region",args:{name:"value"},description:"AWS STS region"},{name:"--aws_sts_session_name",args:{name:"value"},description:"AWS STS session name"},{name:"--aws_sts_timeout",args:{name:"value"},description:"AWS STS assume role credential validity in seconds (default 3600)"},{name:"--buffered_log_max",args:{name:"value"},description:"Maximum number of logs in buffered output plugins (0 = unlimited)"},{name:"--decorations_top_level",description:"Add decorators as top level JSON objects"},{name:"--disable_audit",description:"Disable receiving events from the audit subsystem"},{name:"--disable_caching",description:"Disable scheduled query caching"},{name:"--disable_database",description:"Disable the persistent RocksDB storage"},{name:"--disable_decorators",description:"Disable log result decoration"},{name:"--disable_distributed",description:"Disable distributed queries (default true)"},{name:"--disable_endpointsecurity",description:"Disable receiving events from the EndpointSecurity subsystem"},{name:"--disable_endpointsecurity_fim",description:"Disable file events from the EndpointSecurity subsystem"},{name:"--disable_events",description:"Disable osquery publish/subscribe system"},{name:"--disable_hash_cache",description:"Cache calculated file hashes, re-calculate only if inode times change"},{name:"--disable_logging",description:"Disable ERROR/INFO logging"},{name:"--distributed_interval",args:{name:"value"},description:"Seconds between polling for new queries (default 60)"},{name:"--distributed_loginfo",description:"Log the running distributed queries name at INFO level"},{name:"--distributed_plugin",args:{name:"value"},description:"Distributed plugin name"},{name:"--distributed_tls_max_attempts",args:{name:"value"},description:"Number of times to attempt a request"},{name:"--distributed_tls_read_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for distributed query retrieval"},{name:"--distributed_tls_write_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for distributed query results"},{name:"--docker_socket",args:{name:"value",template:"filepaths"},description:"Docker UNIX domain socket path"},{name:"--enable_file_events",description:"Enables the file_events publisher"},{name:"--enable_foreign",description:"Enable no-op foreign virtual tables"},{name:"--enable_keyboard_events",description:"Enable listening for keyboard events"},{name:"--enable_mouse_events",description:"Enable listening for mouse events"},{name:"--enable_numeric_monitoring",description:"Enable numeric monitoring system"},{name:"--ephemeral",description:"Skip pidfile and database state checks"},{name:"--es_fim_mute_path_literal",args:{name:"value"},description:"Comma delimited list of path literals to be muted for FIM"},{name:"--es_fim_mute_path_prefix",args:{name:"value"},description:"Comma delimited list of path prefxes to be muted for FIM"},{name:"--events_expiry",args:{name:"value"},description:"Timeout to expire event subscriber results"},{name:"--events_max",args:{name:"value"},description:"Maximum number of event batches per type to buffer"},{name:"--events_optimize",description:"Optimize subscriber select queries (scheduler only)"},{name:"--extensions_default_index",description:"Enable INDEX on all extension table columns (default true)"},{name:"--hash_cache_max",args:{name:"value"},description:"Size of LRU file hash cache"},{name:"--host_identifier",args:{name:"value"},description:"Field used to identify the host running osquery (hostname, uuid, instance, ephemeral, specified)"},{name:"--logger_event_type",description:"Log scheduled results as events"},{name:"--logger_kafka_acks",args:{name:"value",suggestions:["0","1","all"]},description:"The number of acknowledgments the leader has to receive (0, 1, 'all')"},{name:"--logger_kafka_brokers",args:{name:"value"},description:"Bootstrap broker(s) as a comma-separated list of host or host:port (default port 9092)"},{name:"--logger_kafka_compression",args:{name:"value",suggestions:["none","gzip"]},description:"Compression codec to use for compressing message sets ('none' or 'gzip')"},{name:"--logger_kafka_topic",args:{name:"value"},description:"Kafka topic to publish logs under"},{name:"--logger_min_status",args:{name:"value"},description:"Minimum level for status log recording"},{name:"--logger_min_stderr",args:{name:"value"},description:"Minimum level for statuses written to stderr"},{name:"--logger_numerics",description:"Use numeric JSON syntax for numeric values"},{name:"--logger_path",args:{name:"value",template:"filepaths"},description:"Directory path for ERROR/WARN/INFO and results logging"},{name:"--logger_rotate",description:"Use filesystem log rotation"},{name:"--logger_rotate_max_files",args:{name:"value"},description:"Max number of files to keep in rotation"},{name:"--logger_rotate_size",args:{name:"value"},description:"Size for each filesystem log in bytes"},{name:"--logger_snapshot_event_type",description:"Log scheduled snapshot results as events"},{name:"--logger_syslog_facility",args:{name:"value"},description:"Syslog facility for status and results logs (0-23, default 19)"},{name:"--logger_syslog_prepend_cee",description:"Prepend @cee: tag to logged JSON messages"},{name:"--logger_tls_compress",description:"GZip compress TLS/HTTPS request body"},{name:"--logger_tls_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for results logging"},{name:"--logger_tls_max_lines",args:{name:"value"},description:"Max number of logs to send per period"},{name:"--logger_tls_max_linesize",args:{name:"value"},description:"Max size in bytes allowed per log line"},{name:"--logger_tls_period",args:{name:"value"},description:"Seconds between flushing logs over TLS/HTTPS"},{name:"--nullvalue",args:{name:"value"},description:"Set string for NULL values, default ''"},{name:"--numeric_monitoring_filesystem_path",args:{name:"value"},description:"File to dump numeric monitoring records one per line. The format of the line is <PATH><TAB><VALUE><TAB><TIMESTAMP>"},{name:"--numeric_monitoring_plugins",args:{name:"value"},description:"Comma separated numeric monitoring plugins names"},{name:"--numeric_monitoring_pre_aggregation_time",args:{name:"value"},description:"Time period in seconds for numeric monitoring pre-aggregation buffer"},{name:"--pack_delimiter",args:{name:"value"},description:"Delimiter for pack and query names"},{name:"--pack_refresh_interval",args:{name:"value"},description:"Cache expiration for a packs discovery queries"},{name:"--read_max",args:{name:"value"},description:"Maximum file read size"},{name:"--schedule_default_interval",args:{name:"value"},description:"Query interval to use if none is provided"},{name:"--schedule_epoch",args:{name:"value"},description:"Epoch for scheduled queries"},{name:"--schedule_lognames",description:"Log the running scheduled query name at INFO level"},{name:"--schedule_max_drift",args:{name:"value"},description:"Max time drift in seconds"},{name:"--schedule_reload",args:{name:"value"},description:"Interval in seconds to reload database arenas"},{name:"--schedule_splay_percent",args:{name:"value"},description:"Percent to splay config times"},{name:"--schedule_timeout",args:{name:"value"},description:"Limit the schedule to a duration in seconds, 0 for no limit"},{name:"--specified_identifier",args:{name:"value"},description:"Field used to specify the host_identifier when set to 'specified'"},{name:"--table_delay",args:{name:"value"},description:"Add an optional microsecond delay between table scans"},{name:"--table_exceptions",description:"Allow tables to throw exceptions"},{name:"--thrift_string_size_limit",args:{name:"value"},description:"Sets the maximum string size allowed in a thrift message, use 0 for unlimited"},{name:"--thrift_timeout",args:{name:"value"},description:"Timeout for thrift socket operations"},{name:"--thrift_verbose",description:"Enable the thrift log handler"},{name:"--tls_disable_status_log",description:"Disable sending status logs"},{name:"--verbose",description:"Enable verbose informational messages"},{name:"--worker_threads",args:{name:"value"},description:"Number of work dispatch threads"},{name:"--yara_delay",args:{name:"value"},description:"Time in ms to sleep after scan of each file (default 50) to reduce memory spikes"},{name:"--A",args:{name:"value"},description:"Select all from a table"},{name:"--L",description:"List all table names"},{name:"--connect",args:{name:"value"},description:"Connect to an extension socket"},{name:"--csv",description:"Set output mode to 'csv'"},{name:"--extension",args:{name:"value",template:["filepaths","folders"]},description:"Path to a single extension to autoload"},{name:"--header",description:"Toggle column headers true/false"},{name:"--json",description:"Set output mode to 'json'"},{name:"--json_pretty",description:"Set output mode to 'json_pretty'"},{name:"--line",description:"Set output mode to 'line'"},{name:"--list",description:"Set output mode to 'list'"},{name:"--pack",args:{name:"value"},description:"Run all queries in a pack"},{name:"--planner",description:"Enable osquery runtime planner output"},{name:"--profile",args:{name:"value"},description:"Enable profile mode when non-0, set number of iterations"},{name:"--separator",args:{name:"value"},description:"Set output field separator, default '|'"}]},Ie=xe;export{Ie as default};
|
|
1
|
+
var Y=Object.create;var W=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var O=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var ie=(e,n,t,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ne(n))!se.call(e,i)&&i!==t&&W(e,i,{get:()=>n[i],enumerable:!(s=ee(n,i))||s.enumerable});return e};var ae=(e,n,t)=>(t=e!=null?Y(te(e)):{},ie(n||!e||!e.__esModule?W(t,"default",{value:e,enumerable:!0}):t,e));var R=O(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 oe=(e,n)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",n):e,le=(e,n)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var a;let o=i.slice(1);return(a=n[o])!==null&&a!==void 0?a:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,a,o)=>{var c,d;return(d=(c=n[a])!==null&&c!==void 0?c:o)!==null&&d!==void 0?d:i}),ce=(e,n)=>{var t;let{environmentVariables:s}=n;return le(oe(e,(t=s?.HOME)!==null&&t!==void 0?t:"~"),s)};T.shellExpand=ce});var V=O(b=>{"use strict";var de=b&&b.__awaiter||function(e,n,t,s){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function c(r){try{l(s.next(r))}catch(u){o(u)}}function d(r){try{l(s.throw(r))}catch(u){o(u)}}function l(r){r.done?a(r.value):i(r.value).then(c,d)}l((s=s.apply(e,n||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=H;var E=R();function H(e,n=[]){let t=n.map(i=>i.toLowerCase()),s=e.filter(i=>!t.includes(i.toLowerCase()));return[...s.filter(i=>!i.startsWith(".")).sort((i,a)=>i.localeCompare(a)),...s.filter(i=>i.startsWith(".")).sort((i,a)=>i.localeCompare(a)),"../"]}var ue=(e,n,t)=>{if(e===null)return"/";let s=(0,E.shellExpand)(n,t),i=s.slice(0,s.lastIndexOf("/")+1);return i===""?(0,E.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,E.ensureTrailingSlash)(e)}${i}`};b.getCurrentInsertedDirectory=ue;function L(e={}){let{extensions:n=[],equals:t=[],matches:s,filterFolders:i=!1,editFileSuggestions:a,editFolderSuggestions:o,rootDirectory:c,showFolders:d="always"}=e,l=new Set(n),r=new Set(t),u=()=>n.length>0||t.length>0||s,g=(p=[])=>u()?p.filter(({name:f="",type:y})=>{if(!i&&y==="folder"||r.has(f)||s&&f.match(s))return!0;let[,...m]=f.split(".");if(m.length>=1){let v=m.length-1,w=m[v];do{if(l.has(w))return!0;v-=1,w=[m[v],w].join(".")}while(v>=0)}return!1}):p,S=(p=[])=>!a&&!o?p:p.map(f=>Object.assign(Object.assign({},f),(f.type==="file"?a:o)||{}));return{trigger:(p,f)=>{let y=p.lastIndexOf("/"),m=f.lastIndexOf("/");return y!==m?!0:y===-1&&m===-1?!1:p.slice(0,y)!==f.slice(0,m)},getQueryTerm:p=>p.slice(p.lastIndexOf("/")+1),custom:(p,f,y)=>de(this,void 0,void 0,function*(){var m;let{isDangerous:v,currentWorkingDirectory:w,searchTerm:_}=y,k=(m=(0,b.getCurrentInsertedDirectory)(c??w,_,y))!==null&&m!==void 0?m:"/";try{let N=yield f({command:"ls",args:["-1ApL"],cwd:k}),Z=H(N.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),F=[];for(let P of Z)if(P){let I=P.endsWith("/")?"folders":"filepaths";(I==="filepaths"&&d!=="only"||I==="folders"&&d!=="never")&&F.push({type:I==="filepaths"?"file":"folder",name:P,insertValue:P,isDangerous:v,context:{templateType:I}})}return S(g(F))}catch{return[]}})}}b.folders=Object.assign(()=>L({showFolders:"only"}),Object.freeze(L({showFolders:"only"})));b.filepaths=Object.assign(L,Object.freeze(L()))});var J=O(x=>{"use strict";var A=x&&x.__awaiter||function(e,n,t,s){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function c(r){try{l(s.next(r))}catch(u){o(u)}}function d(r){try{l(s.throw(r))}catch(u){o(u)}}function l(r){r.done?a(r.value):i(r.value).then(c,d)}l((s=s.apply(e,n||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=me;x.keyValue=pe;x.keyValueList=_e;var U=new Map;function M(e,n){return e.length===0?n:n.map(t=>t.insertValue?t:Object.assign(Object.assign({},t),{insertValue:t.name+e}))}function K(e,n,t){return A(this,void 0,void 0,function*(){if(typeof e=="function"){let s=yield e(...t);return M(n,s)}if(typeof e[0]=="string"){let s=e.map(i=>({name:i}));return M(n,s)}return M(n,e)})}function z(e,n,t,s){return A(this,void 0,void 0,function*(){if(t||Array.isArray(e)){let i=U.get(e);return i===void 0&&(i=yield K(e,n,s),U.set(e,i)),i}return K(e,n,s)})}function B(e,n){return typeof n=="string"?e&&n==="keys"||!e&&n==="values":n}function D(e,...n){return Math.max(...n.map(t=>e.lastIndexOf(t)))}function j(e,n){let t=new Set(e);return n.filter(s=>{var i;return typeof s.name=="string"?!t.has(s.name):!(!((i=s.name)===null||i===void 0)&&i.some(a=>t.has(a)))})}function me({delimiter:e=",",values:n=[],cache:t=!1,insertDelimiter:s=!1,allowRepeatedValues:i=!1}){return{trigger:(a,o)=>a.lastIndexOf(e)!==o.lastIndexOf(e),getQueryTerm:a=>a.slice(a.lastIndexOf(e)+e.length),custom:(...a)=>A(this,void 0,void 0,function*(){var o;let c=yield z(n,s?e:"",t,a);if(i)return c;let[d]=a,l=(o=d[d.length-1])===null||o===void 0?void 0:o.split(e);return j(l,c)})}}function pe({separator:e="=",keys:n=[],values:t=[],cache:s=!1,insertSeparator:i=!0}){return{trigger:(a,o)=>a.indexOf(e)!==o.indexOf(e),getQueryTerm:a=>a.slice(a.indexOf(e)+1),custom:(...a)=>A(this,void 0,void 0,function*(){let[o]=a,d=!o[o.length-1].includes(e),l=d?n:t,r=B(d,s);return z(l,d&&i?e:"",r,a)})}}function _e({separator:e="=",delimiter:n=",",keys:t=[],values:s=[],cache:i=!1,insertSeparator:a=!0,insertDelimiter:o=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:d=!0}){return{trigger:(l,r)=>{let u=D(l,e,n),g=D(r,e,n);return u!==g},getQueryTerm:l=>{let r=D(l,e,n);return l.slice(r+1)},custom:(...l)=>A(this,void 0,void 0,function*(){let[r]=l,u=r[r.length-1],g=D(u,e,n),S=g===-1||u.slice(g,g+e.length)!==e,p=S?t:s,f=B(S,i),m=yield z(p,S?a?e:"":o?n:"",f,l);if(S){if(c)return m;let w=u.split(n).map(_=>_.slice(0,_.indexOf(e)));return j(w,m)}if(d)return m;let v=u.split(n).map(w=>w.slice(w.indexOf(e)+e.length));return j(v,m)})}}});var X=O(q=>{"use strict";var fe=q&&q.__awaiter||function(e,n,t,s){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function c(r){try{l(s.next(r))}catch(u){o(u)}}function d(r){try{l(s.throw(r))}catch(u){o(u)}}function l(r){r.done?a(r.value):i(r.value).then(c,d)}l((s=s.apply(e,n||[])).next())})};Object.defineProperty(q,"__esModule",{value:!0});q.ai=ye;var ge=4097,he=4,ve=.8,be=ge*he*ve;function ye({name:e,prompt:n,message:t,postProcess:s,temperature:i,splitOn:a}){return{scriptTimeout:15e3,custom:(o,c,d)=>fe(this,void 0,void 0,function*(){var l,r;let u=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(u.stdout))return[];let g=typeof n=="function"?yield n({tokens:o,executeCommand:c,generatorContext:d}):n,S=typeof t=="function"?yield t({tokens:o,executeCommand:c,generatorContext:d}):t;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let p=be-((l=g?.length)!==null&&l!==void 0?l:0),f={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...g?[{role:"system",content:g}]:[],{role:"user",content:S.slice(0,p)}],temperature:i},y=JSON.stringify(f),m=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",y]}),v=JSON.parse(m.stdout);return(r=v?.choices.map(_=>{var k;return(k=_?.message)===null||k===void 0?void 0:k.content}).filter(_=>typeof _=="string").flatMap(_=>a?_.split(a).filter(k=>k.trim().length>0):[_]).map(_=>{if(s)return s(_);let k=_.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:k,insertValue:`'${k}'`,description:"Generated by Fig AI"}}))!==null&&r!==void 0?r:[]})}}});var Q=O(h=>{"use strict";var we=h&&h.__createBinding||(Object.create?function(e,n,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(n,t);(!i||("get"in i?!n.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,s,i)}:function(e,n,t,s){s===void 0&&(s=t),e[s]=n[t]}),Se=h&&h.__exportStar||function(e,n){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&we(n,e,t)};Object.defineProperty(h,"__esModule",{value:!0});h.ai=h.folders=h.filepaths=void 0;var $=V();Object.defineProperty(h,"filepaths",{enumerable:!0,get:function(){return $.filepaths}});Object.defineProperty(h,"folders",{enumerable:!0,get:function(){return $.folders}});Se(J(),h);var ke=X();Object.defineProperty(h,"ai",{enumerable:!0,get:function(){return ke.ai}})});var C=ae(Q(),1),G=["account_policy_data","acpi_tables","ad_config","alf","alf_exceptions","alf_explicit_auths","app_schemes","apps","arp_cache","asl","atom_packages","augeas","authorization_mechanisms","authorizations","authorized_keys","azure_instance_metadata","azure_instance_tags","battery","block_devices","browser_plugins","carbon_black_info","carves","certificates","chrome_extension_content_scripts","chrome_extensions","cpu_time","crashes","crontab","cups_destinations","cups_jobs","curl","curl_certificate","device_file","device_firmware","device_hash","device_partitions","disk_encryption","disk_events","dns_resolvers","docker_container_envs","docker_container_fs_changes","docker_container_labels","docker_container_mounts","docker_container_networks","docker_container_ports","docker_container_processes","docker_container_stats","docker_containers","docker_image_history","docker_image_labels","docker_image_layers","docker_images","docker_info","docker_network_labels","docker_networks","docker_version","docker_volume_labels","docker_volumes","ec2_instance_metadata","ec2_instance_tags","es_process_events","es_process_file_events","etc_hosts","etc_protocols","etc_services","event_taps","extended_attributes","fan_speed_sensors","file","file_events","firefox_addons","gatekeeper","gatekeeper_approved_apps","groups","hardware_events","hash","homebrew_packages","ibridge_info","interface_addresses","interface_details","interface_ipv6","iokit_devicetree","iokit_registry","kernel_extensions","kernel_info","kernel_panics","keychain_acls","keychain_items","known_hosts","last","launchd","launchd_overrides","listening_ports","load_average","location_services","logged_in_users","magic","managed_policies","mdfind","mdls","memory_array_mapped_addresses","memory_arrays","memory_device_mapped_addresses","memory_devices","memory_error_info","mounts","nfs_shares","npm_packages","nvram","oem_strings","os_version","osquery_events","osquery_extensions","osquery_flags","osquery_info","osquery_packs","osquery_registry","osquery_schedule","package_bom","package_install_history","package_receipts","password_policy","pci_devices","platform_info","plist","power_sensors","preferences","process_envs","process_events","process_memory_map","process_open_files","process_open_sockets","processes","prometheus_metrics","python_packages","quicklook_cache","routes","running_apps","safari_extensions","sandboxes","screenlock","shared_folders","sharing_preferences","shell_history","signature","sip_config","smbios_tables","smc_keys","socket_events","ssh_configs","startup_items","sudoers","suid_bin","system_controls","system_extensions","system_info","temperature_sensors","time","time_machine_backups","time_machine_destinations","ulimit_info","uptime","usb_devices","user_events","user_groups","user_interaction_events","user_ssh_keys","users","virtual_memory_info","wifi_networks","wifi_status","wifi_survey","xprotect_entries","xprotect_meta","xprotect_reports","yara","yara_events","ycloud_instance_metadata"],xe={name:"osqueryi",description:"Your OS as a high-performance relational database",options:[{name:"--flagfile",args:{name:"path",template:"filepaths"},description:"Line-delimited file of additional flags"},{name:"--D",description:"Run as a daemon process"},{name:"--S",description:"Run as a shell process"},{name:"--alarm_timeout",args:{name:"value"},description:"Seconds to allow for shutdown. Minimum is 10"},{name:"--carver_block_size",args:{name:"value"},description:"Size of blocks used for POSTing data back to remote endpoints"},{name:"--carver_compression",description:"Compress archives using zstd prior to upload (default false)"},{name:"--carver_continue_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint that receives carved content after session creation"},{name:"--carver_disable_function",description:"Disable the osquery file carver function (default true)"},{name:"--carver_expiry",args:{name:"value"},description:"Seconds to store successful carve result metadata (in carves table)"},{name:"--carver_start_endpoint",args:{name:"value"},description:"TLS/HTTPS init endpoint for forensic carver"},{name:"--config_accelerated_refresh",args:{name:"value"},description:"Interval to wait if reading a configuration fails"},{name:"--config_check",description:"Check the format of an osquery config and exit"},{name:"--config_dump",description:"Dump the contents of the configuration, then exit"},{name:"--config_enable_backup",description:"Backup config and use it when refresh fails"},{name:"--config_path",args:{name:"value",template:"filepaths"},description:"Path to JSON config file"},{name:"--config_plugin",args:{name:"value"},description:"Config plugin name"},{name:"--config_refresh",args:{name:"value"},description:"Optional interval in seconds to re-read configuration"},{name:"--config_tls_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for config retrieval"},{name:"--config_tls_max_attempts",args:{name:"value"},description:"Number of attempts to retry a TLS config request"},{name:"--daemonize",description:"Attempt to daemonize (POSIX only)"},{name:"--database_dump",description:"Dump the contents of the backing store"},{name:"--database_path",args:{name:"value",template:"filepaths"},description:"If using a disk-based backing store, specify a path"},{name:"--disable_carver",description:"Disable the osquery file carver (default true)"},{name:"--disable_enrollment",description:"Disable enrollment functions on related config/logger plugins"},{name:"--disable_extensions",description:"Disable extension API"},{name:"--disable_reenrollment",description:"Disable re-enrollment attempts if related plugins return invalid"},{name:"--disable_tables",args:{name:"value",generators:(0,C.valueList)({values:G})},description:"Comma-delimited list of table names to be disabled"},{name:"--disable_watchdog",description:"Disable userland watchdog process"},{name:"--enable_extensions_watchdog",description:"Enable userland watchdog for extensions processes"},{name:"--enable_tables",args:{name:"value",generators:(0,C.valueList)({values:G})},description:"Comma-delimited list of table names to be enabled"},{name:"--enroll_always",description:"On startup, send a new enrollment request"},{name:"--enroll_secret_env",args:{name:"value"},description:"Name of environment variable holding enrollment-auth secret"},{name:"--enroll_secret_path",args:{name:"value",template:"filepaths"},description:"Path to an optional client enrollment-auth secret"},{name:"--enroll_tls_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for client enrollment"},{name:"--extensions_autoload",args:{name:"value",template:"filepaths"},description:"Optional path to a list of autoloaded & managed extensions"},{name:"--extensions_interval",args:{name:"value"},description:"Seconds delay between connectivity checks"},{name:"--extensions_require",args:{name:"value"},description:"Comma-separated list of required extensions"},{name:"--extensions_socket",args:{name:"value",template:"filepaths"},description:"Path to the extensions UNIX domain socket"},{name:"--extensions_timeout",args:{name:"value"},description:"Seconds to wait for autoloaded extensions"},{name:"--force",description:"Force osqueryd to kill previously-running daemons"},{name:"--install",description:"Install osqueryd as a service"},{name:"--logger_mode",args:{name:"value"},description:"Octal mode for log files (default '0640')"},{name:"--logger_plugin",args:{name:"value"},description:"Logger plugin name"},{name:"--logger_stderr",description:"Write status logs to stderr"},{name:"--logtostderr",description:"Log messages to stderr in addition to the logger plugin(s)"},{name:"--pidfile",args:{name:"value",template:"filepaths"},description:"Path to the daemon pidfile mutex"},{name:"--proxy_hostname",args:{name:"value"},description:"Optional HTTP proxy hostname"},{name:"--stderrthreshold",args:{name:"value"},description:"Stderr log level threshold"},{name:"--tls_client_cert",args:{name:"value",template:"filepaths"},description:"Optional path to a TLS client-auth PEM certificate"},{name:"--tls_client_key",args:{name:"value",template:"filepaths"},description:"Optional path to a TLS client-auth PEM private key"},{name:"--tls_enroll_max_attempts",args:{name:"value"},description:"The total number of attempts that will be made to the enroll endpoint if a request fails, 0 for infinite"},{name:"--tls_enroll_max_interval",args:{name:"value"},description:"Maximum wait time in seconds between enroll retry attempts"},{name:"--tls_hostname",args:{name:"value"},description:"TLS/HTTPS hostname for Config, Logger, and Enroll plugins"},{name:"--tls_server_certs",args:{name:"value",template:"filepaths"},description:"Optional path to a TLS server PEM certificate(s) bundle"},{name:"--tls_session_reuse",description:"Reuse TLS session sockets"},{name:"--tls_session_timeout",args:{name:"value"},description:"TLS session keep alive timeout in seconds"},{name:"--uninstall",description:"Uninstall osqueryd as a service"},{name:"--watchdog_delay",args:{name:"value"},description:"Initial delay in seconds before watchdog starts"},{name:"--watchdog_forced_shutdown_delay",args:{name:"value"},description:"Seconds that the watchdog will wait to do a forced shutdown after a graceful shutdown request, when a resource limit is hit"},{name:"--watchdog_latency_limit",args:{name:"value"},description:"Override watchdog profile CPU utilization latency limit"},{name:"--watchdog_level",args:{name:"value",suggestions:[{name:"0",description:"Normal"},{name:"1",description:"Restrictive"},{name:"-1",description:"Off"}]},description:"Performance limit level"},{name:"--watchdog_memory_limit",args:{name:"value"},description:"Override watchdog profile memory limit (e.g., 300, for 300MB)"},{name:"--watchdog_utilization_limit",args:{name:"value"},description:"Override watchdog profile CPU utilization limit"},{name:"--audit_allow_config",description:"Allow the audit publisher to change auditing configuration"},{name:"--audit_allow_fim_events",description:"Allow the audit publisher to install filesystem-related rules"},{name:"--audit_allow_process_events",description:"Allow the audit publisher to install process-related rules"},{name:"--audit_allow_sockets",description:"Allow the audit publisher to install socket-related rules"},{name:"--audit_allow_user_events",description:"Allow the audit publisher to install user-related rules"},{name:"--augeas_lenses",args:{name:"value"},description:"Directory that contains augeas lenses files"},{name:"--aws_access_key_id",args:{name:"value"},description:"AWS access key ID"},{name:"--aws_debug",description:"Enable AWS SDK debug logging"},{name:"--aws_enable_proxy",description:"Enable proxying of HTTP/HTTPS requests in AWS client config"},{name:"--aws_firehose_endpoint",args:{name:"value"},description:"Custom Firehose endpoint"},{name:"--aws_firehose_period",args:{name:"value"},description:"Seconds between flushing logs to Firehose (default 10)"},{name:"--aws_firehose_stream",args:{name:"value"},description:"Name of Firehose stream for logging"},{name:"--aws_kinesis_disable_log_status",description:"Disable status logs processing"},{name:"--aws_kinesis_endpoint",args:{name:"value"},description:"Custom Kinesis endpoint"},{name:"--aws_kinesis_period",args:{name:"value"},description:"Seconds between flushing logs to Kinesis (default 10)"},{name:"--aws_kinesis_random_partition_key",description:"Enable random kinesis partition keys"},{name:"--aws_kinesis_stream",args:{name:"value"},description:"Name of Kinesis stream for logging"},{name:"--aws_profile_name",args:{name:"value"},description:"AWS profile for authentication and region configuration"},{name:"--aws_proxy_host",args:{name:"value"},description:"Proxy host for use in AWS client config"},{name:"--aws_proxy_password",args:{name:"value"},description:"Proxy password for use in AWS client config"},{name:"--aws_proxy_port",args:{name:"value"},description:"Proxy port for use in AWS client config"},{name:"--aws_proxy_scheme",args:{name:"value"},description:"Proxy HTTP scheme for use in AWS client config (http or https, default https)"},{name:"--aws_proxy_username",args:{name:"value"},description:"Proxy username for use in AWS client config"},{name:"--aws_region",args:{name:"value"},description:"AWS region"},{name:"--aws_secret_access_key",args:{name:"value"},description:"AWS secret access key"},{name:"--aws_session_token",args:{name:"value"},description:"AWS STS session token"},{name:"--aws_sts_arn_role",args:{name:"value"},description:"AWS STS ARN role"},{name:"--aws_sts_region",args:{name:"value"},description:"AWS STS region"},{name:"--aws_sts_session_name",args:{name:"value"},description:"AWS STS session name"},{name:"--aws_sts_timeout",args:{name:"value"},description:"AWS STS assume role credential validity in seconds (default 3600)"},{name:"--buffered_log_max",args:{name:"value"},description:"Maximum number of logs in buffered output plugins (0 = unlimited)"},{name:"--decorations_top_level",description:"Add decorators as top level JSON objects"},{name:"--disable_audit",description:"Disable receiving events from the audit subsystem"},{name:"--disable_caching",description:"Disable scheduled query caching"},{name:"--disable_database",description:"Disable the persistent RocksDB storage"},{name:"--disable_decorators",description:"Disable log result decoration"},{name:"--disable_distributed",description:"Disable distributed queries (default true)"},{name:"--disable_endpointsecurity",description:"Disable receiving events from the EndpointSecurity subsystem"},{name:"--disable_endpointsecurity_fim",description:"Disable file events from the EndpointSecurity subsystem"},{name:"--disable_events",description:"Disable osquery publish/subscribe system"},{name:"--disable_hash_cache",description:"Cache calculated file hashes, re-calculate only if inode times change"},{name:"--disable_logging",description:"Disable ERROR/INFO logging"},{name:"--distributed_interval",args:{name:"value"},description:"Seconds between polling for new queries (default 60)"},{name:"--distributed_loginfo",description:"Log the running distributed queries name at INFO level"},{name:"--distributed_plugin",args:{name:"value"},description:"Distributed plugin name"},{name:"--distributed_tls_max_attempts",args:{name:"value"},description:"Number of times to attempt a request"},{name:"--distributed_tls_read_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for distributed query retrieval"},{name:"--distributed_tls_write_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for distributed query results"},{name:"--docker_socket",args:{name:"value",template:"filepaths"},description:"Docker UNIX domain socket path"},{name:"--enable_file_events",description:"Enables the file_events publisher"},{name:"--enable_foreign",description:"Enable no-op foreign virtual tables"},{name:"--enable_keyboard_events",description:"Enable listening for keyboard events"},{name:"--enable_mouse_events",description:"Enable listening for mouse events"},{name:"--enable_numeric_monitoring",description:"Enable numeric monitoring system"},{name:"--ephemeral",description:"Skip pidfile and database state checks"},{name:"--es_fim_mute_path_literal",args:{name:"value"},description:"Comma delimited list of path literals to be muted for FIM"},{name:"--es_fim_mute_path_prefix",args:{name:"value"},description:"Comma delimited list of path prefxes to be muted for FIM"},{name:"--events_expiry",args:{name:"value"},description:"Timeout to expire event subscriber results"},{name:"--events_max",args:{name:"value"},description:"Maximum number of event batches per type to buffer"},{name:"--events_optimize",description:"Optimize subscriber select queries (scheduler only)"},{name:"--extensions_default_index",description:"Enable INDEX on all extension table columns (default true)"},{name:"--hash_cache_max",args:{name:"value"},description:"Size of LRU file hash cache"},{name:"--host_identifier",args:{name:"value"},description:"Field used to identify the host running osquery (hostname, uuid, instance, ephemeral, specified)"},{name:"--logger_event_type",description:"Log scheduled results as events"},{name:"--logger_kafka_acks",args:{name:"value",suggestions:["0","1","all"]},description:"The number of acknowledgments the leader has to receive (0, 1, 'all')"},{name:"--logger_kafka_brokers",args:{name:"value"},description:"Bootstrap broker(s) as a comma-separated list of host or host:port (default port 9092)"},{name:"--logger_kafka_compression",args:{name:"value",suggestions:["none","gzip"]},description:"Compression codec to use for compressing message sets ('none' or 'gzip')"},{name:"--logger_kafka_topic",args:{name:"value"},description:"Kafka topic to publish logs under"},{name:"--logger_min_status",args:{name:"value"},description:"Minimum level for status log recording"},{name:"--logger_min_stderr",args:{name:"value"},description:"Minimum level for statuses written to stderr"},{name:"--logger_numerics",description:"Use numeric JSON syntax for numeric values"},{name:"--logger_path",args:{name:"value",template:"filepaths"},description:"Directory path for ERROR/WARN/INFO and results logging"},{name:"--logger_rotate",description:"Use filesystem log rotation"},{name:"--logger_rotate_max_files",args:{name:"value"},description:"Max number of files to keep in rotation"},{name:"--logger_rotate_size",args:{name:"value"},description:"Size for each filesystem log in bytes"},{name:"--logger_snapshot_event_type",description:"Log scheduled snapshot results as events"},{name:"--logger_syslog_facility",args:{name:"value"},description:"Syslog facility for status and results logs (0-23, default 19)"},{name:"--logger_syslog_prepend_cee",description:"Prepend @cee: tag to logged JSON messages"},{name:"--logger_tls_compress",description:"GZip compress TLS/HTTPS request body"},{name:"--logger_tls_endpoint",args:{name:"value"},description:"TLS/HTTPS endpoint for results logging"},{name:"--logger_tls_max_lines",args:{name:"value"},description:"Max number of logs to send per period"},{name:"--logger_tls_max_linesize",args:{name:"value"},description:"Max size in bytes allowed per log line"},{name:"--logger_tls_period",args:{name:"value"},description:"Seconds between flushing logs over TLS/HTTPS"},{name:"--nullvalue",args:{name:"value"},description:"Set string for NULL values, default ''"},{name:"--numeric_monitoring_filesystem_path",args:{name:"value"},description:"File to dump numeric monitoring records one per line. The format of the line is <PATH><TAB><VALUE><TAB><TIMESTAMP>"},{name:"--numeric_monitoring_plugins",args:{name:"value"},description:"Comma separated numeric monitoring plugins names"},{name:"--numeric_monitoring_pre_aggregation_time",args:{name:"value"},description:"Time period in seconds for numeric monitoring pre-aggregation buffer"},{name:"--pack_delimiter",args:{name:"value"},description:"Delimiter for pack and query names"},{name:"--pack_refresh_interval",args:{name:"value"},description:"Cache expiration for a packs discovery queries"},{name:"--read_max",args:{name:"value"},description:"Maximum file read size"},{name:"--schedule_default_interval",args:{name:"value"},description:"Query interval to use if none is provided"},{name:"--schedule_epoch",args:{name:"value"},description:"Epoch for scheduled queries"},{name:"--schedule_lognames",description:"Log the running scheduled query name at INFO level"},{name:"--schedule_max_drift",args:{name:"value"},description:"Max time drift in seconds"},{name:"--schedule_reload",args:{name:"value"},description:"Interval in seconds to reload database arenas"},{name:"--schedule_splay_percent",args:{name:"value"},description:"Percent to splay config times"},{name:"--schedule_timeout",args:{name:"value"},description:"Limit the schedule to a duration in seconds, 0 for no limit"},{name:"--specified_identifier",args:{name:"value"},description:"Field used to specify the host_identifier when set to 'specified'"},{name:"--table_delay",args:{name:"value"},description:"Add an optional microsecond delay between table scans"},{name:"--table_exceptions",description:"Allow tables to throw exceptions"},{name:"--thrift_string_size_limit",args:{name:"value"},description:"Sets the maximum string size allowed in a thrift message, use 0 for unlimited"},{name:"--thrift_timeout",args:{name:"value"},description:"Timeout for thrift socket operations"},{name:"--thrift_verbose",description:"Enable the thrift log handler"},{name:"--tls_disable_status_log",description:"Disable sending status logs"},{name:"--verbose",description:"Enable verbose informational messages"},{name:"--worker_threads",args:{name:"value"},description:"Number of work dispatch threads"},{name:"--yara_delay",args:{name:"value"},description:"Time in ms to sleep after scan of each file (default 50) to reduce memory spikes"},{name:"--A",args:{name:"value"},description:"Select all from a table"},{name:"--L",description:"List all table names"},{name:"--connect",args:{name:"value"},description:"Connect to an extension socket"},{name:"--csv",description:"Set output mode to 'csv'"},{name:"--extension",args:{name:"value",template:["filepaths","folders"]},description:"Path to a single extension to autoload"},{name:"--header",description:"Toggle column headers true/false"},{name:"--json",description:"Set output mode to 'json'"},{name:"--json_pretty",description:"Set output mode to 'json_pretty'"},{name:"--line",description:"Set output mode to 'line'"},{name:"--list",description:"Set output mode to 'list'"},{name:"--pack",args:{name:"value"},description:"Run all queries in a pack"},{name:"--planner",description:"Enable osquery runtime planner output"},{name:"--profile",args:{name:"value"},description:"Enable profile mode when non-0, set number of iterations"},{name:"--separator",args:{name:"value"},description:"Set output field separator, default '|'"}]},Le=xe;export{Le as default};
|
package/build/pandoc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var ee=Object.create;var
|
|
2
|
-
`),[".DS_Store"]),N=[];for(let _ of Z)if(_){let E=_.endsWith("/")?"folders":"filepaths";(E==="filepaths"&&c!=="only"||E==="folders"&&c!=="never")&&N.push({type:E==="filepaths"?"file":"folder",name:_,insertValue:_,isDangerous:
|
|
1
|
+
var ee=Object.create;var D=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var O=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var se=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ne(t))!ae.call(e,a)&&a!==n&&D(e,a,{get:()=>t[a],enumerable:!(i=te(t,a))||i.enumerable});return e};var oe=(e,t,n)=>(n=e!=null?ee(ie(e)):{},se(t||!e||!e.__esModule?D(n,"default",{value:e,enumerable:!0}):n,e));var V=O(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.shellExpand=I.ensureTrailingSlash=void 0;var re=e=>e.endsWith("/")?e:`${e}/`;I.ensureTrailingSlash=re;var le=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,de=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,a=>{var s;let r=a.slice(1);return(s=t[r])!==null&&s!==void 0?s:a}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(a,s,r)=>{var d,c;return(c=(d=t[s])!==null&&d!==void 0?d:r)!==null&&c!==void 0?c:a}),ce=(e,t)=>{var n;let{environmentVariables:i}=t;return de(le(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};I.shellExpand=ce});var W=O(v=>{"use strict";var ue=v&&v.__awaiter||function(e,t,n,i){function a(s){return s instanceof n?s:new n(function(r){r(s)})}return new(n||(n=Promise))(function(s,r){function d(o){try{l(i.next(o))}catch(u){r(u)}}function c(o){try{l(i.throw(o))}catch(u){r(u)}}function l(o){o.done?s(o.value):a(o.value).then(d,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(v,"__esModule",{value:!0});v.filepaths=v.folders=v.getCurrentInsertedDirectory=void 0;v.sortFilesAlphabetically=q;var R=V();function q(e,t=[]){let n=t.map(a=>a.toLowerCase()),i=e.filter(a=>!n.includes(a.toLowerCase()));return[...i.filter(a=>!a.startsWith(".")).sort((a,s)=>a.localeCompare(s)),...i.filter(a=>a.startsWith(".")).sort((a,s)=>a.localeCompare(s)),"../"]}var pe=(e,t,n)=>{if(e===null)return"/";let i=(0,R.shellExpand)(t,n),a=i.slice(0,i.lastIndexOf("/")+1);return a===""?(0,R.ensureTrailingSlash)(e):a.startsWith("/")?a:`${(0,R.ensureTrailingSlash)(e)}${a}`};v.getCurrentInsertedDirectory=pe;function U(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:a=!1,editFileSuggestions:s,editFolderSuggestions:r,rootDirectory:d,showFolders:c="always"}=e,l=new Set(t),o=new Set(n),u=()=>t.length>0||n.length>0||i,g=(f=[])=>u()?f.filter(({name:m="",type:w})=>{if(!a&&w==="folder"||o.has(m)||i&&m.match(i))return!0;let[,...p]=m.split(".");if(p.length>=1){let b=p.length-1,T=p[b];do{if(l.has(T))return!0;b-=1,T=[p[b],T].join(".")}while(b>=0)}return!1}):f,x=(f=[])=>!s&&!r?f:f.map(m=>Object.assign(Object.assign({},m),(m.type==="file"?s:r)||{}));return{trigger:(f,m)=>{let w=f.lastIndexOf("/"),p=m.lastIndexOf("/");return w!==p?!0:w===-1&&p===-1?!1:f.slice(0,w)!==m.slice(0,p)},getQueryTerm:f=>f.slice(f.lastIndexOf("/")+1),custom:(f,m,w)=>ue(this,void 0,void 0,function*(){var p;let{isDangerous:b,currentWorkingDirectory:T,searchTerm:h}=w,L=(p=(0,v.getCurrentInsertedDirectory)(d??T,h,w))!==null&&p!==void 0?p:"/";try{let X=yield m({command:"ls",args:["-1ApL"],cwd:L}),Z=q(X.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),N=[];for(let _ of Z)if(_){let E=_.endsWith("/")?"folders":"filepaths";(E==="filepaths"&&c!=="only"||E==="folders"&&c!=="never")&&N.push({type:E==="filepaths"?"file":"folder",name:_,insertValue:_,isDangerous:b,context:{templateType:E}})}return x(g(N))}catch{return[]}})}}v.folders=Object.assign(()=>U({showFolders:"only"}),Object.freeze(U({showFolders:"only"})));v.filepaths=Object.assign(U,Object.freeze(U()))});var B=O(S=>{"use strict";var M=S&&S.__awaiter||function(e,t,n,i){function a(s){return s instanceof n?s:new n(function(r){r(s)})}return new(n||(n=Promise))(function(s,r){function d(o){try{l(i.next(o))}catch(u){r(u)}}function c(o){try{l(i.throw(o))}catch(u){r(u)}}function l(o){o.done?s(o.value):a(o.value).then(d,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(S,"__esModule",{value:!0});S.valueList=fe;S.keyValue=he;S.keyValueList=me;var J=new Map;function P(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function G(e,t,n){return M(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return P(t,i)}if(typeof e[0]=="string"){let i=e.map(a=>({name:a}));return P(t,i)}return P(t,e)})}function j(e,t,n,i){return M(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let a=J.get(e);return a===void 0&&(a=yield G(e,t,i),J.set(e,a)),a}return G(e,t,i)})}function K(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function A(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function C(e,t){let n=new Set(e);return t.filter(i=>{var a;return typeof i.name=="string"?!n.has(i.name):!(!((a=i.name)===null||a===void 0)&&a.some(s=>n.has(s)))})}function fe({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:a=!1}){return{trigger:(s,r)=>s.lastIndexOf(e)!==r.lastIndexOf(e),getQueryTerm:s=>s.slice(s.lastIndexOf(e)+e.length),custom:(...s)=>M(this,void 0,void 0,function*(){var r;let d=yield j(t,i?e:"",n,s);if(a)return d;let[c]=s,l=(r=c[c.length-1])===null||r===void 0?void 0:r.split(e);return C(l,d)})}}function he({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:a=!0}){return{trigger:(s,r)=>s.indexOf(e)!==r.indexOf(e),getQueryTerm:s=>s.slice(s.indexOf(e)+1),custom:(...s)=>M(this,void 0,void 0,function*(){let[r]=s,c=!r[r.length-1].includes(e),l=c?t:n,o=K(c,i);return j(l,c&&a?e:"",o,s)})}}function me({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:a=!1,insertSeparator:s=!0,insertDelimiter:r=!1,allowRepeatedKeys:d=!1,allowRepeatedValues:c=!0}){return{trigger:(l,o)=>{let u=A(l,e,t),g=A(o,e,t);return u!==g},getQueryTerm:l=>{let o=A(l,e,t);return l.slice(o+1)},custom:(...l)=>M(this,void 0,void 0,function*(){let[o]=l,u=o[o.length-1],g=A(u,e,t),x=g===-1||u.slice(g,g+e.length)!==e,f=x?n:i,m=K(x,a),p=yield j(f,x?s?e:"":r?t:"",m,l);if(x){if(d)return p;let T=u.split(t).map(h=>h.slice(0,h.indexOf(e)));return C(T,p)}if(c)return p;let b=u.split(t).map(T=>T.slice(T.indexOf(e)+e.length));return C(b,p)})}}});var $=O(F=>{"use strict";var ge=F&&F.__awaiter||function(e,t,n,i){function a(s){return s instanceof n?s:new n(function(r){r(s)})}return new(n||(n=Promise))(function(s,r){function d(o){try{l(i.next(o))}catch(u){r(u)}}function c(o){try{l(i.throw(o))}catch(u){r(u)}}function l(o){o.done?s(o.value):a(o.value).then(d,c)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0});F.ai=Te;var ye=4097,be=4,ve=.8,we=ye*be*ve;function Te({name:e,prompt:t,message:n,postProcess:i,temperature:a,splitOn:s}){return{scriptTimeout:15e3,custom:(r,d,c)=>ge(this,void 0,void 0,function*(){var l,o;let u=yield d({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(u.stdout))return[];let g=typeof t=="function"?yield t({tokens:r,executeCommand:d,generatorContext:c}):t,x=typeof n=="function"?yield n({tokens:r,executeCommand:d,generatorContext:c}):n;if(x===null||x.length===0)return console.warn("No message provided to AI generator"),[];let f=we-((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,f)}],temperature:a},w=JSON.stringify(m),p=yield d({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",w]}),b=JSON.parse(p.stdout);return(o=b?.choices.map(h=>{var L;return(L=h?.message)===null||L===void 0?void 0:L.content}).filter(h=>typeof h=="string").flatMap(h=>s?h.split(s).filter(L=>L.trim().length>0):[h]).map(h=>{if(i)return i(h);let L=h.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:L,insertValue:`'${L}'`,description:"Generated by Fig AI"}}))!==null&&o!==void 0?o:[]})}}});var Y=O(y=>{"use strict";var xe=y&&y.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,a)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),Le=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&xe(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var z=W();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return z.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return z.folders}});Le(B(),y);var Se=$();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Se.ai}})});var H=oe(Y(),1),k={inputFormats:[{script:["pandoc","--list-input-formats"],postProcess:function(e){return e.split(`
|
|
3
3
|
`).map(t=>({name:t,icon:`fig://icon?type=${t}`}))}}],outputFormats:[{script:["pandoc","--list-output-formats"],postProcess:function(e){return e.split(`
|
|
4
4
|
`).map(t=>({name:t,icon:`fig://icon?type=${t}`}))}}],formats:[{script:["pandoc","--list-input-formats"],postProcess:function(e){return Array.from(new Set(e.split(`
|
|
5
5
|
`))).map(n=>({name:n,icon:`fig://icon?type=${n}`}))}},{script:["pandoc","--list-output-formats"],postProcess:function(e){return Array.from(new Set(e.split(`
|
|
6
|
-
`))).map(n=>({name:n,icon:`fig://icon?type=${n}`}))}}],yamlFiles:[(0,H.filepaths)({extensions:["yaml"]})],yamlJSONFiles:[(0,H.filepaths)({extensions:["yaml","json"]})]},Q={name:"STYLE|FILE",template:"filepaths",default:"pygments",suggestions:["pygments","kate","monochrome","breezeDark","espresso","zenburn","haddock","tango"]},Ie={name:"pandoc",description:"A universal document converter",options:[{name:["-f","-r","--from","--read"],description:"Specify input format",args:{name:"format",generators:O.inputFormats}},{name:["-t","-w","--to","--write"],description:"Specify output format",args:{name:"format",generators:O.outputFormats}},{name:["-o","--output"],description:"Write output to FILE instead of stdout",args:{name:"file",template:"filepaths"}},{name:"--data-dir",description:"Specify the user data directory to search for pandoc data files",args:{name:"directory",template:"folders"}},{name:["-d","--defaults"],description:"Specify a set of default option settings",args:{name:"file",generators:O.yamlFiles}},{name:"--bash-completion",description:"Generate a bash completion script"},{name:"--verbose",description:"Give verbose debugging output"},{name:"--quiet",description:"Suppress warning messages"},{name:"--fail-if-warnings",description:"Exit with error status if there are any warnings"},{name:"--log",description:"Write log messages in machine-readable JSON format to FILE",args:{name:"file",template:"filepaths"}},{name:"--list-input-formats",description:"List supported input formats, one per line"},{name:"--list-output-formats",description:"List supported output formats, one per line"},{name:"--list-extensions",description:"List supported extensions for FORMAT, one per line, preceded by a + or - indicating whether it is enabled by default in FORMAT",args:{name:"format",generators:O.formats,isOptional:!0}},{name:"--list-highlight-languages",description:"List supported languages for syntax highlighting, one per line"},{name:"--list-highlight-styles",description:"List supported styles for syntax highlighting, one per line"},{name:["-v","--version"],description:"Print version"},{name:["-h","--help"],description:"Show usage message"},{name:"--shift-heading-level-by",description:"Shift heading levels by a positive or negative integer",args:{name:"number"}},{name:"--indented-code-classes",description:"Specify classes to use for indented code blocks\u2013for example, perl,numberLines or haskell. Multiple classes may be separated by spaces or commas",args:{name:"classes"}},{name:"--default-image-extension",description:"Specify a default extension to use when image paths/URLs have no extension. This allows you to use the same source for formats that require different kinds of images. Currently this option only affects the Markdown and LaTeX readers",args:{name:"extension"}},{name:"--file-scope",description:"Parse each file individually before combining for multifile documents. This will allow footnotes in different files with the same identifiers to work as expected"},{name:["-F","--filter"],description:"Specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written",args:{name:"executable",template:"filepaths"}},{name:["-L","--lua-filter"],description:"Transform the document in a similar fashion as JSON filters, but use pandoc\u2019s built-in Lua filtering system",args:{name:"script",template:"filepaths"}},{name:["-M","--metadata"],description:"Set the metadata field KEY to the value VAL",args:[{name:"key"},{name:"value",isOptional:!0}]},{name:"--metadata-file",description:"Read metadata from the supplied YAML (or JSON) file",args:{name:"file",generators:O.yamlJSONFiles}},{name:["-p","--preserve-tabs"],description:"Preserve tabs instead of converting them to spaces"},{name:"--tab-stop",description:"Specify the number of spaces per tab",args:{name:"number",default:"4"}},{name:"--track-changes",description:"Specifies what to do with insertions, deletions, and comments produced by the MS Word `Track Changes` feature",args:{name:"mode",default:"accept",suggestions:[{name:"accept",description:"Processes all the insertions and deletions and ignores comments"},{name:"reject",description:"Ignores all the insertions and deletions and ignores comments"},{name:"all",description:"Includes all insertions, deletions, and comments, wrapped in spans with insertion, deletion, comment-start, and comment-end classes, respectively"}]}},{name:"--extract-media",description:"Extract images and other media contained in or linked from the source document to the path DIR, creating it if necessary, and adjust the images references in the document so they point to the extracted files",args:{name:"dir",template:"folders"}},{name:"--abbreviations",description:"Specifies a custom abbreviations file, with abbreviations one to a line. If this option is not specified, pandoc will read the data file abbreviations from the user data directory or fall back on a system default",args:{name:"file",template:"filepaths"}},{name:["-s","--standalone"],description:"Produce output with an appropriate header and footer (e.g. a standalone HTML, LaTeX, TEI, or RTF file, not a fragment). This option is set automatically for pdf, epub, epub3, fb2, docx, and odt output"},{name:"--template",description:"Use the specified file as a custom template for the generated document",args:{name:"file or URL",template:"filepaths"}},{name:["-V","--variable"],description:"Set the template variable KEY to the value VAL when rendering the document in standalone mode. If no VAL is specified, the key will be given the value true",args:[{name:"key"},{name:"value",isOptional:!0}]},{name:["-D","--print-default-template"],description:"Print the system default template for an output FORMAT. Templates in the user data directory are ignored",args:{name:"format",generators:O.outputFormats}},{name:"--print-default-data-file",description:"Print a system default data file. Files in the user data directory are ignored",args:{name:"file",template:"filepaths"}},{name:"--eol",description:"Manually specify line endings: crlf (Windows), lf (macOS/Linux/UNIX), or native (line endings appropriate to the OS on which pandoc is being run). The default is native",args:{name:"type",suggestions:[{name:"crlf",description:"Windows"},{name:"lf",description:"MacOS/Linux/UNIX"},{name:"native",description:"Line endings appropriate to the OS on which Pandoc is being run"}]}},{name:"--dpi",description:"Specify the default dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa",args:{name:"number",default:"96"}},{name:"--wrap",description:"Determine how text is wrapped in the output (the source code, not the rendered version)",args:{name:"mode",default:"auto",suggestions:[{name:"auto",description:"Attempts to wrap lines to the column width specified by --columns (default 72)"},{name:"none",description:"Will not wrap lines at all"},{name:"preserve",description:"Attempts to preserve the wrapping from the source document"}]}},{name:"--columns",description:"Specify length of lines in characters. This affects text wrapping in the generated source code",args:{name:"number",default:"72"}},{name:["--toc","--table-of-contents"],description:"Include an automatically generated table of contents (or, in the case of latex, context, docx, odt, opendocument, rst, or ms, an instruction to create one) in the output document. It has no effect on man, docbook4, docbook5, or jats output",dependsOn:["-s","--standalone"]},{name:"--toc-depth",description:"Specify the number of section levels to include in the table of contents",args:{name:"number",default:"3"}},{name:"--strip-comments",description:"Strip out HTML comments in the Markdown or Textile source, rather than passing them on to Markdown, Textile or HTML output as raw HTML. This does not apply to HTML comments inside raw HTML blocks when the markdown_in_html_blocks extension is not set"},{name:"--no-highlight",description:"Disables syntax highlighting for code blocks and inlines, even when a language attribute is given"},{name:"--highlight-style",description:"Specifies the coloring style to be used in highlighted source code",args:Q},{name:"--print-highlight-style",description:"Prints a JSON version of a highlighting style, which can be modified, saved with a .theme extension, and used with --highlight-style",args:Q},{name:"--syntax-definition",description:"Instructs pandoc to load a KDE XML syntax definition file, which will be used for syntax highlighting of appropriately marked code blocks",args:{name:"file",template:"filepaths"}},{name:["-H","--include-in-header"],description:"Include contents of FILE, verbatim, at the end of the header",args:{name:"FILE|URL",template:"filepaths"}},{name:["-B","--include-before-body"],description:"Include contents of FILE, verbatim, at the beginning of the document body",args:{name:"FILE|URL",template:"filepaths"}},{name:["-A","--include-after-body"],description:"Include contents of FILE, verbatim, at the end of the document body",args:{name:"FILE|URL",template:"filepaths"}},{name:"--resource-path",description:"List of paths to search for images and other resources. If --resource-path is not specified, the default resource path is the working directory",args:{name:"search path",description:"The paths should be separated by : on Linux, UNIX, and macOS systems, and by ; on Windows",template:"folders"}},{name:"--request-header",description:"Set the request header NAME to the value VAL when making HTTP requests. If you\u2019re behind a proxy, you also need to set the environment variable http_proxy to http://",args:{name:"NAME:VAL"}},{name:"--no-check-certificate",description:"Disable the certificate verification to allow access to unsecure HTTP resources"},{name:"--self-contained",description:"Produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos"},{name:"--html-q-tags",description:"Use <q> tags for quotes in HTML. This option only has an effect if the smart extension is enabled"},{name:"--ascii",description:"Use only ASCII characters in output. Currently supported for XML, HTML formats, CommonMark, gfm, Markdown, roff ms , and to a limited degree LaTeX, roff man output uses ASCII by default"},{name:"--reference-links",description:"Use reference-style links, rather than inline links, in writing Markdown or reStructuredText"},{name:"--reference-location",description:"Specify whether footnotes (and references, if reference-links is set) are placed at the end of the current (top-level) block, the current section, or the document. Currently only affects the markdown writer",args:{name:"type",default:"document",suggestions:["block","section","document"]}},{name:"--markdown-headings",description:"Specify whether to use ATX-style (#-prefixed) or Setext-style (underlined) headings for level 1 and 2 headings in Markdown output",args:{name:"type",default:"atx",suggestions:["setext","atx"]}},{name:"--atx-headers",description:"Deprecated synonym for --markdown-headings=atx"},{name:"--top-level-division",description:"Treat top-level headings as the given division type in LaTeX, ConTeXt, DocBook, and TEI output",args:{name:"mode",suggestions:["default","section","chapter","part"]}},{name:["-N","--number-sections"],description:"Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB output. By default, sections are not numbered"},{name:"--number-offset",description:"Offset for section headings in HTML output (ignored in other output formats)",args:{name:"number",description:"The first number is added to the section number for top-level headings, the second for second-level headings, and so on",isVariadic:!0}},{name:"--listings",description:"Use the listings package for LaTeX code blocks. The package does not support multi-byte encoding for source code. To handle UTF-8 you would need to use a custom template"},{name:["-i","--incremental"],description:"Make list items in slide shows display incrementally"},{name:"--slide-level",description:"Specifies that headings with the specified level create slides (for beamer, s5, slidy, slideous, dzslides). Headings above this level in the hierarchy are used to divide the slide show into sections; headings below this level create subheads within a slide",args:{name:"level",description:"Number"}},{name:"--section-divs",description:"Wrap sections in <section> tags (or <div> tags for html4), and attach identifiers to the enclosing <section> (or <div>) rather than the heading itself"},{name:"--email-obfuscation",description:"Specify a method for obfuscating mailto: links in HTML documents references . The default is none",args:{name:"type",default:"none",suggestions:[{name:"none",description:"Leaves mailto: links as they are"},{name:"javascript",description:"Obfuscates mailto: links using JavaScript"},{name:"references",description:"Obfuscates mailto: links by printing their letters as decimal or hexadecimal character references"}]}},{name:"--id-prefix",description:"Specify a prefix to be added to all identifiers and internal links in HTML and DocBook output, and to footnote numbers in Markdown and Haddock output",args:{name:"string"}},{name:["-T","--title-prefix"],description:"Specify STRING as a prefix at the beginning of the title that appears in the HTML header (but not in the title as it appears at the beginning of the HTML body)",args:{name:"string"}},{name:["-c","--css"],description:"Link to a CSS style sheet. This option can be used repeatedly to include multiple files. They will be included in the order specified",args:{name:"URL"}},{name:"--reference-doc",description:"Use the specified file as a style reference in producing a docx or ODT file",args:{name:"file",template:"filepaths"}},{name:"--epub-cover-image",description:"Use the specified image as the EPUB cover. It is recommended that the image be less than 1000px in width and height. Note that in a Markdown source document you can also specify cover-image in a YAML metadata block",args:{name:"file",template:"filepaths"}},{name:"--epub-metadata",description:"Look in the specified XML file for metadata for the EPUB. The file should contain a series of Dublin Core elements",args:{name:"file",template:"filepaths"}},{name:"--epub-embed-font",description:"Embed the specified font in the EPUB. This option can be repeated to embed multiple fonts. Wildcards can also be used",args:{name:"file",template:"filepaths"}},{name:"--pdf-engine",description:"Use the specified engine when producing PDF output",args:{name:"program",suggestions:["pdflatex","lualatex","xelatex","latexmk","tectonic","wkhtmltopdf","weasyprint","prince","context","pdfroff"]}},{name:"--pdf-engine-opt",description:"Use the given string as a command-line argument to the pdf-engine",args:{name:"string"}},{name:["-C","--citeproc"],description:"Process the citations in the file, replacing them with rendered citations and adding a bibliography. Citation processing will not take place unless bibliographic data is supplied, either through an external file specified using the --bibliography option or the bibliography field in metadata, or via a references section in metadata containing a list of citations in CSL YAML format with Markdown formatting. The style is controlled by a CSL stylesheet specified using the --csl option or the csl field in metadata. (If no stylesheet is specified, the chicago-author-date style will be used by default)"},{name:"--bibliography",description:"Set the bibliography field in the document\u2019s metadata to FILE, overriding any value set in the metadata. If you supply this argument multiple times, each FILE will be added to bibliography. If FILE is a URL, it will be fetched via HTTP. If FILE is not found relative to the working directory, it will be sought in the resource path",isRepeatable:!0,args:{name:"file",template:"filepaths"}},{name:"--csl",description:"Set the csl field in the document\u2019s metadata to FILE, overriding any value set in the metadata. (This is equivalent to --metadata csl=FILE.) If FILE is a URL, it will be fetched via HTTP. If FILE is not found relative to the working directory, it will be sought in the resource path and finally in the csl subdirectory of the pandoc user data directory",args:{name:"file",template:"filepaths"}},{name:"--citation-abbreviations",description:"Set the citation-abbreviations field in the document\u2019s metadata to FILE, overriding any value set in the metadata. If FILE is a URL, it will be fetched via HTTP. If FILE is not found relative to the working directory, it will be sought in the resource path and finally in the csl subdirectory of the pandoc user data directory",args:{name:"file",template:"filepaths"}},{name:"--natbib",description:"Use natbib for citations in LaTeX output. It is intended for use in producing a LaTeX file that can be processed with bibtex",exclusiveOn:["--citeproc"]},{name:"--biblatex",description:"Use biblatex for citations in LaTeX output. It is intended for use in producing a LaTeX file that can be processed with bibtex or biber",exclusiveOn:["--citeproc"]},{name:"--mathjax",description:"Use MathJax to display embedded TeX math in HTML output. TeX math will be put between (...) (for inline math) or [...] (for display math) and wrapped in <span> tags with class math. Then the MathJax JavaScript will render it. The URL should point to the MathJax.js load script. If a URL is not provided, a link to the Cloudflare CDN will be inserted",args:{name:"URL"}},{name:"--mathml",description:"Convert TeX math to MathML (in epub3, docbook4, docbook5, jats, html4 and html5). This is the default in odt output. Note that currently only Firefox and Safari (and select e-book readers) natively support MathML"},{name:"--webtex",description:"Convert TeX formulas to <img> tags that link to an external script that converts formulas to images. The formula will be URL-encoded and concatenated with the URL provided. For SVG images you can for example use --webtex https://latex.codecogs.com/svg.latex?. If no URL is specified, the CodeCogs URL generating PNGs will be used (https://latex.codecogs.com/png.latex?). Note: the --webtex option will affect Markdown output as well as HTML, which is useful if you\u2019re targeting a version of Markdown without native math support",args:{name:"URL"}},{name:"--katex",description:"Use KaTeX to display embedded TeX math in HTML output. The URL is the base URL for the KaTeX library. That directory should contain a katex.min.js and a katex.min.css file. If a URL is not provided, a link to the KaTeX CDN will be inserted",args:{name:"URL"}},{name:"--gladtex",description:"Enclose TeX math in <eq> tags in HTML output. The resulting HTML can then be processed by GladTeX to produce SVG images of the typeset formulas and an HTML file with these images embedded"},{name:"--dump-args",description:"Print information about command-line arguments to stdout, then exit. This option is intended primarily for use in wrapper scripts"},{name:"--ignore-args",description:"Ignore command-line arguments (for use in wrapper scripts). Regular pandoc options are not ignored"}],args:{name:"input file(s)",template:"filepaths",isVariadic:!0}},Ae=Ie;export{Ae as default};
|
|
6
|
+
`))).map(n=>({name:n,icon:`fig://icon?type=${n}`}))}}],yamlFiles:[(0,H.filepaths)({extensions:["yaml"]})],yamlJSONFiles:[(0,H.filepaths)({extensions:["yaml","json"]})]},Q={name:"STYLE|FILE",template:"filepaths",default:"pygments",suggestions:["pygments","kate","monochrome","breezeDark","espresso","zenburn","haddock","tango"]},Ie={name:"pandoc",description:"A universal document converter",options:[{name:["-f","-r","--from","--read"],description:"Specify input format",args:{name:"format",generators:k.inputFormats}},{name:["-t","-w","--to","--write"],description:"Specify output format",args:{name:"format",generators:k.outputFormats}},{name:["-o","--output"],description:"Write output to FILE instead of stdout",args:{name:"file",template:"filepaths"}},{name:"--data-dir",description:"Specify the user data directory to search for pandoc data files",args:{name:"directory",template:"folders"}},{name:["-d","--defaults"],description:"Specify a set of default option settings",args:{name:"file",generators:k.yamlFiles}},{name:"--bash-completion",description:"Generate a bash completion script"},{name:"--verbose",description:"Give verbose debugging output"},{name:"--quiet",description:"Suppress warning messages"},{name:"--fail-if-warnings",description:"Exit with error status if there are any warnings"},{name:"--log",description:"Write log messages in machine-readable JSON format to FILE",args:{name:"file",template:"filepaths"}},{name:"--list-input-formats",description:"List supported input formats, one per line"},{name:"--list-output-formats",description:"List supported output formats, one per line"},{name:"--list-extensions",description:"List supported extensions for FORMAT, one per line, preceded by a + or - indicating whether it is enabled by default in FORMAT",args:{name:"format",generators:k.formats,isOptional:!0}},{name:"--list-highlight-languages",description:"List supported languages for syntax highlighting, one per line"},{name:"--list-highlight-styles",description:"List supported styles for syntax highlighting, one per line"},{name:["-v","--version"],description:"Print version"},{name:["-h","--help"],description:"Show usage message"},{name:"--shift-heading-level-by",description:"Shift heading levels by a positive or negative integer",args:{name:"number"}},{name:"--indented-code-classes",description:"Specify classes to use for indented code blocks\u2013for example, perl,numberLines or haskell. Multiple classes may be separated by spaces or commas",args:{name:"classes"}},{name:"--default-image-extension",description:"Specify a default extension to use when image paths/URLs have no extension. This allows you to use the same source for formats that require different kinds of images. Currently this option only affects the Markdown and LaTeX readers",args:{name:"extension"}},{name:"--file-scope",description:"Parse each file individually before combining for multifile documents. This will allow footnotes in different files with the same identifiers to work as expected"},{name:["-F","--filter"],description:"Specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written",args:{name:"executable",template:"filepaths"}},{name:["-L","--lua-filter"],description:"Transform the document in a similar fashion as JSON filters, but use pandoc\u2019s built-in Lua filtering system",args:{name:"script",template:"filepaths"}},{name:["-M","--metadata"],description:"Set the metadata field KEY to the value VAL",args:[{name:"key"},{name:"value",isOptional:!0}]},{name:"--metadata-file",description:"Read metadata from the supplied YAML (or JSON) file",args:{name:"file",generators:k.yamlJSONFiles}},{name:["-p","--preserve-tabs"],description:"Preserve tabs instead of converting them to spaces"},{name:"--tab-stop",description:"Specify the number of spaces per tab",args:{name:"number",default:"4"}},{name:"--track-changes",description:"Specifies what to do with insertions, deletions, and comments produced by the MS Word `Track Changes` feature",args:{name:"mode",default:"accept",suggestions:[{name:"accept",description:"Processes all the insertions and deletions and ignores comments"},{name:"reject",description:"Ignores all the insertions and deletions and ignores comments"},{name:"all",description:"Includes all insertions, deletions, and comments, wrapped in spans with insertion, deletion, comment-start, and comment-end classes, respectively"}]}},{name:"--extract-media",description:"Extract images and other media contained in or linked from the source document to the path DIR, creating it if necessary, and adjust the images references in the document so they point to the extracted files",args:{name:"dir",template:"folders"}},{name:"--abbreviations",description:"Specifies a custom abbreviations file, with abbreviations one to a line. If this option is not specified, pandoc will read the data file abbreviations from the user data directory or fall back on a system default",args:{name:"file",template:"filepaths"}},{name:["-s","--standalone"],description:"Produce output with an appropriate header and footer (e.g. a standalone HTML, LaTeX, TEI, or RTF file, not a fragment). This option is set automatically for pdf, epub, epub3, fb2, docx, and odt output"},{name:"--template",description:"Use the specified file as a custom template for the generated document",args:{name:"file or URL",template:"filepaths"}},{name:["-V","--variable"],description:"Set the template variable KEY to the value VAL when rendering the document in standalone mode. If no VAL is specified, the key will be given the value true",args:[{name:"key"},{name:"value",isOptional:!0}]},{name:["-D","--print-default-template"],description:"Print the system default template for an output FORMAT. Templates in the user data directory are ignored",args:{name:"format",generators:k.outputFormats}},{name:"--print-default-data-file",description:"Print a system default data file. Files in the user data directory are ignored",args:{name:"file",template:"filepaths"}},{name:"--eol",description:"Manually specify line endings: crlf (Windows), lf (macOS/Linux/UNIX), or native (line endings appropriate to the OS on which pandoc is being run). The default is native",args:{name:"type",suggestions:[{name:"crlf",description:"Windows"},{name:"lf",description:"MacOS/Linux/UNIX"},{name:"native",description:"Line endings appropriate to the OS on which Pandoc is being run"}]}},{name:"--dpi",description:"Specify the default dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa",args:{name:"number",default:"96"}},{name:"--wrap",description:"Determine how text is wrapped in the output (the source code, not the rendered version)",args:{name:"mode",default:"auto",suggestions:[{name:"auto",description:"Attempts to wrap lines to the column width specified by --columns (default 72)"},{name:"none",description:"Will not wrap lines at all"},{name:"preserve",description:"Attempts to preserve the wrapping from the source document"}]}},{name:"--columns",description:"Specify length of lines in characters. This affects text wrapping in the generated source code",args:{name:"number",default:"72"}},{name:["--toc","--table-of-contents"],description:"Include an automatically generated table of contents (or, in the case of latex, context, docx, odt, opendocument, rst, or ms, an instruction to create one) in the output document. It has no effect on man, docbook4, docbook5, or jats output",dependsOn:["-s","--standalone"]},{name:"--toc-depth",description:"Specify the number of section levels to include in the table of contents",args:{name:"number",default:"3"}},{name:"--strip-comments",description:"Strip out HTML comments in the Markdown or Textile source, rather than passing them on to Markdown, Textile or HTML output as raw HTML. This does not apply to HTML comments inside raw HTML blocks when the markdown_in_html_blocks extension is not set"},{name:"--no-highlight",description:"Disables syntax highlighting for code blocks and inlines, even when a language attribute is given"},{name:"--highlight-style",description:"Specifies the coloring style to be used in highlighted source code",args:Q},{name:"--print-highlight-style",description:"Prints a JSON version of a highlighting style, which can be modified, saved with a .theme extension, and used with --highlight-style",args:Q},{name:"--syntax-definition",description:"Instructs pandoc to load a KDE XML syntax definition file, which will be used for syntax highlighting of appropriately marked code blocks",args:{name:"file",template:"filepaths"}},{name:["-H","--include-in-header"],description:"Include contents of FILE, verbatim, at the end of the header",args:{name:"FILE|URL",template:"filepaths"}},{name:["-B","--include-before-body"],description:"Include contents of FILE, verbatim, at the beginning of the document body",args:{name:"FILE|URL",template:"filepaths"}},{name:["-A","--include-after-body"],description:"Include contents of FILE, verbatim, at the end of the document body",args:{name:"FILE|URL",template:"filepaths"}},{name:"--resource-path",description:"List of paths to search for images and other resources. If --resource-path is not specified, the default resource path is the working directory",args:{name:"search path",description:"The paths should be separated by : on Linux, UNIX, and macOS systems, and by ; on Windows",template:"folders"}},{name:"--request-header",description:"Set the request header NAME to the value VAL when making HTTP requests. If you\u2019re behind a proxy, you also need to set the environment variable http_proxy to http://",args:{name:"NAME:VAL"}},{name:"--no-check-certificate",description:"Disable the certificate verification to allow access to unsecure HTTP resources"},{name:"--self-contained",description:"Produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos"},{name:"--html-q-tags",description:"Use <q> tags for quotes in HTML. This option only has an effect if the smart extension is enabled"},{name:"--ascii",description:"Use only ASCII characters in output. Currently supported for XML, HTML formats, CommonMark, gfm, Markdown, roff ms , and to a limited degree LaTeX, roff man output uses ASCII by default"},{name:"--reference-links",description:"Use reference-style links, rather than inline links, in writing Markdown or reStructuredText"},{name:"--reference-location",description:"Specify whether footnotes (and references, if reference-links is set) are placed at the end of the current (top-level) block, the current section, or the document. Currently only affects the markdown writer",args:{name:"type",default:"document",suggestions:["block","section","document"]}},{name:"--markdown-headings",description:"Specify whether to use ATX-style (#-prefixed) or Setext-style (underlined) headings for level 1 and 2 headings in Markdown output",args:{name:"type",default:"atx",suggestions:["setext","atx"]}},{name:"--atx-headers",description:"Deprecated synonym for --markdown-headings=atx"},{name:"--top-level-division",description:"Treat top-level headings as the given division type in LaTeX, ConTeXt, DocBook, and TEI output",args:{name:"mode",suggestions:["default","section","chapter","part"]}},{name:["-N","--number-sections"],description:"Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB output. By default, sections are not numbered"},{name:"--number-offset",description:"Offset for section headings in HTML output (ignored in other output formats)",args:{name:"number",description:"The first number is added to the section number for top-level headings, the second for second-level headings, and so on",isVariadic:!0}},{name:"--listings",description:"Use the listings package for LaTeX code blocks. The package does not support multi-byte encoding for source code. To handle UTF-8 you would need to use a custom template"},{name:["-i","--incremental"],description:"Make list items in slide shows display incrementally"},{name:"--slide-level",description:"Specifies that headings with the specified level create slides (for beamer, s5, slidy, slideous, dzslides). Headings above this level in the hierarchy are used to divide the slide show into sections; headings below this level create subheads within a slide",args:{name:"level",description:"Number"}},{name:"--section-divs",description:"Wrap sections in <section> tags (or <div> tags for html4), and attach identifiers to the enclosing <section> (or <div>) rather than the heading itself"},{name:"--email-obfuscation",description:"Specify a method for obfuscating mailto: links in HTML documents references . The default is none",args:{name:"type",default:"none",suggestions:[{name:"none",description:"Leaves mailto: links as they are"},{name:"javascript",description:"Obfuscates mailto: links using JavaScript"},{name:"references",description:"Obfuscates mailto: links by printing their letters as decimal or hexadecimal character references"}]}},{name:"--id-prefix",description:"Specify a prefix to be added to all identifiers and internal links in HTML and DocBook output, and to footnote numbers in Markdown and Haddock output",args:{name:"string"}},{name:["-T","--title-prefix"],description:"Specify STRING as a prefix at the beginning of the title that appears in the HTML header (but not in the title as it appears at the beginning of the HTML body)",args:{name:"string"}},{name:["-c","--css"],description:"Link to a CSS style sheet. This option can be used repeatedly to include multiple files. They will be included in the order specified",args:{name:"URL"}},{name:"--reference-doc",description:"Use the specified file as a style reference in producing a docx or ODT file",args:{name:"file",template:"filepaths"}},{name:"--epub-cover-image",description:"Use the specified image as the EPUB cover. It is recommended that the image be less than 1000px in width and height. Note that in a Markdown source document you can also specify cover-image in a YAML metadata block",args:{name:"file",template:"filepaths"}},{name:"--epub-metadata",description:"Look in the specified XML file for metadata for the EPUB. The file should contain a series of Dublin Core elements",args:{name:"file",template:"filepaths"}},{name:"--epub-embed-font",description:"Embed the specified font in the EPUB. This option can be repeated to embed multiple fonts. Wildcards can also be used",args:{name:"file",template:"filepaths"}},{name:"--pdf-engine",description:"Use the specified engine when producing PDF output",args:{name:"program",suggestions:["pdflatex","lualatex","xelatex","latexmk","tectonic","wkhtmltopdf","weasyprint","prince","context","pdfroff"]}},{name:"--pdf-engine-opt",description:"Use the given string as a command-line argument to the pdf-engine",args:{name:"string"}},{name:["-C","--citeproc"],description:"Process the citations in the file, replacing them with rendered citations and adding a bibliography. Citation processing will not take place unless bibliographic data is supplied, either through an external file specified using the --bibliography option or the bibliography field in metadata, or via a references section in metadata containing a list of citations in CSL YAML format with Markdown formatting. The style is controlled by a CSL stylesheet specified using the --csl option or the csl field in metadata. (If no stylesheet is specified, the chicago-author-date style will be used by default)"},{name:"--bibliography",description:"Set the bibliography field in the document\u2019s metadata to FILE, overriding any value set in the metadata. If you supply this argument multiple times, each FILE will be added to bibliography. If FILE is a URL, it will be fetched via HTTP. If FILE is not found relative to the working directory, it will be sought in the resource path",isRepeatable:!0,args:{name:"file",template:"filepaths"}},{name:"--csl",description:"Set the csl field in the document\u2019s metadata to FILE, overriding any value set in the metadata. (This is equivalent to --metadata csl=FILE.) If FILE is a URL, it will be fetched via HTTP. If FILE is not found relative to the working directory, it will be sought in the resource path and finally in the csl subdirectory of the pandoc user data directory",args:{name:"file",template:"filepaths"}},{name:"--citation-abbreviations",description:"Set the citation-abbreviations field in the document\u2019s metadata to FILE, overriding any value set in the metadata. If FILE is a URL, it will be fetched via HTTP. If FILE is not found relative to the working directory, it will be sought in the resource path and finally in the csl subdirectory of the pandoc user data directory",args:{name:"file",template:"filepaths"}},{name:"--natbib",description:"Use natbib for citations in LaTeX output. It is intended for use in producing a LaTeX file that can be processed with bibtex",exclusiveOn:["--citeproc"]},{name:"--biblatex",description:"Use biblatex for citations in LaTeX output. It is intended for use in producing a LaTeX file that can be processed with bibtex or biber",exclusiveOn:["--citeproc"]},{name:"--mathjax",description:"Use MathJax to display embedded TeX math in HTML output. TeX math will be put between (...) (for inline math) or [...] (for display math) and wrapped in <span> tags with class math. Then the MathJax JavaScript will render it. The URL should point to the MathJax.js load script. If a URL is not provided, a link to the Cloudflare CDN will be inserted",args:{name:"URL"}},{name:"--mathml",description:"Convert TeX math to MathML (in epub3, docbook4, docbook5, jats, html4 and html5). This is the default in odt output. Note that currently only Firefox and Safari (and select e-book readers) natively support MathML"},{name:"--webtex",description:"Convert TeX formulas to <img> tags that link to an external script that converts formulas to images. The formula will be URL-encoded and concatenated with the URL provided. For SVG images you can for example use --webtex https://latex.codecogs.com/svg.latex?. If no URL is specified, the CodeCogs URL generating PNGs will be used (https://latex.codecogs.com/png.latex?). Note: the --webtex option will affect Markdown output as well as HTML, which is useful if you\u2019re targeting a version of Markdown without native math support",args:{name:"URL"}},{name:"--katex",description:"Use KaTeX to display embedded TeX math in HTML output. The URL is the base URL for the KaTeX library. That directory should contain a katex.min.js and a katex.min.css file. If a URL is not provided, a link to the KaTeX CDN will be inserted",args:{name:"URL"}},{name:"--gladtex",description:"Enclose TeX math in <eq> tags in HTML output. The resulting HTML can then be processed by GladTeX to produce SVG images of the typeset formulas and an HTML file with these images embedded"},{name:"--dump-args",description:"Print information about command-line arguments to stdout, then exit. This option is intended primarily for use in wrapper scripts"},{name:"--ignore-args",description:"Ignore command-line arguments (for use in wrapper scripts). Regular pandoc options are not ignored"}],args:{name:"input file(s)",template:"filepaths",isVariadic:!0}},Ue=Ie;export{Ue as default};
|
package/build/pdfunite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
`),[".DS_Store"]),N=[];for(let V of
|
|
1
|
+
var k=Object.create;var W=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var re=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ee(t))!ne.call(e,i)&&i!==n&&W(e,i,{get:()=>t[i],enumerable:!(r=Y(t,i))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?k(te(e)):{},re(t||!e||!e.__esModule?W(n,"default",{value:e,enumerable:!0}):n,e));var R=T(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.shellExpand=I.ensureTrailingSlash=void 0;var se=e=>e.endsWith("/")?e:`${e}/`;I.ensureTrailingSlash=se;var oe=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,le=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,i=>{var s;let l=i.slice(1);return(s=t[l])!==null&&s!==void 0?s:i}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(i,s,l)=>{var c,a;return(a=(c=t[s])!==null&&c!==void 0?c:l)!==null&&a!==void 0?a:i}),ue=(e,t)=>{var n;let{environmentVariables:r}=t;return le(oe(e,(n=r?.HOME)!==null&&n!==void 0?n:"~"),r)};I.shellExpand=ue});var K=T(O=>{"use strict";var ce=O&&O.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function c(o){try{u(r.next(o))}catch(f){l(f)}}function a(o){try{u(r.throw(o))}catch(f){l(f)}}function u(o){o.done?s(o.value):i(o.value).then(c,a)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(O,"__esModule",{value:!0});O.filepaths=O.folders=O.getCurrentInsertedDirectory=void 0;O.sortFilesAlphabetically=$;var L=R();function $(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)),"../"]}var ae=(e,t,n)=>{if(e===null)return"/";let r=(0,L.shellExpand)(t,n),i=r.slice(0,r.lastIndexOf("/")+1);return i===""?(0,L.ensureTrailingSlash)(e):i.startsWith("/")?i:`${(0,L.ensureTrailingSlash)(e)}${i}`};O.getCurrentInsertedDirectory=ae;function M(e={}){let{extensions:t=[],equals:n=[],matches:r,filterFolders:i=!1,editFileSuggestions:s,editFolderSuggestions:l,rootDirectory:c,showFolders:a="always"}=e,u=new Set(t),o=new Set(n),f=()=>t.length>0||n.length>0||r,y=(h=[])=>f()?h.filter(({name:v="",type:m})=>{if(!i&&m==="folder"||o.has(v)||r&&v.match(r))return!0;let[,...d]=v.split(".");if(d.length>=1){let _=d.length-1,b=d[_];do{if(u.has(b))return!0;_-=1,b=[d[_],b].join(".")}while(_>=0)}return!1}):h,S=(h=[])=>!s&&!l?h:h.map(v=>Object.assign(Object.assign({},v),(v.type==="file"?s:l)||{}));return{trigger:(h,v)=>{let m=h.lastIndexOf("/"),d=v.lastIndexOf("/");return m!==d?!0:m===-1&&d===-1?!1:h.slice(0,m)!==v.slice(0,d)},getQueryTerm:h=>h.slice(h.lastIndexOf("/")+1),custom:(h,v,m)=>ce(this,void 0,void 0,function*(){var d;let{isDangerous:_,currentWorkingDirectory:b,searchTerm:p}=m,w=(d=(0,O.getCurrentInsertedDirectory)(c??b,p,m))!==null&&d!==void 0?d:"/";try{let q=yield v({command:"ls",args:["-1ApL"],cwd:w}),U=$(q.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),N=[];for(let V of U)if(V){let F=V.endsWith("/")?"folders":"filepaths";(F==="filepaths"&&a!=="only"||F==="folders"&&a!=="never")&&N.push({type:F==="filepaths"?"file":"folder",name:V,insertValue:V,isDangerous:_,context:{templateType:F}})}return S(y(N))}catch{return[]}})}}O.folders=Object.assign(()=>M({showFolders:"only"}),Object.freeze(M({showFolders:"only"})));O.filepaths=Object.assign(M,Object.freeze(M()))});var H=T(x=>{"use strict";var j=x&&x.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function c(o){try{u(r.next(o))}catch(f){l(f)}}function a(o){try{u(r.throw(o))}catch(f){l(f)}}function u(o){o.done?s(o.value):i(o.value).then(c,a)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(x,"__esModule",{value:!0});x.valueList=fe;x.keyValue=de;x.keyValueList=he;var z=new Map;function D(e,t){return e.length===0?t:t.map(n=>n.insertValue?n:Object.assign(Object.assign({},n),{insertValue:n.name+e}))}function J(e,t,n){return j(this,void 0,void 0,function*(){if(typeof e=="function"){let r=yield e(...n);return D(t,r)}if(typeof e[0]=="string"){let r=e.map(i=>({name:i}));return D(t,r)}return D(t,e)})}function P(e,t,n,r){return j(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let i=z.get(e);return i===void 0&&(i=yield J(e,t,r),z.set(e,i)),i}return J(e,t,r)})}function Q(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(s=>n.has(s)))})}function fe({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:r=!1,allowRepeatedValues:i=!1}){return{trigger:(s,l)=>s.lastIndexOf(e)!==l.lastIndexOf(e),getQueryTerm:s=>s.slice(s.lastIndexOf(e)+e.length),custom:(...s)=>j(this,void 0,void 0,function*(){var l;let c=yield P(t,r?e:"",n,s);if(i)return c;let[a]=s,u=(l=a[a.length-1])===null||l===void 0?void 0:l.split(e);return E(u,c)})}}function de({separator:e="=",keys:t=[],values:n=[],cache:r=!1,insertSeparator:i=!0}){return{trigger:(s,l)=>s.indexOf(e)!==l.indexOf(e),getQueryTerm:s=>s.slice(s.indexOf(e)+1),custom:(...s)=>j(this,void 0,void 0,function*(){let[l]=s,a=!l[l.length-1].includes(e),u=a?t:n,o=Q(a,r);return P(u,a&&i?e:"",o,s)})}}function he({separator:e="=",delimiter:t=",",keys:n=[],values:r=[],cache:i=!1,insertSeparator:s=!0,insertDelimiter:l=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:a=!0}){return{trigger:(u,o)=>{let f=C(u,e,t),y=C(o,e,t);return f!==y},getQueryTerm:u=>{let o=C(u,e,t);return u.slice(o+1)},custom:(...u)=>j(this,void 0,void 0,function*(){let[o]=u,f=o[o.length-1],y=C(f,e,t),S=y===-1||f.slice(y,y+e.length)!==e,h=S?n:r,v=Q(S,i),d=yield P(h,S?s?e:"":l?t:"",v,u);if(S){if(c)return d;let b=f.split(t).map(p=>p.slice(0,p.indexOf(e)));return E(b,d)}if(a)return d;let _=f.split(t).map(b=>b.slice(b.indexOf(e)+e.length));return E(_,d)})}}});var B=T(A=>{"use strict";var pe=A&&A.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function c(o){try{u(r.next(o))}catch(f){l(f)}}function a(o){try{u(r.throw(o))}catch(f){l(f)}}function u(o){o.done?s(o.value):i(o.value).then(c,a)}u((r=r.apply(e,t||[])).next())})};Object.defineProperty(A,"__esModule",{value:!0});A.ai=Oe;var ve=4097,ye=4,ge=.8,_e=ve*ye*ge;function Oe({name:e,prompt:t,message:n,postProcess:r,temperature:i,splitOn:s}){return{scriptTimeout:15e3,custom:(l,c,a)=>pe(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 y=typeof t=="function"?yield t({tokens:l,executeCommand:c,generatorContext:a}):t,S=typeof n=="function"?yield n({tokens:l,executeCommand:c,generatorContext:a}):n;if(S===null||S.length===0)return console.warn("No message provided to AI generator"),[];let h=_e-((u=y?.length)!==null&&u!==void 0?u:0),v={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...y?[{role:"system",content:y}]:[],{role:"user",content:S.slice(0,h)}],temperature:i},m=JSON.stringify(v),d=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",m]}),_=JSON.parse(d.stdout);return(o=_?.choices.map(p=>{var w;return(w=p?.message)===null||w===void 0?void 0:w.content}).filter(p=>typeof p=="string").flatMap(p=>s?p.split(s).filter(w=>w.trim().length>0):[p]).map(p=>{if(r)return r(p);let w=p.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(g=>{"use strict";var me=g&&g.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),be=g&&g.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&me(t,e,n)};Object.defineProperty(g,"__esModule",{value:!0});g.ai=g.folders=g.filepaths=void 0;var G=K();Object.defineProperty(g,"filepaths",{enumerable:!0,get:function(){return G.filepaths}});Object.defineProperty(g,"folders",{enumerable:!0,get:function(){return G.folders}});be(H(),g);var Se=B();Object.defineProperty(g,"ai",{enumerable:!0,get:function(){return Se.ai}})});var Z=ie(X(),1),we={name:"pdfunite",description:"Combine multiple pdfs",options:[{name:"-v",description:"Print copyright and version info"},{name:["-h","--help","-?"],description:"Print usage information"}],args:{generators:(0,Z.filepaths)({extensions:["pdf"]}),isVariadic:!0}},Fe=we;export{Fe as default};
|
package/build/pi.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var re=Object.create;var K=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var
|
|
2
|
-
`),[".DS_Store"]),H=[];for(let F of se)if(F){let L=F.endsWith("/")?"folders":"filepaths";(L==="filepaths"&&d!=="only"||L==="folders"&&d!=="never")&&H.push({type:L==="filepaths"?"file":"folder",name:F,insertValue:F,isDangerous:b,context:{templateType:L}})}return w(h(H))}catch{return[]}})}}v.folders=Object.assign(()=>E({showFolders:"only"}),Object.freeze(E({showFolders:"only"})));v.filepaths=Object.assign(E,Object.freeze(E()))});var ee=P(_=>{"use strict";var D=_&&_.__awaiter||function(e,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(r){try{l(i.next(r))}catch(p){a(p)}}function d(r){try{l(i.throw(r))}catch(p){a(p)}}function l(r){r.done?s(r.value):o(r.value).then(c,d)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(_,"__esModule",{value:!0});_.keyValueList=_.keyValue=_.valueList=void 0;var X=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 Y(e,t,n){return D(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return q(t,i)}if(typeof e[0]=="string"){let i=e.map(o=>({name:o}));return q(t,i)}return q(t,e)})}function W(e,t,n,i){return D(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let o=X.get(e);return o===void 0&&(o=yield Y(e,t,i),X.set(e,o)),o}return Y(e,t,i)})}function Z(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function C(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function z(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(s=>n.has(s)))})}function be({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:o=!1}){return{trigger:(s,a)=>s.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:s=>s.slice(s.lastIndexOf(e)+e.length),custom:(...s)=>D(this,void 0,void 0,function*(){var a;let c=yield W(t,i?e:"",n,s);if(o)return c;let[d]=s,l=(a=d[d.length-1])===null||a===void 0?void 0:a.split(e);return z(l,c)})}}_.valueList=be;function Oe({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:o=!0}){return{trigger:(s,a)=>s.indexOf(e)!==a.indexOf(e),getQueryTerm:s=>s.slice(s.indexOf(e)+1),custom:(...s)=>D(this,void 0,void 0,function*(){let[a]=s,d=!a[a.length-1].includes(e),l=d?t:n,r=Z(d,i);return W(l,d&&o?e:"",r,s)})}}_.keyValue=Oe;function xe({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:o=!1,insertSeparator:s=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:d=!0}){return{trigger:(l,r)=>{let p=C(l,e,t),h=C(r,e,t);return p!==h},getQueryTerm:l=>{let r=C(l,e,t);return l.slice(r+1)},custom:(...l)=>D(this,void 0,void 0,function*(){let[r]=l,p=r[r.length-1],h=C(p,e,t),w=h===-1||p.slice(h,h+e.length)!==e,m=w?n:i,g=Z(w,o),u=yield W(m,w?s?e:"":a?t:"",g,l);if(w){if(c)return u;let x=p.split(t).map(f=>f.slice(0,f.indexOf(e)));return z(x,u)}if(d)return u;let b=p.split(t).map(x=>x.slice(x.indexOf(e)+e.length));return z(b,u)})}}_.keyValueList=xe});var te=P(T=>{"use strict";var we=T&&T.__awaiter||function(e,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(r){try{l(i.next(r))}catch(p){a(p)}}function d(r){try{l(i.throw(r))}catch(p){a(p)}}function l(r){r.done?s(r.value):o(r.value).then(c,d)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.ai=void 0;var Se=4097,_e=4,ke=.8,Ae=Se*_e*ke;function Ie({name:e,prompt:t,message:n,postProcess:i,temperature:o,splitOn:s}){return{scriptTimeout:15e3,custom:(a,c,d)=>we(this,void 0,void 0,function*(){var l,r;let p=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(p.stdout))return[];let h=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:d}):t,w=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:d}):n;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let m=Ae-((l=h?.length)!==null&&l!==void 0?l:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...h?[{role:"system",content:h}]:[],{role:"user",content:w.slice(0,m)}],temperature:o},O=JSON.stringify(g),u=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),b=JSON.parse(u.stdout);return(r=b?.choices.map(f=>{var S;return(S=f?.message)===null||S===void 0?void 0:S.content}).filter(f=>typeof f=="string").flatMap(f=>s?f.split(s).filter(S=>S.trim().length>0):[f]).map(f=>{if(i)return i(f);let S=f.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&r!==void 0?r:[]})}}T.ai=Ie});var ie=P(y=>{"use strict";var Te=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]}),je=y&&y.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Te(t,e,n)};Object.defineProperty(y,"__esModule",{value:!0});y.ai=y.folders=y.filepaths=void 0;var ne=G();Object.defineProperty(y,"filepaths",{enumerable:!0,get:function(){return ne.filepaths}});Object.defineProperty(y,"folders",{enumerable:!0,get:function(){return ne.folders}});je(ee(),y);var Pe=te();Object.defineProperty(y,"ai",{enumerable:!0,get:function(){return Pe.ai}})});var J=ue(ie(),1),De=["amazon-bedrock","ant-ling","anthropic","azure","baseten","cerebras","cloudflare-ai-gateway","cloudflare-workers-ai","deepseek","fireworks","github-copilot","google","google-vertex","groq","huggingface","kimi-coding","meta","minimax","minimax-cn","mistral","moonshotai","moonshotai-cn","nvidia","openai","openai-codex","opencode","opencode-go","openrouter","qwen-token-plan","qwen-token-plan-cn","qwen-token-plan-individual","radius","together","typesafe","vercel-ai-gateway","xai","xiaomi","xiaomi-token-plan-ams","xiaomi-token-plan-cn","xiaomi-token-plan-sgp","zai","zai-coding-cn"],oe=[{name:"read",description:"Read file contents"},{name:"bash",description:"Execute bash commands"},{name:"powershell",description:"Execute PowerShell commands on Windows"},{name:"edit",description:"Edit files with find/replace"},{name:"write",description:"Write files (creates/overwrites)"},{name:"grep",description:"Search file contents (off by default)"},{name:"find",description:"Find files by glob pattern (off by default)"},{name:"ls",description:"List directory contents (off by default)"},{name:"codemode",description:"Codemode tool (built-in extension)"}],k={name:["-h","--help"],description:"Show help for this command"},A={name:["-l","--local"],description:"Use project settings (.pi/) instead of global settings"},j=[{name:["-a","--approve"],description:"Trust project-local files for this run"},{name:["-na","--no-approve"],description:"Ignore project-local files for this run"}],M={name:"--provider",description:"Provider to use",args:{name:"provider",suggestions:De}},R={name:"--model",description:'Model pattern or ID (supports "provider/id")',args:{name:"pattern"}},V={name:"source",description:"Package source (npm:<pkg>, git:<repo>, URL, or local path)",template:"filepaths"},U={name:"server",description:"MCP server name"},Fe={name:"pi",description:"AI coding agent with read, bash, edit, write tools",subcommands:[{name:"install",description:"Install extension source and add to settings",args:V,options:[A,...j,k]},{name:["remove","uninstall"],description:"Remove extension source from settings",args:V,options:[A,...j,k]},{name:"update",description:"Update pi, extensions, or model catalogs",args:{...V,isOptional:!0,suggestions:[{name:"pi",description:"Update pi only"},{name:"self",description:"Update pi only (alias for pi)"}]},options:[{name:"--self",description:"Update pi only (default when no target is given)"},{name:"--extensions",description:"Update installed packages only"},{name:"--models",description:"Refresh model catalogs only"},{name:"--all",description:"Update pi and installed packages"},{name:"--extension",description:"Update one package only",args:V},...j,{name:"--force",description:"Reinstall pi even if the current version is latest"},k]},{name:"list",description:"List installed extensions from settings",options:[...j,k]},{name:"config",description:"Open TUI to enable/disable package resources",options:[{...A,description:"Edit project overrides (.pi/)"},...j,k]},{name:"auth",description:"Print credentials or check provider readiness",options:[k],subcommands:[{name:"check",description:"Check whether a provider is ready to use",options:[M,R,{name:"--json",description:"Print the result as JSON"},{name:"--credentials",description:"Emit the credential, or include it in JSON output"},{name:"--no-refresh",description:"Don't refresh expired OAuth credentials"}]},{name:"print-api-key",description:"Print a provider API key for an external client",options:[M,R]},{name:"print-bearer-token",description:"Print an OAuth bearer token (refreshes if expired)",options:[M,R,{name:"--min-expiry",description:"Refresh if the token expires sooner than this",args:{name:"duration",suggestions:["30m","1h"]}}]}]},{name:"mcp",description:"Manage MCP servers",options:[k],subcommands:[{name:"add",description:"Add or replace a server in mcp.json",args:[U,{name:"command",description:"Stdio server command (after --)",isOptional:!0,isCommand:!0}],options:[A,{name:"--url",description:"Streamable HTTP server URL (instead of a command)",args:{name:"url"}},{name:"--env",description:"Environment variable for a stdio server",isRepeatable:!0,args:{name:"KEY=VALUE"}},{name:"--cwd",description:"Working directory for a stdio server",args:{name:"dir",template:"folders"}},{name:"--header",description:"HTTP header",isRepeatable:!0,args:{name:"KEY=VALUE"}},{name:"--bearer-token-env-var",description:'Send "Authorization: Bearer ${NAME}"',args:{name:"NAME"}},{name:"--oauth-client-id",description:"Pre-registered OAuth client id",args:{name:"id"}},{name:"--oauth-client-secret",description:"OAuth client secret (may be ${NAME} or !command)",args:{name:"secret"}},{name:"--oauth-callback-port",description:"Fixed OAuth callback port",args:{name:"port"}},{name:"--oauth-client-name",description:"Client name sent when registering with the server",args:{name:"name"}},{name:"--oauth-client-registration",description:"OAuth client registration mode",args:{name:"mode",suggestions:["auto","cimd","dcr"]}},{name:"--exposure",description:"How the server's tools are exposed",args:{name:"mode",suggestions:["codemode","deferred","direct","hidden"]}},{name:"--description",description:"What the server offers, shown in the system prompt",args:{name:"text"}}]},{name:"remove",description:"Remove a server from mcp.json",args:U,options:[A]},{name:"list",description:"Show state, tools, and errors",options:[{name:"--json",description:"Print the list as JSON"}]},{name:"login",description:"Sign in through the browser",args:U,options:[A,{name:"--timeout",description:"Time limit for the whole sign-in (default: 300)",args:{name:"seconds"}}]},{name:"logout",description:"Delete the stored OAuth credentials",args:U,options:[A]}]}],options:[{...M,description:"Provider to search for --model (requires --model)"},{...R,description:'Model pattern or ID (supports "provider/id" and optional ":<thinking>")'},{name:"--api-key",description:"API key (defaults to env vars)",args:{name:"key"}},{name:"--system-prompt",description:"System prompt (default: coding assistant prompt)",args:{name:"text"}},{name:"--append-system-prompt",description:"Append text or file contents to the system prompt",isRepeatable:!0,args:{name:"text",template:"filepaths"}},{name:"--mode",description:"Output mode",args:{name:"mode",suggestions:[{name:"text",description:"Plain text output (default)"},{name:"json",description:"JSON event stream"},{name:"rpc",description:"RPC over stdin/stdout"}]}},{name:["-p","--print"],description:"Non-interactive mode: process prompt and exit",args:{name:"prompt",isOptional:!0}},{name:["-c","--continue"],description:"Continue the most recent session for the current directory"},{name:["-r","--resume"],description:"Pick a session to resume"},{name:"--session",description:"Open a session by file path or full/partial ID",args:{name:"path|id",template:"filepaths"}},{name:"--session-id",description:"Use the existing session with this ID, creating it otherwise",args:{name:"id"}},{name:"--fork",description:"Fork a session by file path or ID into the current directory",args:{name:"path|id",template:"filepaths"}},{name:"--session-dir",description:"Directory for session storage and lookup",args:{name:"dir",template:"folders"}},{name:"--no-session",description:"Don't save session (ephemeral)"},{name:["-n","--name"],description:"Set session display name",args:{name:"name"}},{name:"--models",description:"Comma-separated model patterns for Ctrl+P cycling",args:{name:"patterns"}},{name:["-nt","--no-tools"],description:"Disable all tools by default (built-in and extension)"},{name:["-nbt","--no-builtin-tools"],description:"Disable built-in tools but keep extension/custom tools"},{name:["-t","--tools"],description:"Comma-separated allowlist of tool names or patterns",args:{name:"tools",generators:(0,J.valueList)({values:oe})}},{name:["-xt","--exclude-tools"],description:"Comma-separated denylist of tool names or patterns",args:{name:"tools",generators:(0,J.valueList)({values:oe})}},{name:"--thinking",description:"Set thinking level",args:{name:"level",suggestions:["off","minimal","low","medium","high","xhigh","max"]}},{name:["-e","--extension"],description:"Load an extension file or builtin:<name>",isRepeatable:!0,args:{name:"path",template:"filepaths",suggestions:["builtin:codemode","builtin:llama.cpp","builtin:mcp","builtin:tool-search"]}},{name:["-ne","--no-extensions"],description:"Disable extension discovery and built-in extensions"},{name:"--no-mcp",description:"Disable built-in MCP support"},{name:"--skill",description:"Load a skill file or directory",isRepeatable:!0,args:{name:"path",template:"filepaths"}},{name:["-ns","--no-skills"],description:"Disable skills discovery and loading"},{name:"--prompt-template",description:"Load a prompt template file or directory",isRepeatable:!0,args:{name:"path",template:"filepaths"}},{name:["-np","--no-prompt-templates"],description:"Disable prompt template discovery and loading"},{name:"--theme",description:"Load a theme file or directory",isRepeatable:!0,args:{name:"path",template:"filepaths"}},{name:"--use-theme",description:"Set the initial interactive theme for this run",args:{name:"name[/name]",suggestions:["dark","light"]}},{name:"--no-themes",description:"Disable theme discovery and loading"},{name:["-nc","--no-context-files"],description:"Disable AGENTS.md and CLAUDE.md discovery and loading"},{name:"--export",description:"Export session file to HTML and exit",args:[{name:"file",template:"filepaths"},{name:"output",isOptional:!0,template:"filepaths"}]},{name:"--list-models",description:"List available models (with optional fuzzy search)",args:{name:"search",isOptional:!0}},{name:"--verbose",description:"Force verbose startup (overrides quietStartup setting)"},{name:"--tui-mode",description:"TUI mode",args:{name:"mode",suggestions:[{name:"fullscreen",description:"Fullscreen TUI (default)"},{name:"regular",description:"Regular inline TUI"}]}},...j,{name:"--offline",description:"Disable startup network operations (same as PI_OFFLINE=1)"},{name:["-h","--help"],description:"Show help"},{name:["-v","--version"],description:"Show version number"}],args:{name:"messages",description:"Prompt messages; prefix a path with @ to include the file",isOptional:!0,isVariadic:!0,template:"filepaths"}},Ue=Fe;export{Ue as default};
|
|
1
|
+
var re=Object.create;var K=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of le(t))!de.call(e,o)&&o!==n&&K(e,o,{get:()=>t[o],enumerable:!(i=ae(t,o))||i.enumerable});return e};var ue=(e,t,n)=>(n=e!=null?re(ce(e)):{},pe(t||!e||!e.__esModule?K(n,"default",{value:e,enumerable:!0}):n,e));var Q=j(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.shellExpand=I.ensureTrailingSlash=void 0;var me=e=>e.endsWith("/")?e:`${e}/`;I.ensureTrailingSlash=me;var fe=(e,t)=>e.startsWith("~")&&(e.length===1||e.charAt(1)==="/")?e.replace("~",t):e,ge=(e,t)=>e.replace(/\$([A-Za-z0-9_]+)/g,o=>{var s;let a=o.slice(1);return(s=t[a])!==null&&s!==void 0?s:o}).replace(/\$\{([A-Za-z0-9_]+)(?::-([^}]+))?\}/g,(o,s,a)=>{var c,d;return(d=(c=t[s])!==null&&c!==void 0?c:a)!==null&&d!==void 0?d:o}),he=(e,t)=>{var n;let{environmentVariables:i}=t;return ge(fe(e,(n=i?.HOME)!==null&&n!==void 0?n:"~"),i)};I.shellExpand=he});var G=j(b=>{"use strict";var ve=b&&b.__awaiter||function(e,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(r){try{l(i.next(r))}catch(p){a(p)}}function d(r){try{l(i.throw(r))}catch(p){a(p)}}function l(r){r.done?s(r.value):o(r.value).then(c,d)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0});b.filepaths=b.folders=b.getCurrentInsertedDirectory=void 0;b.sortFilesAlphabetically=B;var N=Q();function B(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,s)=>o.localeCompare(s)),...i.filter(o=>o.startsWith(".")).sort((o,s)=>o.localeCompare(s)),"../"]}var ye=(e,t,n)=>{if(e===null)return"/";let i=(0,N.shellExpand)(t,n),o=i.slice(0,i.lastIndexOf("/")+1);return o===""?(0,N.ensureTrailingSlash)(e):o.startsWith("/")?o:`${(0,N.ensureTrailingSlash)(e)}${o}`};b.getCurrentInsertedDirectory=ye;function L(e={}){let{extensions:t=[],equals:n=[],matches:i,filterFolders:o=!1,editFileSuggestions:s,editFolderSuggestions:a,rootDirectory:c,showFolders:d="always"}=e,l=new Set(t),r=new Set(n),p=()=>t.length>0||n.length>0||i,h=(m=[])=>p()?m.filter(({name:g="",type:O})=>{if(!o&&O==="folder"||r.has(g)||i&&g.match(i))return!0;let[,...u]=g.split(".");if(u.length>=1){let y=u.length-1,x=u[y];do{if(l.has(x))return!0;y-=1,x=[u[y],x].join(".")}while(y>=0)}return!1}):m,w=(m=[])=>!s&&!a?m:m.map(g=>Object.assign(Object.assign({},g),(g.type==="file"?s:a)||{}));return{trigger:(m,g)=>{let O=m.lastIndexOf("/"),u=g.lastIndexOf("/");return O!==u?!0:O===-1&&u===-1?!1:m.slice(0,O)!==g.slice(0,u)},getQueryTerm:m=>m.slice(m.lastIndexOf("/")+1),custom:(m,g,O)=>ve(this,void 0,void 0,function*(){var u;let{isDangerous:y,currentWorkingDirectory:x,searchTerm:f}=O,S=(u=(0,b.getCurrentInsertedDirectory)(c??x,f,O))!==null&&u!==void 0?u:"/";try{let $=yield g({command:"ls",args:["-1ApL"],cwd:S}),se=B($.stdout.split(`
|
|
2
|
+
`),[".DS_Store"]),H=[];for(let F of se)if(F){let E=F.endsWith("/")?"folders":"filepaths";(E==="filepaths"&&d!=="only"||E==="folders"&&d!=="never")&&H.push({type:E==="filepaths"?"file":"folder",name:F,insertValue:F,isDangerous:y,context:{templateType:E}})}return w(h(H))}catch{return[]}})}}b.folders=Object.assign(()=>L({showFolders:"only"}),Object.freeze(L({showFolders:"only"})));b.filepaths=Object.assign(L,Object.freeze(L()))});var ee=j(_=>{"use strict";var P=_&&_.__awaiter||function(e,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(r){try{l(i.next(r))}catch(p){a(p)}}function d(r){try{l(i.throw(r))}catch(p){a(p)}}function l(r){r.done?s(r.value):o(r.value).then(c,d)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(_,"__esModule",{value:!0});_.valueList=be;_.keyValue=Oe;_.keyValueList=xe;var X=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 Y(e,t,n){return P(this,void 0,void 0,function*(){if(typeof e=="function"){let i=yield e(...n);return q(t,i)}if(typeof e[0]=="string"){let i=e.map(o=>({name:o}));return q(t,i)}return q(t,e)})}function W(e,t,n,i){return P(this,void 0,void 0,function*(){if(n||Array.isArray(e)){let o=X.get(e);return o===void 0&&(o=yield Y(e,t,i),X.set(e,o)),o}return Y(e,t,i)})}function Z(e,t){return typeof t=="string"?e&&t==="keys"||!e&&t==="values":t}function C(e,...t){return Math.max(...t.map(n=>e.lastIndexOf(n)))}function z(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(s=>n.has(s)))})}function be({delimiter:e=",",values:t=[],cache:n=!1,insertDelimiter:i=!1,allowRepeatedValues:o=!1}){return{trigger:(s,a)=>s.lastIndexOf(e)!==a.lastIndexOf(e),getQueryTerm:s=>s.slice(s.lastIndexOf(e)+e.length),custom:(...s)=>P(this,void 0,void 0,function*(){var a;let c=yield W(t,i?e:"",n,s);if(o)return c;let[d]=s,l=(a=d[d.length-1])===null||a===void 0?void 0:a.split(e);return z(l,c)})}}function Oe({separator:e="=",keys:t=[],values:n=[],cache:i=!1,insertSeparator:o=!0}){return{trigger:(s,a)=>s.indexOf(e)!==a.indexOf(e),getQueryTerm:s=>s.slice(s.indexOf(e)+1),custom:(...s)=>P(this,void 0,void 0,function*(){let[a]=s,d=!a[a.length-1].includes(e),l=d?t:n,r=Z(d,i);return W(l,d&&o?e:"",r,s)})}}function xe({separator:e="=",delimiter:t=",",keys:n=[],values:i=[],cache:o=!1,insertSeparator:s=!0,insertDelimiter:a=!1,allowRepeatedKeys:c=!1,allowRepeatedValues:d=!0}){return{trigger:(l,r)=>{let p=C(l,e,t),h=C(r,e,t);return p!==h},getQueryTerm:l=>{let r=C(l,e,t);return l.slice(r+1)},custom:(...l)=>P(this,void 0,void 0,function*(){let[r]=l,p=r[r.length-1],h=C(p,e,t),w=h===-1||p.slice(h,h+e.length)!==e,m=w?n:i,g=Z(w,o),u=yield W(m,w?s?e:"":a?t:"",g,l);if(w){if(c)return u;let x=p.split(t).map(f=>f.slice(0,f.indexOf(e)));return z(x,u)}if(d)return u;let y=p.split(t).map(x=>x.slice(x.indexOf(e)+e.length));return z(y,u)})}}});var te=j(D=>{"use strict";var we=D&&D.__awaiter||function(e,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(r){try{l(i.next(r))}catch(p){a(p)}}function d(r){try{l(i.throw(r))}catch(p){a(p)}}function l(r){r.done?s(r.value):o(r.value).then(c,d)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(D,"__esModule",{value:!0});D.ai=Ie;var Se=4097,_e=4,ke=.8,Ae=Se*_e*ke;function Ie({name:e,prompt:t,message:n,postProcess:i,temperature:o,splitOn:s}){return{scriptTimeout:15e3,custom:(a,c,d)=>we(this,void 0,void 0,function*(){var l,r;let p=yield c({command:"fig",args:["settings","--format","json","autocomplete.ai.enabled"]});if(!JSON.parse(p.stdout))return[];let h=typeof t=="function"?yield t({tokens:a,executeCommand:c,generatorContext:d}):t,w=typeof n=="function"?yield n({tokens:a,executeCommand:c,generatorContext:d}):n;if(w===null||w.length===0)return console.warn("No message provided to AI generator"),[];let m=Ae-((l=h?.length)!==null&&l!==void 0?l:0),g={model:"gpt-3.5-turbo",source:"autocomplete",name:e,messages:[...h?[{role:"system",content:h}]:[],{role:"user",content:w.slice(0,m)}],temperature:o},O=JSON.stringify(g),u=yield c({command:"fig",args:["_","request","--route","/ai/chat","--method","POST","--body",O]}),y=JSON.parse(u.stdout);return(r=y?.choices.map(f=>{var S;return(S=f?.message)===null||S===void 0?void 0:S.content}).filter(f=>typeof f=="string").flatMap(f=>s?f.split(s).filter(S=>S.trim().length>0):[f]).map(f=>{if(i)return i(f);let S=f.trim().replace(/\n/g," ");return{icon:"\u{1FA84}",name:S,insertValue:`'${S}'`,description:"Generated by Fig AI"}}))!==null&&r!==void 0?r:[]})}}});var ie=j(v=>{"use strict";var Te=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]}),je=v&&v.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Te(t,e,n)};Object.defineProperty(v,"__esModule",{value:!0});v.ai=v.folders=v.filepaths=void 0;var ne=G();Object.defineProperty(v,"filepaths",{enumerable:!0,get:function(){return ne.filepaths}});Object.defineProperty(v,"folders",{enumerable:!0,get:function(){return ne.folders}});je(ee(),v);var Pe=te();Object.defineProperty(v,"ai",{enumerable:!0,get:function(){return Pe.ai}})});var J=ue(ie(),1),De=["amazon-bedrock","ant-ling","anthropic","azure","baseten","cerebras","cloudflare-ai-gateway","cloudflare-workers-ai","deepseek","fireworks","github-copilot","google","google-vertex","groq","huggingface","kimi-coding","meta","minimax","minimax-cn","mistral","moonshotai","moonshotai-cn","nvidia","openai","openai-codex","opencode","opencode-go","openrouter","qwen-token-plan","qwen-token-plan-cn","qwen-token-plan-individual","radius","together","typesafe","vercel-ai-gateway","xai","xiaomi","xiaomi-token-plan-ams","xiaomi-token-plan-cn","xiaomi-token-plan-sgp","zai","zai-coding-cn"],oe=[{name:"read",description:"Read file contents"},{name:"bash",description:"Execute bash commands"},{name:"powershell",description:"Execute PowerShell commands on Windows"},{name:"edit",description:"Edit files with find/replace"},{name:"write",description:"Write files (creates/overwrites)"},{name:"grep",description:"Search file contents (off by default)"},{name:"find",description:"Find files by glob pattern (off by default)"},{name:"ls",description:"List directory contents (off by default)"},{name:"codemode",description:"Codemode tool (built-in extension)"}],k={name:["-h","--help"],description:"Show help for this command"},A={name:["-l","--local"],description:"Use project settings (.pi/) instead of global settings"},T=[{name:["-a","--approve"],description:"Trust project-local files for this run"},{name:["-na","--no-approve"],description:"Ignore project-local files for this run"}],M={name:"--provider",description:"Provider to use",args:{name:"provider",suggestions:De}},R={name:"--model",description:'Model pattern or ID (supports "provider/id")',args:{name:"pattern"}},U={name:"source",description:"Package source (npm:<pkg>, git:<repo>, URL, or local path)",template:"filepaths"},V={name:"server",description:"MCP server name"},Fe={name:"pi",description:"AI coding agent with read, bash, edit, write tools",subcommands:[{name:"install",description:"Install extension source and add to settings",args:U,options:[A,...T,k]},{name:["remove","uninstall"],description:"Remove extension source from settings",args:U,options:[A,...T,k]},{name:"update",description:"Update pi, extensions, or model catalogs",args:{...U,isOptional:!0,suggestions:[{name:"pi",description:"Update pi only"},{name:"self",description:"Update pi only (alias for pi)"}]},options:[{name:"--self",description:"Update pi only (default when no target is given)"},{name:"--extensions",description:"Update installed packages only"},{name:"--models",description:"Refresh model catalogs only"},{name:"--all",description:"Update pi and installed packages"},{name:"--extension",description:"Update one package only",args:U},...T,{name:"--force",description:"Reinstall pi even if the current version is latest"},k]},{name:"list",description:"List installed extensions from settings",options:[...T,k]},{name:"config",description:"Open TUI to enable/disable package resources",options:[{...A,description:"Edit project overrides (.pi/)"},...T,k]},{name:"auth",description:"Print credentials or check provider readiness",options:[k],subcommands:[{name:"check",description:"Check whether a provider is ready to use",options:[M,R,{name:"--json",description:"Print the result as JSON"},{name:"--credentials",description:"Emit the credential, or include it in JSON output"},{name:"--no-refresh",description:"Don't refresh expired OAuth credentials"}]},{name:"print-api-key",description:"Print a provider API key for an external client",options:[M,R]},{name:"print-bearer-token",description:"Print an OAuth bearer token (refreshes if expired)",options:[M,R,{name:"--min-expiry",description:"Refresh if the token expires sooner than this",args:{name:"duration",suggestions:["30m","1h"]}}]}]},{name:"mcp",description:"Manage MCP servers",options:[k],subcommands:[{name:"add",description:"Add or replace a server in mcp.json",args:[V,{name:"command",description:"Stdio server command (after --)",isOptional:!0,isCommand:!0}],options:[A,{name:"--url",description:"Streamable HTTP server URL (instead of a command)",args:{name:"url"}},{name:"--env",description:"Environment variable for a stdio server",isRepeatable:!0,args:{name:"KEY=VALUE"}},{name:"--cwd",description:"Working directory for a stdio server",args:{name:"dir",template:"folders"}},{name:"--header",description:"HTTP header",isRepeatable:!0,args:{name:"KEY=VALUE"}},{name:"--bearer-token-env-var",description:'Send "Authorization: Bearer ${NAME}"',args:{name:"NAME"}},{name:"--oauth-client-id",description:"Pre-registered OAuth client id",args:{name:"id"}},{name:"--oauth-client-secret",description:"OAuth client secret (may be ${NAME} or !command)",args:{name:"secret"}},{name:"--oauth-callback-port",description:"Fixed OAuth callback port",args:{name:"port"}},{name:"--oauth-client-name",description:"Client name sent when registering with the server",args:{name:"name"}},{name:"--oauth-client-registration",description:"OAuth client registration mode",args:{name:"mode",suggestions:["auto","cimd","dcr"]}},{name:"--exposure",description:"How the server's tools are exposed",args:{name:"mode",suggestions:["codemode","deferred","direct","hidden"]}},{name:"--description",description:"What the server offers, shown in the system prompt",args:{name:"text"}}]},{name:"remove",description:"Remove a server from mcp.json",args:V,options:[A]},{name:"list",description:"Show state, tools, and errors",options:[{name:"--json",description:"Print the list as JSON"}]},{name:"login",description:"Sign in through the browser",args:V,options:[A,{name:"--timeout",description:"Time limit for the whole sign-in (default: 300)",args:{name:"seconds"}}]},{name:"logout",description:"Delete the stored OAuth credentials",args:V,options:[A]}]}],options:[{...M,description:"Provider to search for --model (requires --model)"},{...R,description:'Model pattern or ID (supports "provider/id" and optional ":<thinking>")'},{name:"--api-key",description:"API key (defaults to env vars)",args:{name:"key"}},{name:"--system-prompt",description:"System prompt (default: coding assistant prompt)",args:{name:"text"}},{name:"--append-system-prompt",description:"Append text or file contents to the system prompt",isRepeatable:!0,args:{name:"text",template:"filepaths"}},{name:"--mode",description:"Output mode",args:{name:"mode",suggestions:[{name:"text",description:"Plain text output (default)"},{name:"json",description:"JSON event stream"},{name:"rpc",description:"RPC over stdin/stdout"}]}},{name:["-p","--print"],description:"Non-interactive mode: process prompt and exit",args:{name:"prompt",isOptional:!0}},{name:["-c","--continue"],description:"Continue the most recent session for the current directory"},{name:["-r","--resume"],description:"Pick a session to resume"},{name:"--session",description:"Open a session by file path or full/partial ID",args:{name:"path|id",template:"filepaths"}},{name:"--session-id",description:"Use the existing session with this ID, creating it otherwise",args:{name:"id"}},{name:"--fork",description:"Fork a session by file path or ID into the current directory",args:{name:"path|id",template:"filepaths"}},{name:"--session-dir",description:"Directory for session storage and lookup",args:{name:"dir",template:"folders"}},{name:"--no-session",description:"Don't save session (ephemeral)"},{name:["-n","--name"],description:"Set session display name",args:{name:"name"}},{name:"--models",description:"Comma-separated model patterns for Ctrl+P cycling",args:{name:"patterns"}},{name:["-nt","--no-tools"],description:"Disable all tools by default (built-in and extension)"},{name:["-nbt","--no-builtin-tools"],description:"Disable built-in tools but keep extension/custom tools"},{name:["-t","--tools"],description:"Comma-separated allowlist of tool names or patterns",args:{name:"tools",generators:(0,J.valueList)({values:oe})}},{name:["-xt","--exclude-tools"],description:"Comma-separated denylist of tool names or patterns",args:{name:"tools",generators:(0,J.valueList)({values:oe})}},{name:"--thinking",description:"Set thinking level",args:{name:"level",suggestions:["off","minimal","low","medium","high","xhigh","max"]}},{name:["-e","--extension"],description:"Load an extension file or builtin:<name>",isRepeatable:!0,args:{name:"path",template:"filepaths",suggestions:["builtin:codemode","builtin:llama.cpp","builtin:mcp","builtin:tool-search"]}},{name:["-ne","--no-extensions"],description:"Disable extension discovery and built-in extensions"},{name:"--no-mcp",description:"Disable built-in MCP support"},{name:"--skill",description:"Load a skill file or directory",isRepeatable:!0,args:{name:"path",template:"filepaths"}},{name:["-ns","--no-skills"],description:"Disable skills discovery and loading"},{name:"--prompt-template",description:"Load a prompt template file or directory",isRepeatable:!0,args:{name:"path",template:"filepaths"}},{name:["-np","--no-prompt-templates"],description:"Disable prompt template discovery and loading"},{name:"--theme",description:"Load a theme file or directory",isRepeatable:!0,args:{name:"path",template:"filepaths"}},{name:"--use-theme",description:"Set the initial interactive theme for this run",args:{name:"name[/name]",suggestions:["dark","light"]}},{name:"--no-themes",description:"Disable theme discovery and loading"},{name:["-nc","--no-context-files"],description:"Disable AGENTS.md and CLAUDE.md discovery and loading"},{name:"--export",description:"Export session file to HTML and exit",args:[{name:"file",template:"filepaths"},{name:"output",isOptional:!0,template:"filepaths"}]},{name:"--list-models",description:"List available models (with optional fuzzy search)",args:{name:"search",isOptional:!0}},{name:"--verbose",description:"Force verbose startup (overrides quietStartup setting)"},{name:"--tui-mode",description:"TUI mode",args:{name:"mode",suggestions:[{name:"fullscreen",description:"Fullscreen TUI (default)"},{name:"regular",description:"Regular inline TUI"}]}},...T,{name:"--offline",description:"Disable startup network operations (same as PI_OFFLINE=1)"},{name:["-h","--help"],description:"Show help"},{name:["-v","--version"],description:"Show version number"}],args:{name:"messages",description:"Prompt messages; prefix a path with @ to include the file",isOptional:!0,isVariadic:!0,template:"filepaths"}},Ve=Fe;export{Ve as default};
|