@aventurevc/mcp-server 0.8.228 → 0.8.230

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.
@@ -1 +1 @@
1
- import{d as e}from"./tool-policy-NZK3f-HT.js";function t(t,n,r,i){let a=t===`array`?n:t,o=t===`array`?`...`:``;return r===`uuid`||r===`date-time`||r===`date`?`${r}${o}`:a===`boolean`?`true|false${o}`:a===`integer`||a===`number`?`${a}${o}`:`${e(i)}${o}`}function n(e,t){let n=s(e);if(t===void 0||t.length===0)return n;let r=`Allowed values: ${t.join(`, `)}`;return n===``?`${r}.`:`${n} ${r}.`}var r={path:{heading:`Path parameters:`,rank:0},header:{heading:`Request headers:`,rank:1},input:{heading:`Input:`,rank:2},body:{heading:`Body fields:`,rank:3},option:{heading:`Options:`,rank:1/0}};function i(e){return o(e).rank}function a(e){return o(e).heading}function o(e){return e.location===`path`?r.path:e.location===`header`?r.header:e.inputType===`file`||e.schemaFormat===`binary`?r.input:e.location===`body`?r.body:r.option}var s=e=>e===``||/[.!?]$/u.test(e)?e:`${e}.`,c={researchData:{heading:`Research data commands:`,rank:0},account:{heading:`Account commands:`,rank:1},administration:{heading:`Administration commands:`,rank:2},cli:{heading:`CLI commands:`,rank:3}};function l(e,t){return e!==void 0&&u(e,t)===`administration`}function u(e,t){return t?.[e]?.section??d[e]}var d={app:`account`,auth:`account`,entities:`researchData`,people:`researchData`,enrichments:`researchData`,news:`researchData`,search:`researchData`,directory:`researchData`,resolve:`researchData`,lookup:`researchData`,"lookup-jobs":`researchData`,"lookup-mentions":`researchData`,"research-runs":`researchData`,provenance:`administration`,billing:`account`,harness:`administration`,jobs:`administration`,operations:`administration`,metrics:`cli`,inference:`administration`,web:`researchData`,contacts:`administration`,"url-types":`researchData`,"unique-ids":`researchData`,research:`administration`,status:`cli`,agents:`cli`,help:`cli`},f=new Set([`metrics`]);export{n as a,a as c,u as i,s as l,f as n,t as o,l as r,i as s,c as t};
1
+ import{d as e}from"./tool-policy-BjOSkLem.js";function t(t,n,r,i){let a=t===`array`?n:t,o=t===`array`?`...`:``;return r===`uuid`||r===`date-time`||r===`date`?`${r}${o}`:a===`boolean`?`true|false${o}`:a===`integer`||a===`number`?`${a}${o}`:`${e(i)}${o}`}function n(e,t){let n=s(e);if(t===void 0||t.length===0)return n;let r=`Allowed values: ${t.join(`, `)}`;return n===``?`${r}.`:`${n} ${r}.`}var r={path:{heading:`Path parameters:`,rank:0},header:{heading:`Request headers:`,rank:1},input:{heading:`Input:`,rank:2},body:{heading:`Body fields:`,rank:3},option:{heading:`Options:`,rank:1/0}};function i(e){return o(e).rank}function a(e){return o(e).heading}function o(e){return e.location===`path`?r.path:e.location===`header`?r.header:e.inputType===`file`||e.schemaFormat===`binary`?r.input:e.location===`body`?r.body:r.option}var s=e=>e===``||/[.!?]$/u.test(e)?e:`${e}.`,c={researchData:{heading:`Research data commands:`,rank:0},account:{heading:`Account commands:`,rank:1},administration:{heading:`Administration commands:`,rank:2},cli:{heading:`CLI commands:`,rank:3}};function l(e,t){return e!==void 0&&u(e,t)===`administration`}function u(e,t){return t?.[e]?.section??d[e]}var d={app:`account`,auth:`account`,entities:`researchData`,people:`researchData`,enrichments:`researchData`,news:`researchData`,search:`researchData`,directory:`researchData`,resolve:`researchData`,lookup:`researchData`,"lookup-jobs":`researchData`,"lookup-mentions":`researchData`,"research-runs":`researchData`,provenance:`administration`,billing:`account`,harness:`administration`,jobs:`administration`,operations:`administration`,metrics:`cli`,inference:`administration`,web:`researchData`,contacts:`administration`,"url-types":`researchData`,"unique-ids":`researchData`,research:`administration`,status:`cli`,agents:`cli`,help:`cli`},f=new Set([`metrics`]);export{n as a,a as c,u as i,s as l,f as n,t as o,l as r,i as s,c as t};
@@ -14,6 +14,6 @@ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._life
14
14
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(r.existsSync(e))return;let i=`'${e}' does not exist
15
15
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
16
16
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
17
- - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(i)}_executeSubCommand(e,a){a=a.slice();let s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let i=n.resolve(e,t);if(r.existsSync(i))return i;if(s.includes(n.extname(t)))return;let a=s.find(e=>r.existsSync(`${i}${e}`));if(a)return`${i}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||``;if(this._scriptPath){let e;try{e=r.realpathSync(this._scriptPath)}catch{e=this._scriptPath}u=n.resolve(n.dirname(e),u)}if(u){let t=c(u,l);if(!t&&!e._executableFile&&this._scriptPath){let r=n.basename(this._scriptPath,n.extname(this._scriptPath));r!==this._name&&(t=c(u,`${r}-${e._name}`))}l=t||l}let d=s.includes(n.extname(l)),f;i.platform===`win32`?(this._checkForMissingExecutable(l,u,e._name),a.unshift(l),a=y(i.execArgv).concat(a),f=t.spawn(i.execPath,a,{stdio:`inherit`})):d?(a.unshift(l),a=y(i.execArgv).concat(a),f=t.spawn(i.argv[0],a,{stdio:`inherit`})):f=t.spawn(l,a,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{i.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new o(e,`commander.executeSubCommandAsync`,`(close)`)):i.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(l,u,e._name);else if(t.code===`EACCES`)throw Error(`'${l}' not executable`);if(!p)i.exit(1);else{let e=new o(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
17
+ - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(i)}_executeSubCommand(e,a){a=a.slice();let s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let i=n.resolve(e,t);if(r.existsSync(i))return i;if(s.includes(n.extname(t)))return;let a=s.find(e=>r.existsSync(`${i}${e}`));if(a)return`${i}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||``;if(this._scriptPath){let e;try{e=r.realpathSync(this._scriptPath)}catch{e=this._scriptPath}u=n.resolve(n.dirname(e),u)}if(u){let t=c(u,l);if(!t&&!e._executableFile&&this._scriptPath){let r=n.basename(this._scriptPath,n.extname(this._scriptPath));r!==this._name&&(t=c(u,`${r}-${e._name}`))}l=t||l}let d=s.includes(n.extname(l)),f;i.platform===`win32`?(this._checkForMissingExecutable(l,u,e._name),a.unshift(l),a=y(i.execArgv).concat(a),f=t.spawn(i.execPath,a,{stdio:`inherit`})):d?(a.unshift(l),a=y(i.execArgv).concat(a),f=t.spawn(i.argv[0],a,{stdio:`inherit`})):f=t.spawn(l,a,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{i.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new o(e,`commander.executeSubCommandAsync`,`(close)`)):i.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(l,u,e._name);else if(t.code===`EACCES`)throw Error(`'${l}' not executable`);if(!p)i.exit(1);else{let e=new o(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l)))this.emit(`option:${o.name()}`,l);else{if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
18
18
  `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in i.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,i.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new f(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=_(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=e.length,i=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${r}: ${e.join(`, `)}.`;this.error(i,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=_(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>l(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=n.basename(e,n.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(i.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
19
19
  Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function y(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function b(){if(i.env.NO_COLOR||i.env.FORCE_COLOR===`0`||i.env.FORCE_COLOR===`false`)return!1;if(i.env.FORCE_COLOR||i.env.CLICOLOR_FORCE!==void 0)return!0}new v;export{o as a,c as i,d as n,s as o,u as r,v as t};
@@ -1,6 +1,6 @@
1
- import{n as e}from"./commander-BB7CDPLs.js";import{c as t,f as n,i as r,l as i,m as a,n as o,o as s,s as c,u as l,w as u}from"./tool-policy-NZK3f-HT.js";import{C as d,O as f,T as p,i as m,l as h,n as g,o as _,p as v,t as ee,u as y,v as b,w as x,y as S}from"./person-owner-BJgNYLKX.js";import{Br as te,Gr as C,Hr as ne,Ur as re,Vr as ie,Wr as ae,Yr as oe,zr as se}from"./dist-OKMe67Ss.js";import{c as ce,i as le,p as ue,r as w}from"./result-envelope-P63eZxlW.js";import{a as de}from"./package-DPDX5zmx.js";import{a as T,c as fe,i as pe,l as me,n as E,r as he,s as D,t as ge}from"./text-field-jFKOGMzr.js";import{A as _e,C as ve,D as ye,E as be,O as xe,S as Se,T as O,_ as Ce,a as we,b as Te,c as Ee,d as De,f as Oe,g as ke,h as Ae,i as je,j as Me,k as Ne,l as Pe,m as Fe,n as Ie,o as Le,p as Re,r as ze,s as Be,t as Ve,u as He,v as Ue,w as We,x as Ge,y as Ke}from"./detail-BsTee2g2.js";import{a as qe,o as Je}from"./cli-help-policy-DQmyRbFU.js";import{Buffer as Ye}from"node:buffer";var k=_([`HIGH`,`MEDIUM`,`LOW`]),Xe=_([`PAID_PLAN`,`DAILY_ALLOWANCE`]),Ze=_([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),Qe=Object.assign(p([Ze,x()]),{enum:Ze.enum}),$e=S({billingAccess:Xe.nullish(),excerpt:x(),sourceId:x(),sourceType:Qe,sourceVersion:x().nullish()}),et=S({instruction:x(),operationId:x(),planTaskKey:h(x()).optional(),stepKey:x().optional()}),tt=S({body:x(),expectation:x(),method:h(x()),override:x(),reject:h(x()),typeCatalog:x()}),nt=S({cliCommand:x(),mcpTool:x().nullish(),step:et,writeGuidance:tt.nullish()}),rt=_([`ENTITY`,`TEXT`,`WRITER_BRIEF`]),it=Object.assign(p([rt,x()]),{enum:rt.enum}),at=S({allowedValue:x().nullish(),description:x(),key:x(),required:y().default(!0).optional(),type:it}),ot=S({catalogRevision:v().optional(),gateId:h(x()).optional(),input:h(at),step:h(nt),taskKey:x().optional()}),A=_([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),st=S({candidate:h($e),operationId:x().nullish(),outcome:A,probability:b().nullish(),taskKey:x().nullish(),taskPlan:ot.nullish()}),ct=S({answer:x(),citation:h($e),confidence:k,resolution:st.nullish()});function j(e,t,n=t.inputName){if(t.in===`body`)return n;let r=bt.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?yt(gt(n!==`id`&&n!==`slug`?n:`${ft(e.path)}${ht(n)}`),t):r.inputName}function lt(e,t,n=mt(e)){return ut(pt(e,t),new Set(n))}function ut(e,t){if(!t.has(e))return e;let n=`body${ht(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function dt(e,t,n){return`${e}[${t}].${n}`}function ft(e){return xt.find(([,t])=>t.test(e))?.[0]??`record`}function pt(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=_t(t);return yt(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?gt(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function mt(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>j(e,t)))}function ht(e){return e.replace(/^./u,e=>e.toUpperCase())}function gt(e){return e.replace(/^addressAddress/u,`address`).replace(/^arrayFilterAmountInvestedRange/u,`fundraiseAmountInvestedRange`).replace(/^arrayFilterAmountRaisedRange/u,`fundraiseAmountRaisedRange`).replace(/^arrayFilterEntityName$/u,`entityName`).replace(/^arrayFilterInvestedCompany$/u,`fundraiseInvestedCompanyName`).replace(/^arrayFilterPersonTitle$/u,`personTitle`).replace(/^arrayFilterRound$/u,`fundraiseRound`).replace(/^arrayFilterTotalInvestmentCount/u,`totalInvestmentCount`).replace(/^arrayFilterTypeRecord$/u,`typeRecord`).replace(/^createEntity/u,`entity`).replace(/^createUrlLink/u,`urlLink`).replace(/^fundraiseActivity/u,`fundraise`).replace(/FundraiseActivity/gu,`Fundraise`).replace(/^logoOption/u,`logo`).replace(/LogoOption/gu,`Logo`).replace(/^researchDetailTypeResearchDetail$/u,`researchDetailType`).replace(/^researchDetailValueResearchDetail$/u,`researchDetailValue`).replace(/^textText$/u,`text`).replace(/^textTextName$/u,`textName`).replace(/^textTextType$/u,`textType`)}function _t(e){let t=gt(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?vt(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function vt(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function yt(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var bt=[{name:`detailId`,path:`/research-details/{detailId}`,inputName:`researchDetailId`},{name:`version`,path:`/instructions/`,inputName:`instructionVersion`},{name:`detailId`,path:`/financial/valuation/{detailId}`,inputName:`valuationDetailId`},{name:`joinId`,path:`/fundraise-investor-joins`,inputName:`fundraiseInvestorJoinId`}],xt=[[`entity`,/^\/v1\/entities(?:$|\/detail|\/lookup|\/summary|\/duplicate-check)/u],[`person`,/^\/v1\/people(?:\/detail|\/lookup|\/duplicate-check|\/\{slug\})/u],[`news`,/^\/v1\/(?:news\/|jobs\/news\/)/u],[`screenshot`,/^\/v1\/media\/screenshots\//u],[`media`,/^\/v1\/media/u],[`article`,/^\/v1\/app\/blog\/articles/u],[`page`,/^\/v1\/app\/pages/u],[`contact`,/^\/v1\/contacts\//u],[`provenance`,/^\/v1\/provenance\//u],[`location`,/^\/v1\/addresses\/locations\//u]];function St(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>Ct(t,j(e,t))),r=(t?.parameter??[]).map(t=>Ct(t,lt(e,t)));return{selector:n.filter(e=>e.location===`path`||wt(e)),pagination:n.filter(Tt),filter:[...n.filter(Et),...r.filter(Et)],body:r.filter(e=>!Et(e))}}function Ct(e,t){let{in:n,inputName:r,...i}=e;return{...i,flag:s(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function wt(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function Tt(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function Et(e){return e.location!==`path`&&!wt(e)&&!Tt(e)}function Dt(e){return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,scope:e.projection.scope,requiredInput:jt(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]}}function Ot(e,t){let n=e.requestBody?.[0],r=Dt(e),i=Nt(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:St(e)}:{...r,optionalInput:Mt(e),arrayInput:Pt(e),...i===void 0?{}:{paidPlan:i}}}function kt(e){let t=St(e),n=e=>e.filter(e=>e.required);return{...Ot(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function At(e){let{cli:t,scope:n,...r}=Dt(e),i=Nt(e);return{...r,...i===void 0?{}:{paidPlan:i},optionalDetailOmitted:!0}}function jt(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function Mt(e){let t=e.requestBody?.[0],n=new Set(t?.requiredPath??[]);return{query:e.parameter.filter(e=>e.in===`query`&&!e.required).map(({name:e})=>e),body:(t?.parameter??[]).filter(({name:e})=>!n.has(e)).map(({name:e})=>e)}}function Nt(e){return e.response.find(({status:e})=>e===`402`)?.description}function Pt(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var Ft=160,M=`Operation catalog matches`,It=[`whole`,`described`,`requiredDescribed`,`optionalNamed`],Lt=e=>`${[M,...e].join(`
1
+ import{n as e}from"./commander-DEj7N1b9.js";import{c as t,f as n,i as r,l as i,m as a,n as o,o as s,s as c,u as l,w as u}from"./tool-policy-BjOSkLem.js";import{C as d,O as f,T as p,i as m,l as h,n as g,o as _,p as v,t as ee,u as y,v as b,w as x,y as S}from"./person-owner-C0YuWKvY.js";import{Br as te,Gr as C,Hr as ne,Ur as re,Vr as ie,Wr as ae,Yr as oe,zr as se}from"./dist-BU_vrwZi.js";import{c as ce,i as le,p as ue,r as w}from"./result-envelope-BKQSGfkH.js";import{a as de}from"./package-DPDX5zmx.js";import{a as T,c as fe,i as pe,l as me,n as E,r as he,s as D,t as ge}from"./text-field-jFKOGMzr.js";import{A as _e,C as ve,D as ye,E as be,O as xe,S as Se,T as O,_ as Ce,a as we,b as Te,c as Ee,d as De,f as Oe,g as ke,h as Ae,i as je,j as Me,k as Ne,l as Pe,m as Fe,n as Ie,o as Le,p as Re,r as ze,s as Be,t as Ve,u as He,v as Ue,w as We,x as Ge,y as Ke}from"./detail-BTjlqGmV.js";import{a as qe,o as Je}from"./cli-help-policy-BfaoryK2.js";import{Buffer as Ye}from"node:buffer";var k=_([`HIGH`,`MEDIUM`,`LOW`]),Xe=_([`PAID_PLAN`,`DAILY_ALLOWANCE`]),Ze=_([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),Qe=Object.assign(p([Ze,x()]),{enum:Ze.enum}),$e=S({billingAccess:Xe.nullish(),excerpt:x(),sourceId:x(),sourceType:Qe,sourceVersion:x().nullish()}),et=S({instruction:x(),operationId:x(),planTaskKey:h(x()).optional(),stepKey:x().optional()}),tt=S({body:x(),expectation:x(),method:h(x()),override:x(),reject:h(x()),typeCatalog:x()}),nt=S({cliCommand:x(),mcpTool:x().nullish(),step:et,writeGuidance:tt.nullish()}),rt=_([`ENTITY`,`TEXT`,`WRITER_BRIEF`]),it=Object.assign(p([rt,x()]),{enum:rt.enum}),at=S({allowedValue:x().nullish(),description:x(),key:x(),required:y().default(!0).optional(),type:it}),ot=S({catalogRevision:v().optional(),gateId:h(x()).optional(),input:h(at),step:h(nt),taskKey:x().optional()}),A=_([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),st=S({candidate:h($e),operationId:x().nullish(),outcome:A,probability:b().nullish(),taskKey:x().nullish(),taskPlan:ot.nullish()}),ct=S({answer:x(),citation:h($e),confidence:k,resolution:st.nullish()});function j(e,t,n=t.inputName){if(t.in===`body`)return n;let r=bt.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?yt(gt(n!==`id`&&n!==`slug`?n:`${ft(e.path)}${ht(n)}`),t):r.inputName}function lt(e,t,n=mt(e)){return ut(pt(e,t),new Set(n))}function ut(e,t){if(!t.has(e))return e;let n=`body${ht(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function dt(e,t,n){return`${e}[${t}].${n}`}function ft(e){return xt.find(([,t])=>t.test(e))?.[0]??`record`}function pt(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=_t(t);return yt(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?gt(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function mt(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>j(e,t)))}function ht(e){return e.replace(/^./u,e=>e.toUpperCase())}function gt(e){return e.replace(/^addressAddress/u,`address`).replace(/^arrayFilterAmountInvestedRange/u,`fundraiseAmountInvestedRange`).replace(/^arrayFilterAmountRaisedRange/u,`fundraiseAmountRaisedRange`).replace(/^arrayFilterEntityName$/u,`entityName`).replace(/^arrayFilterInvestedCompany$/u,`fundraiseInvestedCompanyName`).replace(/^arrayFilterPersonTitle$/u,`personTitle`).replace(/^arrayFilterRound$/u,`fundraiseRound`).replace(/^arrayFilterTotalInvestmentCount/u,`totalInvestmentCount`).replace(/^arrayFilterTypeRecord$/u,`typeRecord`).replace(/^createEntity/u,`entity`).replace(/^createUrlLink/u,`urlLink`).replace(/^fundraiseActivity/u,`fundraise`).replace(/FundraiseActivity/gu,`Fundraise`).replace(/^logoOption/u,`logo`).replace(/LogoOption/gu,`Logo`).replace(/^researchDetailTypeResearchDetail$/u,`researchDetailType`).replace(/^researchDetailValueResearchDetail$/u,`researchDetailValue`).replace(/^textText$/u,`text`).replace(/^textTextName$/u,`textName`).replace(/^textTextType$/u,`textType`)}function _t(e){let t=gt(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?vt(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function vt(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function yt(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var bt=[{name:`detailId`,path:`/research-details/{detailId}`,inputName:`researchDetailId`},{name:`version`,path:`/instructions/`,inputName:`instructionVersion`},{name:`detailId`,path:`/financial/valuation/{detailId}`,inputName:`valuationDetailId`},{name:`joinId`,path:`/fundraise-investor-joins`,inputName:`fundraiseInvestorJoinId`}],xt=[[`entity`,/^\/v1\/entities(?:$|\/detail|\/lookup|\/summary|\/duplicate-check)/u],[`person`,/^\/v1\/people(?:\/detail|\/lookup|\/duplicate-check|\/\{slug\})/u],[`news`,/^\/v1\/(?:news\/|jobs\/news\/)/u],[`screenshot`,/^\/v1\/media\/screenshots\//u],[`media`,/^\/v1\/media/u],[`article`,/^\/v1\/app\/blog\/articles/u],[`page`,/^\/v1\/app\/pages/u],[`contact`,/^\/v1\/contacts\//u],[`provenance`,/^\/v1\/provenance\//u],[`location`,/^\/v1\/addresses\/locations\//u]];function St(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>Ct(t,j(e,t))),r=(t?.parameter??[]).map(t=>Ct(t,lt(e,t)));return{selector:n.filter(e=>e.location===`path`||wt(e)),pagination:n.filter(Tt),filter:[...n.filter(Et),...r.filter(Et)],body:r.filter(e=>!Et(e))}}function Ct(e,t){let{in:n,inputName:r,...i}=e;return{...i,flag:s(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function wt(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function Tt(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function Et(e){return e.location!==`path`&&!wt(e)&&!Tt(e)}function Dt(e){return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,scope:e.projection.scope,requiredInput:jt(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]}}function Ot(e,t){let n=e.requestBody?.[0],r=Dt(e),i=Nt(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:St(e)}:{...r,optionalInput:Mt(e),arrayInput:Pt(e),...i===void 0?{}:{paidPlan:i}}}function kt(e){let t=St(e),n=e=>e.filter(e=>e.required);return{...Ot(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function At(e){let{cli:t,scope:n,...r}=Dt(e),i=Nt(e);return{...r,...i===void 0?{}:{paidPlan:i},optionalDetailOmitted:!0}}function jt(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function Mt(e){let t=e.requestBody?.[0],n=new Set(t?.requiredPath??[]);return{query:e.parameter.filter(e=>e.in===`query`&&!e.required).map(({name:e})=>e),body:(t?.parameter??[]).filter(({name:e})=>!n.has(e)).map(({name:e})=>e)}}function Nt(e){return e.response.find(({status:e})=>e===`402`)?.description}function Pt(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var Ft=160,M=`Operation catalog matches`,It=[`whole`,`described`,`requiredDescribed`,`optionalNamed`],Lt=e=>`${[M,...e].join(`
2
2
  `)}\n`;function Rt(e,t=[]){if(!Array.isArray(e)||e.length===0||!e.every(Ut))return null;let n=e,r=e=>ne([M,...e,...t]);for(let e of It){let t=[...n.flatMap(t=>Vt(t,e)),...Bt(n,e)];if(r(t))return Lt(t)}let i=e=>[...n.slice(0,e).flatMap(e=>Vt(e,`optionalNamed`)),...Bt(n.slice(0,e),`optionalNamed`),`... ${n.length-e} more operations omitted to fit ${se} UTF-8 bytes: ${n.slice(e).map(({operationId:e})=>e).join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`];return Lt(i([...n.keys()].findLast(e=>e>0&&r(i(e)))??1))}var zt=`call aventure_help with q=<operationId> and limit=1; inspect structuredContent.data argument and optionalInput for the retained inputs`;function Bt(e,t){let n=e.flatMap(e=>`argument`in e?Object.values(e.argument).flat():[]),r=t===`whole`?0:n.filter(e=>e.description.length>Ft&&(t===`described`||e.required)).length,i=r===0?[]:[`... ${r} argument descriptions shortened; inspect structuredContent.data[].argument for full descriptions.`];if(e.some(e=>`optionalDetailOmitted`in e))return[...i,e.some(e=>`argument`in e)?`... optional argument details omitted: the full list exceeds the result cap; ${zt}.`:`... optional inputs omitted: the full list exceeds the result cap; call aventure_help with q=<operationId> and limit=1 to read one operation's inputs.`];if(t===`whole`||!e.some(e=>`argument`in e))return[];if(t===`described`)return i;let a=t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`,o=n.filter(({required:e})=>!e).length;return[...i,`... ${o} ${a} omitted to fit ${se} UTF-8 bytes; structuredContent carries them, and ${zt}.`]}function Vt(e,t){let n=`argument`in e?Object.values(e.argument).flat():[],r=n.filter(({required:e})=>!e).map(({name:e})=>e);return[`${e.operationId} ${e.method} ${e.path} (aventure_${e.intent})`,` ${e.summary}`,` required: ${e.requiredInput.length===0?`none`:e.requiredInput.join(`, `)}`,` responseContentType: ${e.responseContentType.length===0?`none`:e.responseContentType.join(`, `)}`,...`optionalInput`in e?Object.entries(e.optionalInput).filter(([,e])=>e.length>0).map(([e,t])=>` optional ${e}: ${t.join(`, `)}`):[],...`arrayInput`in e&&e.arrayInput.length>0?[` JSON array inputs: ${e.arrayInput.join(`, `)}`]:[],...`paidPlan`in e&&e.paidPlan!==void 0?[` paid plan: ${e.paidPlan}`]:[],...n.filter(({required:e})=>e||t!==`optionalNamed`).map(e=>Ht(e,e.required||t!==`requiredDescribed`,t)),...t===`optionalNamed`&&r.length>0?[` optional inputs: ${r.join(`, `)}`]:[]]}function Ht(e,t,n){let r=[e.location,e.required?`required`:void 0,e.schemaType,e.schemaFormat,e.schemaEnum===void 0?void 0:`choices: ${e.schemaEnum.join(`, `)}`,e.itemSchemaEnum===void 0?void 0:`item choices: ${e.itemSchemaEnum.join(`, `)}`,e.schemaDefault===void 0?void 0:`default: ${JSON.stringify(e.schemaDefault)}`,e.itemSchemaType===void 0?void 0:`items: ${e.itemSchemaType}${e.itemSchemaFormat===void 0?``:` (${e.itemSchemaFormat})`}`].filter(e=>e!==void 0).join(`, `),i=` ${e.name} (${r})`;return t?`${i}: ${n===`whole`||e.description.length<=Ft?e.description:`${e.description.slice(0,157)}...`}`:i}function Ut(e){return typeof e==`object`&&!!e&&`operationId`in e&&typeof e.operationId==`string`&&`requiredInput`in e&&Array.isArray(e.requiredInput)&&`intent`in e&&`summary`in e}function Wt(e){let t=t=>{let n=(`parameter`in e?e.parameter:e.parameters.map(e=>({...e,in:e.location,schemaDefault:e.defaultValue}))).filter(e=>e.in===t&&e.required&&e.schemaDefault===void 0).map(({name:e})=>[e,`<${e}>`]);return n.length===0?void 0:Object.fromEntries(n)},n=t(`path`),r=t(`query`);return{tool:i(e.intent),arguments:{operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:Kt(e)}}}}var Gt=4;function Kt(e){let t=e.requestBody?.[0];if(t===void 0)return{};if(t.requiredPath.length>0||e.intent!==`lookup`||t.schemaType===`array`)return qt(t.requiredPath);let n=t.parameter;return Object.fromEntries(n.flatMap(e=>{let{name:t,schemaType:n,schemaFormat:r}=e,i=`optionKey`in e?e.choices:e.schemaEnum;return t.includes(`.`)||n!==`string`||r!==void 0?[]:i===void 0?[[t,`<${t}>`]]:i.length>Gt?[]:[[t,`<${i.join(`|`)}>`]]}))}function qt(e){let t={},n=e.filter(t=>!e.some(e=>e.startsWith(`${t}.`)||e.startsWith(`${t}[]`)));for(let e of n){let n=e.split(`.`),r=n.slice(0,-1).reduce(Jt,t);r[n.at(-1)??e]=`<${e}>`}return t}function Jt(e,t){let n=t.replace(/\[\]$/u,``),r=e[n],i=Array.isArray(r)?r[0]:r;if(typeof i==`object`&&i&&!Array.isArray(i))return i;let a={};return e[n]=t.endsWith(`[]`)?[a]:a,a}function Yt(e){let t=Nt(e);return{mcpCall:Wt(e),...t===void 0?{}:{paidPlan:t}}}function Xt(e){let t=Zt(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function Zt(e){let t=e.match(/USE FOR:\s*([\s\S]*?)(?:NOT FOR:|$)/iu),n=e.match(/NOT FOR:\s*([\s\S]*?)$/iu);return{useFor:t?.[1]?.trim()??``,notFor:n?.[1]?.trim()??``}}var N=2,Qt=new Set(`a.an.the.and.or.for.to.of.in.on.at.by.with.from.into.is.are.be.do.does.how.what.which.that.this.these.those.i.me.my.we.our.you.your.it.its.please.want.need.can.could.should.would`.split(`.`));function P(e,t){let n=L(t);n.length!==0&&(e.add(n),(n===`individual`||n===`individuals`)&&P(e,`person`),tn(e,$t(n),n),tn(e,en(n),n))}function $t(e){if(e===`people`)return`person`;let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=N&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return`${e.slice(0,-3)}y`;let n=e.endsWith(`es`)?e.slice(0,-2):``;if(n.length>=N&&n!==`us`&&/(?:s|ss|sh|ch|x|z)$/u.test(n))return n;if(e.length>N&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`)return e.slice(0,-1)}function en(e){if(e===`person`)return`people`;if(e!==`new`&&e!==`news`&&e!==`status`&&e!==`us`){if(e.length>=N&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e))return`${e.slice(0,-1)}ies`;if(!(e.length>=N&&e.endsWith(`es`)))return e.length>=N&&/(?:s|ss|sh|ch|x|z)$/u.test(e)?`${e}es`:e.endsWith(`s`)?void 0:`${e}s`}}function tn(e,t,n){t!==void 0&&t!==n&&t.length>=N&&/^[a-z]+$/u.test(t)&&e.add(t)}function F(e){let t=new Set(I(e)),n=Array.from(t);for(let e of n)P(t,e);return t}function nn(e){return I(e).map(F)}function rn(e,t){if(e.length===0)return!1;let n=F(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function I(e){return L(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!Qt.has(e))}function L(e){return e.trim().replace(/([a-z0-9])([A-Z])/gu,`$1 $2`).replace(/[_-]/gu,` `).replace(/\s+/gu,` `).toLowerCase().replace(/\blook up\b/gu,`lookup`)}var an=/\b(?:https?:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:\/\S*)?/giu,on=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/giu,sn=/^[a-z0-9]+(?:-[a-z0-9]+)+$/u,cn=250,ln=40,un=100;function dn(e,t){let n=new Set,r=[],i=/\bslugs?\b/iu.test(e);return{text:e.replace(on,()=>(n.add(`uuid`),` `)).replace(an,e=>{n.add(`url`);let t=e.replace(/^(?:https?:\/\/)?[^/]+/iu,``).replace(/[?#].*$/su,``).split(`/`).filter(e=>e.length>0).map(e=>e.toLowerCase()),i=t.at(-1);return i!==void 0&&sn.test(i)&&(n.add(`slug`),t.pop()),r.push(...t.flatMap(e=>e.split(/[^a-z0-9]+/u))),` `}).split(/\s+/u).filter(e=>{let r=e.replace(/^[^a-z0-9]+|[^a-z0-9]+$/giu,``).toLowerCase(),a=sn.test(r)&&!t.has(r)&&(i||/\d/u.test(r));return a&&n.add(`slug`),!a}).join(` `).trim(),kind:n,urlPathWord:r.filter(e=>e.length>0)}}function fn(e,t,n){return e===`uuid`?/(?:^id|Id)$/u.test(t)&&n.includes(`{${t}}`):t===e}function pn(e,t){let n=new Set;for(let r of e){let e=new Set;P(e,r);let i=t.filter(({cliPath:t})=>e.has(t[0]??``)),a=i.length>0?i:t.filter(({cliPath:t})=>t.some(t=>e.has(t)));for(let{resource:e}of a)n.add(e)}return n}function mn(e,t,n){if(n.intent!==`read`&&n.intent!==`lookup`)return 0;let r=new Set(I(n.summary)),i=0;for(let t of e.kind)n.directParameterName.some(e=>fn(t,e,n.path))&&(i+=cn,r.has(t)&&(i+=ln));if(i===0)return 0;let a=new Set(I(`${n.summary} ${n.description}`));return(t.size>0?t.has(n.resource):e.urlPathWord.some(e=>{let t=new Set;return P(t,e),[...t].some(e=>a.has(e))}))&&(i+=un),i}var hn=40,gn=4,_n=3,vn=1,yn=new Map;function bn(e){let t=yn.get(e);if(t!==void 0)return t;let n=oe(),r=u(n.paths,e),i=r===null?new Map:a(n,r.operation.responses,_n);return yn.set(e,i),i}function xn(e,t,n){let r=0,i=new Map;for(let[e,a]of n){if(t.has(e.toLowerCase())&&(r+=hn*(4-a)/4),a>vn)continue;let n=new Set;for(let t of I(e))P(n,t);for(let e of n)i.set(e,Math.min(i.get(e)??a,a))}for(let t of e){let e=Math.min(...[...t].map(e=>i.get(e)??1/0));e<=vn&&(r+=gn*(2-e))}return r}var Sn=5,Cn=.5,wn=15,Tn=30,En=2,Dn=100,On=.5;function kn(e,t,n){let r=t.map(e=>({item:e,fields:n(e)})),i=dn(e,new Set(r.flatMap(({fields:e})=>e.cliPath))),a=pn(i.urlPathWord,r.map(({fields:e})=>e)),o=L(i.text);if(o.length===0&&i.kind.size===0)return t.map(e=>({item:e,score:1}));let s=F(o),c=nn(o),l=new Set(i.text.toLowerCase().split(/[^a-z0-9]+/u));return r.map(({item:e,fields:t})=>({item:e,fields:t,score:(o.length===0?0:Nn({normalizedQuery:o,tokens:s,termForm:c,queryWord:l},t))+mn(i,a,t)})).filter(({score:e})=>e>0).toSorted((e,t)=>Number(e.fields.deprecated===!0)-Number(t.fields.deprecated===!0)||t.score-e.score||e.fields.cliPath.length-t.fields.cliPath.length||e.fields.cliPath.join(` `).localeCompare(t.fields.cliPath.join(` `))||e.fields.operationId.localeCompare(t.fields.operationId)).map(({item:e,score:t})=>({item:e,score:t}))}function An(e){let t=e.requestBody??[],n=[...e.parameter,...t.flatMap(e=>e.parameter)];return{...e,cliPath:e.projection.cliPath,enumParameter:n.map(e=>({values:e.itemSchemaEnum??e.schemaEnum??[],direct:e.name===e.inputName})),parameterName:n.flatMap(e=>[e.name,e.inputName]),directParameterName:e.parameter.map(e=>e.name),parameterDescription:[...n,...t].map(({description:e})=>e),responseFieldLevel:bn(e.operationId)}}function jn(e,t){let n=e.q?.trim()??``,r=kn(n,t.filter(t=>Mn(e,t)&&(n.length>0||t.deprecated!==!0)),An),i=(r[0]?.score??0)*Cn,a=r.filter(({score:e})=>e>=i),o=e.limit===void 0||!Number.isFinite(e.limit)?Sn:e.limit,s=Math.min(a.length,Math.max(0,Math.trunc(o))),c=a.slice(0,s).map(({item:e})=>e),l={totalOperations:t.length,matched:a.length,returned:c.length},u=c.length===1,d=c.map(e=>Ot(e,u)),f=ce(M,d,{counts:l}),p=le(f),m=u?c.map(kt):c.map(At);return{summary:M,data:p?d:m,counts:l}}function Mn(e,t){let{root:n}=e;return!(e.method!==void 0&&t.method!==e.method||e.scope!==void 0&&t.projection.scope!==e.scope||n&&t.resource!==n&&t.projection.cliPath[0]!==n)}function Nn({normalizedQuery:e,tokens:n,termForm:r,queryWord:i},a){let o=zn(a),s=Ln(a),c=0;o.some(t=>t===e)&&(c+=100),o.some(t=>t.includes(e))&&(c+=40),c+=Rn(e,o);let l=new Set(o.flatMap(I)),u=new Set(s.flatMap(I));for(let e of n)o.some(t=>t===e)?c+=20:u.has(e)?c+=8:l.has(e)&&(c+=En);for(let e of a.cliPath){let t=new Set;P(t,e),[...t].some(e=>n.has(e))&&(c+=wn)}rn(r,s)&&(c+=200),r.length>1&&s.some(t=>t.includes(e))&&(c+=Dn),a.parameterName.some(t=>L(t)===e)&&(c+=Tn);let d=new Set(a.parameterDescription.flatMap(I));for(let e of n)d.has(e)&&(c+=En);return c+=Vn(n,a.enumParameter),[`list`,`search`,`find`,`browse`].some(e=>n.has(e))&&/^(?:list|search)[A-Z]/u.test(a.operationId)&&(c+=30),c+=xn(r,i,a.responseFieldLevel),c-=Bn(e,n,a.description),t(a.intent)&&!In(i)?c*On:c}var Pn=`edit change set fix rename link unlink mark publish correct`.split(` `),Fn=new Set([...Object.entries(o).filter(([,e])=>t(e)).map(([e])=>e),...Pn]);function In(e){return[...e].some(e=>Fn.has(e))}function Ln(e){return[e.operationId,e.cliPath.join(` `),e.summary].map(L).filter(e=>e.length>0)}function Rn(e,t){let n=I(e),r=0;for(let e=0;e<n.length-1;e+=1){let i=n.slice(e,e+2).join(` `);t.some(e=>e.includes(i))&&(r+=24)}return r}function zn(e){return[...new Set([e.operationId,e.method,e.path,e.resource,e.intent,e.cliPath.join(` `),e.summary,(Zt(e.description).useFor||e.description).slice(0,240)].map(L).filter(e=>e.length>0))]}function Bn(e,t,n){let r=L(Zt(n).notFor);if(r.length===0)return 0;let i=r.includes(e)?40:0,a=new Set(I(r));for(let e of t)r===e?i+=20:a.has(e)&&(i+=8);return i}function Vn(e,t){let n=0;for(let{values:r,direct:i}of t)r.some(t=>Hn(e,t))&&(n+=i?40:10);return n}function Hn(e,t){let n=I(t);return n.length>0&&n.every(t=>e.has(t))}function Un(e){return typeof e.data==`object`&&e.data!==null&&`response`in e.data?e.data.response:void 0}async function Wn(e,t,n,r){let i=e.q?.trim()??``;if(i.length===0)return w(`Provide q to resolve a request to one operation.`);let a=n.find(({resource:e,intent:t,deprecated:n})=>e===`help`&&t===`search`&&n!==!0);if(a===void 0)return w(`This build ships no help resolve operation.`);let o=await r(a,{body:{question:i,resolve:!0,...e.scope===void 0?{}:{scope:e.scope===`read`?`READ`:`WRITE`}}});if(!o.ok)return{...o,data:null};let s=ct.safeParse(Un(o));if(!s.success||s.data.resolution==null)return w(`The help resolve operation returned no resolution.`);let{answer:c,resolution:l}=s.data,u=e=>t.find(t=>t.operationId===e),d=u(l.operationId),f=l.taskPlan??void 0,p=(f?.step??[]).map(({step:e})=>({step:e,contract:u(e.operationId)})),m=[...new Set([...l.operationId!=null&&d===void 0?[l.operationId]:[],...p.filter(({contract:e})=>e===void 0).map(({step:e})=>e.operationId)])];return m.some(e=>!n.some(t=>t.operationId===e))?w(`No operation on this connection answers that request.`):ce(m.length===0?`Help resolution`:`Help resolution this connection cannot finish: it cannot run ${m.join(`, `)}.`,{outcome:l.outcome,probability:l.probability,answer:c,candidate:l.candidate.filter(({sourceId:e})=>n.some(({operationId:t})=>t===e)).map(({sourceId:e})=>{let t=u(e);return t===void 0?{sourceId:e}:Object.assign({sourceId:e},Yt(t))}),...d===void 0?{}:{operation:{operationId:d.operationId,apiRoute:`${d.method} ${d.path}`,...Xt(d),...Yt(d)}},...(l.taskKey,{}),...f===void 0?{}:{taskPlan:{input:f.input,step:p.map(({contract:e,step:{stepKey:t,instruction:n,operationId:r}})=>e===void 0?{instruction:n,operationId:r}:{instruction:n,mcpCall:Wt(e)})}}},{warnings:m.map(e=>n.some(t=>t.operationId===e)?`Operation ${e} is in this server's catalog, but your grant does not allow it.`:`Operation ${e} is outside this server's catalog, so no credential runs it here.`)})}var Gn=S({detail:x(),field:x().nullish(),scope:_([`entity`,`person`,`news`])}),Kn=_([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),qn=Object.assign(p([Kn,x()]),{enum:Kn.enum}),R=S({modeRequested:qn,modeUsed:qn}),Jn=S({answerUnavailable:y(),entity:R,news:R,person:R,rejection:h(Gn),unavailable:h(_([`entity`,`person`,`news`]))}),Yn=S({acceleratorParticipation:h(ke),detail:h(Ae)}),z=S({core:O,enrichment:be,fundraiseRound:h(Ke),provider:Ue.nullish(),research:Yn,semanticMatch:Le.nullish()}),Xn=_([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),Zn=S({compositeScore:b().nullish(),cosineScore:b().nullish(),curatedAsOf:x().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),curatedRelationshipType:x().nullish(),curatedSource:x().nullish(),derivedFromEntityId:f().nullish(),matchedSectionWeight:b().nullish(),origin:Xn,rank:v(),sharedSectionCount:v().nullish()}),Qn=S({entity:z,similarity:Zn}),$n=S({fundraiseInvestorJoin:y(),fundraiseTransaction:y(),operatingStatus:y(),relationship:y()}),er=_([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),tr=_([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),nr=S({acquiredEntity:O,acquirerEntity:O,amount:b().int().nullish(),announcedAt:x().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),asOf:x().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),completedAt:x().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),createdAt:m({offset:!0}).nullish(),currency:x().nullish(),dataConfidence:Se.nullish(),evidence:$n,fundraiseTransactionId:f().nullish(),investorJoinId:f().nullish(),isCurrent:y().nullish(),publicSource:ve.nullish(),relationshipId:v(),status:er,transactionStatus:tr.nullish(),updatedAt:m({offset:!0}).nullish()}),rr=S({entity:Ve,investorAttribution:h(Te),round:h(Ge),roundCount:v()}),ir=S({core:O,fundingDetail:Ne.nullish(),similarity:Zn,urlLink:h(ye)}),ar=S({compliance:Fe.nullish(),createdAt:m({offset:!0}).nullish(),id:v(),isCurrent:y().nullish(),isPrimary:y().nullish(),language:x().nullish(),owner:ee,text:x(),textName:x().nullish(),textType:x(),updatedAt:m({offset:!0}).nullish()}),or=_([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),sr=_([`fundraiseRound`,`researchDetail`]),cr=_([`preMoney`,`postMoney`,`reported`]),lr=S({amountRaised:b().int().nullish(),asOfDate:x().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),confidence:Pe,currency:x(),declaredBasis:cr,derivation:or,detailId:v().nullish(),label:x().nullish(),source:sr,sourceRef:x(),valuationPostMoney:b().int().nullish(),valuationPreMoney:b().int().nullish()}),ur=S({createdAt:m({offset:!0}).nullish(),description:x().nullish(),forkCount:v(),githubId:b().int(),homepageUrl:x().nullish(),id:b().int(),isArchived:y(),isFork:y(),language:x().nullish(),license:x().nullish(),name:x(),ownerLogin:x(),repoCreatedAt:m({offset:!0}).nullish(),repoPushedAt:m({offset:!0}).nullish(),stargazerCount:v(),topic:h(x()),updatedAt:m({offset:!0}).nullish(),url:x()}),B=S({empty:y().optional(),sorted:y().optional(),unsorted:y().optional()}),V=S({offset:b().int().optional(),paged:y().optional(),pageNumber:v().optional(),pageSize:v().optional(),sort:B.optional(),unpaged:y().optional()}),dr=S({investorAttribution:h(Te),person:ze,round:h(Ge),roundCount:v()}),fr=_([`by`,`about`]),pr=_([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),mr=S({canonicalUrl:x().nullish(),contentId:x(),contentType:pr,createdAt:m({offset:!0}).nullish(),publishedAt:m({offset:!0}).nullish(),relation:fr.nullish(),sourceDomain:x().nullish(),sourceName:x().nullish(),summary:x().nullish(),title:x(),topic:x().nullish(),updatedAt:m({offset:!0}).nullish(),url:x().nullish(),year:v().nullish()});S({content:h(De).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(p([Me,_e])).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Ee).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(O).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(nr).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Ve).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(We).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Ke).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(rr).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(z).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(He).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Ce).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Ae).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Re).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Qn).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(ir).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(ar).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(ye).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(lr).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(ur).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Oe).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(we).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(ze).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(Be).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(dr).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(je).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()}),S({content:h(mr).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()});var hr=S({content:h(z),number:v(),size:v(),totalElements:b().int(),totalPages:v()}),gr=S({content:h(Oe),number:v(),size:v(),totalElements:b().int(),totalPages:v()}),_r=S({content:h(we),number:v(),size:v(),totalElements:b().int(),totalPages:v()});S({content:h(Ie).optional(),empty:y().optional(),first:y().optional(),last:y().optional(),number:v().optional(),numberOfElements:v().optional(),pageable:V.optional(),size:v().optional(),sort:B.optional(),totalElements:b().int().optional(),totalPages:v().optional()});var vr=_([`entityRecord`,`researchSnippet`,`newsArticle`,`personRecord`,`fundraiseTransaction`,`webProfile`]),yr=Object.assign(p([vr,x()]),{enum:vr.enum}),br=S({entityId:f(),source:yr,sourceId:x()}),xr=S({citation:h(br),text:x(),topic:x().nullish()}),Sr=S({citation:h(br),confidence:k,description:x().nullish(),heading:x().nullish(),paragraph:h(xr),relatedQuery:h(x()),shareable:y(),text:x(),title:x().nullish()}),Cr=S({enrichmentRunId:f().nullish(),entityId:f()}),wr=S({sortPriority:_([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),Tr=S({max:m({offset:!0}).nullish(),min:m({offset:!0}).nullish()}),H=S({max:b().nullish(),min:b().nullish()}),U=S({max:v().nullish(),min:v().nullish()}),Er=S({averageAmountInvestedUsdRange:h(H).optional(),largestAmountInvestedUsdRange:h(H).optional(),smallestAmountInvestedUsdRange:h(H).optional(),totalAmountInvestedUsdRange:h(H).optional(),totalInvestmentRange:h(U).optional()}),Dr=S({amountInvestedRange:h(H).optional(),amountRaisedRange:h(H).optional(),dateAnnouncedRange:Tr.nullish(),investedCompanyName:h(x()).optional(),investedCountry:h(x()).optional(),investedIndustry:h(x()).optional(),investedRound:h(x()).optional(),investorActivity:Er.optional(),investorName:h(x()).optional(),lastRoundYearRange:h(U).optional(),rankByInvestmentActivity:y().nullish(),round:h(x()).optional(),totalRaisedRange:h(H).optional(),valuationRange:h(H).optional()}),Or=_([`NONE`,`COMPANY_LISTING_READY`]),kr=_([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),Ar=_([`hostPath`,`domain`]),jr=d({acceleratorBrand:h(x()).optional(),acceleratorCohort:h(x()).optional(),acceleratorName:h(x()).optional(),acceleratorStatus:h(x()).optional(),affinity:h(x()).optional(),closedLast:y().optional(),employeeCountRange:h(U).optional(),entityId:h(f()).optional(),entityName:h(x()).optional(),featured:y().nullish(),fundraiseActivity:Dr.optional(),hasFundraising:y().nullish(),headquartersCity:h(x()).optional(),headquartersCountry:h(x()).optional(),headquartersState:h(x()).optional(),industry:h(x()).optional(),letter:x().nullish(),location:h(x()).optional(),logoOption:wr.optional(),mainProduct:h(x()).optional(),operatingStatus:h(kr).optional(),originCountry:h(x()).optional(),person:h(x()).optional(),portfolioHeadquartersCity:h(x()).optional(),portfolioHeadquartersCountry:h(x()).optional(),portfolioHeadquartersState:h(x()).optional(),qualityGate:Or.optional(),rankByProminence:y().nullish(),semanticQuery:x().nullish(),slug:h(x().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:h(x()).optional(),suppressLateStage:y().nullish(),suppressNonOperating:y().nullish(),suppressZeroTotalRaised:y().nullish(),tag:h(x()).optional(),textSearch:x().nullish(),typeCustomer:h(x()).optional(),typeModel:h(x()).optional(),typeOwnership:h(x()).optional(),typeRecord:h(g).optional(),typeRevenue:h(x()).optional(),typeTechnologyUsed:h(x()).optional(),url:x().nullish(),urlDomain:x().nullish(),urlMatchMode:Ar.nullish(),urlType:xe.nullish(),yearFoundedRange:h(U).optional()}),Mr=_([`discovery`,`profile`,`peer`,`comparison`]),Nr=_([`keyword`,`semantic`]),Pr=_([`ID`,`NAME_BRAND`,`YEAR_FOUNDED`,`STATUS_OPERATING`,`UPDATED_AT`,`CREATED_AT`,`NEXT_DUE_AT`,`DATA_COMPLETION_COVERAGE`,`TOTAL_RAISED`,`AMOUNT_INVESTED`,`RECENT_INVESTMENT_AT`,`STAGE`,`MOST_RECENT_AMOUNT`,`LATEST_VALUATION`,`MOST_RECENT_DATE`,`ACCELERATOR_BRAND`,`ACCELERATOR_COHORT`,`HEADQUARTERS_COUNTRY`,`EMPLOYEE_COUNT`]),Fr=Object.assign(p([Pr,x()]),{enum:Pr.enum}),Ir=S({descending:y(),field:Fr,sortKey:x().nullish()}),Lr=S({order:h(Ir),relevance:Nr.nullish()}),Rr=S({confidence:k,execution:R,fallbackUsed:y(),filter:jr,intent:Mr,interpretation:x(),sort:Lr,subjectEntityName:h(x()),unsupported:x().nullish()}),zr=S({changedAt:m({offset:!0}).nullish(),dataSourceUpdatedAt:m({offset:!0}).nullish(),pendingApproval:v().nullish(),sourceId:x().nullish(),status:x().nullish()}),Br=S({fundManagerRelationshipSource:zr.nullish(),fundraiseTransaction:Ke,fundraiseTransactionSource:zr.nullish(),investorJoinSource:zr.nullish()}),Vr=S({evidence:Br,investor:ee,semanticMatch:Le.nullish()}),Hr=S({entityId:f(),matchedOffering:O.nullish(),probability:b(),webUrl:h(x())}),Ur=S({entityId:f(),label:x(),publishedAt:m({offset:!0}).nullish(),score:b(),source:yr,sourceId:x(),text:x(),url:x().nullish()}),Wr=S({answer:Sr.nullish(),filing:h(Cr).nullish(),interpretation:Rr,investment:h(Vr),judgment:h(Hr),passage:h(Ur),peer:h(Qn),pendingWebQuery:h(x()),result:hr,searchRequestId:f().nullish(),subject:h(z)}),Gr=_([`auto-match`,`needs-review`,`approved`,`rejected`]),Kr=S({createdAt:m({offset:!0}),entityId:f(),href:x().nullish(),internal:y(),matchStatus:Gr.nullish(),mention:x().nullish(),slug:x().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:g.nullish(),updatedAt:m({offset:!0})}),qr=S({entity:h(Kr),newsId:v()}),Jr=d({acceleratorBrand:h(x()).optional(),acceleratorCohort:h(x()).optional(),acceleratorName:h(x()).optional(),acceleratorStatus:h(x()).optional(),affinity:h(x()).optional(),closedLast:y().optional(),employeeCountRange:h(U).optional(),entityId:h(f()).optional(),entityName:h(x()).optional(),featured:y().nullish(),fundraiseActivity:Dr.optional(),hasFundraising:y().nullish(),headquartersCity:h(x()).optional(),headquartersCountry:h(x()).optional(),headquartersState:h(x()).optional(),industry:h(x()).optional(),letter:x().nullish(),location:h(x()).optional(),logoOption:wr.optional(),mainProduct:h(x()).optional(),operatingStatus:h(kr).optional(),originCountry:h(x()).optional(),person:h(x()).optional(),portfolioHeadquartersCity:h(x()).optional(),portfolioHeadquartersCountry:h(x()).optional(),portfolioHeadquartersState:h(x()).optional(),qualityGate:Or.optional(),rankByProminence:y().nullish(),slug:h(x().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:h(x()).optional(),suppressLateStage:y().nullish(),suppressNonOperating:y().nullish(),suppressZeroTotalRaised:y().nullish(),tag:h(x()).optional(),textSearch:x().nullish(),typeCustomer:h(x()).optional(),typeModel:h(x()).optional(),typeOwnership:h(x()).optional(),typeRecord:h(g).optional(),typeRevenue:h(x()).optional(),typeTechnologyUsed:h(x()).optional(),url:x().nullish(),urlDomain:x().nullish(),urlMatchMode:Ar.nullish(),urlType:xe.nullish(),yearFoundedRange:h(U).optional()}),Yr=S({amountInvestedRange:h(H).nullish(),amountRaisedRange:h(H).nullish(),entityName:h(x()).nullish(),investedCompany:h(x()).nullish(),personTitle:h(x()).nullish(),round:h(x()).nullish(),totalInvestmentCount:h(U).nullish(),typeRecord:h(g).nullish()}),Xr=S({arrayFilter:Yr.optional(),entityFilter:Jr.optional(),entityId:f().nullish(),entitySlug:x().nullish(),firstName:x().nullish(),includeAddress:y().nullish(),includeUrl:y().nullish(),investorActivity:Er.optional(),isCurrent:y().nullish(),lastName:x().nullish(),letter:x().nullish(),personId:h(f()).max(200).optional(),personName:h(x()).optional(),role:x().nullish(),search:x().nullish(),semanticQuery:x().nullish(),status:x().nullish()}),Zr=S({descending:y(),field:_([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`]),sortKey:x().nullish()}),Qr=S({order:h(Zr),relevance:Nr.nullish()}),$r=S({confidence:k,execution:R,fallbackUsed:y(),filter:Xr,interpretation:x(),sort:Qr,unsupported:x().nullish()}),ei=S({currentCompany:x().nullish(),headline:x().nullish(),id:f(),location:x().nullish(),name:x(),named:x(),organizationEvidence:_([`headline`,`profile`,`none`]).nullish(),photoUrl:x().nullish(),profileUrl:x(),slug:x().regex(/^[a-z0-9_-]+$/).max(255)}),ti=S({interpretation:$r,investment:h(Vr),profile:h(ei),result:_r,searchRequestId:f().nullish()}),ni=S({label:x(),query:x()}),ri=S({key:x(),option:h(ni),prompt:x()}),ii=S({entity:Wr,entityDetail:h(Ve),news:gr,newsEntityMention:h(qr),person:ti,personDetail:h(ze),personLead:y(),provenance:Jn,qualifier:ri.nullish(),section:h(_([`person`,`company`,`productService`,`investor`])).optional()});function ai(e,r){return e.map(e=>{let a=e.requestBody??[],o=[...e.parameters.map(e=>oi(e)),...a.flatMap(e=>e.parameter.map(t=>oi(t,a.length>1?e.contentType:void 0))),...si(a)],s=[r,...e.cliPath].join(` `),u=e.mutates===!0||t(e.intent),d=n(e),f=a[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:u,destructive:c(e.method,e.intent),auth:e.auth,cli:{command:s,path:e.cliPath},mcpTool:e.binaryResponse||!l(e.path)||d===null?null:i(d),body:{hasBody:f!==void 0,kind:f?.kind??null,...f!==void 0&&a.length>1?{contentType:f.contentType}:{},required:f?.required??!1,description:f?.description??``,requiredPath:f?.requiredPath??[]},flags:o,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},summary:e.summary,description:e.description,...e.deprecated===void 0?{}:{deprecated:e.deprecated}}})}function oi(e,t){let n=e.flag.split(/\s+/u);return{name:n[0]??e.flag,optionKey:e.optionKey,wireName:e.name,location:e.location,required:e.required,placeholder:n.length<=1?null:n.slice(1).join(` `),description:e.description,choices:e.choices??[],...t===void 0?{}:{contentType:t}}}function si(e){if((e?.length??0)<=1)return[];let t=e?.map(({contentType:e})=>e)??[];return[{name:`--content-type`,optionKey:`contentType`,wireName:`Content-Type`,location:`body`,required:!1,placeholder:`<media-type>`,description:`Select the request body encoding, never an uploaded file's media type; omit for ${t[0]}.`,choices:t}]}function ci(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var li=[`-id`,`-slug`,`-url`],ui=[`--id`,`--slug`,`--url`],di=`/v1/lookup`,fi=`--from-file "<path>"`;function pi(e,t,n=de().bin[0]){let r=ai(t,n),i=r.find(t=>t.operationId===e);return i===void 0?[]:_i(i,r)}function mi(e,t,n=de().bin[0]){let r=t.find(t=>t.operationId===e),[i]=r===void 0?[]:ai([r],n);return i&&gi(i,bi(i,!1))}function hi(e,t,n,r=de().bin[0]){let i=e=>{let t=e.findIndex((e,t)=>n[t]!==e);return t===-1?e.length:t},a=`${n[0]} get`,[o,s]=t.filter(({method:t,path:n,parameters:r,cliPath:o})=>{let s=r.filter(({location:e})=>e===`path`),[c]=s;return t===`GET`&&s.length===1&&c?.flag.split(/\s+/u)[0]===e&&n.endsWith(`/{${c.name}}`)&&(i(o)>1||o.join(` `)===a)}).toSorted((e,t)=>i(t.cliPath)-i(e.cliPath));if(o!==void 0&&(s===void 0||i(s.cliPath)!==i(o.cliPath)))return mi(o.operationId,t,r)}function gi(e,t){return[e.cli.command,...t,`--data`].join(` `)}function _i(e,t){return[`example: ${gi(e,bi(e))}`,...vi(e,t)]}function vi(e,t){return ci(e).flatMap(e=>{if(!e.required||!e.optionKey.endsWith(`Id`))return[];let n=`${e.optionKey.slice(0,-2)}Slug`,r=t.find(e=>e.method===`GET`&&/\/lookup(?:-exact)?$/u.test(e.path)&&e.flags.some(e=>e.optionKey===n)),i=r?.flags.find(e=>e.optionKey===n);if(r===void 0||i===void 0)return[];let a=`${r.cli.command} ${Si(i)} --data`,o=t.find(e=>e.method===`POST`&&e.path===di),s=o?.flags.find(e=>e.optionKey===`name`),c=o?.flags.find(e=>e.optionKey===`kind`),l=c?.choices.find(t=>e.optionKey.toUpperCase().startsWith(t)),u=`lookup: ${e.name} from a slug: ${a}`;return o===void 0||s===void 0||c===void 0||l===void 0?[u]:[u,`lookup: ${e.name} from a name or URL: ${o.cli.command} ${c.name} ${l} ${Si(s)} --data, then match.owner.${e.optionKey} when status is MATCHED`]})}var yi=/(?:^|\.)text$/u;function bi(e,t=!0){let n=ci(e),r=n.filter(e=>e.required),i=e.body.kind===`json`&&n.some(e=>e.location===`body`&&yi.test(e.wireName)&&(e.required||!e.wireName.includes(`.`))),a=i?r.filter(e=>e.location!==`body`):r,o=(r.length>0||!t?a:xi(e)).map(Si);return i||(e.body.required||e.body.requiredPath.length>0)&&!a.some(e=>e.location===`body`)?[...o,fi]:o}function xi(e){let t=new Set;P(t,e.resource);for(let n of li)for(let r of t){let t=e.flags.find(e=>e.name===`--${r}${n}`);if(t!==void 0)return[t]}for(let t of ui){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function Si(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}var Ci=`aventure`;function wi(e,t,n=`cli`){let r=t.find(t=>t.operationId===e);if(n===`mcp`&&r!==void 0){let e=Wt(r);return`${e.tool} ${JSON.stringify(e.arguments)}`}let i=r?.cliPath;return i===void 0?void 0:`${Ci} ${i.join(` `)}`}function Ti(e,t,n=e,r=`cli`){return r===`mcp`?wi(e,t,r)??e:mi(e,t,`aventure`)??n}function Ei(e,t,n=`cli`){let r=ct.safeParse(e);if(!r.success)return null;let{answer:i,citation:a,confidence:o,resolution:s}=r.data;if(s!=null)return Di(i,s,t,n);let c=i.trimEnd().split(`
3
- `),l=new Set(a.flatMap(({sourceType:e,sourceId:r})=>{if(e!==Qe.options[0].enum.OPERATION)return[];let i=wi(r,t,n);return i===void 0?[]:[i]}));return l.size>0&&c.push(``,n===`mcp`?`MCP calls:`:`Commands:`,...[...l].map(e=>` ${e}`)),c.push(``,`Confidence: ${o}`),a.length===0?c:(c.push(`Sources (${a.length}):`),c.push(...a.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`})),c)}function Di(e,t,n,r){let{outcome:i,operationId:a,probability:o,candidate:s,taskKey:c,taskPlan:l}=t,u=[l==null?e.trimEnd():ki(l)],d=[``,`Outcome: ${i}${o==null?``:` (probability ${o.toFixed(2)})`}`];switch(i){case A.enum.TASK_PLAN:return[...u,...l==null?[]:Ai(l,n,r),...d];case A.enum.OPERATION_ADVICE:{let e=s.filter(({sourceId:e})=>e!==a);return[...u,...a==null?[]:[``,r===`mcp`?`MCP call:`:`Command:`,` ${Ti(a,n,a,r)}`],...d,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case A.enum.CLARIFY:return[...u,...c==null?[]:[``,`Leading catalog task: ${c}`],...Mi(`Candidates:`,s,n,r),...d];case A.enum.ABSTAIN:return[...u,...Mi(`Nearest operations:`,s,n,r),...d];default:throw Error(`Unhandled help resolution outcome ${String(i)}`)}}function Oi(e,t,n=`cli`){let r=ot.safeParse(e);return r.success?[ki(r.data),...Ai(r.data,t,n)]:null}var ki=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function Ai(e,t,n){return e.step.length===0?[``,`This catalog task has no planned steps yet.`]:[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n,required:r})=>` ${e} (${t}, ${r===!1?`optional`:`required`}): ${n}`)],``,`Steps:`,...e.step.flatMap(({step:r,cliCommand:i,writeGuidance:a},o)=>[` ${o+1}. ${r.stepKey===void 0?``:`${r.stepKey}: `}${Ti(r.operationId,t,i,n)}`,` ${r.instruction}`,...ji(e,o,a)]),...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function ji(e,t,n){if(n==null)return[];let r=JSON.stringify(n),i=e.step.findIndex(({writeGuidance:e})=>JSON.stringify(e)===r);return i===t?[` Write guidance:`,` - Expectation: ${n.expectation}`,` - Body: ${n.body}`,` - Read first: ${n.typeCatalog}`,` - Rejected when:`,...n.reject.map(e=>` - ${e}`),` - Override: ${n.override}`,` - Method: ${n.method.join(`; `)}`]:[` Write guidance: as step ${i+1}.`]}function Mi(e,t,n,r){if(t.length===0)return[];let i=t.map(({sourceId:e,excerpt:t})=>({command:wi(e,n,r)??e,excerpt:t})),a=Math.max(...i.map(({command:e})=>e.length));return[``,e,...i.map(({command:e,excerpt:t})=>` ${e.padEnd(a)} # ${t}`)]}var W=30,Ni=8,G=10,Pi=2,Fi=[`id`,`association.associationId`,`slug`,`name`,`nameBrand`,`nameFull`,`core.nameBrand`,`core.nameFull`,`core.slug`,`core.typeRecord`,`entity.core.nameBrand`,`entity.core.slug`,`title`,`sourceName`,`publishedAt`,`round`,`dateAnnounced`,`amountRaised`,`investorAttribution.amountInvested`,`stage`,`updatedAt`,`createdAt`],Ii=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]);function Li(e,t,n,{transport:r=`cli`,trailer:i=[]}={}){if(typeof t==`string`)return ae(t,r,i);let a=Rt(t,i);if(a!==null)return ie(a,i,r);let o=Ji(t);if(o===null)return null;let s=e.find(({operationId:e})=>e===o.operationId),c=me(s?.detailField,o.response),l=[...c.hiddenNote,...i],u=(e,t)=>te([e.trimEnd(),...t].join(`
3
+ `),l=new Set(a.flatMap(({sourceType:e,sourceId:r})=>{if(e!==Qe.options[0].enum.OPERATION)return[];let i=wi(r,t,n);return i===void 0?[]:[i]}));return l.size>0&&c.push(``,n===`mcp`?`MCP calls:`:`Commands:`,...[...l].map(e=>` ${e}`)),c.push(``,`Confidence: ${o}`),a.length===0||(c.push(`Sources (${a.length}):`),c.push(...a.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`}))),c}function Di(e,t,n,r){let{outcome:i,operationId:a,probability:o,candidate:s,taskKey:c,taskPlan:l}=t,u=[l==null?e.trimEnd():ki(l)],d=[``,`Outcome: ${i}${o==null?``:` (probability ${o.toFixed(2)})`}`];switch(i){case A.enum.TASK_PLAN:return[...u,...l==null?[]:Ai(l,n,r),...d];case A.enum.OPERATION_ADVICE:{let e=s.filter(({sourceId:e})=>e!==a);return[...u,...a==null?[]:[``,r===`mcp`?`MCP call:`:`Command:`,` ${Ti(a,n,a,r)}`],...d,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case A.enum.CLARIFY:return[...u,...c==null?[]:[``,`Leading catalog task: ${c}`],...Mi(`Candidates:`,s,n,r),...d];case A.enum.ABSTAIN:return[...u,...Mi(`Nearest operations:`,s,n,r),...d];default:throw Error(`Unhandled help resolution outcome ${String(i)}`)}}function Oi(e,t,n=`cli`){let r=ot.safeParse(e);return r.success?[ki(r.data),...Ai(r.data,t,n)]:null}var ki=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function Ai(e,t,n){return e.step.length===0?[``,`This catalog task has no planned steps yet.`]:[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n,required:r})=>` ${e} (${t}, ${r===!1?`optional`:`required`}): ${n}`)],``,`Steps:`,...e.step.flatMap(({step:r,cliCommand:i,writeGuidance:a},o)=>[` ${o+1}. ${r.stepKey===void 0?``:`${r.stepKey}: `}${Ti(r.operationId,t,i,n)}`,` ${r.instruction}`,...ji(e,o,a)]),...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function ji(e,t,n){if(n==null)return[];let r=JSON.stringify(n),i=e.step.findIndex(({writeGuidance:e})=>JSON.stringify(e)===r);return i===t?[` Write guidance:`,` - Expectation: ${n.expectation}`,` - Body: ${n.body}`,` - Read first: ${n.typeCatalog}`,` - Rejected when:`,...n.reject.map(e=>` - ${e}`),` - Override: ${n.override}`,` - Method: ${n.method.join(`; `)}`]:[` Write guidance: as step ${i+1}.`]}function Mi(e,t,n,r){if(t.length===0)return[];let i=t.map(({sourceId:e,excerpt:t})=>({command:wi(e,n,r)??e,excerpt:t})),a=Math.max(...i.map(({command:e})=>e.length));return[``,e,...i.map(({command:e,excerpt:t})=>` ${e.padEnd(a)} # ${t}`)]}var W=30,Ni=8,G=10,Pi=2,Fi=[`id`,`association.associationId`,`slug`,`name`,`nameBrand`,`nameFull`,`core.nameBrand`,`core.nameFull`,`core.slug`,`core.typeRecord`,`entity.core.nameBrand`,`entity.core.slug`,`title`,`sourceName`,`publishedAt`,`round`,`dateAnnounced`,`amountRaised`,`investorAttribution.amountInvested`,`stage`,`updatedAt`,`createdAt`],Ii=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]);function Li(e,t,n,{transport:r=`cli`,trailer:i=[]}={}){if(typeof t==`string`)return ae(t,r,i);let a=Rt(t,i);if(a!==null)return ie(a,i,r);let o=Ji(t);if(o===null)return null;let s=e.find(({operationId:e})=>e===o.operationId),c=me(s?.detailField,o.response),l=[...c.hiddenNote,...i],u=(e,t)=>te([e.trimEnd(),...t].join(`
4
4
  `),{appendNewline:!0,preservedTrailerLines:t.length>0?t.length:void 0,transport:r}),d=s?.parameters??[],f={...o,response:c.response,parameters:d,transport:r},p=Ei(f.response,e,r)??Oi(f.response,e,r);if(p!==null)return u(p.join(`
5
5
  `),i);let m=Ri(f);if(m!==null)return u(m.join(`
6
6
  `),l);let h=[f.summary??n??f.operationId??`OpenAPI call succeeded`,`${f.method} ${f.endpoint}`],g=re(Hi(f),117-l.length,se-Ye.byteLength(`${[...h,...l].join(`
@@ -13,4 +13,4 @@ import{n as e}from"./commander-BB7CDPLs.js";import{c as t,f as n,i as r,l as i,m
13
13
  `)}`;return[`answer:\n ${pe(e.text).replaceAll(`
14
14
  `,`
15
15
  `)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function Bi(e){let t=Ji(e)?.response,n=X(t)?t.interpretation:void 0;if(!X(n))return null;let r=R.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=ge(n.filter),{unsupported:s,fallbackUsed:c}=n,l=[`strategy: requested=${i} used=${a}`,...X(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${Vi(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``];return te(l.filter(Boolean).join(`
16
- `),{appendNewline:!0})}var Vi=e=>Z(e)?T(e):Array.isArray(e)&&e.every(Z)?e.map(e=>T(e)).join(`, `):JSON.stringify(e);function Hi(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a,transport:o}=e;if(t===void 0)return a!==void 0&&i!==void 0?[`status=${i} redirect=${a}`]:i===void 0?[]:[`status=${i} no response body`];let s=i===void 0||n===`GET`?``:`status=${i}`,c=X(t)&&!Xi(t)?Zi(t):null,l=c===null?void 0:X(c.context.interpretation)?ge(c.context):c.context,u=l!==void 0&&X(l)?Object.entries(l):[],d=u.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(X)),f=new Set(d.map(([e])=>e)),p=Object.fromEntries(u.filter(([e])=>!f.has(e)));return[s,...Xi(t)?K(t,e,r):c===null?$i(t)?Gi(t,[`filter`],t.meta,o):ea(t)?Gi(t,[`arrayFilterEntry`,`rangeFilterEntry`],t.filtersMeta,o):na(t)?Ki(t,o):q(t,``):[...K(c.page,e,r),...Object.keys(p).length===0?[]:q(p,``),...d.flatMap(([e,t])=>[`${e}:`].concat(Ui(t,o)))]].filter(Boolean)}function K(e,t,n){let r=qi(t),i=e.numberOfElements??e.content.length,a=Math.min(e.content.length,W),o=Math.max(1,a),s=(e.number??0)*(e.size??i),c=(e.totalElements??0)-s-i,l=e.number===void 0?``:` page=${e.number}`,u=e.size===void 0?``:` size=${e.size}`,d=e.totalElements===void 0?``:` total=${e.totalElements}`,f=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,p=(e.number??0)+1,m=e.totalPages===void 0||p<e.totalPages,h=E(`page`,t.parameters);return[`rows=${i}${l}${u}${d}${f}`,a>=i?``:`page rows omitted: ${i-a} (${a}/${i} shown); ${e.content.length>a?C(t.transport,`.content`):`reread with ${E(`size`,t.parameters)} ${o} and ${h} ${Math.floor((s+a)/o)} through ${Math.floor((s+i-1)/o)} (MCP: size, page); pages start at 0`}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${D(n)}`,c<=0||n!==void 0?``:m&&i===e.size?`more: ${c} rows not shown; use ${h} or ${E(`size`,t.parameters)} to see them`:`more: ${c} more matched but this response returns only these ${i}; narrow the query to reach them${m?` (${h} ${p} starts after this page)`:``}`,...Ui(e.content.slice(0,a),t.transport)].filter(Boolean)}function Ui(e,t){if(!e.every(X))return J(e,``);let n=e.filter(X);if(n.length===0)return e.length===0?[`(empty)`]:J(e,``);let r=Wi(n);if(r.length===0)return J(e,``);let i=n.slice(0,W).map(e=>{let t=Y(e);return r.map(e=>t[e]??``)}),a=r.map(e=>e.split(`.`).at(-1)??e),o=a.map((e,t)=>{let n=i.map(e=>e[t]??``),r=Math.max(e.length,...n.map(e=>e.length));return e===`id`||e.endsWith(`Id`)?r:Math.min(32,r)}),s=e=>e.map((e,t)=>fe(e,o[t]??12).padEnd(o[t]??12)).join(` `),c=[s(a),s(o.map(e=>`-`.repeat(e)))];return i.forEach(e=>c.push(s(e))),n.length>W&&c.push(`... ${n.length-W} more rows omitted; ${C(t)}`),c}function Wi(e){let t=e.map(e=>Y(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=Fi.filter(e=>n.has(e)),i=new Set(r.map(Yi)),a=[...n].filter(e=>{let n=t.every(t=>/^-?\d+(?:\.\d+)?$/u.test(t[e]??`0`));return!e.includes(`.`)||/id$/iu.test(e)||i.has(Yi(e))?!1:(n&&i.add(Yi(e)),n)}),o=[...n].filter(e=>/(?:^|\.)id$/u.test(e)).slice(0,1),s=[...new Set([...r,...o,...a])],c=[...n].filter(e=>!s.includes(e)).filter(e=>!e.toLowerCase().includes(`logo`)).slice(0,Ni-s.length);return[...s,...c].slice(0,Ni)}function Gi(e,t,n,r){let i=t.flatMap(t=>e[t].map((e,n)=>({...e,path:`.${t}[${n}].choiceOption`}))),a=n!==void 0&&X(n)?n:{},o=[`total`,`limit`].flatMap(e=>typeof a[e]==`number`?[` ${e}=${a[e]}`]:[]).join(``),s=[`filters=${i.length}${o}`];for(let e of i){let t=e.choiceOption.length,n=e.choiceOptionTotal===null?`unknown (degraded)`:e.choiceOptionTotal??t,i=e.choiceOptionTruncated===!0?` truncated`:``;s.push(`- ${e.filterKey} (${e.label}): choices ${t}/${n}${i}`),e.choiceOption.slice(0,G).forEach(t=>{s.push(` ${E(e.filterKey)} ${D(t.value)}`)}),t>G&&s.push(` ... ${t-G} choices omitted for ${e.filterKey}; ${C(r,e.path)}`)}return s}function Ki(e,t){let n=E(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,G).map(e=>`${n} ${D(e)}`),e.result.length>G?`... ${e.result.length-G} matches omitted; ${C(t,`.result`)}`:``].filter(Boolean)}function qi({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Ii.has(e)&&t.length>0).map(([e,n])=>`${E(e,t)} ${D(n)}`)}function Ji(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:void 0},[n,r,i]=[t(`method`),t(`endpoint`),t(`nextCursor`)];if(n===void 0||r===void 0)return null;let a=Reflect.get(e,`httpStatus`),o=Reflect.get(e,`response`),s=o===void 0?void 0:ue.safeParse(o);return s!==void 0&&!s.success?null:{method:n,endpoint:r,httpStatus:typeof a==`number`?a:void 0,location:t(`location`),operationId:t(`operationId`),summary:t(`summary`),nextCursor:i===``?void 0:i,response:s?.data}}function q(e,t,n){if(e===void 0)return[];if(Z(e))return[`${t}${he(e,n)}`];if(Array.isArray(e))return J(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if(Z(i)){r.push(`${t}${n}: ${he(i,n)}`);continue}r.push(`${t}${n}:`);for(let e of q(i,`${t} `,n))r.push(e)}return r.length===0?[`${t}(empty)`]:r}function J(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e){if(Z(i)){r.push(`${t}- ${he(i,n)}`);continue}r.push(`${t}-`);for(let e of q(i,`${t} `))r.push(e)}return r}function Y(e,t=``,n=0){return Z(e)?t.length===0?{}:{[t]:T(e,t)}:n>Pi?{}:Array.isArray(e)?e[0]===void 0?{}:Y(e[0],t,n+1):Object.fromEntries(Object.entries(e).flatMap(([e,r])=>{if(r===void 0)return[];let i=t.length===0?e:`${t}.${e}`;return Z(r)?[[i,T(r,i)]]:Object.entries(Y(r,i,n+1))}))}var Yi=e=>e.split(`.`,1)[0],Xi=e=>X(e)&&Array.isArray(e.content);function Zi(e){let[t,...n]=Object.entries(e).filter(e=>Xi(e[1])&&typeof e[1].totalElements==`number`);if(t===void 0||n.length>0)return null;let[r,i]=t;return{page:i,context:Object.fromEntries(Object.entries(e).filter(([e])=>e!==r))}}function Qi(e){return X(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var $i=e=>X(e)&&ta(e.filter),ea=e=>X(e)&&ta(e.arrayFilterEntry)&&ta(e.rangeFilterEntry),ta=e=>Array.isArray(e)&&e.every(Qi),na=e=>X(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),X=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Z=e=>typeof e!=`object`||!e,Q=/\{([^}]+)\}/gu;function ra(e,t,n=`cli`){let i=t.filter(e=>e.method===`GET`&&(n===`cli`||e.binaryResponse!==!0)),a=t=>e.endpoint!==void 0&&t.endsWith(e.endpoint),o=t.find(t=>t.operationId===e.operationId),s=e.ok&&o!==void 0&&r(o.intent),c=[...s&&e.endpoint!==void 0?sa(e.endpoint.split(`?`)[0]??``,i,!1,n).map(e=>n===`mcp`?e:`${e} --data --to-file <path>`):[],...e.references.filter(e=>!a(e)).flatMap(oa).flatMap(e=>sa(e.pathname,i,!0,n)),...e.references.filter(a).flatMap(oa).flatMap(e=>ca(e,i,n))],l=n===`mcp`?ia:void 0;return c.length===0?{write:s,narrowerRead:l}:{exactRecovery:`Read the full result ${c.join(`; `)}.`,write:s,narrowerRead:l}}var ia=`Refetch a narrower result: call aventure_help with q set to the read intent, then call aventure_read with its operationId and declared query or pathParams, using ids/references, filters, or smaller query.page/query.size windows.`;function aa(e,t){let n=t.find(t=>t.operationId===e.operationId);if(!e.ok||n?.method!==`GET`||n.mutates===!0||r(n.intent)||e.endpoint===void 0)return;let i=new URL(e.endpoint,`https://localhost`),a=[...n.path.matchAll(Q)].map(([,e])=>e),o=RegExp(`^${n.path.replace(Q,`([^/]+)`)}$`,`u`).exec(i.pathname);if(o===null)return;let s=n.parameters.find(e=>e.location===`query`&&e.name===`compact`&&e.schemaType===`boolean`);s!==void 0&&i.searchParams.set(s.name,`true`);let c=[];for(let e of n.parameters){let t=e.location===`path`?[decodeURIComponent(o[a.indexOf(e.name)+1]??``)]:e.location===`query`?i.searchParams.getAll(e.name):[];if(e.required&&t.length===0)return;t.length>0&&c.push($(e),...t.map(fa))}return`Run: \`${da(n,[...c,`--data`,`--to-file`,`./aventure-output.json`])}\`. On success, the spill file contains the bare payload (top-level keys as returned), not the result envelope or a data.response wrapper.`}function oa(e){return URL.canParse(e)?[new URL(e)]:[]}function sa(e,t,n,r){return t.flatMap(t=>{let i=[...t.path.matchAll(Q)].map(([,e])=>e),a=RegExp(`^${t.path.replace(Q,`([^/]+)`)}$`,`u`),o=n&&i.length===0?null:a.exec(e);if(o===null)return[];if(r===`mcp`)return[la(t,{pathParams:Object.fromEntries(i.map((e,t)=>[e??``,decodeURIComponent(o[t+1]??``)]))})];let s=i.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[$(r),o[n+1]??``]});return[`${ua(t)}, ${da(t,s)}`]})}function ca(e,t,n){let r=t.find(t=>t.path===e.pathname);return r===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${r.path}/`))return[];let i=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),a=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(i===void 0||a===void 0)return[];if(n===`mcp`)return[`in windows: ${la(t,{query:{...Object.fromEntries([...e.searchParams].filter(([e])=>t.parameters.some(t=>t.location===`query`&&t.name===e))),[i.name]:`<offset>`,[a.name]:`<limit>`}})}, advancing query.${i.name} until a window returns fewer than query.${a.name} units`];let o=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[$(t),fa(n)]}),s=[$(i),`<n>`,$(a),`<n>`];return[`${ua(t)}, in windows: ${da(t,[...o,...s])}, advancing ${$(i)} until a window returns fewer than ${$(a)} units`]})}function la(e,t){return`${i(e.intent)} ${JSON.stringify({operationId:e.operationId,...t})}`}function ua(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function da(e,t){return[Ci,...e.cliPath,...t].join(` `)}function $(e){return e.flag.split(/\s+/u)[0]??e.flag}function fa(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function pa(e){return e.toSorted((e,t)=>e.projection.cliPath.length-t.projection.cliPath.length||e.projection.cliPath.join(` `).localeCompare(t.projection.cliPath.join(` `))||e.operationId.localeCompare(t.operationId)).map(e=>{let t=e.parameter.flatMap(t=>{if(t.in!==`path`&&t.in!==`query`&&t.in!==`header`)return[];let n=t.in;return(t.in===`query`&&t.itemProperty!==void 0?t.itemProperty:[t]).map(t=>{let r=va(t,j(e,t),n);if(t.legacyName===void 0)return r;let i=va(t,j(e,t,t.legacyName),n).flag;return i===r.flag?r:Object.assign(r,{legacyFlag:i})})}),n=e.requestBody?.map(n=>{let r=ga(e,t,n),i=ha(n.cliConflicts,r),a=i.length===0?{}:{cliConflicts:i};return Object.assign({},n,{parameter:r},a)}),r=e.response.find(({status:e})=>e.startsWith(`2`)),i=r?.schemaName?.replace(/Schema$/,``);return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliPath:e.projection.cliPath,summary:e.summary,description:e.description,binaryResponse:e.binaryResponse?!0:void 0,explain:e.explain?!0:void 0,deprecated:e.deprecated?!0:void 0,requestBody:n,mutationReadback:e.mutationReadback,scope:e.projection.scope,auth:e.projection.auth,visibility:e.projection.visibility,mutates:e.projection.mutates,errorResponse:e.errorResponse,successResponse:i,detailField:r?.detailField,parameters:t}})}function ma(e,t){let[n,r]=e.filter(e=>e.role===t);if(n===void 0||r!==void 0)throw Error(`Generated composite CLI role '${t}' is incomplete`);return n}function ha(e,t){let n=new Map(t.map(({name:e,optionKey:t})=>[e,t]));return(e??[]).map(e=>e.map(e=>{let t=n.get(e);if(t===void 0)throw Error(`x-aventure-cli-conflicts field '${e}' was removed from the generated CLI projection`);return t}))}function ga(e,t,n){let r=new Set(t.map(e=>e.optionKey));(e.requestBody?.length??0)>1&&r.add(`contentType`);let i=new Set(t.filter(e=>e.location===`path`).map(e=>e.name));return n.parameter.toSorted((e,t)=>_a(e.name)-_a(t.name)).flatMap(t=>{if(!t.required&&(r.has(t.inputName)||i.has(t.name)))return[];let n=lt(e,t,r);return r.add(n),[va(t,n,`body`)]})}function _a(e){let t=e.split(`.`).at(-1);return t===`min`?0:t===`max`?1:2}function va(t,n,r){let i=t.itemSchemaEnum??t.schemaEnum,a=Je(t.schemaType,t.itemSchemaType,t.schemaFormat,n),o=`${s(n)} ${t.schemaType===`boolean`?`[${a}]`:`<${a}>`}`;return{name:t.name,optionKey:new e(o).attributeName(),flag:o,required:t.required&&t.schemaDefault===void 0,description:qe(t.description,i),schemaType:t.schemaType,schemaFormat:t.schemaFormat,itemSchemaType:t.itemSchemaType,defaultValue:ya(t.schemaDefault),choices:i,...t.envName===void 0?{}:{envName:t.envName},...t.visibility&&{visibility:t.visibility},location:r}}var ya=e=>Array.isArray(e)?e.map(String):typeof e==`number`?String(e):e;export{dt as S,bn as _,Li as a,L as b,ci as c,_i as d,ai as f,Wn as g,jn as h,ra as i,pi as l,kn as m,ma as n,Bi as o,An as p,aa as r,yi as s,pa as t,hi as u,F as v,Ot as x,I as y};
16
+ `),{appendNewline:!0})}var Vi=e=>Z(e)?T(e):Array.isArray(e)&&e.every(Z)?e.map(e=>T(e)).join(`, `):JSON.stringify(e);function Hi(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a,transport:o}=e;if(t===void 0)return a!==void 0&&i!==void 0?[`status=${i} redirect=${a}`]:i===void 0?[]:[`status=${i} no response body`];let s=i===void 0||n===`GET`?``:`status=${i}`,c=X(t)&&!Xi(t)?Zi(t):null,l=c===null?void 0:X(c.context.interpretation)?ge(c.context):c.context,u=l!==void 0&&X(l)?Object.entries(l):[],d=u.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(X)),f=new Set(d.map(([e])=>e)),p=Object.fromEntries(u.filter(([e])=>!f.has(e)));return[s,...Xi(t)?K(t,e,r):c===null?$i(t)?Gi(t,[`filter`],t.meta,o):ea(t)?Gi(t,[`arrayFilterEntry`,`rangeFilterEntry`],t.filtersMeta,o):na(t)?Ki(t,o):q(t,``):[...K(c.page,e,r),...Object.keys(p).length===0?[]:q(p,``),...d.flatMap(([e,t])=>[`${e}:`].concat(Ui(t,o)))]].filter(Boolean)}function K(e,t,n){let r=qi(t),i=e.numberOfElements??e.content.length,a=Math.min(e.content.length,W),o=Math.max(1,a),s=(e.number??0)*(e.size??i),c=(e.totalElements??0)-s-i,l=e.number===void 0?``:` page=${e.number}`,u=e.size===void 0?``:` size=${e.size}`,d=e.totalElements===void 0?``:` total=${e.totalElements}`,f=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,p=(e.number??0)+1,m=e.totalPages===void 0||p<e.totalPages,h=E(`page`,t.parameters);return[`rows=${i}${l}${u}${d}${f}`,a>=i?``:`page rows omitted: ${i-a} (${a}/${i} shown); ${e.content.length>a?C(t.transport,`.content`):`reread with ${E(`size`,t.parameters)} ${o} and ${h} ${Math.floor((s+a)/o)} through ${Math.floor((s+i-1)/o)} (MCP: size, page); pages start at 0`}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${D(n)}`,c<=0||n!==void 0?``:m&&i===e.size?`more: ${c} rows not shown; use ${h} or ${E(`size`,t.parameters)} to see them`:`more: ${c} more matched but this response returns only these ${i}; narrow the query to reach them${m?` (${h} ${p} starts after this page)`:``}`,...Ui(e.content.slice(0,a),t.transport)].filter(Boolean)}function Ui(e,t){if(!e.every(X))return J(e,``);let n=e.filter(X);if(n.length===0)return e.length===0?[`(empty)`]:J(e,``);let r=Wi(n);if(r.length===0)return J(e,``);let i=n.slice(0,W).map(e=>{let t=Y(e);return r.map(e=>t[e]??``)}),a=r.map(e=>e.split(`.`).at(-1)??e),o=a.map((e,t)=>{let n=i.map(e=>e[t]??``),r=Math.max(e.length,...n.map(e=>e.length));return e===`id`||e.endsWith(`Id`)?r:Math.min(32,r)}),s=e=>e.map((e,t)=>fe(e,o[t]??12).padEnd(o[t]??12)).join(` `),c=[s(a),s(o.map(e=>`-`.repeat(e)))];return i.forEach(e=>c.push(s(e))),n.length>W&&c.push(`... ${n.length-W} more rows omitted; ${C(t)}`),c}function Wi(e){let t=e.map(e=>Y(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=Fi.filter(e=>n.has(e)),i=new Set(r.map(Yi)),a=[...n].filter(e=>{let n=t.every(t=>/^-?\d+(?:\.\d+)?$/u.test(t[e]??`0`));return!e.includes(`.`)||/id$/iu.test(e)||i.has(Yi(e))?!1:(n&&i.add(Yi(e)),n)}),o=[...n].filter(e=>/(?:^|\.)id$/u.test(e)).slice(0,1),s=[...new Set([...r,...o,...a])],c=[...n].filter(e=>!s.includes(e)).filter(e=>!e.toLowerCase().includes(`logo`)).slice(0,Ni-s.length);return[...s,...c].slice(0,Ni)}function Gi(e,t,n,r){let i=t.flatMap(t=>e[t].map((e,n)=>({...e,path:`.${t}[${n}].choiceOption`}))),a=n!==void 0&&X(n)?n:{},o=[`total`,`limit`].flatMap(e=>typeof a[e]==`number`?[` ${e}=${a[e]}`]:[]).join(``),s=[`filters=${i.length}${o}`];for(let e of i){let t=e.choiceOption.length,n=e.choiceOptionTotal===null?`unknown (degraded)`:e.choiceOptionTotal??t,i=e.choiceOptionTruncated===!0?` truncated`:``;s.push(`- ${e.filterKey} (${e.label}): choices ${t}/${n}${i}`),e.choiceOption.slice(0,G).forEach(t=>{s.push(` ${E(e.filterKey)} ${D(t.value)}`)}),t>G&&s.push(` ... ${t-G} choices omitted for ${e.filterKey}; ${C(r,e.path)}`)}return s}function Ki(e,t){let n=E(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,G).map(e=>`${n} ${D(e)}`),e.result.length>G?`... ${e.result.length-G} matches omitted; ${C(t,`.result`)}`:``].filter(Boolean)}function qi({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Ii.has(e)&&t.length>0).map(([e,n])=>`${E(e,t)} ${D(n)}`)}function Ji(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:void 0},[n,r,i]=[t(`method`),t(`endpoint`),t(`nextCursor`)];if(n===void 0||r===void 0)return null;let a=Reflect.get(e,`httpStatus`),o=Reflect.get(e,`response`),s=o===void 0?void 0:ue.safeParse(o);return s!==void 0&&!s.success?null:{method:n,endpoint:r,httpStatus:typeof a==`number`?a:void 0,location:t(`location`),operationId:t(`operationId`),summary:t(`summary`),nextCursor:i===``?void 0:i,response:s?.data}}function q(e,t,n){if(e===void 0)return[];if(Z(e))return[`${t}${he(e,n)}`];if(Array.isArray(e))return J(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if(Z(i))r.push(`${t}${n}: ${he(i,n)}`);else{r.push(`${t}${n}:`);for(let e of q(i,`${t} `,n))r.push(e)}}return r.length===0?[`${t}(empty)`]:r}function J(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e)if(Z(i))r.push(`${t}- ${he(i,n)}`);else{r.push(`${t}-`);for(let e of q(i,`${t} `))r.push(e)}return r}function Y(e,t=``,n=0){return Z(e)?t.length===0?{}:{[t]:T(e,t)}:n>Pi?{}:Array.isArray(e)?e[0]===void 0?{}:Y(e[0],t,n+1):Object.fromEntries(Object.entries(e).flatMap(([e,r])=>{if(r===void 0)return[];let i=t.length===0?e:`${t}.${e}`;return Z(r)?[[i,T(r,i)]]:Object.entries(Y(r,i,n+1))}))}var Yi=e=>e.split(`.`,1)[0],Xi=e=>X(e)&&Array.isArray(e.content);function Zi(e){let[t,...n]=Object.entries(e).filter(e=>Xi(e[1])&&typeof e[1].totalElements==`number`);if(t===void 0||n.length>0)return null;let[r,i]=t;return{page:i,context:Object.fromEntries(Object.entries(e).filter(([e])=>e!==r))}}function Qi(e){return X(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var $i=e=>X(e)&&ta(e.filter),ea=e=>X(e)&&ta(e.arrayFilterEntry)&&ta(e.rangeFilterEntry),ta=e=>Array.isArray(e)&&e.every(Qi),na=e=>X(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),X=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Z=e=>typeof e!=`object`||!e,Q=/\{([^}]+)\}/gu;function ra(e,t,n=`cli`){let i=t.filter(e=>e.method===`GET`&&(n===`cli`||e.binaryResponse!==!0)),a=t=>e.endpoint!==void 0&&t.endsWith(e.endpoint),o=t.find(t=>t.operationId===e.operationId),s=e.ok&&o!==void 0&&r(o.intent),c=[...s&&e.endpoint!==void 0?sa(e.endpoint.split(`?`)[0]??``,i,!1,n).map(e=>n===`mcp`?e:`${e} --data --to-file <path>`):[],...e.references.filter(e=>!a(e)).flatMap(oa).flatMap(e=>sa(e.pathname,i,!0,n)),...e.references.filter(a).flatMap(oa).flatMap(e=>ca(e,i,n))],l=n===`mcp`?ia:void 0;return c.length===0?{write:s,narrowerRead:l}:{exactRecovery:`Read the full result ${c.join(`; `)}.`,write:s,narrowerRead:l}}var ia=`Refetch a narrower result: call aventure_help with q set to the read intent, then call aventure_read with its operationId and declared query or pathParams, using ids/references, filters, or smaller query.page/query.size windows.`;function aa(e,t){let n=t.find(t=>t.operationId===e.operationId);if(!e.ok||n?.method!==`GET`||n.mutates===!0||r(n.intent)||e.endpoint===void 0)return;let i=new URL(e.endpoint,`https://localhost`),a=[...n.path.matchAll(Q)].map(([,e])=>e),o=RegExp(`^${n.path.replace(Q,`([^/]+)`)}$`,`u`).exec(i.pathname);if(o===null)return;let s=n.parameters.find(e=>e.location===`query`&&e.name===`compact`&&e.schemaType===`boolean`);s!==void 0&&i.searchParams.set(s.name,`true`);let c=[];for(let e of n.parameters){let t=e.location===`path`?[decodeURIComponent(o[a.indexOf(e.name)+1]??``)]:e.location===`query`?i.searchParams.getAll(e.name):[];if(e.required&&t.length===0)return;t.length>0&&c.push($(e),...t.map(fa))}return`Run: \`${da(n,[...c,`--data`,`--to-file`,`./aventure-output.json`])}\`. On success, the spill file contains the bare payload (top-level keys as returned), not the result envelope or a data.response wrapper.`}function oa(e){return URL.canParse(e)?[new URL(e)]:[]}function sa(e,t,n,r){return t.flatMap(t=>{let i=[...t.path.matchAll(Q)].map(([,e])=>e),a=RegExp(`^${t.path.replace(Q,`([^/]+)`)}$`,`u`),o=n&&i.length===0?null:a.exec(e);if(o===null)return[];if(r===`mcp`)return[la(t,{pathParams:Object.fromEntries(i.map((e,t)=>[e??``,decodeURIComponent(o[t+1]??``)]))})];let s=i.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[$(r),o[n+1]??``]});return[`${ua(t)}, ${da(t,s)}`]})}function ca(e,t,n){let r=t.find(t=>t.path===e.pathname);return r===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${r.path}/`))return[];let i=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),a=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(i===void 0||a===void 0)return[];if(n===`mcp`)return[`in windows: ${la(t,{query:{...Object.fromEntries([...e.searchParams].filter(([e])=>t.parameters.some(t=>t.location===`query`&&t.name===e))),[i.name]:`<offset>`,[a.name]:`<limit>`}})}, advancing query.${i.name} until a window returns fewer than query.${a.name} units`];let o=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[$(t),fa(n)]}),s=[$(i),`<n>`,$(a),`<n>`];return[`${ua(t)}, in windows: ${da(t,[...o,...s])}, advancing ${$(i)} until a window returns fewer than ${$(a)} units`]})}function la(e,t){return`${i(e.intent)} ${JSON.stringify({operationId:e.operationId,...t})}`}function ua(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function da(e,t){return[Ci,...e.cliPath,...t].join(` `)}function $(e){return e.flag.split(/\s+/u)[0]??e.flag}function fa(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function pa(e){return e.toSorted((e,t)=>e.projection.cliPath.length-t.projection.cliPath.length||e.projection.cliPath.join(` `).localeCompare(t.projection.cliPath.join(` `))||e.operationId.localeCompare(t.operationId)).map(e=>{let t=e.parameter.flatMap(t=>{if(t.in!==`path`&&t.in!==`query`&&t.in!==`header`)return[];let n=t.in;return(t.in===`query`&&t.itemProperty!==void 0?t.itemProperty:[t]).map(t=>{let r=va(t,j(e,t),n);if(t.legacyName===void 0)return r;let i=va(t,j(e,t,t.legacyName),n).flag;return i===r.flag?r:Object.assign(r,{legacyFlag:i})})}),n=e.requestBody?.map(n=>{let r=ga(e,t,n),i=ha(n.cliConflicts,r),a=i.length===0?{}:{cliConflicts:i};return Object.assign({},n,{parameter:r},a)}),r=e.response.find(({status:e})=>e.startsWith(`2`)),i=r?.schemaName?.replace(/Schema$/,``);return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliPath:e.projection.cliPath,summary:e.summary,description:e.description,binaryResponse:e.binaryResponse?!0:void 0,explain:e.explain?!0:void 0,deprecated:e.deprecated?!0:void 0,requestBody:n,mutationReadback:e.mutationReadback,scope:e.projection.scope,auth:e.projection.auth,visibility:e.projection.visibility,mutates:e.projection.mutates,errorResponse:e.errorResponse,successResponse:i,detailField:r?.detailField,parameters:t}})}function ma(e,t){let[n,r]=e.filter(e=>e.role===t);if(n===void 0||r!==void 0)throw Error(`Generated composite CLI role '${t}' is incomplete`);return n}function ha(e,t){let n=new Map(t.map(({name:e,optionKey:t})=>[e,t]));return(e??[]).map(e=>e.map(e=>{let t=n.get(e);if(t===void 0)throw Error(`x-aventure-cli-conflicts field '${e}' was removed from the generated CLI projection`);return t}))}function ga(e,t,n){let r=new Set(t.map(e=>e.optionKey));(e.requestBody?.length??0)>1&&r.add(`contentType`);let i=new Set(t.filter(e=>e.location===`path`).map(e=>e.name));return n.parameter.toSorted((e,t)=>_a(e.name)-_a(t.name)).flatMap(t=>{if(!t.required&&(r.has(t.inputName)||i.has(t.name)))return[];let n=lt(e,t,r);return r.add(n),[va(t,n,`body`)]})}function _a(e){let t=e.split(`.`).at(-1);return t===`min`?0:t===`max`?1:2}function va(t,n,r){let i=t.itemSchemaEnum??t.schemaEnum,a=Je(t.schemaType,t.itemSchemaType,t.schemaFormat,n),o=`${s(n)} ${t.schemaType===`boolean`?`[${a}]`:`<${a}>`}`;return{name:t.name,optionKey:new e(o).attributeName(),flag:o,required:t.required&&t.schemaDefault===void 0,description:qe(t.description,i),schemaType:t.schemaType,schemaFormat:t.schemaFormat,itemSchemaType:t.itemSchemaType,defaultValue:ya(t.schemaDefault),choices:i,...t.envName===void 0?{}:{envName:t.envName},...t.visibility&&{visibility:t.visibility},location:r}}var ya=e=>Array.isArray(e)?e.map(String):typeof e==`number`?String(e):e;export{dt as S,bn as _,Li as a,L as b,ci as c,_i as d,ai as f,Wn as g,jn as h,ra as i,pi as l,kn as m,ma as n,Bi as o,An as p,aa as r,yi as s,pa as t,hi as u,F as v,Ot as x,I as y};
@@ -0,0 +1 @@
1
+ import{O as e,T as t,i as n,l as r,m as ee,n as i,o as a,p as o,r as s,t as c,u as l,v as u,w as d,y as f}from"./person-owner-C0YuWKvY.js";var te=a([`domicile`,`dominant`,`origin`]),ne=f({endDate:s().nullish(),id:o(),isCurrent:l(),role:te.nullish(),startDate:s().nullish()}),re=f({id:o().nullish(),name:d()}),ie=f({countryCodeChar2:d().nullish(),countryCodeChar3:d().nullish(),id:o().nullish(),name:d(),unRegion:d().nullish(),unSubregion:d().nullish()}),ae=f({id:o().nullish(),name:d(),stateAbbrev:d().nullish()}),p=f({address:o().nullish(),addressLine1:d().nullish(),addressLine2:d().nullish(),association:r(ne).optional(),city:re.nullish(),country:ie.nullish(),countryAbbrev:d().nullish(),createdAt:n({offset:!0}).nullish(),fullAddress:d().nullish(),id:o().nullish(),isCurrent:l().nullish(),isHq:l().nullish(),isPrimary:l().nullish(),latitude:u().nullish(),longitude:u().nullish(),postalCode:d().nullish(),state:ae.nullish(),stateAbbrev:d().nullish(),street:d().nullish(),updatedAt:n({offset:!0}).nullish()}),m=a([`editorial`,`standardized`]),h=Object.assign(t([m,d()]),{enum:m.enum}),oe=f({isCurrent:l().nullish(),isPrimary:l().nullish(),name:d().max(255),registry:h}),g=ee(oe,f({bucket:d().nullish(),classificationId:o().nullish(),createdAt:n({offset:!0}).nullish(),id:o(),isCurrent:l().nullish(),isPrimary:l().nullish(),name:d().max(255),slug:d().regex(/^[a-z0-9_-]+$/).max(255).nullish(),type:d(),updatedAt:n({offset:!0}).nullish()})),_=f({category:d(),classificationId:o().nullish(),code:o().nullish(),createdAt:n({offset:!0}).nullish(),id:o(),isCurrent:l().nullish(),isPrimary:l().nullish(),level:o().nullish(),name:d().max(255),registry:h,updatedAt:n({offset:!0}).nullish()}),se=f({geoLocationExposure:r(g).default([]).optional(),industry:r(g).default([]).optional(),mainProduct:r(g).default([]).optional(),standardizedClassification:r(_).default([]).optional(),tag:r(g).default([]).optional(),typeCustomer:r(g).default([]).optional(),typeModel:r(g).default([]).optional(),typeOwnership:r(g).default([]).optional(),typeRevenue:r(g).default([]).optional(),typeTechnologyUsed:r(g).default([]).optional()}),ce=a(`Angel.Pre-Seed.Seed.Series A.Series B.Series C.Series D.Series E.Series F.Series G.Series H.Series I.Series J.Series K.Series L.Series M.Series N.Series O.Series P.Series Q.Series R.Series S.Series T.Series U.Series V.Series W.Series X.Series Y.Series Z.Late Stage Private.Investment Firm.Fund.Nonprofit.Government.Public.Acquired.Acquired Subsidiary.Bankrupt`.split(`.`)),le=Object.assign(t([ce,d()]),{enum:ce.enum}),v=f({currency:d().nullish(),fundingRoundCount:o(),investorCount:o(),latestValuation:u().nullish(),mostRecentAmount:u().nullish(),mostRecentDate:s().nullish(),stage:le.nullish(),totalRaised:u(),totalRaisedUsd:u().nullish(),unconvertedRoundCount:o()}),y=f({expanded:d().nullish(),generatedDescription:d().nullish(),short:d().nullish()}),ue=a([`cloudflare`,`akamai`,`fastly`,`awsCloudfront`,`vercel`,`netlify`,`sucuri`,`incapsula`,`bunny`,`keycdn`,`cdn77`,`gcore`,`cdnetworks`,`azureCdn`,`leaseweb`,`digitalocean`,`stackpath`,`googlecloudCdn`,`none`,`unknown`]),de=a([`static`,`jsRequired`,`jsEnhanced`]),b=d(),x=f({crawlCdnProvider:ue.nullish(),crawlRenderMode:de.nullish(),createdAt:n({offset:!0}).nullish(),id:o().nullish(),isCurrent:l().nullish(),isPrimary:l().nullish(),owner:c.nullish(),sourceId:d().nullish(),status:d().nullish(),statusChecked:n({offset:!0}).nullish(),updatedAt:n({offset:!0}).nullish(),url:d(),urlType:b}),S=f({address:r(p),classification:se,fundingDetail:v.nullish(),headquartersAddressId:o().nullish(),headquartersRemoteAsOf:n({offset:!0}).nullish(),text:y,urlLink:r(x)}),C=f({isMonogram:l(),logo:d().nullish(),logoSquare:d().nullish()}),fe=a([`alternativeDba`,`relatedLegal`]),pe=f({displayable:l().nullish(),name:d(),type:fe.nullish()}),w=f({hasAcquisitions:l().default(!1).optional(),hasAnalysis:l(),hasEmployees:l(),hasFundraising:l(),hasNews:l(),productServiceSlug:r(d())}),T=f({defaultCurrency:d().nullish(),foundedYear:o().nullish(),id:e(),image:C,lastModifiedAt:n({offset:!0}).nullish(),nameAlias:r(pe),nameBrand:d(),nameLegal:d().nullish(),operatingStatus:d().nullish(),publicId:d().regex(/^e[0-9A-Za-z]{11}$/).nullish(),publicUrl:d().nullish(),sitemap:w.nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255),typeRecord:i,updatedAt:n({offset:!0}).nullish()}),E=a([`SAFE`,`Convertible Note`,`Preferred Stock`,`Common Stock`,`Other Equity`,`Bond`,`Loan`,`Other Debt`,`Grant`,`Token`]),D=f({amountInvested:u().nullish(),createdAt:n({offset:!0}),financialInstrumentType:E.nullish(),id:e(),investor:c,investorName:d().nullish(),investorSlug:d().regex(/^[a-z0-9_-]+$/).max(255).nullish(),leadInvestor:l(),transactionId:e(),updatedAt:n({offset:!0})}),O=f({core:T,fundingDetail:v.nullish()}),k=f({lastFetchedAt:n({offset:!0}).nullish(),publishedAt:n({offset:!0}).nullish(),recordedAt:n({offset:!0}),sourceDetail:d()}),A=a([`High`,`Medium`,`Low`,`Verified`]),me=a([`direct`,`managedFund`]),j=f({round:d()}),M=f({amountInvested:u().nullish(),attributionType:me,beneficialEntityId:e().nullish(),fundManagerRelationshipId:o().nullish(),joinId:e(),leadInvestor:l(),recordedEntityId:e().nullish(),round:j.nullish(),transactionId:e()}),N=f({amountRaised:u().int().nullish(),createdAt:n({offset:!0}).nullish(),currency:d().nullish(),dataConfidence:A.nullish(),dateAnnounced:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),dateFundingComplete:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),dateInvestorExit:n({offset:!0}).nullish(),entity:O.nullish(),financialInstrumentType:E.nullish(),id:e(),investor:r(D).nullish(),investorAttribution:M.nullish(),investorCount:o().nullish(),publicSource:k.nullish(),round:d().nullish(),roundType:d().nullish(),sourceAttribution:r(M),updatedAt:n({offset:!0}).nullish(),valuationPostMoney:u().int().nullish(),valuationPreMoney:u().int().nullish()}),P=f({entity:T,headquarters:p.nullish(),relationshipType:a([`fundManagerFirm`,`productService`])}),he=f({fundingStage:le.nullish(),ownership:r(d()),pricingModel:r(d()),sellsTo:r(d()),totalRaised:u().nullish(),website:d().nullish()}),F=f({asOf:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),comparisonSignals:he.nullish(),createdAt:n({offset:!0}).nullish(),detail:d().nullish(),entity:T,id:o().nullish(),isCurrent:l().nullish(),isPrimary:l().nullish(),publicSource:k.nullish(),get relationship(){return r(F)},relationshipType:d(),sourceEntityId:e().nullish(),targetEntityId:e().nullish(),updatedAt:n({offset:!0}).nullish()}),I=F,L=f({accelerator:T,acceleratorName:d(),asOfDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),batch:d().nullish(),id:d(),program:d().nullish(),status:d().nullish()}),R=a([`text`,`numeric`,`monetary`,`percentage`,`date`]),ge=a([`pastDue`,`withinThreeMonths`,`threeToSixMonths`,`sixToTwelveMonths`,`twelveToTwentyFourMonths`,`beyondTwoYears`]),_e=f({asOfDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),bucket:ge,monthsFromNow:o(),targetDate:n({offset:!0})}),z=f({asOfDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),currentEligible:l().nullish(),derivedRange:_e.nullish(),discreteValue:u().nullish(),entityId:e(),id:o(),publicSource:k.nullish(),textValue:d().nullish(),typeResearchDetail:d(),updatedAt:n({offset:!0}).nullish(),valueResearchDetail:d().nullish(),valueType:R}),B=f({characterCount:o(),meetsRequirements:l(),violation:r(d()),wordCount:o()}),V=f({compliance:B.nullish(),entityId:e(),id:o(),publicSource:k.nullish(),text:d(),textType:d(),updatedAt:n({offset:!0}).nullish()}),ve=f({acceleratorParticipation:r(L),detail:r(z),snippet:r(V)}),H=f({author:d().nullish(),category:d().nullish(),createdAt:n({offset:!0}).nullish(),excerpt:d().nullish(),externalNewsArticle:l().nullish(),id:o(),newsImageThumbnail:d().nullish(),newsUrlOriginal:d().nullish(),publication:d().nullish(),publishedAt:n({offset:!0}).nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255).nullish(),title:d(),updatedAt:n({offset:!0}).nullish()}),ye=a([`aventureBlog`,`personalBlog`,`employerBlog`,`linkedin`,`xTwitter`,`medium`,`substack`,`other`]),U=f({author:d().nullish(),createdAt:n({offset:!0}),externalId:d().nullish(),id:e(),isCurrent:l(),lastFetchedAt:n({offset:!0}).nullish(),mentionedEntityId:r(e()),mentionedPersonId:r(e()),owner:c,publishedAt:n({offset:!0}).nullish(),summary:d().nullish(),summaryGeneratedAt:n({offset:!0}).nullish(),title:d().nullish(),topic:d().nullish(),type:ye,updatedAt:n({offset:!0}),url:d()}),be=f({count:o(),stage:d()}),xe=f({attributedInvestmentCount:o(),averageAmountInvestedUsd:u().nullish(),currentPortfolioCount:o(),largestAmountInvestedUsd:u().nullish(),portfolioCompanyCount:o(),smallestAmountInvestedUsd:u().nullish(),topInvestmentStage:r(be),totalAmountInvestedUsd:u().nullish(),totalInvestment:o(),totalPortfolioExit:o(),totalWriteOff:o()}),Se=a([`nickname`,`maidenName`,`formerName`,`stageName`]),W=f({displayable:l().nullish(),name:d(),type:Se.nullish()}),G=f({isMonogram:l(),picture:d().nullish()}),K=f({associationId:o(),endDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),entityAddress:r(p),entityId:e(),entityLogo:C,entityName:d().nullish(),entityOperatingStatus:d().nullish(),entitySlug:d().regex(/^[a-z0-9_-]+$/).max(255),entityType:i.nullish(),entityUrlLink:r(x),isCurrent:l().nullish(),personAddress:r(p),personId:e(),personImage:G,personName:d(),personSlug:d().regex(/^[a-z0-9_-]+$/).max(255),personUrlLink:r(x),score:o().nullish(),startDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),titleFunction:d().nullish(),titleId:o().nullish(),titleLevel:d().nullish(),titleName:d().nullish()}),Ce=f({address:r(p),urlLink:r(x)}),q=a([`low`,`medium`,`high`]),we=f({asOfDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),currentEligible:l().nullish(),dataConfidence:q.nullish(),dateValue:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),numericValue:u().nullish(),referenceValue:d().nullish(),source:d().nullish(),textValue:d().nullish(),updatedAt:n({offset:!0}).nullish(),valueType:R}),J=f({asOfDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),fact:we,id:d()}),Y=f({isCurrent:l().nullish(),personId:e(),personImage:G,personName:d(),personSlug:d().regex(/^[a-z0-9_-]+$/).max(255),titleName:d().nullish()}),Te=f({entity:O,keyPerson:r(Y)}),Ee=f({colleague:r(Y),employeeCount:J.nullish(),entity:O,primaryAddress:p.nullish(),recentNews:r(H),similarEntity:r(Te)}),De=f({overlapCount:o(),person:Y,round:d().nullish(),sharedEntity:T.nullish(),transactionId:e().nullish()}),Oe=f({careerContext:r(Ee),coInvestor:r(De),computedAt:n({offset:!0}).nullish()}),ke=f({amountRaised:u().nullish(),dateAnnounced:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),id:e(),image:C,investorCount:o().nullish(),nameBrand:d(),round:d().nullish(),status:d().nullish(),valuationPostMoney:u().nullish()}),Ae=f({entity:T,headquartersCity:d().nullish(),headquartersCountry:d().nullish(),headquartersRegion:d().nullish(),industry:d().nullish()}),X=f({amount:u().nullish(),company:Ae,date:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),fundraiseTransaction:ke.nullish(),fundraiseTransactionId:e(),id:d(),investmentDate:n({offset:!0}),investorAttribution:M.nullish(),round:d().nullish()}),Z=a([`entity`,`person`,`newsArticle`,`blogPost`,`text`,`classificationTag`,`classificationCode`,`product`,`service`,`agentHelpDoc`,`researchSnippet`,`sourceDocument`]),je=Object.assign(t([Z,d()]),{enum:Z.enum}),Me=f({computedAt:n({offset:!0}),cosineDistance:u(),cosineScore:u(),modelVersion:d(),rank:o(),sourceHash:d(),sourceId:d(),sourceType:je}),Q=f({bioUpdatedAt:n({offset:!0}).nullish(),createdAt:n({offset:!0}).nullish(),gender:d().nullish(),id:e(),image:G,lastModifiedAt:n({offset:!0}).nullish(),nameAlias:r(W),nameFirst:d().nullish(),nameFull:d(),nameLast:d().nullish(),nameMiddle:d().nullish(),nickname:d().nullish(),publicId:d().regex(/^p[0-9A-Za-z]{12}$/).nullish(),semanticMatch:Me.nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255),suffix:d().nullish(),text:y,updatedAt:n({offset:!0}).nullish()}),Ne=a([`precomputed`,`live`]),Pe=f({compositeScore:u().nullish(),cosineScore:u().nullish(),matchedSectionWeight:u().nullish(),origin:Ne,rank:o(),sharedSectionCount:o().nullish()}),Fe=f({currentRole:K.nullish(),person:Q,similarity:Pe}),Ie=f({articleCount:o().nullish(),association:r(K),blogPost:r(U).nullish(),core:Q,enrichment:Ce,graph:Oe.nullish(),investment:r(X),investorActivity:xe.nullish(),nameAlias:r(W),similar:r(Fe).nullish()}),Le=a([`ein`,`secCik`,`ticker`,`lei`,`duns`,`isin`,`cusip`,`crd`,`orcid`,`folk`]),Re=Object.assign(t([Le,d()]),{enum:Le.enum}),$=f({createdAt:n({offset:!0}),id:o(),identifier:d(),idType:Re,owner:c,source:d().nullish(),updatedAt:n({offset:!0})}),ze=f({core:T,enrichment:S,fundraiseRound:r(N),newsArticle:r(H),person:r(Ie),provider:P.nullish(),publicUrl:d().nullish(),relationship:r(I),research:ve,sitemap:w,uniqueId:r($)});export{_ as A,k as C,x as D,S as E,b as O,A as S,T,I as _,Q as a,M as b,J as c,U as d,H as f,L as g,z as h,Fe as i,g as j,v as k,q as l,B as m,$ as n,Me as o,V as p,Ie as r,X as s,ze as t,K as u,P as v,D as w,j as x,N as y};