@aventurevc/aventure-cli 0.8.180 → 0.8.181
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aventure-cli/index.js +1 -1
- package/dist/aventure-cli/unified-operations.json +19 -268
- package/dist/chunks/{aventure-cli-1wY4a8zo.js → aventure-cli-TzWe0JCu.js} +5 -5
- package/dist/chunks/{cli-help-policy-ClfxVVMO.js → cli-help-policy-DUARQ4wz.js} +1 -1
- package/dist/chunks/contract-EVv6oDkS.js +27 -0
- package/dist/chunks/detail-CSoU73eT.js +1 -0
- package/dist/chunks/{detail-DDrpot7C.js → detail-MEh1aLs6.js} +1 -1
- package/dist/chunks/{dist-COybJYus.js → dist-F6oHzTAJ.js} +2 -2
- package/dist/chunks/mcp-generation-contract-B7DhTI6F.js +1 -0
- package/dist/chunks/mcp-generation-contract-Cz19o23D.js +1 -0
- package/dist/chunks/{oauth-bearer-credential-BdZ-pdVf.js → oauth-bearer-credential-DKnuQe5D.js} +2 -2
- package/dist/chunks/oauth-bearer-credential-Dm5z74F2.js +1 -0
- package/dist/chunks/{oauth-login-BfnyHuts.js → oauth-login-CbUY11wb.js} +1 -1
- package/dist/chunks/oauth-login-CnWRvM6E.js +1 -0
- package/dist/chunks/openapi-commands-Bm7sTOA4.js +1 -0
- package/dist/chunks/openapi-commands-BxF0Cw1A.js +1 -0
- package/dist/chunks/provider-catalog-DcrjzHvb.js +1 -0
- package/dist/chunks/startup-auth-6aYRzFwo.js +1 -0
- package/dist/chunks/{startup-auth-DaJp5qea.js → startup-auth-CL764pKQ.js} +1 -1
- package/dist/chunks/{tool-policy-DDfbFJCQ.js → tool-policy-Dw6KBl9G.js} +1 -1
- package/package.json +3 -3
- package/dist/chunks/contract-qNgU9Yeq.js +0 -27
- package/dist/chunks/detail-B93equBj.js +0 -1
- package/dist/chunks/mcp-generation-contract-57Ma8uaG.js +0 -1
- package/dist/chunks/mcp-generation-contract-qkSbgO9-.js +0 -1
- package/dist/chunks/oauth-bearer-credential-nO_y4YXf.js +0 -1
- package/dist/chunks/oauth-login-Cgjwcc4U.js +0 -1
- package/dist/chunks/openapi-commands-BQWRBrXR.js +0 -1
- package/dist/chunks/openapi-commands-EyRhLowQ.js +0 -1
- package/dist/chunks/provider-catalog-sHoS3jIA.js +0 -1
- package/dist/chunks/startup-auth-G6Utbedw.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"./commander-BB7CDPLs.js";import{i as a,o}from"./logging-BkyFCiym.js";import{i as s,o as c,r as l,s as u,t as d,u as f}from"./env-Casn05NX.js";import{M as p,O as m,i as h,o as g,v as ee,w as _,y as v}from"./person-owner-BJgNYLKX.js";import{Ar as te,Br as ne,Mr as re,Or as ie,Pr as ae,jr as oe,kr as se,zr as ce}from"./dist-COybJYus.js";import{c as y,d as le,i as b,r as ue}from"./result-envelope-CFE7wPAr.js";import{a as x,n as de,r as fe,t as pe}from"./package-DPDX5zmx.js";import{_ as me,c as he,g as ge,i as _e,s as ve,t as ye,v as be,y as xe}from"./tool-policy-DDfbFJCQ.js";import{i as Se,r as Ce}from"./response-problem-DpVA-CLe.js";import{n as we,r as Te}from"./output-spill-CjiBFqUS.js";import{a as Ee,c as De,d as Oe,g as ke,i as Ae,l as je,n as S,o as Me,p as Ne,r as Pe,s as Fe,u as Ie,x as Le,y as Re}from"./contract-qNgU9Yeq.js";import{a as ze,c as Be,i as Ve,l as He,n as Ue,s as We,t as Ge}from"./cli-help-policy-ClfxVVMO.js";import{S as Ke,_ as qe,a as Je,g as C,h as Ye,i as Xe,m as Ze,n as Qe,p as $e,r as et,s as tt,t as nt,v as rt,x as w,y as it}from"./api-key-bearer-credential-08YUx1xO.js";import{a as at,c as ot,d as st,g as ct,l as lt,m as ut,o as dt,s as ft,t as pt,u as mt}from"./oauth-bearer-credential-BdZ-pdVf.js";import{n as ht,r as gt,t as _t}from"./oauth-login-BfnyHuts.js";import{a as vt,c as yt,d as bt,i as xt,l as St,n as Ct,o as wt,s as Tt,t as Et,u as Dt}from"./startup-auth-DaJp5qea.js";import{n as Ot,t as T}from"./openapi-commands-BQWRBrXR.js";import{i as E,r as kt,t as D}from"./output-mode-Bl9hZ5Qe.js";import{spawnSync as At}from"node:child_process";import{basename as O,dirname as k,relative as jt,resolve as A,sep as Mt}from"node:path";import{copyFileSync as Nt,existsSync as j,lstatSync as Pt,mkdirSync as M,mkdtempSync as Ft,readFileSync as It,readdirSync as Lt,readlinkSync as Rt,realpathSync as zt,renameSync as Bt,symlinkSync as Vt,writeFileSync as Ht}from"node:fs";import N,{stderr as P,stdin as Ut}from"node:process";import{TextDecoder as Wt,inspect as Gt}from"node:util";import{homedir as Kt,hostname as qt,platform as Jt}from"node:os";import{fileURLToPath as Yt}from"node:url";import{setTimeout as Xt}from"node:timers/promises";import{randomUUID as Zt,webcrypto as Qt}from"node:crypto";import{readFile as $t}from"node:fs/promises";import{createInterface as en}from"node:readline/promises";function tn(e,t,n){let r={...n};for(let n of t.parameter){let t=n.envName;if(t===void 0)continue;let i=process.env[t]?.trim();if(i===void 0||i.length===0)continue;let a=r[n.optionKey];if(a!==void 0&&(typeof a!=`string`||a!==i))return{...b(`${e} ${n.flag.split(` `)[0]??n.name} conflicts with ${t}; omit the flag or use ${i}.`),data:r};a===void 0&&(r[n.optionKey]=i)}return y(`Environment-bound options applied`,r)}function nn(e,t,n){if(!I(n))return null;for(let r of t.parameter){let t=r.envName,i=t===void 0?void 0:process.env[t]?.trim();if(t===void 0||i===void 0||i.length===0||!_n(n,r.name))continue;let a=gn(n,r.name);if(typeof a!=`string`||a!==i)return`${e} ${r.name} in --from-file conflicts with ${t}; omit the field or use ${i}.`}return null}function rn(e){let t=new Set(e.parameter.map(({name:e})=>e));return e.kind===`multipart`?e.requiredPath:e.requiredPath.filter(e=>!t.has(e))}function an(e,t,n,r=!1){if(r||!F(t)||!Array.isArray(n))return xn(e,t,n);for(let[r,i]of n.entries()){let n=xn(e,t,i,r);if(!n.ok)return n}return y(`Body value assigned`,null)}function on(e,t,n,r){return xn(e,t,r,n)}function sn(e){let t=[];for(let n of e.split(`.`)){let e=Cn(n);if(t.push(e.key),e.isArray)return t.join(`.`)}return null}function cn(e,t){let n=sn(t);if(n===null)return null;let r=hn(e,n.split(`.`));return Array.isArray(r)?{path:n,rowCount:r.length,firstHole:mn(r)}:null}function ln(e,t){if(F(e.name)||e.schemaType===`array`)return y(`Repeated body option selected`,typeof t==`string`?[t]:t);if(!Array.isArray(t))return y(`Scalar body option selected`,t);let n=e.flag.split(` `)[0]??e.name;return t.length===1?y(`Scalar body option selected`,t[0]):b(`${n} was already given; pass it once.`)}var un=/^(?<row>\d+):(?<item>.*)$/su;function dn(e,t){let n=sn(e.name);if(e.schemaType!==`array`||n===null||t===void 0||typeof t==`boolean`)return null;let r=new Map,i=[];for(let e of typeof t==`string`?[t]:t){let t=un.exec(e)?.groups,n=t?.row,a=t?.item;if(n===void 0||a===void 0){i.push(e);continue}let o=r.get(Number(n));o===void 0?r.set(Number(n),[a]):o.push(a)}return r.size===0?null:{container:n,rows:r,plain:i}}function fn(e,t,n){let r=0;for(let i of e.parameter){let e=t[i.optionKey];e!==void 0&&typeof e!=`boolean`&&sn(i.name)===n&&(r=Math.max(r,typeof e==`string`?1:e.length))}return r}function pn(e,t,n,r){for(let i of t.parameter){let t=n[i.optionKey];if(t===void 0)continue;let a=cn(r,i.name);if(a===null)continue;if(a.firstHole!==null)return b(`${e} has no ${a.path}[] row ${a.firstHole} — number ${a.path}[] rows from 0 with no gaps.`);if(i.schemaType!==`array`||a.rowCount<=1||dn(i,t)!==null)continue;let o=i.flag.split(` `)[0]??i.name;return b(`${o} fills one ${a.path}[] row's list, so ${e} cannot also build ${a.rowCount} ${a.path}[] rows from direct options — prefix each value with its 0-based ${a.path}[] row index, as 0:value, or pass the rows with --from-file.`)}return null}function mn(e){for(let t=0;t<e.length;t+=1)if(e[t]===void 0)return t;return null}function hn(e,t){let n=e;for(let e of t){if(!I(n))return;n=n[e]??null}return n}function gn(e,t){if(!F(t))return hn(e,t.split(`.`))}function _n(e,t){return yn(e,t.split(`.`))}function vn(e,t,n){if(!I(n))return null;let r=new Set(t.parameter.map(({name:e})=>e));for(let i of e)if(i!==t){for(let e of i.parameter)if(!r.has(e.name)&&_n(n,e.name))return`${e.name} in --from-file requires --content-type ${i.contentType}.`}return null}function yn(e,t){let[n,...r]=t;if(n===void 0)return!0;let i=Cn(n);if(!I(e)||!Object.hasOwn(e,i.key))return!1;let a=e[i.key]??null;return i.isArray?Array.isArray(a)&&a.every(e=>yn(e,r)):yn(a,r)}function F(e){return e.split(`.`).some(e=>Cn(e).isArray)}function bn(e,t){return e.parameter.length===0||!I(t)?null:Tn(t,[],wn(e.parameter))}function I(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xn(e,t,n,r=0){let i=t.split(`.`),a=e;for(let[e,o]of i.entries()){let s=Cn(o),c=e===i.length-1,l=Sn(a,s,t,c,n,r);if(!l.ok||l.data===null)return b(l.summary,l.warnings);if(c)return y(`Body value assigned`,null);a=l.data}return b(`${t} is not a valid body option path.`)}function Sn(e,t,n,r,i,a){let o=()=>b(`${n} cannot be combined with another body option at ${t.key}.`),s=e[t.key];if(t.isArray){if(s!==void 0&&!Array.isArray(s))return o();let n=s??[];if(s===void 0&&(e[t.key]=n),r)return n[a]===void 0?(n[a]=i,y(`Body value assigned`,e)):o();let c=n[a];if(c===void 0){let e={};return n[a]=e,y(`Body path created`,e)}return I(c)?y(`Body path stepped`,c):o()}if(r)return s===void 0?(e[t.key]=i,y(`Body value assigned`,e)):o();if(s===void 0){let n={};return e[t.key]=n,y(`Body path created`,n)}return I(s)?y(`Body path stepped`,s):o()}function Cn(e){let t=e.endsWith(`[]`);return{key:t?e.slice(0,-2):e,isArray:t}}function wn(e){let t=new Set,n=new Set;for(let r of e){let e=`${r.name}${r.schemaType===`array`?`[]`:``}`;t.add(e);let i=e.split(`.`);for(let e=1;e<i.length;e+=1)n.add(i.slice(0,e).join(`.`))}return{leaf:t,prefix:n}}function Tn(e,t,n){if(Array.isArray(e)){if(e.length===0)return null;for(let r of e){let e=Tn(r,t,n);if(e!==null)return e}return null}if(!I(e))return null;for(let[r,i]of Object.entries(e)){let e=[...t,Array.isArray(i)?`${r}[]`:r],a=e.join(`.`);if(!En(a,n)){if(!Dn(e))continue;let t=On(e,n);return{path:a,...t===void 0?{}:{suggestion:t}}}let o=Tn(i,e,n);if(o!==null)return o}return null}function En(e,t){return t.prefix.has(e)||t.leaf.has(e)}function Dn(e){return e.slice(0,-1).some(e=>e.endsWith(`[]`))}function On(e,t){let n=e.slice(0,-1).join(`.`),r=e.at(-1)?.replace(/\[\]$/u,``).toLowerCase()??``;return[...t.leaf].filter(e=>e.split(`.`).slice(0,-1).join(`.`)===n).map(e=>({path:e,score:kn(r,e.split(`.`).at(-1)??``)})).filter(({score:e})=>e<1/0).toSorted((e,t)=>e.score-t.score||e.path.localeCompare(t.path))[0]?.path}function kn(e,t){let n=t.replace(/\[\]$/u,``).toLowerCase();return n===e?0:n.endsWith(e)||e.endsWith(n)?1:n.includes(e)||e.includes(n)?2:1/0}var An=e=>Array.isArray(e)&&!Object.isFrozen(e);function jn(e,t){let n=new Map;for(let e of t){let t=e.flag?.split(` `)[0];t!==void 0&&n.set(t,t===`--from-file`?{...e,inputType:`file`}:e)}for(let t of e){let e=t.long===void 0?void 0:n.get(t.long);e!==void 0&&(t.helpGroup(Be(e)),t.description=ae(t.description,{...e,hasParseDefault:t.defaultValue!==void 0}))}if(!An(e))throw Error(`Commander option list is frozen; generated option help cannot be ordered.`);e.sort((e,t)=>{let r=e.long===void 0?void 0:n.get(e.long),i=t.long===void 0?void 0:n.get(t.long);return r!==void 0&&i!==void 0?zn(r,i):r===void 0?i===void 0?0:1:-1})}function Mn(e){let t=new Map;for(let n of e)for(let e of n.parameter){let r=e.flag.split(` `)[0]??e.flag,i=t.get(r);i===void 0?t.set(r,{variant:[{descriptor:n,parameter:e}]}):t.set(r,{variant:[...i.variant,{descriptor:n,parameter:e}]})}return[...t.values()]}function Nn(e){let{flag:t}=e.variant[0].parameter;return e.variant.every(({parameter:e})=>e.flag===t)?t:`${t.split(` `)[0]??t} <value>`}function Pn(e){let t=e.variant.map(({descriptor:e,parameter:t})=>({contentType:e.contentType,text:Ln(e,t)})),n=t[0];return n===void 0?``:t.every(({text:e})=>e===n.text)?`${n.text===``?``:`${n.text} `}Request content: ${t.map(({contentType:e})=>e).join(`, `)}.`:t.map(({contentType:e,text:t})=>`${e}: ${t}`).join(` `)}function Fn(e,t){return[...new Set((e.cliConflicts??[]).filter(e=>e.includes(t)).flatMap(e=>e.filter(e=>e!==t)))]}function In(e,t){let n=e.kind===`multipart`?`Read a JSON object keyed by multipart part name from a file, or use - for stdin`:`Read the JSON request body from a file, or use - for stdin`,r=t.filter(e=>!t.some(t=>t.startsWith(`${e}.`)||t.startsWith(`${e}[].`)));return r.length===0?He(n):`${He(n)} Required JSON paths: ${r.join(`, `)}.`}function Ln(e,t){let n=ze(t.description,void 0),r=e.kind!==`multipart`&&F(t.name),i=e.kind!==`multipart`&&t.optionKey!==t.name&&/^\w+$/u.test(t.name);return`${n}${r?` Repeat to add another value.`:``}${i?` --from-file JSON key: ${t.name}.`:``}${Rn(e,t)}`}function Rn(e,t){if(e.kind===`multipart`||t.schemaType!==`array`)return``;let n=sn(t.name);return n===null?``:` Prefix each value with its 0-based ${n}[] row index, as 0:value, to fill more than one ${n}[] row. A leading digits-and-colon is always read as that index, so name the row of a value that starts the same way, as 0:0:00 for the value 0:00.`}function zn(e,t){return We(e)-We(t)||Number(e.required!==!0)-Number(t.required!==!0)}async function Bn(e){let t;try{t=e===`-`?await Vn():await $t(e,`utf8`)}catch(t){return b(`Could not read input: ${t.message}`,[`path=${e}`])}try{if(t.trim().length===0)return y(`No input provided`,null);let e=JSON.parse(t);return y(`Input parsed`,e)}catch(e){return b(`Input is not valid JSON: ${e.message}`)}}async function Vn(){if(process.stdin.isTTY)throw Error(`--from-file - requires JSON on stdin, but stdin is a TTY`);process.stdin.setEncoding(`utf8`);let e=``;for await(let t of process.stdin)e+=t;return e}var Hn=`--content-type`;function Un(e,n,r){let i=e=>!r?.has(e)&&(r?.add(e),!0),a=n.requestBody??[];if(a.length>1&&i(Hn)){let n=a.map(({contentType:e})=>e);e.addOption(new t(`${Hn} <media-type>`,`Select the request body encoding, never an uploaded file's media type; omit for ${n[0]}.`).choices(n).argParser(Gn(a)))}if(lr(n)&&i(`--from-file`)){let r=a[0];if(r===void 0)throw Error(`${n.operationId} has no request body`);e.addOption(new t(`--from-file <path>`,In(r,r.requiredPath)).argParser(qn(`--from-file`)))}let o=Mn(a).filter(e=>i(L(e.variant[0].parameter)));for(let n of o.toSorted((e,t)=>zn(e.variant[0].parameter,t.variant[0].parameter))){let{descriptor:r,parameter:i}=n.variant[0],o=new t(Nn(n),a.length>1?Pn(n):Ln(r,i));a.length===1&&i.envName!==void 0&&o.env(i.envName);let s=a.length===1?Fn(r,i.optionKey):[];s.length>0&&o.conflicts(s),a.length>1?o.argParser(Wn):F(i.name)||i.schemaType===`array`?o.argParser(Kn):o.argParser(qn(i.flag)),e.addOption(o),o.envVar!==void 0&&e.on(`optionEnv:${o.name()}`,()=>{let t=e.opts()[i.optionKey];typeof t==`string`&&t.trim()&&e.setOptionValueWithSource(i.optionKey,t.trim(),`env`)})}cr(e,n,o)}function Wn(e,t){return t===void 0?e:typeof t==`string`?[t,e]:[...t,e]}function Gn(e){return(t,r)=>{if(r!==void 0)throw new n(`${Hn} was already given; pass it once.`);let i=ge(e,t);if(!i.ok)throw new n(i.summary);return t}}function Kn(e,t){return[...t??[],e]}function qn(e){let t=e.split(/\s+/u)[0]??e;return(e,r)=>{if(r!==void 0)throw new n(`${t} was already given; pass it once.`);return e}}async function Jn(e,t){let n=wt(e,t),r=ge(e.requestBody??[],n);if(!r.ok||r.data===null)return b(r.summary,r.warnings);let i=r.data;if(i===void 0)return y(`No body`,void 0);let a=Yn(e,i,t);if(a!==null)return b(a);let o=tn(e.operationId,i,t);if(!o.ok)return b(o.summary,o.warnings);t=o.data;let s=Xn(i,t);if(s!==null)return b(s);let c=await er(t);if(!c.ok)return b(c.summary,c.warnings);let l=vn(e.requestBody??[],i,c.data);if(l!==null)return b(l);let u=$n(e.operationId,i,c.data);if(!u.ok)return u;let d=nn(e.operationId,i,c.data);if(d!==null)return b(d);let f=tr(e.operationId,i,t);if(!f.ok)return f;if(c.data===void 0&&f.data===void 0)return i.required?b(sr(e.operationId,i)):y(`No body`,void 0);let p=rr(e.operationId,i,c.data,f.data);if(!p.ok||p.data===void 0)return p;if(i.schemaType===`array`&&!Array.isArray(p.data))return b(`${e.operationId} requires a JSON array body.`);if(i.parameter.length>0&&!I(p.data)){let t=i.kind===`multipart`?` keyed by multipart part name`:` body`;return b(`${e.operationId} requires a JSON object${t}.`)}let m=Qn(i,p.data);if(m.length>0)return b(`${e.operationId} requires body option(s): ${m.join(`, `)}`);let h=p.data,g=I(h)?rn(i).filter(e=>!_n(h,e)):[];return g.length>0?b(Zn(e.operationId,i,g)):p}function Yn(e,t,n){let r=new Set(t.parameter.map(({optionKey:e})=>e));for(let i of e.requestBody??[])if(i!==t)for(let t of i.parameter){if(r.has(t.optionKey)||n[t.optionKey]===void 0)continue;let i=(e.requestBody??[]).filter(e=>e.parameter.some(({optionKey:e})=>e===t.optionKey)).map(({contentType:e})=>e);return`${L(t)} requires ${Hn} ${i.join(` or `)}.`}return null}function Xn(e,t){for(let n of e.cliConflicts??[]){let e=n.filter(e=>t[e]!==void 0);if(e.length>1)return`Options ${e.join(`, `)} cannot be used together.`}return null}function Zn(e,t,n){let r=`${e} requires JSON body path(s): ${n.join(`, `)}`;return t.kind===`multipart`?`${r}. ${n.includes(`body`)?`For multipart --from-file, wrap the endpoint JSON under top-level "body".`:`For multipart --from-file, put the missing nested path(s) inside top-level "body".`}`:r}function Qn(e,t){return I(t)?e.parameter.filter(e=>e.required&&!_n(t,e.name)).map(L):[]}function $n(e,t,n){let r=bn(t,n);if(r===null)return y(`Body file paths validated`,null);let i=r.suggestion===void 0?``:` Use ${r.suggestion}.`;return b(`${e} --from-file contains unknown JSON path ${r.path}.${i}`)}async function er(e){let t=typeof e.fromFile==`string`?e.fromFile:void 0;if(t===void 0)return y(`No body file`,void 0);let n=await Bn(t);if(!n.ok)return b(n.summary,n.warnings);let r=le.safeParse(n.data);return r.success?y(`Input parsed`,r.data):b(`Input is not valid JSON value: ${r.error.message}`)}function tr(e,t,n){let r={},i=!1;for(let e of t.parameter){let a=ln(e,n[e.optionKey]);if(!a.ok||a.data===null)return b(a.summary,a.warnings);let o=a.data;if(o===void 0)continue;let s=nr(t,n,r,e,o);if(!s.ok)return b(s.summary,s.warnings);i=!0}if(!i)return y(`No direct body options`,void 0);let a=pn(e,t,n,r);return a===null?y(`Direct body options parsed`,r):a}function nr(e,t,n,r,i){let a=dn(r,i);if(a===null){let e=ar(r,i);return e.ok?an(n,r.name,e.data,r.schemaType===`array`):b(e.summary,e.warnings)}if(a.plain.length>0)return b(`${L(r)} mixes row-form values with plain value(s): ${a.plain.join(`, `)} — prefix every value with its 0-based ${a.container}[] row index, as 0:value.`);let o=fn(e,t,a.container);for(let e of a.rows.keys())if(!(e<o))return b(`${L(r)} names ${a.container}[] row ${e}, but these options build at most ${o} ${a.container}[] row(s) — number rows from 0, and name the row of a value that itself starts with digits and a colon, as 0:0:00 for the value 0:00.`);for(let[e,t]of a.rows){let i=[];for(let e of t){let t=or(r.name,r.itemSchemaType,e);if(!t.ok)return b(t.summary,t.warnings);i.push(t.data)}let a=on(n,r.name,e,i);if(!a.ok)return a}return y(`Body value assigned`,null)}var L=e=>e.flag.split(` `)[0]??e.name;function rr(e,t,n,r){if(n===void 0)return y(`Direct body parsed`,r);if(r===void 0)return y(`Input parsed`,n);if(I(n)&&I(r))try{return y(`Input parsed`,ir(t,n,r))}catch(t){return b(`${e} ${t instanceof Error?t.message:String(t)}`)}return b(`${e} cannot combine --from-file with direct body options unless the file body is an object.`)}function ir(e,t,n,r=``){let i={...t};for(let[t,a]of Object.entries(n)){let n=i[t],o=`${r}${t}`;if(I(n)&&I(a))i[t]=ir(e,n,a,`${o}.`);else if(n===void 0||n===a)i[t]=a;else throw Error(`sets JSON key '${o}' both in --from-file and with ${e.parameter.find(({name:e})=>e===o)?.flag.split(` `)[0]??`body options`} — set it in one place${Array.isArray(n)?`: move the per-item fields inside the matching '${o}[]' object(s) in the file body`:Me.test(o)?`; keep multi-line text in the --from-file body`:``}.`)}return i}function ar(e,t){if(typeof t==`boolean`)return y(`Body value parsed`,t);if(t===void 0||typeof t==`string`)return or(e.name,e.schemaType,t??``);let n=[],r=F(e.name)&&e.schemaType!==`array`?e.schemaType:e.itemSchemaType;for(let i of t){let t=or(e.name,r,i);if(!t.ok)return t;n.push(t.data)}return y(`Body value parsed`,n)}function or(e,t,n){if(t===`boolean`)return n===`true`?y(`Body value parsed`,!0):n===`false`?y(`Body value parsed`,!1):b(`${e} must be true or false.`);if(t===`number`||t===`integer`){let r=n.trim(),i=Number(r);return r===``||!Number.isFinite(i)?b(`${e} must be a finite ${t}.`):t===`integer`&&!Number.isInteger(i)?b(`${e} must be an integer.`):y(`Body value parsed`,i)}return y(`Body value parsed`,n)}function sr(e,t){let n=t.parameter.filter(e=>e.required);if(n.length>0&&t.requiredPath.every(e=>n.some(({name:t})=>t===e||t.startsWith(`${e}.`))))return`${e} requires body option(s): ${n.map(L).join(`, `)}`;let r=rn(t);if(r.length>0)return`${e} requires --from-file with JSON body path(s): ${r.join(`, `)}`;let i=t.parameter.map(L).join(`, `);return i.length===0?`${e} requires --from-file`:`${e} requires --from-file or body option(s): ${i}`}function cr(e,t,n){let r=[...t.parameters,...n.map(({variant:e})=>e[0].parameter)];(t.requestBody?.length??0)>1&&r.push({optionKey:`contentType`,flag:Hn,location:`body`}),lr(t)&&r.push({optionKey:`fromFile`,flag:`--from-file`,location:`body`}),jn(e.options,r)}function lr(e){return(e.requestBody??[]).some(e=>e.kind!==`multipart`||e.parameter.some(e=>e.schemaFormat!==`binary`))}function ur(e){let t=ue(e,Pe(e,T));return yr(t),process.stdout.write(`${JSON.stringify(t)}\n`),t}function dr(e){let t=ue(e,Pe(e,T));yr(t);let n=Ae(T,t.data,t.summary),r=[];if(t.ok&&n!==null){let e=fr(t);r.push(n.endsWith(`
|
|
1
|
+
import{a as e,n as t,o as n,r,t as i}from"./commander-BB7CDPLs.js";import{i as a,o}from"./logging-BkyFCiym.js";import{i as s,o as c,r as l,s as u,t as d,u as f}from"./env-Casn05NX.js";import{M as p,O as m,i as h,o as g,v as ee,w as _,y as v}from"./person-owner-BJgNYLKX.js";import{Ar as te,Br as ne,Mr as re,Or as ie,Pr as ae,jr as oe,kr as se,zr as ce}from"./dist-F6oHzTAJ.js";import{c as y,d as le,i as b,r as ue}from"./result-envelope-CFE7wPAr.js";import{a as x,n as de,r as fe,t as pe}from"./package-DPDX5zmx.js";import{_ as me,b as he,c as ge,i as _e,s as ve,t as ye,v as be,y as xe}from"./tool-policy-Dw6KBl9G.js";import{i as Se,r as Ce}from"./response-problem-DpVA-CLe.js";import{n as we,r as Te}from"./output-spill-CjiBFqUS.js";import{a as Ee,c as De,d as Oe,g as ke,i as Ae,l as je,n as S,o as Me,p as Ne,r as Pe,s as Fe,u as Ie,x as Le,y as Re}from"./contract-EVv6oDkS.js";import{a as ze,c as Be,i as Ve,l as He,n as Ue,s as We,t as Ge}from"./cli-help-policy-DUARQ4wz.js";import{S as Ke,_ as qe,a as Je,g as C,h as Ye,i as Xe,m as Ze,n as Qe,p as $e,r as et,s as tt,t as nt,v as rt,x as w,y as it}from"./api-key-bearer-credential-08YUx1xO.js";import{a as at,c as ot,d as st,g as ct,l as lt,m as ut,o as dt,s as ft,t as pt,u as mt}from"./oauth-bearer-credential-DKnuQe5D.js";import{n as ht,r as gt,t as _t}from"./oauth-login-CbUY11wb.js";import{a as vt,c as yt,d as bt,i as xt,l as St,n as Ct,o as wt,s as Tt,t as Et,u as Dt}from"./startup-auth-CL764pKQ.js";import{n as Ot,t as T}from"./openapi-commands-Bm7sTOA4.js";import{i as E,r as kt,t as D}from"./output-mode-Bl9hZ5Qe.js";import{spawnSync as At}from"node:child_process";import{basename as O,dirname as k,relative as jt,resolve as A,sep as Mt}from"node:path";import{copyFileSync as Nt,existsSync as j,lstatSync as Pt,mkdirSync as M,mkdtempSync as Ft,readFileSync as It,readdirSync as Lt,readlinkSync as Rt,realpathSync as zt,renameSync as Bt,symlinkSync as Vt,writeFileSync as Ht}from"node:fs";import N,{stderr as P,stdin as Ut}from"node:process";import{TextDecoder as Wt,inspect as Gt}from"node:util";import{homedir as Kt,hostname as qt,platform as Jt}from"node:os";import{fileURLToPath as Yt}from"node:url";import{setTimeout as Xt}from"node:timers/promises";import{randomUUID as Zt,webcrypto as Qt}from"node:crypto";import{readFile as $t}from"node:fs/promises";import{createInterface as en}from"node:readline/promises";function tn(e,t,n){let r={...n};for(let n of t.parameter){let t=n.envName;if(t===void 0)continue;let i=process.env[t]?.trim();if(i===void 0||i.length===0)continue;let a=r[n.optionKey];if(a!==void 0&&(typeof a!=`string`||a!==i))return{...b(`${e} ${n.flag.split(` `)[0]??n.name} conflicts with ${t}; omit the flag or use ${i}.`),data:r};a===void 0&&(r[n.optionKey]=i)}return y(`Environment-bound options applied`,r)}function nn(e,t,n){if(!I(n))return null;for(let r of t.parameter){let t=r.envName,i=t===void 0?void 0:process.env[t]?.trim();if(t===void 0||i===void 0||i.length===0||!_n(n,r.name))continue;let a=gn(n,r.name);if(typeof a!=`string`||a!==i)return`${e} ${r.name} in --from-file conflicts with ${t}; omit the field or use ${i}.`}return null}function rn(e){let t=new Set(e.parameter.map(({name:e})=>e));return e.kind===`multipart`?e.requiredPath:e.requiredPath.filter(e=>!t.has(e))}function an(e,t,n,r=!1){if(r||!F(t)||!Array.isArray(n))return xn(e,t,n);for(let[r,i]of n.entries()){let n=xn(e,t,i,r);if(!n.ok)return n}return y(`Body value assigned`,null)}function on(e,t,n,r){return xn(e,t,r,n)}function sn(e){let t=[];for(let n of e.split(`.`)){let e=Cn(n);if(t.push(e.key),e.isArray)return t.join(`.`)}return null}function cn(e,t){let n=sn(t);if(n===null)return null;let r=hn(e,n.split(`.`));return Array.isArray(r)?{path:n,rowCount:r.length,firstHole:mn(r)}:null}function ln(e,t){if(F(e.name)||e.schemaType===`array`)return y(`Repeated body option selected`,typeof t==`string`?[t]:t);if(!Array.isArray(t))return y(`Scalar body option selected`,t);let n=e.flag.split(` `)[0]??e.name;return t.length===1?y(`Scalar body option selected`,t[0]):b(`${n} was already given; pass it once.`)}var un=/^(?<row>\d+):(?<item>.*)$/su;function dn(e,t){let n=sn(e.name);if(e.schemaType!==`array`||n===null||t===void 0||typeof t==`boolean`)return null;let r=new Map,i=[];for(let e of typeof t==`string`?[t]:t){let t=un.exec(e)?.groups,n=t?.row,a=t?.item;if(n===void 0||a===void 0){i.push(e);continue}let o=r.get(Number(n));o===void 0?r.set(Number(n),[a]):o.push(a)}return r.size===0?null:{container:n,rows:r,plain:i}}function fn(e,t,n){let r=0;for(let i of e.parameter){let e=t[i.optionKey];e!==void 0&&typeof e!=`boolean`&&sn(i.name)===n&&(r=Math.max(r,typeof e==`string`?1:e.length))}return r}function pn(e,t,n,r){for(let i of t.parameter){let t=n[i.optionKey];if(t===void 0)continue;let a=cn(r,i.name);if(a===null)continue;if(a.firstHole!==null)return b(`${e} has no ${a.path}[] row ${a.firstHole} — number ${a.path}[] rows from 0 with no gaps.`);if(i.schemaType!==`array`||a.rowCount<=1||dn(i,t)!==null)continue;let o=i.flag.split(` `)[0]??i.name;return b(`${o} fills one ${a.path}[] row's list, so ${e} cannot also build ${a.rowCount} ${a.path}[] rows from direct options — prefix each value with its 0-based ${a.path}[] row index, as 0:value, or pass the rows with --from-file.`)}return null}function mn(e){for(let t=0;t<e.length;t+=1)if(e[t]===void 0)return t;return null}function hn(e,t){let n=e;for(let e of t){if(!I(n))return;n=n[e]??null}return n}function gn(e,t){if(!F(t))return hn(e,t.split(`.`))}function _n(e,t){return yn(e,t.split(`.`))}function vn(e,t,n){if(!I(n))return null;let r=new Set(t.parameter.map(({name:e})=>e));for(let i of e)if(i!==t){for(let e of i.parameter)if(!r.has(e.name)&&_n(n,e.name))return`${e.name} in --from-file requires --content-type ${i.contentType}.`}return null}function yn(e,t){let[n,...r]=t;if(n===void 0)return!0;let i=Cn(n);if(!I(e)||!Object.hasOwn(e,i.key))return!1;let a=e[i.key]??null;return i.isArray?Array.isArray(a)&&a.every(e=>yn(e,r)):yn(a,r)}function F(e){return e.split(`.`).some(e=>Cn(e).isArray)}function bn(e,t){return e.parameter.length===0||!I(t)?null:Tn(t,[],wn(e.parameter))}function I(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xn(e,t,n,r=0){let i=t.split(`.`),a=e;for(let[e,o]of i.entries()){let s=Cn(o),c=e===i.length-1,l=Sn(a,s,t,c,n,r);if(!l.ok||l.data===null)return b(l.summary,l.warnings);if(c)return y(`Body value assigned`,null);a=l.data}return b(`${t} is not a valid body option path.`)}function Sn(e,t,n,r,i,a){let o=()=>b(`${n} cannot be combined with another body option at ${t.key}.`),s=e[t.key];if(t.isArray){if(s!==void 0&&!Array.isArray(s))return o();let n=s??[];if(s===void 0&&(e[t.key]=n),r)return n[a]===void 0?(n[a]=i,y(`Body value assigned`,e)):o();let c=n[a];if(c===void 0){let e={};return n[a]=e,y(`Body path created`,e)}return I(c)?y(`Body path stepped`,c):o()}if(r)return s===void 0?(e[t.key]=i,y(`Body value assigned`,e)):o();if(s===void 0){let n={};return e[t.key]=n,y(`Body path created`,n)}return I(s)?y(`Body path stepped`,s):o()}function Cn(e){let t=e.endsWith(`[]`);return{key:t?e.slice(0,-2):e,isArray:t}}function wn(e){let t=new Set,n=new Set;for(let r of e){let e=`${r.name}${r.schemaType===`array`?`[]`:``}`;t.add(e);let i=e.split(`.`);for(let e=1;e<i.length;e+=1)n.add(i.slice(0,e).join(`.`))}return{leaf:t,prefix:n}}function Tn(e,t,n){if(Array.isArray(e)){if(e.length===0)return null;for(let r of e){let e=Tn(r,t,n);if(e!==null)return e}return null}if(!I(e))return null;for(let[r,i]of Object.entries(e)){let e=[...t,Array.isArray(i)?`${r}[]`:r],a=e.join(`.`);if(!En(a,n)){if(!Dn(e))continue;let t=On(e,n);return{path:a,...t===void 0?{}:{suggestion:t}}}let o=Tn(i,e,n);if(o!==null)return o}return null}function En(e,t){return t.prefix.has(e)||t.leaf.has(e)}function Dn(e){return e.slice(0,-1).some(e=>e.endsWith(`[]`))}function On(e,t){let n=e.slice(0,-1).join(`.`),r=e.at(-1)?.replace(/\[\]$/u,``).toLowerCase()??``;return[...t.leaf].filter(e=>e.split(`.`).slice(0,-1).join(`.`)===n).map(e=>({path:e,score:kn(r,e.split(`.`).at(-1)??``)})).filter(({score:e})=>e<1/0).toSorted((e,t)=>e.score-t.score||e.path.localeCompare(t.path))[0]?.path}function kn(e,t){let n=t.replace(/\[\]$/u,``).toLowerCase();return n===e?0:n.endsWith(e)||e.endsWith(n)?1:n.includes(e)||e.includes(n)?2:1/0}var An=e=>Array.isArray(e)&&!Object.isFrozen(e);function jn(e,t){let n=new Map;for(let e of t){let t=e.flag?.split(` `)[0];t!==void 0&&n.set(t,t===`--from-file`?{...e,inputType:`file`}:e)}for(let t of e){let e=t.long===void 0?void 0:n.get(t.long);e!==void 0&&(t.helpGroup(Be(e)),t.description=ae(t.description,{...e,hasParseDefault:t.defaultValue!==void 0}))}if(!An(e))throw Error(`Commander option list is frozen; generated option help cannot be ordered.`);e.sort((e,t)=>{let r=e.long===void 0?void 0:n.get(e.long),i=t.long===void 0?void 0:n.get(t.long);return r!==void 0&&i!==void 0?zn(r,i):r===void 0?i===void 0?0:1:-1})}function Mn(e){let t=new Map;for(let n of e)for(let e of n.parameter){let r=e.flag.split(` `)[0]??e.flag,i=t.get(r);i===void 0?t.set(r,{variant:[{descriptor:n,parameter:e}]}):t.set(r,{variant:[...i.variant,{descriptor:n,parameter:e}]})}return[...t.values()]}function Nn(e){let{flag:t}=e.variant[0].parameter;return e.variant.every(({parameter:e})=>e.flag===t)?t:`${t.split(` `)[0]??t} <value>`}function Pn(e){let t=e.variant.map(({descriptor:e,parameter:t})=>({contentType:e.contentType,text:Ln(e,t)})),n=t[0];return n===void 0?``:t.every(({text:e})=>e===n.text)?`${n.text===``?``:`${n.text} `}Request content: ${t.map(({contentType:e})=>e).join(`, `)}.`:t.map(({contentType:e,text:t})=>`${e}: ${t}`).join(` `)}function Fn(e,t){return[...new Set((e.cliConflicts??[]).filter(e=>e.includes(t)).flatMap(e=>e.filter(e=>e!==t)))]}function In(e,t){let n=e.kind===`multipart`?`Read a JSON object keyed by multipart part name from a file, or use - for stdin`:`Read the JSON request body from a file, or use - for stdin`,r=t.filter(e=>!t.some(t=>t.startsWith(`${e}.`)||t.startsWith(`${e}[].`)));return r.length===0?He(n):`${He(n)} Required JSON paths: ${r.join(`, `)}.`}function Ln(e,t){let n=ze(t.description,void 0),r=e.kind!==`multipart`&&F(t.name),i=e.kind!==`multipart`&&t.optionKey!==t.name&&/^\w+$/u.test(t.name);return`${n}${r?` Repeat to add another value.`:``}${i?` --from-file JSON key: ${t.name}.`:``}${Rn(e,t)}`}function Rn(e,t){if(e.kind===`multipart`||t.schemaType!==`array`)return``;let n=sn(t.name);return n===null?``:` Prefix each value with its 0-based ${n}[] row index, as 0:value, to fill more than one ${n}[] row. A leading digits-and-colon is always read as that index, so name the row of a value that starts the same way, as 0:0:00 for the value 0:00.`}function zn(e,t){return We(e)-We(t)||Number(e.required!==!0)-Number(t.required!==!0)}async function Bn(e){let t;try{t=e===`-`?await Vn():await $t(e,`utf8`)}catch(t){return b(`Could not read input: ${t.message}`,[`path=${e}`])}try{if(t.trim().length===0)return y(`No input provided`,null);let e=JSON.parse(t);return y(`Input parsed`,e)}catch(e){return b(`Input is not valid JSON: ${e.message}`)}}async function Vn(){if(process.stdin.isTTY)throw Error(`--from-file - requires JSON on stdin, but stdin is a TTY`);process.stdin.setEncoding(`utf8`);let e=``;for await(let t of process.stdin)e+=t;return e}var Hn=`--content-type`;function Un(e,n,r){let i=e=>!r?.has(e)&&(r?.add(e),!0),a=n.requestBody??[];if(a.length>1&&i(Hn)){let n=a.map(({contentType:e})=>e);e.addOption(new t(`${Hn} <media-type>`,`Select the request body encoding, never an uploaded file's media type; omit for ${n[0]}.`).choices(n).argParser(Gn(a)))}if(lr(n)&&i(`--from-file`)){let r=a[0];if(r===void 0)throw Error(`${n.operationId} has no request body`);e.addOption(new t(`--from-file <path>`,In(r,r.requiredPath)).argParser(qn(`--from-file`)))}let o=Mn(a).filter(e=>i(L(e.variant[0].parameter)));for(let n of o.toSorted((e,t)=>zn(e.variant[0].parameter,t.variant[0].parameter))){let{descriptor:r,parameter:i}=n.variant[0],o=new t(Nn(n),a.length>1?Pn(n):Ln(r,i));a.length===1&&i.envName!==void 0&&o.env(i.envName);let s=a.length===1?Fn(r,i.optionKey):[];s.length>0&&o.conflicts(s),a.length>1?o.argParser(Wn):F(i.name)||i.schemaType===`array`?o.argParser(Kn):o.argParser(qn(i.flag)),e.addOption(o),o.envVar!==void 0&&e.on(`optionEnv:${o.name()}`,()=>{let t=e.opts()[i.optionKey];typeof t==`string`&&t.trim()&&e.setOptionValueWithSource(i.optionKey,t.trim(),`env`)})}cr(e,n,o)}function Wn(e,t){return t===void 0?e:typeof t==`string`?[t,e]:[...t,e]}function Gn(e){return(t,r)=>{if(r!==void 0)throw new n(`${Hn} was already given; pass it once.`);let i=me(e,t);if(!i.ok)throw new n(i.summary);return t}}function Kn(e,t){return[...t??[],e]}function qn(e){let t=e.split(/\s+/u)[0]??e;return(e,r)=>{if(r!==void 0)throw new n(`${t} was already given; pass it once.`);return e}}async function Jn(e,t){let n=wt(e,t),r=me(e.requestBody??[],n);if(!r.ok||r.data===null)return b(r.summary,r.warnings);let i=r.data;if(i===void 0)return y(`No body`,void 0);let a=Yn(e,i,t);if(a!==null)return b(a);let o=tn(e.operationId,i,t);if(!o.ok)return b(o.summary,o.warnings);t=o.data;let s=Xn(i,t);if(s!==null)return b(s);let c=await er(t);if(!c.ok)return b(c.summary,c.warnings);let l=vn(e.requestBody??[],i,c.data);if(l!==null)return b(l);let u=$n(e.operationId,i,c.data);if(!u.ok)return u;let d=nn(e.operationId,i,c.data);if(d!==null)return b(d);let f=tr(e.operationId,i,t);if(!f.ok)return f;if(c.data===void 0&&f.data===void 0)return i.required?b(sr(e.operationId,i)):y(`No body`,void 0);let p=rr(e.operationId,i,c.data,f.data);if(!p.ok||p.data===void 0)return p;if(i.schemaType===`array`&&!Array.isArray(p.data))return b(`${e.operationId} requires a JSON array body.`);if(i.parameter.length>0&&!I(p.data)){let t=i.kind===`multipart`?` keyed by multipart part name`:` body`;return b(`${e.operationId} requires a JSON object${t}.`)}let m=Qn(i,p.data);if(m.length>0)return b(`${e.operationId} requires body option(s): ${m.join(`, `)}`);let h=p.data,g=I(h)?rn(i).filter(e=>!_n(h,e)):[];return g.length>0?b(Zn(e.operationId,i,g)):p}function Yn(e,t,n){let r=new Set(t.parameter.map(({optionKey:e})=>e));for(let i of e.requestBody??[])if(i!==t)for(let t of i.parameter){if(r.has(t.optionKey)||n[t.optionKey]===void 0)continue;let i=(e.requestBody??[]).filter(e=>e.parameter.some(({optionKey:e})=>e===t.optionKey)).map(({contentType:e})=>e);return`${L(t)} requires ${Hn} ${i.join(` or `)}.`}return null}function Xn(e,t){for(let n of e.cliConflicts??[]){let e=n.filter(e=>t[e]!==void 0);if(e.length>1)return`Options ${e.join(`, `)} cannot be used together.`}return null}function Zn(e,t,n){let r=`${e} requires JSON body path(s): ${n.join(`, `)}`;return t.kind===`multipart`?`${r}. ${n.includes(`body`)?`For multipart --from-file, wrap the endpoint JSON under top-level "body".`:`For multipart --from-file, put the missing nested path(s) inside top-level "body".`}`:r}function Qn(e,t){return I(t)?e.parameter.filter(e=>e.required&&!_n(t,e.name)).map(L):[]}function $n(e,t,n){let r=bn(t,n);if(r===null)return y(`Body file paths validated`,null);let i=r.suggestion===void 0?``:` Use ${r.suggestion}.`;return b(`${e} --from-file contains unknown JSON path ${r.path}.${i}`)}async function er(e){let t=typeof e.fromFile==`string`?e.fromFile:void 0;if(t===void 0)return y(`No body file`,void 0);let n=await Bn(t);if(!n.ok)return b(n.summary,n.warnings);let r=le.safeParse(n.data);return r.success?y(`Input parsed`,r.data):b(`Input is not valid JSON value: ${r.error.message}`)}function tr(e,t,n){let r={},i=!1;for(let e of t.parameter){let a=ln(e,n[e.optionKey]);if(!a.ok||a.data===null)return b(a.summary,a.warnings);let o=a.data;if(o===void 0)continue;let s=nr(t,n,r,e,o);if(!s.ok)return b(s.summary,s.warnings);i=!0}if(!i)return y(`No direct body options`,void 0);let a=pn(e,t,n,r);return a===null?y(`Direct body options parsed`,r):a}function nr(e,t,n,r,i){let a=dn(r,i);if(a===null){let e=ar(r,i);return e.ok?an(n,r.name,e.data,r.schemaType===`array`):b(e.summary,e.warnings)}if(a.plain.length>0)return b(`${L(r)} mixes row-form values with plain value(s): ${a.plain.join(`, `)} — prefix every value with its 0-based ${a.container}[] row index, as 0:value.`);let o=fn(e,t,a.container);for(let e of a.rows.keys())if(!(e<o))return b(`${L(r)} names ${a.container}[] row ${e}, but these options build at most ${o} ${a.container}[] row(s) — number rows from 0, and name the row of a value that itself starts with digits and a colon, as 0:0:00 for the value 0:00.`);for(let[e,t]of a.rows){let i=[];for(let e of t){let t=or(r.name,r.itemSchemaType,e);if(!t.ok)return b(t.summary,t.warnings);i.push(t.data)}let a=on(n,r.name,e,i);if(!a.ok)return a}return y(`Body value assigned`,null)}var L=e=>e.flag.split(` `)[0]??e.name;function rr(e,t,n,r){if(n===void 0)return y(`Direct body parsed`,r);if(r===void 0)return y(`Input parsed`,n);if(I(n)&&I(r))try{return y(`Input parsed`,ir(t,n,r))}catch(t){return b(`${e} ${t instanceof Error?t.message:String(t)}`)}return b(`${e} cannot combine --from-file with direct body options unless the file body is an object.`)}function ir(e,t,n,r=``){let i={...t};for(let[t,a]of Object.entries(n)){let n=i[t],o=`${r}${t}`;if(I(n)&&I(a))i[t]=ir(e,n,a,`${o}.`);else if(n===void 0||n===a)i[t]=a;else throw Error(`sets JSON key '${o}' both in --from-file and with ${e.parameter.find(({name:e})=>e===o)?.flag.split(` `)[0]??`body options`} — set it in one place${Array.isArray(n)?`: move the per-item fields inside the matching '${o}[]' object(s) in the file body`:Me.test(o)?`; keep multi-line text in the --from-file body`:``}.`)}return i}function ar(e,t){if(typeof t==`boolean`)return y(`Body value parsed`,t);if(t===void 0||typeof t==`string`)return or(e.name,e.schemaType,t??``);let n=[],r=F(e.name)&&e.schemaType!==`array`?e.schemaType:e.itemSchemaType;for(let i of t){let t=or(e.name,r,i);if(!t.ok)return t;n.push(t.data)}return y(`Body value parsed`,n)}function or(e,t,n){if(t===`boolean`)return n===`true`?y(`Body value parsed`,!0):n===`false`?y(`Body value parsed`,!1):b(`${e} must be true or false.`);if(t===`number`||t===`integer`){let r=n.trim(),i=Number(r);return r===``||!Number.isFinite(i)?b(`${e} must be a finite ${t}.`):t===`integer`&&!Number.isInteger(i)?b(`${e} must be an integer.`):y(`Body value parsed`,i)}return y(`Body value parsed`,n)}function sr(e,t){let n=t.parameter.filter(e=>e.required);if(n.length>0&&t.requiredPath.every(e=>n.some(({name:t})=>t===e||t.startsWith(`${e}.`))))return`${e} requires body option(s): ${n.map(L).join(`, `)}`;let r=rn(t);if(r.length>0)return`${e} requires --from-file with JSON body path(s): ${r.join(`, `)}`;let i=t.parameter.map(L).join(`, `);return i.length===0?`${e} requires --from-file`:`${e} requires --from-file or body option(s): ${i}`}function cr(e,t,n){let r=[...t.parameters,...n.map(({variant:e})=>e[0].parameter)];(t.requestBody?.length??0)>1&&r.push({optionKey:`contentType`,flag:Hn,location:`body`}),lr(t)&&r.push({optionKey:`fromFile`,flag:`--from-file`,location:`body`}),jn(e.options,r)}function lr(e){return(e.requestBody??[]).some(e=>e.kind!==`multipart`||e.parameter.some(e=>e.schemaFormat!==`binary`))}function ur(e){let t=ue(e,Pe(e,T));return yr(t),process.stdout.write(`${JSON.stringify(t)}\n`),t}function dr(e){let t=ue(e,Pe(e,T));yr(t);let n=Ae(T,t.data,t.summary),r=[];if(t.ok&&n!==null){let e=fr(t);r.push(n.endsWith(`
|
|
2
2
|
`)?n.slice(0,-1):n),r.push(...e),process.stdout.write(Le(r.join(`
|
|
3
3
|
`),!0,!0,e.length));return}let i=t.ok?`OK`:`FAIL`;r.push(`[${i}] ${t.summary}`),!t.ok&&t.problem!==void 0&&r.push(...hr(t.problem)),r.push(...fr(t)),process.stdout.write(Le(r.join(`
|
|
4
4
|
`),!0))}function fr(e){let t=[];e.ids.length>0&&t.push(` ids: ${e.ids.join(`, `)}`);for(let[n,r]of Object.entries(e.counts))t.push(` ${n}: ${r}`);for(let n of e.references)t.push(` ref: ${n}`);if(e.truncation!==void 0){let n=e.truncation.omitted.join(`, `);t.push(` truncated: byteLength=${e.truncation.byteLength} maxBytes=${e.truncation.maxBytes} omitted=${n}`,` recovery: ${e.truncation.recovery}`)}for(let n of e.warnings)t.push(` warn: ${n}`);return t}function R(e,t){let n=Te(t);if(e.mode===`data`||e.mode===`data-full`){let t=e.mode===`data`?ue(n,pr(n)):n;yr(t),process.stdout.write(`${JSON.stringify(t.ok&&t.truncated!==!0?we(t.data):t)}\n`),t.ok||(process.exitCode=1);return}let r=e.mode===`json`?ur(n):n;e.mode===`text`&&dr(r),r.ok||(process.exitCode=1)}function pr(e){let t=Pe(e,T);if(t.write===!0)return t;let n=t.exactRecovery??`Refetch a narrower result: use ids/references, a more specific list read (e.g. entities relationships list, entities people list, or news list --owner-entity-id), filters, or smaller pages with page and size.`;return{...t,exactRecovery:`--data printed this truncated result envelope (truncated: true), not the bare payload, so payload paths read as null; rerun with --to-file <path> for the whole payload, or --data-full in a bounded program. ${n}`}}function mr(e,t){let n=Ee(t);if(n===null){process.stderr.write(`explain: the response carried no search interpretation
|
|
@@ -11,7 +11,7 @@ import{a as e,n as t,o as n,r,t as i}from"./commander-BB7CDPLs.js";import{i as a
|
|
|
11
11
|
`)}function Hr(e,t){return t===`json`?JSON.stringify(e,null,2):t===`ndjson`?JSON.stringify(e.operation):t===`lines`?Kr(e.operation):t===`compact`?Ur(e.operation):e.usage}function Ur(e){let t=Wr(e);return[e.cli.command,e.summary,t.length===0?Mr:t.join(` `)].join(jr)}function Wr(e){return e.flags.filter(t=>t.required&&(t.contentType===void 0||t.contentType===e.body.contentType)).map(e=>e.name)}function Gr(e){return e.map(e=>`${e.cli.command}\n ${Kr(e)}`).join(`
|
|
12
12
|
`)}function Kr(e){let t=Wr(e);return[z(`operationId`,e.operationId),z(`scope`,e.scope),z(`mutates`,String(e.mutates)),z(`destructive`,String(e.destructive)),z(`intent`,e.intent),z(`resource`,e.resource),z(`cli`,e.cli.command),e.mcpTool===null?``:z(`mcpTool`,e.mcpTool),z(`method`,e.method),z(`path`,e.path),z(`auth`,e.auth),z(`flags`,[...new Set(e.flags.map(e=>e.name))].join(` `)),z(`requiredFlags`,t.join(` `)),z(`bodyKind`,e.body.kind??``),z(`bodyRequired`,String(e.body.required)),z(`summary`,e.summary)].filter(e=>e.length>0).join(` `)}function z(e,t){return t.length===0?``:`${e}=${JSON.stringify(t)}`}function qr(e){return`count`in e?e.count:{returned:1}}function Jr(e,t,n=x().bin[0]){e.helpCommand(!1);let r=e.commands.find(e=>e.name()===`help`)??e.command(`help`);r.summary(`Show full documentation for a command, or ask a question`).description([`Show a command's full documentation offline. Select it by command path,`,"operationId, or `<METHOD> <path>`; `<command> --help` prints only its usage.","`help ask <question>` or `help --ask <question>` answers a platform question."].join(`
|
|
13
13
|
`)).argument(`[command...]`,"command path, operationId, or METHOD and path, e.g. `help entities get`"),r.addOption(new Yr(r)),r.hook(`preSubcommand`,e=>{e.opts().help&&e.help()});let i=ti(t);i!==void 0&&r.option(`--ask <question>`,i.summary),D(r),r.action(async function(r){let a=this.optsWithGlobals();if(a.help&&r.length===0){this.outputHelp();return}if(!a.help&&i!==void 0&&a.ask!==void 0){let e=E(a);if(r.length>0){R({mode:e},b(`Use either a command path or --ask, not both.`));return}R({mode:e},await ai(i,a.ask,a.environment,e));return}let o=ii(e,r),s=t.find(t=>o!==void 0&&ii(e,t.cliPath)===o);if(a.help||o!==void 0&&s===void 0){o===void 0&&this.error(`unknown command '${r.join(` `)}' (run \`${n} --help\` for the command tree)`),o.outputHelp();return}let c=s===void 0?ri(r,t):y(`Resolved by command path`,{operationId:s.operationId});if(c.ok&&c.data?.command!==void 0&&this.error(`unknown command '${r.join(` `)}' (run \`${n} --help\` for the command tree)`),!c.ok||c.data===null){R({mode:E(a)},c);return}Lr({...a,...c.data},t,E(a,`text`),n)}),ei(e,t,n)}var Yr=class extends t{helpCommand;constructor(e){super(`-h, --help`,`display help for command`),this.helpCommand=e}is(e){if(e!==this.short&&e!==this.long)return!1;let t=this.helpCommand.parent?.args??[],n=t.findIndex(e=>e===this.helpCommand.name()||this.helpCommand.aliases().includes(e)),r=n<0?void 0:t[n+1];return r===void 0||r.startsWith(`-`)?!0:!this.helpCommand.commands.some(e=>e.name()===r||e.aliases().includes(r))}},Xr=2,Zr=6,Qr={formatHelp(e,t){let n=n=>r.prototype.formatHelp.call(this,e,Object.assign(Object.create(t),n));if(t.visibleCommands(e).length===0)return n({});let i=t.padWidth(e,t),a={padWidth:()=>i,visibleOptions:()=>[],showGlobalOptions:!1},o=n({...a,visibleCommands:()=>[]}),s=n({padWidth:()=>i,visibleCommands:()=>[]}).slice(o.length);return n(a)+s},visibleCommands(e){let t=r.prototype.visibleCommands.call(this,e);return e.parent===null?t.filter(e=>!Ue.has(e.name())):t},subcommandTerm(e){let t=r.prototype.subcommandTerm.call(this,e);return e.commands.length>0&&e.registeredArguments.length===0?`${t} <command>`:t},formatItem(e,t,n,i){let a=i.helpWidth??80,o=a-t-4;return n===``||o>=i.minWidthToWrap?r.prototype.formatItem.call(i,e,t,n,i):`${` `.repeat(Xr)}${e}\n${$r(n,a,i)}`}};function $r(e,t,n){return n.boxWrap(e,t-Zr).replace(/^/gmu,` `.repeat(Zr))}function ei(e,t,n){for(let r of t){let i=ii(e,r.cliPath);i!==void 0&&i.addHelpText(`after`,()=>{let e=i.createHelp(),a=i.configureOutput().getOutHelpWidth?.();e.prepareContext(a===void 0?{}:{helpWidth:a});let o=e.helpWidth??80,s=De(r.operationId,t,n),[c,...l]=Dr(r.errorResponse),u=l.map(t=>$r(t.trimStart(),o,e).replace(/^ +/u,` `.repeat(Xr))),d=c===void 0?[]:[``,c,...u];return`\n${[...s,...d].join(`
|
|
14
|
-
`)}\n`})}}function ti(e){let[t,...n]=e.filter(e=>{let[t,n,...r]=e.cliPath;return t===`help`&&n!==void 0&&r.length===0&&oi(e)!==void 0});return n.length===0?t:void 0}var ni='Accepted selectors: `<METHOD> <route template or concrete path>`, an operationId, or a CLI command path such as "entities get".';function ri(e,t){let[n=``,...r]=e.join(` `).trim().split(/\s+/u),[i,...a]=t.filter(e=>e.path===n);if(r.length===0&&i!==void 0)return a.length===0?y(`Resolved by route`,{operationId:i.operationId}):b(`${n} is served by ${[i,...a].map(({method:e})=>e).join(`, `)}; name the method, as in \`help ${i.method} ${n}\`.`,[ni]);let o=me.find(e=>e===n.toLowerCase());if(o===void 0||r.length===0){let n=e.join(` `).trim();return y(`Resolved by name`,t.some(e=>e.operationId===n)?{operationId:n}:{command:n})}let s=be(o),c=r.join(``),l=t.find(e=>e.method===s&&e.path===c);if(l!==void 0)return y(`Resolved by route template`,{operationId:l.operationId});let u=oe({method:s,path:c});return!u.ok||u.data===null?b(u.summary,[...u.warnings,ni]):y(`Resolved by method and path`,{operationId:u.data.operation.operationId})}function ii(e,t){let n=e;for(let e of t){let t=n.commands.find(t=>t.name()===e||t.aliases().includes(e));if(t===void 0)return;n=t}return n}async function ai(e,t,n,r){let i=oi(e);if(i===void 0)return b(`The \`${e.cliPath.join(` `)}\` operation no longer takes a single required text body; run it directly instead of \`help --ask\`.`);n!==void 0&&(process.env.API_ENV=n);let a=await Jn(e,{[i.optionKey]:t});return a.ok?await re({method:e.method,path:se(e.operationId,{}),searchParams:{},body:a.data,auth:e.auth,responseFormat:kt(r)?`json`:`auto`}):a}function oi(e){if(e.requestBody?.length!==1||e.parameters.some(e=>e.required))return;let t=(e.requestBody[0]?.parameter??[]).filter(e=>e.required);return t.length===1&&t[0]?.schemaType===`string`?t[0]:void 0}function si(e,t,n){if(e.cliPath[0]!==`lookup`||!ci(n))return null;let r=e.parameters.filter(e=>t[e.optionKey]!==void 0).map(e=>`${e.name}=${String(t[e.optionKey])}`),i=`no record for ${r.length===0?`the given input`:r.join(`, `)}`;return n.ok?b(i):b(i,[],{httpStatus:n.httpStatus,problem:n.problem})}function ci(e){return e.ok?Array.isArray(e.data)&&e.data.length===0:e.httpStatus===404}function li(e,t){if(e.deprecated!==!0)return t;let n=e.description.match(/^Deprecated:[^.]*\./u)?.[0]??`Deprecated; run \`help ${e.cliPath.join(` `)}\` for its replacement.`;return{...t,warnings:[n,...t.warnings]}}var ui=v({artifact:_().nullish(),group:_().nullish(),name:_().nullish(),revision:_().nullish(),time:h({offset:!0}).nullish(),version:_().nullish()}),di=v({build:ui}),fi=g([`MACOS`,`LINUX`,`WINDOWS`,`OTHER`]),pi=g([`RSA_OAEP_256_A256_GCM_V1`]),mi=v({clientLabel:_().regex(/.*\S.*/).min(1).max(120).nullish(),clientPlatform:fi.nullish(),encryptionAlgorithm:pi.nullish(),encryptionPublicKey:_().min(344).max(12e3).nullish()}),hi=32;async function gi(){let e=await Qt.subtle.generateKey({name:`RSA-OAEP`,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:`SHA-256`},!0,[`encrypt`,`decrypt`]),t=await Qt.subtle.exportKey(`spki`,e.publicKey);return{publicKey:Buffer.from(t).toString(`base64`),privateKey:e.privateKey}}async function _i(e,t){let{wrappedKey:n,nonce:r,ciphertext:i,authenticationTag:a}=t,o=vi(n,`wrapped key`,128,1024),s=vi(r,`nonce`,12,12),c=vi(i,`ciphertext`,1,65536),l=vi(a,`authentication tag`,16,16),u;try{u=await Qt.subtle.decrypt({name:`RSA-OAEP`},e,o)}catch{throw Error(`broker credential key could not be decrypted`)}let d=new Uint8Array(u);try{if(d.byteLength!==hi)throw Error(`broker credential used an invalid AES-256 key`);let e=await Qt.subtle.importKey(`raw`,d,{name:`AES-GCM`},!1,[`decrypt`]),t=new Uint8Array(c.byteLength+l.byteLength);t.set(c),t.set(l,c.byteLength);let n;try{n=await Qt.subtle.decrypt({name:`AES-GCM`,iv:s,tagLength:128},e,t)}catch{throw Error(`broker credential payload failed authentication`)}let r=new Wt(`utf-8`,{fatal:!0}).decode(n);if(r.trim().length===0)throw Error(`broker returned a blank credential`);return r}finally{d.fill(0)}}function vi(e,t,n,r){let i=e.replace(/=+$/u,``),a=Uint8Array.from(Buffer.from(e,`base64`)),o=Buffer.from(a).toString(`base64`).replace(/=+$/u,``);if(i.length===0||o!==i||a.byteLength<n||a.byteLength>r)throw Error(`broker returned an invalid ${t}`);return a}var yi=g([`PENDING`,`ISSUING`,`KEY_READY`,`REVOKING`,`CONSUMED`,`REVOKED`,`DENIED`,`EXPIRED`,`FAILED`]),bi=g([`Denied by user`,`Authorization request expired`,`CLI authorization expired before acknowledgement`,`Credential issuance recovery revoked an unrecoverable key`,`Revoked by user`,`Clerk create response validation failed`,`Credential issuance failed`,`Credential issuance could not be recovered`,`API-key quota reached`,`Credential issuance lost its database claim`,`Credential delivery encryption failed`,`Credential issuance finalization was lost`]),xi=v({approvedAt:h({offset:!0}).nullish(),clientLabel:_(),clientPlatform:fi,comparisonCode:_(),consumedAt:h({offset:!0}).nullish(),createdAt:h({offset:!0}),expiresAt:h({offset:!0}),id:m(),intervalSeconds:ee().int().min(1),keyReadyAt:h({offset:!0}).nullish(),status:yi,terminalAt:h({offset:!0}).nullish(),terminalReason:bi.nullish(),updatedAt:h({offset:!0})}),Si=v({algorithm:pi,authenticationTag:_(),ciphertext:_(),nonce:_(),wrappedKey:_()}),Ci=v({delivery:Si.nullish(),expiresAt:h({offset:!0}),status:yi,terminalReason:bi.nullish()}),wi=v({comparisonCode:_(),expiresAt:h({offset:!0}),id:m(),intervalSeconds:ee().int().min(1),pollSecret:_(),verificationUrl:_()}),B=[{command:`auth login`,role:`oauth`,summary:`Sign In Through Your Browser`,description:`Sign in through your browser and save verified CLI access in the credential store. Use --no-browser for OAuth device authorization only when the issuer advertises device-grant support; otherwise use --key --no-browser for API-key approval.`,operationId:`getAuthProviderCatalog`,method:`GET`,path:`/v1/auth/providers`,bodyOption:[],localOption:[{optionKey:`browser`,flag:`--no-browser`,description:`Use OAuth device authorization only when the issuer advertises device-grant support: print a sign-in URL and code, then wait for approval. Otherwise use --key --no-browser for API-key approval.`},{optionKey:`providers`,flag:`--providers`,description:`Print the sign-in providers and CLI OAuth client, then exit without signing in.`}]},{command:`auth login`,role:`start`,summary:`Sign In With a Browser-Approved aVenture API Key`,description:`Creates a short-lived browser approval request and returns its poll credential once.`,operationId:`createCliAuthorization`,method:`POST`,path:`/v1/auth/cli-authorizations`,bodyOption:[{name:`clientLabel`,optionKey:`clientLabel`,flag:`--client-label <client-label>`,required:!1,description:`Label for this CLI installation.`}],localOption:[{optionKey:`key`,flag:`--key`,description:`Sign in with a browser-approved aVenture API key instead of OAuth; the approval URL opens on any device.`},{optionKey:`browser`,flag:`--no-browser`,description:`Print the API-key approval URL and wait for approval without opening a browser.`}]},{command:`auth login`,role:`poll`,summary:`Poll CLI Authorization`,description:`Returns pending state, a terminal state, or an encrypted one-time credential delivery.`,operationId:`pollCliAuthorization`,method:`POST`,path:`/v1/auth/cli-authorizations/{cliAuthorizationId}/poll`,bodyOption:[],localOption:[]},{command:`auth login`,role:`acknowledge`,summary:`Acknowledge CLI Credential Delivery`,description:`Confirms the CLI stored the delivered API key in its credential store and clears transient delivery material.`,operationId:`acknowledgeCliAuthorization`,method:`POST`,path:`/v1/auth/cli-authorizations/{cliAuthorizationId}/acknowledge`,bodyOption:[],localOption:[]},{command:`auth logout`,role:`revoke`,summary:`Sign Out: Revoke the API Key and Forget Stored OAuth`,description:`Revokes the aVenture API key authenticating this request and returns its metadata so the CLI can confirm revocation before deleting its saved copy.`,operationId:`revokeCurrentApiKey`,method:`DELETE`,path:`/v1/auth/api-key`,bodyOption:[],localOption:[{optionKey:`forgetLocal`,flag:`--forget-local`,description:`Delete the saved key even when revocation cannot be confirmed.`}]}],Ti=S(B,`start`),Ei=S(B,`poll`),Di=S(B,`acknowledge`),V=class extends Error{httpStatus;retryAfterSeconds;retryable;constructor(e,t,n=[]){super(`CLI authorization ${e} failed: ${qe(t,n)}`),this.name=`CliAuthorizationRequestError`,this.httpStatus=t.status,this.retryAfterSeconds=Ni(t.retryAfterSeconds),this.retryable=t.status>=500||t.status===429}},Oi=class extends Error{constructor(e,t,n=[]){super(`CLI authorization ${e} transport failed: ${C(t,n)}`,{cause:t}),this.name=`CliAuthorizationTransportError`}};async function ki(e){let t=await ne(Ke(f()),{method:Ti.method,path:xe(Ti.path,{},Ti.operationId),headers:{},contentType:`application/json`,body:e},wi);if(t.ok&&t.redirect)throw new V(`start`,Pi(t.status));if(!t.ok)throw new V(`start`,t.problem);return Fi(t.data)}async function Ai(e,t){let n=te(Ei.operationId),r=await ne(Ke(f()),{method:Ei.method,path:xe(Ei.path,{cliAuthorizationId:e},Ei.operationId),headers:{[n]:t}},Ci);if(r.ok&&r.redirect)throw new V(`poll`,Pi(r.status),[t]);if(!r.ok)throw new V(`poll`,r.problem,[t]);return{authorization:r.data,retryAfterSeconds:Mi(r.headers[`retry-after`])}}async function ji(e,t){let n=te(Di.operationId),r;try{r=await ne(Ke(f()),{method:Di.method,path:xe(Di.path,{cliAuthorizationId:e},Di.operationId),headers:{[n]:t}},xi)}catch(e){throw new Oi(`acknowledge`,e,[t])}if(r.ok&&r.redirect)throw new V(`acknowledge`,Pi(r.status),[t]);if(!r.ok)throw new V(`acknowledge`,r.problem,[t]);return r.data}function Mi(e){if(e===void 0)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function Ni(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:null}function Pi(e){return{status:e,title:`Unexpected redirect`,type:`about:blank`,code:void 0,detail:`CLI authorization endpoint returned an unexpected redirect`}}function Fi(e){let{verificationUrl:t,pollSecret:n,...r}=e,i={...e},a=()=>({...r,verificationUrl:`<redacted>`,pollSecret:`<redacted>`});return Object.defineProperties(i,{verificationUrl:{enumerable:!1,get:()=>t},pollSecret:{enumerable:!1,get:()=>n},toJSON:{enumerable:!1,value:a},toString:{enumerable:!1,value:()=>`CliAuthorizationStart(${JSON.stringify(a())})`},[Gt.custom]:{enumerable:!1,value:a}})}async function Ii(e){let t=await Li(e.credential.secret);if(t.state!==`verified`||e.activation!==`active`)return{stored:e,verification:t};try{return{stored:await Je(e.host,{apiKey:t.apiKey,secret:e.credential.secret},`active`),verification:t}}catch(n){return{stored:e,verification:{state:`unavailable`,summary:`${t.summary}, but the cached metadata could not be updated — ${C(n,[e.credential.secret])}`}}}}async function Li(e){let t=Ke(f()),n;try{n=await ne(t,{method:`GET`,path:se(`getCurrentApiKey`,{}),headers:{Authorization:`Bearer ${e}`}},rt)}catch(t){return{state:`unavailable`,summary:`identity verification failed before an HTTP response — ${C(t,[e])}`}}return n.ok&&n.redirect?{state:`unavailable`,summary:`identity verification returned unexpected redirect ${n.status}`}:n.ok?n.data.status===`ACTIVE`?{state:`verified`,summary:`API key verified by aVenture sign-in`,apiKey:n.data}:{state:`invalid`,summary:`API key is not active`}:{state:n.problem.status===401||n.problem.status===403?`invalid`:`unavailable`,summary:`identity verification: ${qe(n.problem,[e])}`}}var Ri=S(B,`revoke`);async function zi(e){let t;try{t=w(f().host)}catch(e){return b(`auth logout: invalid API host — ${C(e)}`)}let n=await Bi(t),r=await Ui(t,e),i=n.state===`failed`?[`OAuth credential could not be removed — ${n.summary}`]:n.state===`forgotten`&&!n.revoked?[`OAuth refresh token was not revoked remotely — ${n.summary??`no revocation endpoint`}`]:[],a={host:t,revoked:!1,forgotten:!1,oauth:n};return r===null?n.state===`missing`?y(`No CLI credential is stored for this API host.`,a):n.state===`failed`?{...b(`auth logout: ${i[0]}`),data:a}:y(n.revoked?`OAuth credential revoked remotely and removed locally.`:`OAuth credential removed locally.`,a,{warnings:i}):{...r,data:{...r.data??a,oauth:n},warnings:[...r.warnings,...i]}}async function Bi(e){let t=await dt(e);if(t.state===`missing`)return{state:`missing`};let n=t.state===`found`?await Hi(t.stored):{revoked:!1};try{await at(e)}catch(e){return{state:`failed`,summary:C(e)}}return{state:`forgotten`,...n}}async function Vi(e){let t=Reflect.get(await _t(e),`revocation_endpoint`);return typeof t==`string`?ct(t,`revocation endpoint`,!0):void 0}async function Hi(e){let{client:t,tokens:n}=e.credential,r=n.refresh_token??n.access_token;try{let e=await Vi(t);if(e===void 0)return{revoked:!1};let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:r,client_id:mt(t)})});return n.ok?{revoked:!0}:{revoked:!1,summary:`revocation endpoint answered ${n.status}`}}catch(e){return{revoked:!1,summary:C(e,ut(n))}}}async function Ui(e,t){let n;try{n=await Xe(e)}catch(e){return b(`auth logout: stored credential could not be read — ${C(e)}`)}if(n.state===`unavailable`)return{...b(`auth logout: ${n.summary}`),data:{host:e,revoked:!1,forgotten:!1}};if(n.state===`missing`)return null;let r=n.stored,i=await Wi(r),a=i.outcome===`revoked`,o=r.activation===`pending`&&i.outcome===`rejected`;if(!a&&!o&&!t.forgetLocal)return{...b(`auth logout: remote revocation was not confirmed; local credential preserved — ${i.summary}`,[`Retry when the API is available. If an earlier response was lost after revocation, the retry can be unauthorized because revoked keys cannot authenticate.`,"Use `--forget-local` only to remove local bytes while accepting that the remote key may remain active."]),data:Gi(r,!1,!1)};try{await Qe(r.host)}catch(e){return{...b(`auth logout: local credential removal failed — ${C(e,[r.credential.secret])}`,[a?"The remote key is revoked. Re-run with `--forget-local` to retry local cleanup.":`Remote revocation was not confirmed; inspect auth status before retrying.`]),data:Gi(r,a,!1)}}return y(a?`API key revoked remotely and removed locally.`:o?`Stale pending CLI credential removed; its remote key can no longer authenticate and unacknowledged keys expire at the authorization deadline.`:`API key removed locally without confirmed remote revocation.`,Gi(r,a,!0),{ids:[r.credential.apiKey.id],warnings:a||o?[]:[`Remote revocation was not confirmed; the API key may remain active.`]})}async function Wi(e){let t=Ke(f());try{let n=await ne(t,{method:Ri.method,path:xe(Ri.path,{},Ri.operationId),headers:{Authorization:`Bearer ${e.credential.secret}`}},rt);return n.ok&&n.redirect?{outcome:`unconfirmed`,summary:`remote key revocation returned unexpected redirect ${n.status}`}:n.ok?n.data.id!==e.credential.apiKey.id||n.data.subject!==e.credential.apiKey.subject?{outcome:`unconfirmed`,summary:`remote response did not match the stored API key identity`}:n.data.status===`REVOKED`?{outcome:`revoked`,summary:`remote key revocation confirmed`}:{outcome:`unconfirmed`,summary:`remote response did not confirm REVOKED status`}:{outcome:n.problem.status===401&&n.problem.type!==`about:blank`?`rejected`:`unconfirmed`,summary:qe(n.problem,[e.credential.secret])}}catch(t){return{outcome:`unconfirmed`,summary:C(t,[e.credential.secret])}}}function Gi(e,t,n){return{host:e.host,apiKeyId:e.credential.apiKey.id,activation:e.activation,revoked:t,forgotten:n}}var Ki=`RSA_OAEP_256_A256_GCM_V1`,qi=1,Ji=30,H=x().bin[0],Yi=`The local record remains pending and unavailable to ordinary commands. Re-run \`${H} auth login --key\`; it recovers the credential when the broker acknowledged it, and otherwise clears the stale record.`;async function Xi(e){if(!Ut.isTTY)return b(`${H} auth login --key requires an interactive TTY on stdin`,[`For non-interactive automation, inject AUTH_TOKEN through the environment.`]);let t,n;try{let e=f().host;t=w(e),n=it(e)}catch(e){return b(`auth login --key: invalid environment configuration — ${C(e)}`)}for(;;){let e;try{e=await et(t)}catch(e){return b(`auth login --key: credential storage could not be inspected — ${C(e)}`)}if(e.state===`unavailable`)return b(`auth login --key: ${e.summary}`,[`Make the OS keyring or the CLI config directory writable, or use AUTH_TOKEN from the environment.`]);if(e.state===`missing`){e.keyringFailure!==void 0&&P.write(tt(e.keyringFailure));break}let n=await Zi(e.stored);if(n!==null)return n}let r;try{r=await gi()}catch(e){return b(`auth login --key: ephemeral encryption key could not be created — ${C(e)}`)}let i=mi.safeParse({clientLabel:e.clientLabel?.trim()||(qt().trim()||H).slice(0,120),clientPlatform:ta(),encryptionAlgorithm:Ki,encryptionPublicKey:r.publicKey});if(!i.success)return b(`auth login --key: ${p(i.error)}`);let a;try{a=await ki(i.data)}catch(e){return b(`auth login --key: could not start browser authorization — ${C(e)}`)}let o;try{o=Ze(a,n)}catch(e){return b(`auth login --key: unsafe browser authorization URL rejected — ${C(e)}`)}if(!ea(await $e(a,n,{noBrowser:e.noBrowser}),a,o))return b(`auth login --key: browser authorization requires an interactive terminal for manual handoff`,[`Automatic browser opening did not complete, and the approval URL was withheld because stderr is not an interactive terminal. Retry from an interactive terminal.`],{references:[o]});let s;try{s=await $i(a)}catch(e){return b(`auth login --key: authorization did not complete — ${C(e)}`,[],{references:[o]})}if(s.algorithm!==Ki)return b(`auth login --key: broker selected an unsupported encryption algorithm`);let c;try{c=await _i(r.privateKey,s)}catch(e){return b(`auth login --key: encrypted credential could not be opened — ${C(e)}`)}let l=await Li(c);if(l.state!==`verified`)return b(`auth login --key: decrypted credential was neither stored nor acknowledged — ${l.summary}`);let u;try{u=await Je(t,{apiKey:l.apiKey,secret:c},`pending`)}catch(e){return b(`auth login --key: credential could not be durably stored — ${C(e)}`)}let d;try{d=await Qi(a)}catch(e){return U(u,!0,`auth login --key: credential was stored and verified, but broker acknowledgment was not confirmed — ${C(e,[a.pollSecret])}`,Yi)}if(d.status!==`CONSUMED`)return U(u,!0,`auth login --key: broker returned ${d.status} after acknowledgment`,Yi);let m=await Li(c);if(m.state!==`verified`||!aa(m.apiKey,u.credential.apiKey))return U(u,!0,`auth login --key: broker acknowledgment succeeded, but refreshed credential metadata could not prove the granted lifetime — ${m.summary}`,Yi);try{let e=await Je(t,{apiKey:m.apiKey,secret:c},`active`);return y(`API key stored; authenticated identity and broker acknowledgment verified.`,ia(e,!0),{ids:[e.credential.apiKey.id]})}catch(e){return U(u,!0,`auth login --key: remote acknowledgment succeeded, but local activation could not be confirmed — ${C(e)}`,Yi)}}async function Zi(e){let t=await Li(e.credential.secret);if(e.activation!==`pending`)return t.state===`verified`?y(`API key is already stored and its authenticated identity was verified.`,ia(e,!0),{ids:[e.credential.apiKey.id]}):U(e,!1,`auth login --key: stored credential ${t.state} — ${t.summary}`,`Run \`${H} auth logout\` to revoke/remove it before authorizing a replacement.`);if(t.state===`verified`&&aa(t.apiKey,e.credential.apiKey))try{let n=await Je(e.host,{apiKey:t.apiKey,secret:e.credential.secret},`active`);return y(`Recovered pending CLI credential: broker acknowledgment had succeeded.`,ia(n,!0),{ids:[n.credential.apiKey.id]})}catch(t){return U(e,!0,`auth login --key: credential is valid but could not be promoted locally — ${C(t,[e.credential.secret])}`,`The remote key remains valid. Re-run \`${H} auth login --key\` to retry local activation; it will recover the pending credential automatically.`)}if(t.state===`unavailable`||t.state===`verified`&&!e.credential.apiKey.expiresAt)return U(e,t.state===`verified`,`auth login --key: the stored pending credential acknowledgment could not be verified — ${t.summary}`,t.state===`verified`?`The stored expiry is missing. Both records were preserved; inspect the existing key in your account before deciding how to recover it.`:`The stored record and the remote key were both preserved. Re-run \`${H} auth login --key\` when the API is reachable; it recovers an acknowledged credential and clears an unacknowledged one.`);let n=await Wi(e);if(n.outcome===`unconfirmed`)return U(e,!1,`auth login --key: a prior credential is durably stored but broker acknowledgment was not confirmed`,`Remote revocation of the stale pending key was not confirmed — ${n.summary}. Retry when the API is reachable.`);try{await Qe(e.host)}catch(t){return U(e,!1,`auth login --key: stale pending credential could not be removed — ${C(t,[e.credential.secret])}`)}return P.write(n.outcome===`revoked`?`Revoked and cleared a stale pending CLI credential; starting a fresh browser authorization.
|
|
14
|
+
`)}\n`})}}function ti(e){let[t,...n]=e.filter(e=>{let[t,n,...r]=e.cliPath;return t===`help`&&n!==void 0&&r.length===0&&oi(e)!==void 0});return n.length===0?t:void 0}var ni='Accepted selectors: `<METHOD> <route template or concrete path>`, an operationId, or a CLI command path such as "entities get".';function ri(e,t){let[n=``,...r]=e.join(` `).trim().split(/\s+/u),[i,...a]=t.filter(e=>e.path===n);if(r.length===0&&i!==void 0)return a.length===0?y(`Resolved by route`,{operationId:i.operationId}):b(`${n} is served by ${[i,...a].map(({method:e})=>e).join(`, `)}; name the method, as in \`help ${i.method} ${n}\`.`,[ni]);let o=be.find(e=>e===n.toLowerCase());if(o===void 0||r.length===0){let n=e.join(` `).trim();return y(`Resolved by name`,t.some(e=>e.operationId===n)?{operationId:n}:{command:n})}let s=xe(o),c=r.join(``),l=t.find(e=>e.method===s&&e.path===c);if(l!==void 0)return y(`Resolved by route template`,{operationId:l.operationId});let u=oe({method:s,path:c});return!u.ok||u.data===null?b(u.summary,[...u.warnings,ni]):y(`Resolved by method and path`,{operationId:u.data.operation.operationId})}function ii(e,t){let n=e;for(let e of t){let t=n.commands.find(t=>t.name()===e||t.aliases().includes(e));if(t===void 0)return;n=t}return n}async function ai(e,t,n,r){let i=oi(e);if(i===void 0)return b(`The \`${e.cliPath.join(` `)}\` operation no longer takes a single required text body; run it directly instead of \`help --ask\`.`);n!==void 0&&(process.env.API_ENV=n);let a=await Jn(e,{[i.optionKey]:t});return a.ok?await re({method:e.method,path:se(e.operationId,{}),searchParams:{},body:a.data,auth:e.auth,responseFormat:kt(r)?`json`:`auto`}):a}function oi(e){if(e.requestBody?.length!==1||e.parameters.some(e=>e.required))return;let t=(e.requestBody[0]?.parameter??[]).filter(e=>e.required);return t.length===1&&t[0]?.schemaType===`string`?t[0]:void 0}function si(e,t,n){if(e.cliPath[0]!==`lookup`||!ci(n))return null;let r=e.parameters.filter(e=>t[e.optionKey]!==void 0).map(e=>`${e.name}=${String(t[e.optionKey])}`),i=`no record for ${r.length===0?`the given input`:r.join(`, `)}`;return n.ok?b(i):b(i,[],{httpStatus:n.httpStatus,problem:n.problem})}function ci(e){return e.ok?Array.isArray(e.data)&&e.data.length===0:e.httpStatus===404}function li(e,t){if(e.deprecated!==!0)return t;let n=e.description.match(/^Deprecated:[^.]*\./u)?.[0]??`Deprecated; run \`help ${e.cliPath.join(` `)}\` for its replacement.`;return{...t,warnings:[n,...t.warnings]}}var ui=v({artifact:_().nullish(),group:_().nullish(),name:_().nullish(),revision:_().nullish(),time:h({offset:!0}).nullish(),version:_().nullish()}),di=v({build:ui}),fi=g([`MACOS`,`LINUX`,`WINDOWS`,`OTHER`]),pi=g([`RSA_OAEP_256_A256_GCM_V1`]),mi=v({clientLabel:_().regex(/.*\S.*/).min(1).max(120).nullish(),clientPlatform:fi.nullish(),encryptionAlgorithm:pi.nullish(),encryptionPublicKey:_().min(344).max(12e3).nullish()}),hi=32;async function gi(){let e=await Qt.subtle.generateKey({name:`RSA-OAEP`,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:`SHA-256`},!0,[`encrypt`,`decrypt`]),t=await Qt.subtle.exportKey(`spki`,e.publicKey);return{publicKey:Buffer.from(t).toString(`base64`),privateKey:e.privateKey}}async function _i(e,t){let{wrappedKey:n,nonce:r,ciphertext:i,authenticationTag:a}=t,o=vi(n,`wrapped key`,128,1024),s=vi(r,`nonce`,12,12),c=vi(i,`ciphertext`,1,65536),l=vi(a,`authentication tag`,16,16),u;try{u=await Qt.subtle.decrypt({name:`RSA-OAEP`},e,o)}catch{throw Error(`broker credential key could not be decrypted`)}let d=new Uint8Array(u);try{if(d.byteLength!==hi)throw Error(`broker credential used an invalid AES-256 key`);let e=await Qt.subtle.importKey(`raw`,d,{name:`AES-GCM`},!1,[`decrypt`]),t=new Uint8Array(c.byteLength+l.byteLength);t.set(c),t.set(l,c.byteLength);let n;try{n=await Qt.subtle.decrypt({name:`AES-GCM`,iv:s,tagLength:128},e,t)}catch{throw Error(`broker credential payload failed authentication`)}let r=new Wt(`utf-8`,{fatal:!0}).decode(n);if(r.trim().length===0)throw Error(`broker returned a blank credential`);return r}finally{d.fill(0)}}function vi(e,t,n,r){let i=e.replace(/=+$/u,``),a=Uint8Array.from(Buffer.from(e,`base64`)),o=Buffer.from(a).toString(`base64`).replace(/=+$/u,``);if(i.length===0||o!==i||a.byteLength<n||a.byteLength>r)throw Error(`broker returned an invalid ${t}`);return a}var yi=g([`PENDING`,`ISSUING`,`KEY_READY`,`REVOKING`,`CONSUMED`,`REVOKED`,`DENIED`,`EXPIRED`,`FAILED`]),bi=g([`Denied by user`,`Authorization request expired`,`CLI authorization expired before acknowledgement`,`Credential issuance recovery revoked an unrecoverable key`,`Revoked by user`,`Clerk create response validation failed`,`Credential issuance failed`,`Credential issuance could not be recovered`,`API-key quota reached`,`Credential issuance lost its database claim`,`Credential delivery encryption failed`,`Credential issuance finalization was lost`]),xi=v({approvedAt:h({offset:!0}).nullish(),clientLabel:_(),clientPlatform:fi,comparisonCode:_(),consumedAt:h({offset:!0}).nullish(),createdAt:h({offset:!0}),expiresAt:h({offset:!0}),id:m(),intervalSeconds:ee().int().min(1),keyReadyAt:h({offset:!0}).nullish(),status:yi,terminalAt:h({offset:!0}).nullish(),terminalReason:bi.nullish(),updatedAt:h({offset:!0})}),Si=v({algorithm:pi,authenticationTag:_(),ciphertext:_(),nonce:_(),wrappedKey:_()}),Ci=v({delivery:Si.nullish(),expiresAt:h({offset:!0}),status:yi,terminalReason:bi.nullish()}),wi=v({comparisonCode:_(),expiresAt:h({offset:!0}),id:m(),intervalSeconds:ee().int().min(1),pollSecret:_(),verificationUrl:_()}),B=[{command:`auth login`,role:`oauth`,summary:`Sign In Through Your Browser`,description:`Sign in through your browser and save verified CLI access in the credential store. Use --no-browser for OAuth device authorization only when the issuer advertises device-grant support; otherwise use --key --no-browser for API-key approval.`,operationId:`getAuthProviderCatalog`,method:`GET`,path:`/v1/auth/providers`,bodyOption:[],localOption:[{optionKey:`browser`,flag:`--no-browser`,description:`Use OAuth device authorization only when the issuer advertises device-grant support: print a sign-in URL and code, then wait for approval. Otherwise use --key --no-browser for API-key approval.`},{optionKey:`providers`,flag:`--providers`,description:`Print the sign-in providers and CLI OAuth client, then exit without signing in.`}]},{command:`auth login`,role:`start`,summary:`Sign In With a Browser-Approved aVenture API Key`,description:`Creates a short-lived browser approval request and returns its poll credential once.`,operationId:`createCliAuthorization`,method:`POST`,path:`/v1/auth/cli-authorizations`,bodyOption:[{name:`clientLabel`,optionKey:`clientLabel`,flag:`--client-label <client-label>`,required:!1,description:`Label for this CLI installation.`}],localOption:[{optionKey:`key`,flag:`--key`,description:`Sign in with a browser-approved aVenture API key instead of OAuth; the approval URL opens on any device.`},{optionKey:`browser`,flag:`--no-browser`,description:`Print the API-key approval URL and wait for approval without opening a browser.`}]},{command:`auth login`,role:`poll`,summary:`Poll CLI Authorization`,description:`Returns pending state, a terminal state, or an encrypted one-time credential delivery.`,operationId:`pollCliAuthorization`,method:`POST`,path:`/v1/auth/cli-authorizations/{cliAuthorizationId}/poll`,bodyOption:[],localOption:[]},{command:`auth login`,role:`acknowledge`,summary:`Acknowledge CLI Credential Delivery`,description:`Confirms the CLI stored the delivered API key in its credential store and clears transient delivery material.`,operationId:`acknowledgeCliAuthorization`,method:`POST`,path:`/v1/auth/cli-authorizations/{cliAuthorizationId}/acknowledge`,bodyOption:[],localOption:[]},{command:`auth logout`,role:`revoke`,summary:`Sign Out: Revoke the API Key and Forget Stored OAuth`,description:`Revokes the aVenture API key authenticating this request and returns its metadata so the CLI can confirm revocation before deleting its saved copy.`,operationId:`revokeCurrentApiKey`,method:`DELETE`,path:`/v1/auth/api-key`,bodyOption:[],localOption:[{optionKey:`forgetLocal`,flag:`--forget-local`,description:`Delete the saved key even when revocation cannot be confirmed.`}]}],Ti=S(B,`start`),Ei=S(B,`poll`),Di=S(B,`acknowledge`),V=class extends Error{httpStatus;retryAfterSeconds;retryable;constructor(e,t,n=[]){super(`CLI authorization ${e} failed: ${qe(t,n)}`),this.name=`CliAuthorizationRequestError`,this.httpStatus=t.status,this.retryAfterSeconds=Ni(t.retryAfterSeconds),this.retryable=t.status>=500||t.status===429}},Oi=class extends Error{constructor(e,t,n=[]){super(`CLI authorization ${e} transport failed: ${C(t,n)}`,{cause:t}),this.name=`CliAuthorizationTransportError`}};async function ki(e){let t=await ne(Ke(f()),{method:Ti.method,path:he(Ti.path,{},Ti.operationId),headers:{},contentType:`application/json`,body:e},wi);if(t.ok&&t.redirect)throw new V(`start`,Pi(t.status));if(!t.ok)throw new V(`start`,t.problem);return Fi(t.data)}async function Ai(e,t){let n=te(Ei.operationId),r=await ne(Ke(f()),{method:Ei.method,path:he(Ei.path,{cliAuthorizationId:e},Ei.operationId),headers:{[n]:t}},Ci);if(r.ok&&r.redirect)throw new V(`poll`,Pi(r.status),[t]);if(!r.ok)throw new V(`poll`,r.problem,[t]);return{authorization:r.data,retryAfterSeconds:Mi(r.headers[`retry-after`])}}async function ji(e,t){let n=te(Di.operationId),r;try{r=await ne(Ke(f()),{method:Di.method,path:he(Di.path,{cliAuthorizationId:e},Di.operationId),headers:{[n]:t}},xi)}catch(e){throw new Oi(`acknowledge`,e,[t])}if(r.ok&&r.redirect)throw new V(`acknowledge`,Pi(r.status),[t]);if(!r.ok)throw new V(`acknowledge`,r.problem,[t]);return r.data}function Mi(e){if(e===void 0)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function Ni(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:null}function Pi(e){return{status:e,title:`Unexpected redirect`,type:`about:blank`,code:void 0,detail:`CLI authorization endpoint returned an unexpected redirect`}}function Fi(e){let{verificationUrl:t,pollSecret:n,...r}=e,i={...e},a=()=>({...r,verificationUrl:`<redacted>`,pollSecret:`<redacted>`});return Object.defineProperties(i,{verificationUrl:{enumerable:!1,get:()=>t},pollSecret:{enumerable:!1,get:()=>n},toJSON:{enumerable:!1,value:a},toString:{enumerable:!1,value:()=>`CliAuthorizationStart(${JSON.stringify(a())})`},[Gt.custom]:{enumerable:!1,value:a}})}async function Ii(e){let t=await Li(e.credential.secret);if(t.state!==`verified`||e.activation!==`active`)return{stored:e,verification:t};try{return{stored:await Je(e.host,{apiKey:t.apiKey,secret:e.credential.secret},`active`),verification:t}}catch(n){return{stored:e,verification:{state:`unavailable`,summary:`${t.summary}, but the cached metadata could not be updated — ${C(n,[e.credential.secret])}`}}}}async function Li(e){let t=Ke(f()),n;try{n=await ne(t,{method:`GET`,path:se(`getCurrentApiKey`,{}),headers:{Authorization:`Bearer ${e}`}},rt)}catch(t){return{state:`unavailable`,summary:`identity verification failed before an HTTP response — ${C(t,[e])}`}}return n.ok&&n.redirect?{state:`unavailable`,summary:`identity verification returned unexpected redirect ${n.status}`}:n.ok?n.data.status===`ACTIVE`?{state:`verified`,summary:`API key verified by aVenture sign-in`,apiKey:n.data}:{state:`invalid`,summary:`API key is not active`}:{state:n.problem.status===401||n.problem.status===403?`invalid`:`unavailable`,summary:`identity verification: ${qe(n.problem,[e])}`}}var Ri=S(B,`revoke`);async function zi(e){let t;try{t=w(f().host)}catch(e){return b(`auth logout: invalid API host — ${C(e)}`)}let n=await Bi(t),r=await Ui(t,e),i=n.state===`failed`?[`OAuth credential could not be removed — ${n.summary}`]:n.state===`forgotten`&&!n.revoked?[`OAuth refresh token was not revoked remotely — ${n.summary??`no revocation endpoint`}`]:[],a={host:t,revoked:!1,forgotten:!1,oauth:n};return r===null?n.state===`missing`?y(`No CLI credential is stored for this API host.`,a):n.state===`failed`?{...b(`auth logout: ${i[0]}`),data:a}:y(n.revoked?`OAuth credential revoked remotely and removed locally.`:`OAuth credential removed locally.`,a,{warnings:i}):{...r,data:{...r.data??a,oauth:n},warnings:[...r.warnings,...i]}}async function Bi(e){let t=await dt(e);if(t.state===`missing`)return{state:`missing`};let n=t.state===`found`?await Hi(t.stored):{revoked:!1};try{await at(e)}catch(e){return{state:`failed`,summary:C(e)}}return{state:`forgotten`,...n}}async function Vi(e){let t=Reflect.get(await _t(e),`revocation_endpoint`);return typeof t==`string`?ct(t,`revocation endpoint`,!0):void 0}async function Hi(e){let{client:t,tokens:n}=e.credential,r=n.refresh_token??n.access_token;try{let e=await Vi(t);if(e===void 0)return{revoked:!1};let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:r,client_id:mt(t)})});return n.ok?{revoked:!0}:{revoked:!1,summary:`revocation endpoint answered ${n.status}`}}catch(e){return{revoked:!1,summary:C(e,ut(n))}}}async function Ui(e,t){let n;try{n=await Xe(e)}catch(e){return b(`auth logout: stored credential could not be read — ${C(e)}`)}if(n.state===`unavailable`)return{...b(`auth logout: ${n.summary}`),data:{host:e,revoked:!1,forgotten:!1}};if(n.state===`missing`)return null;let r=n.stored,i=await Wi(r),a=i.outcome===`revoked`,o=r.activation===`pending`&&i.outcome===`rejected`;if(!a&&!o&&!t.forgetLocal)return{...b(`auth logout: remote revocation was not confirmed; local credential preserved — ${i.summary}`,[`Retry when the API is available. If an earlier response was lost after revocation, the retry can be unauthorized because revoked keys cannot authenticate.`,"Use `--forget-local` only to remove local bytes while accepting that the remote key may remain active."]),data:Gi(r,!1,!1)};try{await Qe(r.host)}catch(e){return{...b(`auth logout: local credential removal failed — ${C(e,[r.credential.secret])}`,[a?"The remote key is revoked. Re-run with `--forget-local` to retry local cleanup.":`Remote revocation was not confirmed; inspect auth status before retrying.`]),data:Gi(r,a,!1)}}return y(a?`API key revoked remotely and removed locally.`:o?`Stale pending CLI credential removed; its remote key can no longer authenticate and unacknowledged keys expire at the authorization deadline.`:`API key removed locally without confirmed remote revocation.`,Gi(r,a,!0),{ids:[r.credential.apiKey.id],warnings:a||o?[]:[`Remote revocation was not confirmed; the API key may remain active.`]})}async function Wi(e){let t=Ke(f());try{let n=await ne(t,{method:Ri.method,path:he(Ri.path,{},Ri.operationId),headers:{Authorization:`Bearer ${e.credential.secret}`}},rt);return n.ok&&n.redirect?{outcome:`unconfirmed`,summary:`remote key revocation returned unexpected redirect ${n.status}`}:n.ok?n.data.id!==e.credential.apiKey.id||n.data.subject!==e.credential.apiKey.subject?{outcome:`unconfirmed`,summary:`remote response did not match the stored API key identity`}:n.data.status===`REVOKED`?{outcome:`revoked`,summary:`remote key revocation confirmed`}:{outcome:`unconfirmed`,summary:`remote response did not confirm REVOKED status`}:{outcome:n.problem.status===401&&n.problem.type!==`about:blank`?`rejected`:`unconfirmed`,summary:qe(n.problem,[e.credential.secret])}}catch(t){return{outcome:`unconfirmed`,summary:C(t,[e.credential.secret])}}}function Gi(e,t,n){return{host:e.host,apiKeyId:e.credential.apiKey.id,activation:e.activation,revoked:t,forgotten:n}}var Ki=`RSA_OAEP_256_A256_GCM_V1`,qi=1,Ji=30,H=x().bin[0],Yi=`The local record remains pending and unavailable to ordinary commands. Re-run \`${H} auth login --key\`; it recovers the credential when the broker acknowledged it, and otherwise clears the stale record.`;async function Xi(e){if(!Ut.isTTY)return b(`${H} auth login --key requires an interactive TTY on stdin`,[`For non-interactive automation, inject AUTH_TOKEN through the environment.`]);let t,n;try{let e=f().host;t=w(e),n=it(e)}catch(e){return b(`auth login --key: invalid environment configuration — ${C(e)}`)}for(;;){let e;try{e=await et(t)}catch(e){return b(`auth login --key: credential storage could not be inspected — ${C(e)}`)}if(e.state===`unavailable`)return b(`auth login --key: ${e.summary}`,[`Make the OS keyring or the CLI config directory writable, or use AUTH_TOKEN from the environment.`]);if(e.state===`missing`){e.keyringFailure!==void 0&&P.write(tt(e.keyringFailure));break}let n=await Zi(e.stored);if(n!==null)return n}let r;try{r=await gi()}catch(e){return b(`auth login --key: ephemeral encryption key could not be created — ${C(e)}`)}let i=mi.safeParse({clientLabel:e.clientLabel?.trim()||(qt().trim()||H).slice(0,120),clientPlatform:ta(),encryptionAlgorithm:Ki,encryptionPublicKey:r.publicKey});if(!i.success)return b(`auth login --key: ${p(i.error)}`);let a;try{a=await ki(i.data)}catch(e){return b(`auth login --key: could not start browser authorization — ${C(e)}`)}let o;try{o=Ze(a,n)}catch(e){return b(`auth login --key: unsafe browser authorization URL rejected — ${C(e)}`)}if(!ea(await $e(a,n,{noBrowser:e.noBrowser}),a,o))return b(`auth login --key: browser authorization requires an interactive terminal for manual handoff`,[`Automatic browser opening did not complete, and the approval URL was withheld because stderr is not an interactive terminal. Retry from an interactive terminal.`],{references:[o]});let s;try{s=await $i(a)}catch(e){return b(`auth login --key: authorization did not complete — ${C(e)}`,[],{references:[o]})}if(s.algorithm!==Ki)return b(`auth login --key: broker selected an unsupported encryption algorithm`);let c;try{c=await _i(r.privateKey,s)}catch(e){return b(`auth login --key: encrypted credential could not be opened — ${C(e)}`)}let l=await Li(c);if(l.state!==`verified`)return b(`auth login --key: decrypted credential was neither stored nor acknowledged — ${l.summary}`);let u;try{u=await Je(t,{apiKey:l.apiKey,secret:c},`pending`)}catch(e){return b(`auth login --key: credential could not be durably stored — ${C(e)}`)}let d;try{d=await Qi(a)}catch(e){return U(u,!0,`auth login --key: credential was stored and verified, but broker acknowledgment was not confirmed — ${C(e,[a.pollSecret])}`,Yi)}if(d.status!==`CONSUMED`)return U(u,!0,`auth login --key: broker returned ${d.status} after acknowledgment`,Yi);let m=await Li(c);if(m.state!==`verified`||!aa(m.apiKey,u.credential.apiKey))return U(u,!0,`auth login --key: broker acknowledgment succeeded, but refreshed credential metadata could not prove the granted lifetime — ${m.summary}`,Yi);try{let e=await Je(t,{apiKey:m.apiKey,secret:c},`active`);return y(`API key stored; authenticated identity and broker acknowledgment verified.`,ia(e,!0),{ids:[e.credential.apiKey.id]})}catch(e){return U(u,!0,`auth login --key: remote acknowledgment succeeded, but local activation could not be confirmed — ${C(e)}`,Yi)}}async function Zi(e){let t=await Li(e.credential.secret);if(e.activation!==`pending`)return t.state===`verified`?y(`API key is already stored and its authenticated identity was verified.`,ia(e,!0),{ids:[e.credential.apiKey.id]}):U(e,!1,`auth login --key: stored credential ${t.state} — ${t.summary}`,`Run \`${H} auth logout\` to revoke/remove it before authorizing a replacement.`);if(t.state===`verified`&&aa(t.apiKey,e.credential.apiKey))try{let n=await Je(e.host,{apiKey:t.apiKey,secret:e.credential.secret},`active`);return y(`Recovered pending CLI credential: broker acknowledgment had succeeded.`,ia(n,!0),{ids:[n.credential.apiKey.id]})}catch(t){return U(e,!0,`auth login --key: credential is valid but could not be promoted locally — ${C(t,[e.credential.secret])}`,`The remote key remains valid. Re-run \`${H} auth login --key\` to retry local activation; it will recover the pending credential automatically.`)}if(t.state===`unavailable`||t.state===`verified`&&!e.credential.apiKey.expiresAt)return U(e,t.state===`verified`,`auth login --key: the stored pending credential acknowledgment could not be verified — ${t.summary}`,t.state===`verified`?`The stored expiry is missing. Both records were preserved; inspect the existing key in your account before deciding how to recover it.`:`The stored record and the remote key were both preserved. Re-run \`${H} auth login --key\` when the API is reachable; it recovers an acknowledged credential and clears an unacknowledged one.`);let n=await Wi(e);if(n.outcome===`unconfirmed`)return U(e,!1,`auth login --key: a prior credential is durably stored but broker acknowledgment was not confirmed`,`Remote revocation of the stale pending key was not confirmed — ${n.summary}. Retry when the API is reachable.`);try{await Qe(e.host)}catch(t){return U(e,!1,`auth login --key: stale pending credential could not be removed — ${C(t,[e.credential.secret])}`)}return P.write(n.outcome===`revoked`?`Revoked and cleared a stale pending CLI credential; starting a fresh browser authorization.
|
|
15
15
|
`:`Cleared a stale pending CLI credential whose remote key can no longer authenticate; starting a fresh browser authorization.
|
|
16
16
|
`),null}async function Qi(e){let t=new Date(e.expiresAt).getTime(),n=na(e.intervalSeconds);for(;;)try{return await ji(e.id,e.pollSecret)}catch(e){if(e instanceof V){if(!e.retryable)throw e;n=na(e.retryAfterSeconds??n)}else if(!(e instanceof Oi))throw e;if(Date.now()>=t)throw e;P.write(`Broker acknowledgment was interrupted; retrying.
|
|
17
17
|
`),await ra(n,t)}}async function $i(e){let t=new Date(e.expiresAt).getTime(),n=na(e.intervalSeconds),r;for(P.write(`Waiting for browser approval...
|
|
@@ -27,7 +27,7 @@ import{a as e,n as t,o as n,r,t as i}from"./commander-BB7CDPLs.js";import{i as a
|
|
|
27
27
|
`)).option(`--execute`,`Deprecated; accepted and ignored. This command executes by its verb.`,!1).option(`--release <version>`,`Install and activate exactly this version, not the latest.`)).action(e=>R({mode:E(e)},io(void 0,`apply`,e.release)))}function io(e,t=`apply`,n){let r=e;try{r??=x(process.argv[1])}catch(e){return b(e instanceof Error?e.message:String(e),[`invalid_package_metadata`])}let i=r.name,a=r.version,o=r.registry===``?``:de,s=r.registry===``&&i===`@aventurevc/aventure-cli`,c=n;if(c===void 0){let e=ao([`view`,o,`version`,`--silent`,`--global`],r,{timeout:to});if(!e.ok)return{...e,data:null};if(c=(e.data??``).trim(),c===``)return b(`npm view ${o} returned empty version`,[`empty_stdout`])}let l=n!==void 0||s||eo.compare(a,c)<0,u={targetPackage:o,runningPackage:i,currentVersion:a,latestVersion:c,upgradeAvailable:l,upgradeInstalled:!1};if(t===`check`)return y(`${i}@${a} → ${o}@${c} (${l?`available`:`up to date`})`,u);if(r.workingTreeRoot!==null)return b(`Refusing to install over the working-tree build at ${r.workingTreeRoot}; rebuild via make instead`,["running CLI is npm-linked from the back-end checkout — `update` is for published bins"]);try{let e=co(r),t=A(e,...no),i=O(o),s=A(t,`${i}-current`),l=o===``?[o,``]:[o,fe],d=lo(e,r),f=n??[c,d?.version??a].reduce((e,t)=>eo.compare(e,t)<0?t:e,a);M(t,{recursive:!0});let p=[so(r),...j(s)?[zt(s)]:[],...Lt(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>A(t,e.name))],m,h=null,g=!1;for(let t of new Set(p.filter(t=>t!==e))){let e=oo(t,l,f,r.registry);if(e.ok&&e.data!==null){m=t,h=e.data;break}}if(m===void 0){m=Ft(A(t,`${i}-${encodeURIComponent(f)}-`));let e=ao([`install`,`-g`,`--prefix`,m,...l.map(e=>`${e}@${f}`)],r,{stdio:[`ignore`,`inherit`,`inherit`]});if(!e.ok)return{...e,data:null};g=!0;let n=oo(m,l,f,r.registry);if(!n.ok)return{...n,data:null};h=n.data}if(h===null)throw Error(`release verification produced no package`);let ee=uo(m,e,s,h,n),_=po();return y(`${o} active at ${ee}`,{...u,upgradeInstalled:g||n!==void 0||d?.version!==ee,installPrefix:e,verifiedVersion:ee,completionRefreshed:_.refreshed,completionRefreshMessage:_.message})}catch(e){return b(`${o} update failed: ${fo(e)}`,[`existing releases were preserved`])}}function ao(e,t,n={}){let r={...process.env};t.registry===``?r.NODE_AUTH_TOKEN??=r.GH_PACKAGES_TOKEN:delete r.GH_PACKAGES_TOKEN;let i=[...e,`--@aventurevc:registry=${t.registry}`],a=At(`npm`,i,{env:r,encoding:`utf8`,...n});if(a.error)return a.signal===`SIGTERM`&&n.timeout!==void 0?b(`npm ${e[0]??``} did not answer within ${n.timeout}ms`,[`timeout`]):b(`npm ${e[0]??``} failed to start: ${a.error.message}`,[`spawn_error`]);if(a.status!==0){let t=(a.stderr??``).trim().split(`
|
|
28
28
|
`).slice(-3).join(` | `);return b(`npm ${e.join(` `)} exited ${a.status}`,[t||`no stderr`])}return y(`npm ok`,a.stdout??``)}function oo(e,t,n,r){try{let i=t.map(t=>{let i=x(A(e,`lib`,`node_modules`,...t.split(`/`),`package.json`));if(i.name!==t||i.version!==n||i.registry!==r)throw Error(`${t} does not match ${n} from ${r}`);for(let t of i.bin)if(!zt(A(e,`bin`,t)).startsWith(`${i.packageRoot}${Mt}`))throw Error(`${t} escapes ${i.packageRoot}`);return i});for(let t of i){let r=A(e,`bin`,t.bin[0]),i=At(process.execPath,[r,`--version`],{encoding:`utf8`,timeout:to});if(i.error)throw Error(`${t.name} verification failed: ${i.error.message}`);let a=(i.stdout??``).trim();if(i.status!==0||a!==n)throw Error(`${t.name} expected ${n} but reported ${a||`empty output`}`)}return y(`CLI and MCP release verified`,i)}catch(t){return b(`release verification failed: ${fo(t)}`,[`release prefix: ${e}`])}}function so(e){let t=k(e.packageRoot),n=k(t),r=k(n);if(O(t)!==e.name.split(`/`)[0]||O(n)!==`node_modules`||O(r)!==`lib`)throw Error(`the running package is not in a verifiable global npm prefix; npm install was not run`);if(!e.entryPath.startsWith(`${e.packageRoot}${Mt}`))throw Error(`the running entry escapes its package root`);return k(r)}function co(e){let t=so(e),n=`${Mt}${no.join(Mt)}${Mt}`,r=t.lastIndexOf(n);return r<0?t:t.slice(0,r)}function lo(e,t){let n=t.registry===``?O(``):pe,r=A(e,`bin`,n);if(!j(r))return null;let i=x(r);if(i.registry!==t.registry)throw Error(`${r} belongs to another product`);return i}function uo(e,t,n,r,i){let a=r[0];if(a===void 0)throw Error(`release contains no CLI`);let o=A(t,`bin`);M(o,{recursive:!0});let s=r.flatMap(e=>e.bin.filter((e,t)=>{let n=A(o,e);if(!j(n)||x(n).registry===a.registry)return!0;if(a.registry!==``&&t>0)return!1;throw Error(`${n} belongs to another product`)}));if(!j(n)){let t=Ft(A(k(n),`${O(n)}-seed-`));M(A(t,`bin`));for(let n of s){let r=A(o,n);Vt(zt(j(r)?r:A(e,`bin`,n)),A(t,`bin`,n))}try{Vt(jt(k(n),t),n)}catch(e){if(!(e instanceof Error&&`code`in e&&e.code===`EEXIST`))throw e}}if(!Pt(n).isSymbolicLink())throw Error(`${n} is not a release symlink`);for(let e of s){let t=jt(o,A(n,`bin`,e)),r=A(o,`.${e}-${Zt()}`);Vt(t,r),Bt(r,A(o,e))}for(let e of s){let t=A(o,e);if(!Pt(t).isSymbolicLink()||A(o,Rt(t))!==A(n,`bin`,e))throw Error(`${t} does not follow the product current pointer`)}let c=lo(t,a);if(i===void 0&&c!==null&&eo.compare(c.version,a.version)>0)return c.version;let l=`${n}-${Zt()}`;return Vt(jt(k(n),e),l),Bt(l,n),a.version}function fo(e){return e instanceof Error?e.message:String(e)}function po(){try{return Ra()}catch(e){return{refreshed:!1,message:e instanceof Error?e.message:String(e)}}}var mo=[{name:`cli-version`,purpose:`running CLI against the latest published release`},{name:`api-schemas`,purpose:`the installed @aventurevc/api-schemas contracts resolve`},{name:`api-host`,purpose:`the selected API host answers`},{name:`auth`,purpose:`which credential signs in, as which account and role, never secrets`},{name:`catalog`,purpose:`this CLI knows every operation the API serves`}];function ho(e,t=x().bin[0]){D(e.command(`doctor`).summary(`One-call selftest: CLI version, schemas, API host, auth scope, command catalog`).description(["Run every environment check in one call and report `{ ok, check: [...] }`:",...mo.map(e=>` - ${e.name}: ${e.purpose}`),``,`Exit code is 0 only when no check failed; a skipped check (no registry reachable) or a`,`warned one (the account read failed) does not fail the run. Each failing message names the command that fixes it.`,"--json always carries the report at `.data`; --data prints the report directly when",`every check passes and the result envelope when one fails, like every other command.`].join(`
|
|
29
29
|
`))).action(async function(e){let n=this.optsWithGlobals();n.environment!==void 0&&(process.env.API_ENV=n.environment),R({mode:E(e)},await go(t))})}async function go(e){let t=vo(),n=yo(e),[r,i]=await Promise.all([bo(e),xo(t,e)]),a=[n.check,r,i.check,await Co(e),Ao(t,i.servedFingerprint,n.upgradeAvailable,e)],o={pass:_o(a,`pass`),warn:_o(a,`warn`),fail:_o(a,`fail`),skip:_o(a,`skip`)},s=a.filter(e=>e.status===`fail`).map(e=>e.message),c={ok:s.length===0,check:a},l=[`doctor: ${o.pass} pass, ${o.warn} warn, ${o.fail} fail, ${o.skip} skip`,...a.map(e=>` ${e.name} ${e.status} — ${e.message}`)].join(`
|
|
30
|
-
`);return c.ok?y(l,c,{counts:o}):{...b(l,s,{counts:o}),data:c}}function _o(e,t){return e.filter(e=>e.status===t).length}function K(e,t,n){return{name:e,status:t,message:n}}function vo(){return T.find(e=>e.intent===`status`&&e.resource===`status`)}function yo(e){let t=x(),n=io(t,`check`);if(!n.ok||n.data===null)return{check:K(`cli-version`,`skip`,`Could not compare ${t.version} against the registry (${n.summary}); rerun \`${e} update\` with registry access.`),upgradeAvailable:null};let{targetPackage:r,currentVersion:i,latestVersion:a,upgradeAvailable:o}=n.data;return{check:o?K(`cli-version`,`fail`,`Upgrade ${r} from ${i} to ${a}: run \`${e} update\`.`):K(`cli-version`,`pass`,`${r} ${i} matches the latest published release.`),upgradeAvailable:o}}async function bo(e){try{let{EntityDetailSchema:e}=await import(`./detail-
|
|
30
|
+
`);return c.ok?y(l,c,{counts:o}):{...b(l,s,{counts:o}),data:c}}function _o(e,t){return e.filter(e=>e.status===t).length}function K(e,t,n){return{name:e,status:t,message:n}}function vo(){return T.find(e=>e.intent===`status`&&e.resource===`status`)}function yo(e){let t=x(),n=io(t,`check`);if(!n.ok||n.data===null)return{check:K(`cli-version`,`skip`,`Could not compare ${t.version} against the registry (${n.summary}); rerun \`${e} update\` with registry access.`),upgradeAvailable:null};let{targetPackage:r,currentVersion:i,latestVersion:a,upgradeAvailable:o}=n.data;return{check:o?K(`cli-version`,`fail`,`Upgrade ${r} from ${i} to ${a}: run \`${e} update\`.`):K(`cli-version`,`pass`,`${r} ${i} matches the latest published release.`),upgradeAvailable:o}}async function bo(e){try{let{EntityDetailSchema:e}=await import(`./detail-CSoU73eT.js`);if(typeof e.safeParse!=`function`)throw Error(`EntityDetailSchema does not expose a Zod parser`);return K(`api-schemas`,`pass`,`Installed @aventurevc/api-schemas contracts resolve beyond the CLI startup path.`)}catch(t){return K(`api-schemas`,`fail`,`Reinstall the CLI: run \`${e} update\` — ${C(t)}.`)}}async function xo(e,t){let n=e??{method:`GET`,path:`/info`,auth:`none`},r;try{r=f().host}catch(e){return{check:K(`api-host`,`fail`,`Correct API_ENV or pass \`--environment <name>\` — ${C(e)}.`),servedFingerprint:null}}let i=await re({method:n.method,path:n.path,auth:n.auth,responseFormat:`json`}).catch(e=>b(C(e)));return i.ok?{check:K(`api-host`,`pass`,`${n.method} ${n.path} answered at ${r}.`),servedFingerprint:e===void 0?null:So(i.data)}:{check:K(`api-host`,`fail`,i.httpStatus===401?`Replace or unset the credential ${r} rejected, or run \`${t} auth login\`, then rerun \`${t} auth doctor\` — ${n.method} ${n.path} returned ${i.summary}.`:`Point the CLI at a reachable API host with \`--environment <name>\` or API_URL, then rerun \`${t} auth doctor\` — ${n.method} ${n.path} at ${r} returned ${i.summary}.`),servedFingerprint:null}}function So(e){if(typeof e!=`object`||!e||e instanceof Uint8Array)return null;let{response:t}=e;if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t.operationFingerprint;return typeof n==`string`&&n.length>0?n:null}async function Co(e){let t=Ye(),[n,r]=await Promise.all([To(),Eo()]);if(r.state===`unavailable`&&r.cause===`environment`)return K(`auth`,`fail`,`Fix the environment configuration first — ${r.summary}.`);let i=t.present,a=r.state===`found`&&r.stored.activation===`active`;if(!i&&n.state===`invalid`)return K(`auth`,`fail`,`Saved OAuth credential is invalid; run \`${e} auth login\` to sign in again after verification — ${n.summary}.`);if(!i&&n.state===`found`&&ot(n.stored.credential)&&n.stored.credential.tokens.refresh_token===void 0)return K(`auth`,`fail`,`Saved OAuth access token is expired without a refresh token; run \`${e} auth login\` to sign in again.`);if(!i&&!a&&n.state===`unavailable`)return K(`auth`,`fail`,`Make the OS keyring or the CLI config directory usable before \`${e} auth login\`, or inject ${d.authToken} through the environment — ${n.summary}.`);if(i||n.state===`found`||a){let i=await wo(e,t);return K(`auth`,i.status,`Credential source available: ${Do(t,n,r)}; ${i.text}.`)}return r.state===`unavailable`?K(`auth`,`fail`,`Make the OS keyring or the CLI config directory usable before \`${e} auth login --key\`, or inject ${d.authToken} through the environment — ${r.summary}.`):K(`auth`,`fail`,`Run \`${e} auth login\` for OAuth or \`${e} auth login --key\` for an API key. For non-interactive use, set ${d.authToken} in the environment.`)}async function wo(e,t){let n=w(f().host),r=await sa(e),i=`credential=${t.present?t.source??`env`:r.materialized??`none`}`;try{if(r.failure!==null)throw Error(r.failure);let e=await oa(`write`);if(e===null)return{status:`pass`,text:`${i} host=${n}`};let t=e.rbacRole.length===0?`none`:e.rbacRole.join(`,`);return{status:`pass`,text:`${i} account=${e.email??e.id} role=${t} host=${n}`}}catch(t){return{status:`warn`,text:`${i} account=unread host=${n} — GET /v1/auth/me returned ${C(t,[f().userBearerToken])}; run \`${e} auth status --verify write\``}}}async function To(){let e;try{e=w(f().host)}catch(e){return{state:`unavailable`,summary:C(e)}}return await ft(e)}async function Eo(){let e;try{e=w(f().host)}catch(e){return{state:`unavailable`,summary:C(e),cause:`environment`}}try{return await et(e)}catch(e){return{state:`unavailable`,summary:C(e),cause:`storage`}}}function Do(e,t,n){return[Aa(e),`oauth=${ko(t)}`,`api-key=${Oo(n)}`].join(` `)}function Oo(e){if(e.state!==`found`)return e.state===`missing`?`unset`:`unavailable`;let t=w(f().host);return`${e.stored.activation}${ha(t,e)}`}function ko(e){switch(e.state){case`found`:return ot(e.stored.credential)?`expired`:`stored`;case`missing`:return`unset`;case`invalid`:return`invalid`;case`unavailable`:return`unavailable`;default:throw Error(`Unsupported OAuth credential state`)}}function Ao(e,t,n,r){let i=T.length;if(e===void 0)return K(`catalog`,`skip`,`The public catalog omits deployment-status metadata and holds ${i} operations.`);if(t===null)return K(`catalog`,`skip`,`Could not read the served operation fingerprint, so drift is unproven; this catalog holds ${i} operations at ${Ot}.`);if(t===`8dc630ce83db233f`)return K(`catalog`,`pass`,`${i} generated operations match the set the API serves (${Ot}).`);let a=`This catalog describes a different operation set than the API serves (${Ot} vs ${t})`;return n===!0?K(`catalog`,`fail`,`${a}: run \`${r} update\`.`):K(`catalog`,`skip`,n===!1?`${a}, and this CLI is already the latest published release: either the deployed API is older than this CLI, or a newer CLI has not been published yet.`:`${a}, and the registry did not answer, so it is unknown whether a newer release describes it: rerun \`${r} update\` with registry access.`)}var jo=S(B,`oauth`),Mo=[S(B,`start`),S(B,`poll`),S(B,`acknowledge`)],No=S(B,`revoke`);function Po(e,n=x().bin[0]){let r=Ro(e);ho(r,n);let i=[`${jo.description} Default method: OAuth in your browser.`,`With --key: ${Mo.map(({description:e})=>e).join(` `)}`].join(`
|
|
31
31
|
`);D(Lo(r,[jo,...Mo],i)).action(Fo),D(Lo(r,[No],No.description)).action(Io),D(r.command(`status`).summary(`Keep saved credentials current and report them`).description([`Runs the same credential materialization every command runs, then reports:`,` - auth: whether AUTH_TOKEN was already set in this shell's environment`,` - oauth: the saved OAuth identity and access-token expiry for the selected API host;`,` an expired token is renewed with its refresh token and a token the sign-in service rejects is retired`,` - api-key: the saved aVenture API key, re-verified with aVenture sign-in and its cached metadata updated`,` - selected: the credential the next command sends`,` - providers: GET /v1/auth/providers (browser sign-in and the CLI OAuth client)`,` - api: running CLI package version plus GET /info build metadata`,``,`Saved credentials are sent only to the selected API host and aVenture sign-in, never printed.`,`--verify read|write additionally runs a live permission probe for that scope; it does not`,`execute or authorize an arbitrary API operation.`].join(`
|
|
32
32
|
`)).addOption(new t(`--verify <scope>`,`verify one permission-probe scope`).choices([`read`,`write`]))).action(async function(e){zo(this),R({mode:E(e)},await Bo(n,e.verify))}),r.command(`token`).summary(`Print the bearer token the next command sends`).description([`Runs the same credential materialization every command runs, then prints the selected`,`bearer token alone on stdout: ${d.authToken} when set, otherwise the saved OAuth`,`access token (renewed when expired) or the saved aVenture API key.`,`Use it where another client needs this CLI's sign-in, such as an MCP client's header helper.`].join(`
|
|
33
33
|
`)).action(async function(){zo(this);let e=await sa(n),t=process.env[d.authToken]?.trim();if(e.failure===null&&t!==void 0&&t.length>0){process.stdout.write(`${t}\n`);return}R({mode:`text`},e.failure===null?Jo(`auth token: no credentials resolved`,null,n,{oauth:!0,apiKey:!0}):b(`auth token: ${e.failure}`))})}async function Fo(e){zo(this);let t=E(e);if(e.providers===!0){R({mode:t},await Ho());return}R({mode:t},e.key===!0?await Xi({noBrowser:!e.browser,clientLabel:e.clientLabel}):await gt({noBrowser:!e.browser}))}async function Io(e){zo(this),R({mode:E(e)},await zi({forgetLocal:e.forgetLocal===!0}))}function Lo(e,t,n){let[r]=t,i=e.command(r.command.slice(r.command.indexOf(` `)+1)).summary(r.summary).description(n),a=new Set;for(let e of t)for(let t of[...e.bodyOption,...e.localOption])a.has(t.flag)||(a.add(t.flag),`required`in t&&t.required?i.requiredOption(t.flag,t.description):i.option(t.flag,t.description));return i}function Ro(e){return(e.commands.find(e=>e.name()===`auth`)??e.command(`auth`)).summary(`Sign in, sign out, and check credentials`).description([`\`${jo.command}\`: ${jo.summary}; \`--key\` ${Mo[0].summary.toLowerCase()}.`,`\`${No.command}\`: ${No.summary}.`,"`auth status` reports local credential provenance, sign-in providers, and CLI/API build metadata.","`auth doctor` runs the one-call selftest and prints `{ ok, check: [...] }`.","`auth token` prints the bearer token the next command sends."].join(`
|
|
@@ -55,8 +55,8 @@ end
|
|
|
55
55
|
`)}function Qs(e,t=``){if(e.commands.length>0&&!Gs(Y(e)))return;let n=e.options.flatMap(e=>e.hidden?[]:[J(e)]),r=xt(T),i=je(t,r,Y(e),X(e).name());return`${i===void 0?``:`hint: an id you already hold is read with: ${i}\n`}hint: ${Y(e).join(` `)} accepts: ${n.join(` `)}`}function $s(e,t){let n=Es(t,`unknown command`);if(n===void 0||t.message.includes(`
|
|
56
56
|
(Did you mean `))return;let r=Bs(e),i=Vs(e,r);if(i!==void 0)return i;let a=Y(e),o=[...a.slice(0,-1),`${a.at(-1)}-${n}`,...r.slice(1)],s=(Gs(o)?o:void 0)??Rs(e,n)??zs(e,n);if(s!==void 0)return Us(e,s,r)??Zs(e,s.join(` `),!1);let c=r.join(` `)||n,l=Ws(e)??Zs(e,c),u=[...a,...r.slice(1)];return[l,r.length===a.length+a.length&&a.at(-1)===a.at(0)?Us(e,u,r)?.replace(/^hint: Did you mean: /u,` `)+` · `:u.slice(1,-1).length>0?Us(e,u,r):void 0].filter(e=>e!==void 0).join(`
|
|
57
57
|
`)||void 0}function ec(e){return t=>{if(t.code===`commander.missingMandatoryOptionValue`){let n=e.options.filter(t=>t.mandatory&&e.getOptionValue(t.attributeName())===void 0);if(n.length>1){let e=n.map(e=>e.flags.split(`, `).at(-1)??e.flags);process.stderr.write(`error: missing required options: ${e.join(`, `)}\n`)}let r=ks(e);for(let e of r)process.stderr.write(`error: unknown option '${e}'\n`);for(let n of[As(e)??(r.length>0?Qs(e):void 0),Cs(e),Ds(e,t),...qs(e)])n!==void 0&&process.stderr.write(`${n}\n`)}else if(t.code===`commander.excessArguments`){let t=Cs(e)??Js(e);t!==void 0&&process.stderr.write(`${t}\n`)}else if(t.code===`commander.unknownOption`){let n=Es(t,`unknown option`),r=As(e)??Is(e,t)??(n!==void 0&&!t.message.includes(`
|
|
58
|
-
(Did you mean `)?Xs(e,n)??Hs(e,[n.replace(/^--/u,``)],process.argv.slice(process.argv.indexOf(n)+1))??Qs(e,n)??Zs(e,Y(e).slice(1).join(` `)||n.replace(/^--/u,``)):void 0);r!==void 0&&process.stderr.write(`${r}\n`)}else if(t.code===`commander.unknownCommand`){let n=$s(e,t);n!==void 0&&process.stderr.write(`${n}\n`)}throw t}}var tc=class extends t{group;constructor(e){super(`-h, --help`,`display help for command`),this.group=e}is(e){if(e!==this.short&&e!==this.long)return!1;let t=this.group.args.at(0);return t===void 0||t.startsWith(`-`)?!0:this.group.commands.some(e=>e.name()===t||e.aliases().includes(t))}};function nc(e){e.showHelpAfterError(!1).exitOverride(ec(e)),e.commands.length===0?e.hook(`preAction`,Ss):e.registeredArguments.length===0&&e.addHelpOption(new tc(e));for(let t of e.commands)nc(t)}function rc(e,t=new Date){let n=oc(e);return{schemaVersion:1,generatedFrom:`MCP_GENERATION_CONTRACT`,generatedAt:t.toISOString(),totalOperations:n.length,note:`Projection of MCP_GENERATION_CONTRACT - see mcp/scripts/build-unified-operations.ts header for SSOT rules.`,operations:n}}function ic(e){return`${JSON.stringify(e,null,2)}\n`}function ac(e,t){let n=A(e),r=ic(t);return M(k(n),{recursive:!0}),Ht(n,r),{target:n,byteLength:Buffer.byteLength(r,`utf8`),totalOperations:t.totalOperations}}function oc(e){return e.map(e=>({operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliCommand:e.projection.cliPath.join(` `),cliPath:e.projection.cliPath,mcpTool:
|
|
59
|
-
`));r.addHelpText(`after`,()=>`\nShipped compact catalog of operations callable without an admin grant, greppable without\nrunning this CLI (dump --format compact lists every operation your credential reaches):\n ${Nr(n)}\n`),uc(r,t,n),dc(r,t,n),fc(r,t,n),pc(r)}function uc(e,n,r){let i=e.command(`search`).summary(`Search generated operations`).description(`Search generated operation metadata without calling the API.`).argument(`[query...]`,`Search query; same as --q.`).option(`--q <query>`,`Search generated command metadata`).option(`--root <root>`,sc).addOption(new t(`--scope <scope>`,`Filter by required auth scope`).choices([`read`,`write`,`all`]).default(`all`)).addOption(new t(`--mutates <mutates>`,`Filter mutating operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--destructive <destructive>`,`Filter destructive operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--intent <intent>`,`Filter by operation intent`).choices([`read`,`lookup`,`search`,`write`,`delete`,`status`,`all`]).default(`all`)).addOption(new t(`--method <method>`,`Filter by HTTP method`).choices([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`all`]).default(`all`)).option(`--limit <count>`,`Maximum rows to return`,`20`).addOption(new t(`--format <format>`,`Text/file render format`).choices(cc)).option(`--output <path>`,`Write rendered output to a file`);D(i),i.action(function(e){let t=this.optsWithGlobals(),i=E(t,`text`),a=Fr(t,e);Ir(a,(a.q?.trim()??``)===``?n.filter(({deprecated:e})=>e!==!0):n,i,r)})}function dc(e,n,r){let i=e.command(`show`).summary(`Show one generated operation`).description(`Show one generated operation by command path or operationId.`).option(`--command <command>`,`CLI command path, with or without ${r} prefix`).option(`--operation-id <operationId>`,`Generated OpenAPI operationId`).addOption(new t(`--format <format>`,`Text/file render format`).choices([`usage`,`lines`,`compact`,`json`,`ndjson`]).default(`usage`)).option(`--output <path>`,`Write rendered output to a file`);D(i),i.action(function(){let e=this.optsWithGlobals();Lr(e,n,E(e,`text`),r)})}function fc(e,n,r){let i=e.command(`dump`).summary(`Dump generated operations`).description(`Dump generated operations for rg/grep/ag/ack or JSON/NDJSON tooling.`).option(`--root <root>`,sc).addOption(new t(`--scope <scope>`,`Filter by required auth scope`).choices([`read`,`write`,`all`]).default(`all`)).addOption(new t(`--mutates <mutates>`,`Filter mutating operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--destructive <destructive>`,`Filter destructive operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--intent <intent>`,`Filter by operation intent`).choices([`read`,`lookup`,`search`,`write`,`delete`,`status`,`all`]).default(`all`)).addOption(new t(`--method <method>`,`Filter by HTTP method`).choices([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`all`]).default(`all`)).option(`--limit <count>`,`Maximum rows to return`).addOption(new t(`--format <format>`,`Text/file render format`).choices(cc)).option(`--output <path>`,`Write rendered output to a file`);D(i),i.action(function(){let e=this.optsWithGlobals();Ir(e,n,E(e,`text`),r)})}function pc(e){let t=e.command(`unified`).summary(`Dump unified CLI/API/MCP operation JSON`).description(`Dump the flat unified operations JSON projected from MCP_GENERATION_CONTRACT.`).option(`--output <path>`,`Write unified operations JSON to a file`);D(t),t.action(async function(){let e=this.optsWithGlobals(),t=E(e,`text`),{MCP_GENERATION_CONTRACT:n}=await import(`./mcp-generation-contract-
|
|
58
|
+
(Did you mean `)?Xs(e,n)??Hs(e,[n.replace(/^--/u,``)],process.argv.slice(process.argv.indexOf(n)+1))??Qs(e,n)??Zs(e,Y(e).slice(1).join(` `)||n.replace(/^--/u,``)):void 0);r!==void 0&&process.stderr.write(`${r}\n`)}else if(t.code===`commander.unknownCommand`){let n=$s(e,t);n!==void 0&&process.stderr.write(`${n}\n`)}throw t}}var tc=class extends t{group;constructor(e){super(`-h, --help`,`display help for command`),this.group=e}is(e){if(e!==this.short&&e!==this.long)return!1;let t=this.group.args.at(0);return t===void 0||t.startsWith(`-`)?!0:this.group.commands.some(e=>e.name()===t||e.aliases().includes(t))}};function nc(e){e.showHelpAfterError(!1).exitOverride(ec(e)),e.commands.length===0?e.hook(`preAction`,Ss):e.registeredArguments.length===0&&e.addHelpOption(new tc(e));for(let t of e.commands)nc(t)}function rc(e,t=new Date){let n=oc(e);return{schemaVersion:1,generatedFrom:`MCP_GENERATION_CONTRACT`,generatedAt:t.toISOString(),totalOperations:n.length,note:`Projection of MCP_GENERATION_CONTRACT - see mcp/scripts/build-unified-operations.ts header for SSOT rules.`,operations:n}}function ic(e){return`${JSON.stringify(e,null,2)}\n`}function ac(e,t){let n=A(e),r=ic(t);return M(k(n),{recursive:!0}),Ht(n,r),{target:n,byteLength:Buffer.byteLength(r,`utf8`),totalOperations:t.totalOperations}}function oc(e){return e.map(e=>({operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliCommand:e.projection.cliPath.join(` `),cliPath:e.projection.cliPath,mcpTool:ge(e.intent),bodySchemaName:e.requestBody?.[0]?.schemaName??null,bodySchemaImport:e.requestBody?.[0]?.schemaImport??null,auth:e.projection.auth,scope:e.projection.scope,destructive:e.projection.destructive})).toSorted((e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)||e.operationId.localeCompare(t.operationId))}var sc=`Match only the first canonical or CLI-alias command segment`,cc=[`text`,`lines`,`compact`,`json`,`ndjson`];function lc(e,t,n=x().bin[0]){let r=e.command(`command-catalog`).summary(`LLM agent only: search generated CLI metadata`).description([`LLM agent only: search and dump generated ${n} command metadata.`,`This is read-only command metadata derived from the generated OpenAPI command specs.`,`Use --format lines for rg/grep/ag/ack and --format ndjson|json for ast-grep/sg/parsers.`,"Use --format compact for one `cli · summary · requiredFlags` row per operation."].join(`
|
|
59
|
+
`));r.addHelpText(`after`,()=>`\nShipped compact catalog of operations callable without an admin grant, greppable without\nrunning this CLI (dump --format compact lists every operation your credential reaches):\n ${Nr(n)}\n`),uc(r,t,n),dc(r,t,n),fc(r,t,n),pc(r)}function uc(e,n,r){let i=e.command(`search`).summary(`Search generated operations`).description(`Search generated operation metadata without calling the API.`).argument(`[query...]`,`Search query; same as --q.`).option(`--q <query>`,`Search generated command metadata`).option(`--root <root>`,sc).addOption(new t(`--scope <scope>`,`Filter by required auth scope`).choices([`read`,`write`,`all`]).default(`all`)).addOption(new t(`--mutates <mutates>`,`Filter mutating operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--destructive <destructive>`,`Filter destructive operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--intent <intent>`,`Filter by operation intent`).choices([`read`,`lookup`,`search`,`write`,`delete`,`status`,`all`]).default(`all`)).addOption(new t(`--method <method>`,`Filter by HTTP method`).choices([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`all`]).default(`all`)).option(`--limit <count>`,`Maximum rows to return`,`20`).addOption(new t(`--format <format>`,`Text/file render format`).choices(cc)).option(`--output <path>`,`Write rendered output to a file`);D(i),i.action(function(e){let t=this.optsWithGlobals(),i=E(t,`text`),a=Fr(t,e);Ir(a,(a.q?.trim()??``)===``?n.filter(({deprecated:e})=>e!==!0):n,i,r)})}function dc(e,n,r){let i=e.command(`show`).summary(`Show one generated operation`).description(`Show one generated operation by command path or operationId.`).option(`--command <command>`,`CLI command path, with or without ${r} prefix`).option(`--operation-id <operationId>`,`Generated OpenAPI operationId`).addOption(new t(`--format <format>`,`Text/file render format`).choices([`usage`,`lines`,`compact`,`json`,`ndjson`]).default(`usage`)).option(`--output <path>`,`Write rendered output to a file`);D(i),i.action(function(){let e=this.optsWithGlobals();Lr(e,n,E(e,`text`),r)})}function fc(e,n,r){let i=e.command(`dump`).summary(`Dump generated operations`).description(`Dump generated operations for rg/grep/ag/ack or JSON/NDJSON tooling.`).option(`--root <root>`,sc).addOption(new t(`--scope <scope>`,`Filter by required auth scope`).choices([`read`,`write`,`all`]).default(`all`)).addOption(new t(`--mutates <mutates>`,`Filter mutating operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--destructive <destructive>`,`Filter destructive operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new t(`--intent <intent>`,`Filter by operation intent`).choices([`read`,`lookup`,`search`,`write`,`delete`,`status`,`all`]).default(`all`)).addOption(new t(`--method <method>`,`Filter by HTTP method`).choices([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`all`]).default(`all`)).option(`--limit <count>`,`Maximum rows to return`).addOption(new t(`--format <format>`,`Text/file render format`).choices(cc)).option(`--output <path>`,`Write rendered output to a file`);D(i),i.action(function(){let e=this.optsWithGlobals();Ir(e,n,E(e,`text`),r)})}function pc(e){let t=e.command(`unified`).summary(`Dump unified CLI/API/MCP operation JSON`).description(`Dump the flat unified operations JSON projected from MCP_GENERATION_CONTRACT.`).option(`--output <path>`,`Write unified operations JSON to a file`);D(t),t.action(async function(){let e=this.optsWithGlobals(),t=E(e,`text`),{MCP_GENERATION_CONTRACT:n}=await import(`./mcp-generation-contract-Cz19o23D.js`);if(t===`text`&&e.output===void 0&&(e.text===!0||e.allFields===!0)){R({mode:t},y(`Unified operations JSON`,`Use --output <path> to write the unified operations JSON.`,{counts:{totalOperations:n.length}}));return}let r=rc(n);if(e.output!==void 0){let n=ac(e.output,r);R({mode:t},y(`Unified operations JSON written`,{outputPath:n.target,byteLength:n.byteLength,schemaVersion:r.schemaVersion},{counts:{totalOperations:n.totalOperations}}));return}if(t===`text`){zr(`Unified operations JSON`,ic(r));return}R({mode:t},y(`Unified operations JSON`,r,{counts:{totalOperations:r.totalOperations}}))})}var mc=x(Yt(import.meta.url)),Q=mc.bin[0];function hc(e,t){let n=e instanceof Error?e:Error(String(e));a({component:Q,event:`fatal`,message:n.message,error:n}),process.stderr.write(`${Q} fatal (${t}): ${n.stack??n.message}\n`);let r=n instanceof ie?{httpStatus:n.problem.status,problem:n.problem}:{};ur({...b(`${Q} ${t}: ${n.message}`,[n.name||`Error`],r),counts:{exitCode:1}}),process.exit(1)}function gc(e){return Ge[Ve(e,vt)??`cli`]}function _c(e,t){let n=t.map(e=>{let t=e.cliPath[0]??``;return{spec:e,top:t,rank:gc(t).rank}}).toSorted((e,t)=>e.rank-t.rank||e.top.localeCompare(t.top)).map(e=>e.spec),r=new Set(n.filter(e=>Et(e.cliPath[0])).map(e=>e.cliPath[0]??``)),i=new Set,a=new Set;for(let{cliPath:e,deprecated:t}of n)for(let n=1;n<e.length;n++){let r=e.slice(0,n).join(` `);i.add(r),t!==!0&&a.add(r)}for(let t of n)vc(e,t,r,a,i.has(t.cliPath.join(` `)))}function vc(e,t,n,r,i){let a=t.cliPath,o=e,s=``,c=!n.has(a[0]??``);for(let e of a.slice(0,-1)){s=s===``?e:`${s} ${e}`;let t=c&&s===e||!r.has(s);o=yc(o,e,s,t)}let l=a.at(-1)??t.operationId,u=o.commands.find(e=>e.name()===l)??o.command(l,t.deprecated===!0?{hidden:!0}:{}),d=t.requestBody?.flatMap(({parameter:e})=>e)??[];u.summary(t.summary||t.operationId).description([`${t.method} ${t.path}.`,t.summary||t.description,`Full documentation: ${Q} help ${t.cliPath.join(` `)}`,t.requestBody?.[0]?.kind===`json`||[...t.parameters,...d].some(e=>_e(e.schemaType,e.itemSchemaType))?ye:``].filter(Boolean).join(`
|
|
60
60
|
`));let f=Dt(t);for(let e of t.parameters)bc(u,e,i||e===f);if(Un(u,t),ve(t.intent)&&u.option(`--execute`,`Deprecated; accepted and ignored. This command executes by its verb.`,!1),D(u),u.hook(`preAction`,e=>St(e,t)),t.explain===!0&&u.option(`--explain`,`Print the search strategy and parsed constraints before the results`),f!==void 0){u.argument(`[text...]`,f.description||`Same as ${Tt(f.flag)}.`),u.action(async function(e){let n=this.optsWithGlobals(),r=E(n),i=bt(f,e,n);if(!i.ok||i.data===null)return R({mode:r},i);let a=yt(t,i.data);if(a.length>0)return R({mode:r},b(`missing required options: ${a.join(`, `)}`));let o=await xc(t,i.data,r),s=si(t,i.data,o);if(s!==null)return R({mode:r},s);n.explain===!0&&o.ok&&mr(r,o.data),o.ok&&o.data instanceof Uint8Array?process.stdout.write(o.data):R({mode:r},o)});return}u.action(async function(){let e=this.optsWithGlobals(),n=E(e),r=yt(t,e);if(r.length>0)return R({mode:n},b(`missing required options: ${r.join(`, `)}`));let i=await xc(t,e,n),a=si(t,e,i);if(a!==null)return R({mode:n},a);e.explain===!0&&i.ok&&mr(n,i.data),i.ok&&i.data instanceof Uint8Array?process.stdout.write(i.data):R({mode:n},i)})}function yc(e,t,n,r){let i=e.commands.find(e=>e.name()===t);if(i!==void 0)return i;let a=vt[n],o=e.command(t,r?{hidden:!0}:{}).helpCommand(!1);return a!==void 0&&o.summary(a.summary).description(a.summary),o}function bc(e,n,r=!1){let i=n.description||`${n.name} ${n.location} parameter`,a=n.defaultValue===void 0?void 0:typeof n.defaultValue==`string`||typeof n.defaultValue==`boolean`?n.defaultValue:[...n.defaultValue];if(n.legacyFlag!==void 0){let o=new t(n.flag,i);a!==void 0&&o.default(a);let s=new t(n.legacyFlag,i).conflicts(n.optionKey);e.addOption(o).addOption(s),e.hook(`preAction`,e=>{let t=e.opts(),i=t[n.optionKey],a=t[s.attributeName()];if(a!==void 0){(i===void 0||e.getOptionValueSource(n.optionKey)==="default")&&e.setOptionValueWithSource(n.optionKey,a,`cli`);return}!r&&n.required&&i===void 0&&e.error(`error: required option '${o.flags}' not specified`,{code:`commander.missingMandatoryOptionValue`})});return}if(a!==void 0){e.option(n.flag,i,a);return}if(n.required&&!r){e.requiredOption(n.flag,i);return}e.option(n.flag,i)}async function xc(e,t,n){if(t.environment!==void 0){let e=u(t.environment);if(e===null)return b(`Unknown aVenture environment '${t.environment}'`,[`Use one of: ${c().join(`, `)}`]);process.env.API_ENV=e}let r=await Jn(e,t);if(!r.ok)return r;let i=Object.fromEntries(e.parameters.filter(e=>e.location===`path`).map(e=>{let n=t[e.optionKey];if(Array.isArray(n))return[e.name,n.at(0)??``];if(n===void 0)throw Error(`Missing required option ${e.optionKey}`);return[e.name,String(n)]})),a=Object.fromEntries(e.parameters.filter(e=>e.location===`query`).flatMap(e=>{let n=t[e.optionKey];if(n===void 0||Array.isArray(n)&&n.length===0)return[];let r=Array.isArray(n)||typeof n==`boolean`?n:String(n);return[[e.name,r]]})),o=Object.fromEntries(e.parameters.filter(e=>e.location===`header`).flatMap(e=>{let n=t[e.optionKey];return n===void 0||Array.isArray(n)&&n.length===0?[]:[[e.name,Array.isArray(n)?n.join(`,`):String(n)]]}));return li(e,await re({method:e.method,path:se(e.operationId,i),searchParams:a,headers:o,body:r.data,contentType:wt(e,t),auth:e.auth,responseFormat:kt(n)?`json`:`auto`,responseBytes:e.binaryResponse===!0}))}process.on(`uncaughtException`,e=>hc(e,`uncaughtException`)),process.on(`unhandledRejection`,e=>hc(e,`unhandledRejection`));var Sc=Ct(process.argv.slice(2),T),Cc=Sc===`required`?T:xt(T),$=new i;$.name(Q).usage(`<command> [subcommand] [options]`).configureHelp(Qr).version(mc.version).summary(`CLI for the aVenture API: companies, people, and news, with the funding, publications, and classifications attached to them`).description([`The aVenture research API from your terminal. Three records — companies,`,`people, and news — carry everything else: funding, publications, and tags.
|
|
61
61
|
`,`Mutations execute directly; --execute is a deprecated no-op.
|
|
62
62
|
The aVenture MCP server tools execute through this same CLI.`].join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./tool-policy-
|
|
1
|
+
import{u as e}from"./tool-policy-Dw6KBl9G.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 d[e]??t?.[e]?.section}var d={app:`account`,auth:`account`,entities:`researchData`,people:`researchData`,enrichments:`researchData`,news:`researchData`,search:`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};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{C as e,O as t,T as n,i as r,l as i,n as a,o,p as s,t as c,u as l,v as u,w as d,y as f}from"./person-owner-BJgNYLKX.js";import{Fr as p}from"./dist-F6oHzTAJ.js";import{a as m,c as ee,d as h,i as g}from"./result-envelope-CFE7wPAr.js";import{a as te}from"./package-DPDX5zmx.js";import{S as ne,a as re,c as ie,d as ae,f as oe,l as se,n as ce,o as le,s as _}from"./tool-policy-Dw6KBl9G.js";import{a as ue,n as de,r as v,t as fe}from"./text-field-BoNdbrtA.js";import{C as pe,E as me,S as he,T as ge,_ as _e,a as ve,b as y,c as ye,d as be,f as xe,g as Se,h as Ce,i as we,l as Te,m as Ee,n as De,o as Oe,p as ke,r as Ae,s as je,t as Me,u as Ne,v as Pe,w as Fe,x as Ie,y as Le}from"./detail-MEh1aLs6.js";import{a as Re,o as ze}from"./cli-help-policy-DUARQ4wz.js";import{Buffer as b}from"node:buffer";var x=o([`HIGH`,`MEDIUM`,`LOW`]),Be=o([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),Ve=Object.assign(n([Be,d()]),{enum:Be.enum}),He=f({excerpt:d(),sourceId:d(),sourceType:Ve,sourceVersion:d().nullish()}),Ue=f({instruction:d(),operationId:d(),stepKey:d().optional()}),We=f({body:d(),expectation:d(),method:i(d()),override:d(),reject:i(d()),typeCatalog:d()}),Ge=f({cliCommand:d(),mcpTool:d().nullish(),step:Ue,writeGuidance:We.nullish()}),Ke=o([`ENTITY`,`TEXT`]),qe=Object.assign(n([Ke,d()]),{enum:Ke.enum}),Je=f({description:d(),key:d(),type:qe}),Ye=f({catalogRevision:s().optional(),gateId:i(d()).optional(),input:i(Je),step:i(Ge),taskKey:d().optional()}),S=o([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),Xe=f({candidate:i(He),operationId:d().nullish(),outcome:S,probability:u().nullish(),taskKey:d().nullish(),taskPlan:Ye.nullish()}),Ze=f({answer:d(),citation:i(He),confidence:x,resolution:Xe.nullish()});function C(e,t,n=t.inputName){if(t.in===`body`)return n;let r=lt.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?ct(at(n!==`id`&&n!==`slug`?n:`${tt(e.path)}${it(n)}`),t):r.inputName}function Qe(e,t,n=rt(e)){return $e(nt(e,t),new Set(n))}function $e(e,t){if(!t.has(e))return e;let n=`body${it(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function et(e,t,n){return`${e}[${t}].${n}`}function tt(e){return ut.find(([,t])=>t.test(e))?.[0]??`record`}function nt(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=ot(t);return ct(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?at(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function rt(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>C(e,t)))}function it(e){return e.replace(/^./u,e=>e.toUpperCase())}function at(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 ot(e){let t=at(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?st(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function st(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function ct(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var lt=[{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`}],ut=[[`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 dt(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>ft(t,C(e,t))),r=(t?.parameter??[]).map(t=>ft(t,Qe(e,t)));return{selector:n.filter(e=>e.location===`path`||pt(e)),pagination:n.filter(mt),filter:[...n.filter(ht),...r.filter(ht)],body:r.filter(e=>!ht(e))}}function ft(e,t){let{in:n,inputName:r,...i}=e;return{...i,name:e.in===`body`?t:e.name,flag:re(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function pt(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function mt(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function ht(e){return e.location!==`path`&&!pt(e)&&!mt(e)}var w=16e3,gt=(e,t=w)=>e.length<=120&&b.byteLength(`${e.join(`
|
|
2
|
+
`)}\n`,`utf8`)<=t,T=(e,t=!1,n=!1,r=1)=>{let i=de(e),a=t||i.endsWith(`
|
|
3
|
+
`),o=i.endsWith(`
|
|
4
|
+
`)?i.slice(0,-1):i,s=o.length===0?[]:o.split(`
|
|
5
|
+
`),c=b.byteLength(`${s.join(`
|
|
6
|
+
`)}\n`,`utf8`);if(s.length<=120&&c<=16e3)return`${s.join(`
|
|
7
|
+
`)}${a?`
|
|
8
|
+
`:``}`;let l=n?Math.min(Math.max(1,r),118):0,u=l>0?s.slice(-l):[],d=u.length===0?s:s.slice(0,-u.length),f=[s.length>120?`120 physical lines`:``,c>16e3?`${w} UTF-8 bytes`:``].filter(Boolean).join(` and `),p=e=>de(`... output truncated: ${e} more lines omitted to stay within ${f}; recover omitted response content with narrower server-side filters, the relevant sub-resource operation (aventure_help names it), or responseFormat json.`),m=(e,t)=>[...e,...u,t].join(`
|
|
9
|
+
`),ee=120-u.length-1,h=d.slice(0,ee),g=p(s.length-h.length-u.length);for(;b.byteLength(`${m(h,g)}\n`,`utf8`)>w;){if(h.length>0)h=h.slice(0,-1);else if(u.length>0)u=u.slice(1);else break;g=p(s.length-h.length-u.length)}return`${m(h,g)}${a?`
|
|
10
|
+
`:``}`},_t=e=>T(bt(e.trimEnd().split(`
|
|
11
|
+
`),120).join(`
|
|
12
|
+
`),e.endsWith(`
|
|
13
|
+
`)),vt=new Set([`core`,`nameFull`,`nameBrand`,`name`,`title`,`fundingDetail`,`round`,`dateAnnounced`,`amountRaised`,`person`,`fundraiseRound`]),yt=5;function bt(e,t,n=w){let r=e=>e.length<=t&>(e,n);if(r(e))return e;let i=xt(e),a=e=>[...kt(i,e-1),`... output folded to fit 120 lines and ${w} UTF-8 bytes; "(+N lines)" and "N more" mark hidden content; read it whole with responseFormat json, --data --to-file <path>, or the section's sub-resource operation.`],o=2,s=t,c=a(o);for(;o<=s;){let e=Math.floor((o+s)/2),t=a(e);r(t)?(c=t,o=e+1):s=e-1}return c}function xt(e){let t={line:``,child:[]},n=[{node:t,indent:-1}];for(let t of e){let e=Ct(t);for(;n.length>1&&(n.at(-1)?.indent??-1)>=e;)n.pop();let r={line:t,child:[]};n.at(-1)?.node.child.push(r),n.push({node:r,indent:e})}return t.child}var St=new WeakMap,E=e=>{let t=St.get(e);if(t!==void 0)return t;let n=e.child.reduce((e,t)=>e+E(t),1);return St.set(e,n),n},Ct=e=>e.length-e.trimStart().length,wt=/^(?:- ?|\d+\.(?: |$))/u,Tt=e=>(e.line.trimStart().replace(wt,``).split(/[:= ]/u)[0]??``).split(`.`).at(-1)?.replace(/\[\d+\]$/u,``)??``,Et=e=>vt.has(Tt(e)),D=e=>Et(e)||!k(e)&&e.child.some(D),O=e=>Et(e)?E(e):D(e)?e.child.reduce((e,t)=>e+O(t),1):1,k=e=>wt.test(e.line.trimStart()),Dt=e=>e.line.trimStart().startsWith(`... `),Ot=e=>[e.line,...e.child.flatMap(Ot)];function kt(e,t){if(e.reduce((e,t)=>e+E(t),0)<=t)return e.flatMap(Ot);if(!e.some(k)||!e.every(e=>k(e)||Dt(e)))return Mt(e,t);let n=e.filter(Dt).map(({line:e})=>e);return[...jt(e.filter(k),t-n.length),...n]}function At(e,t){return t>=E(e)?Ot(e):t<=1?[`${e.line} (+${E(e)-1} lines)`]:[e.line,...kt(e.child,t-1)]}function jt(e,t){let n=Math.max(1,Math.floor((t-1)/Math.min(e.length,yt))),r=[],i=0;for(let a of e){let e=Math.min(n,E(a));if(r.length+e>t-1)break;r.push(...At(a,e)),i+=1}let a=` `.repeat(Ct(e[0]?.line??``));return i===e.length?r:[...r,`${a}... ${e.length-i} more`]}function Mt(e,t){let n=e=>e.reduce((e,t)=>e+O(t),0);if(e.length>t||n(e)>t&&e.some(e=>O(e)===1)){let r=e.toSorted((e,t)=>Number(D(t))-Number(D(e))||E(e)-E(t)).slice(0,Math.max(0,t-1));for(;r.length>1&&O(r.at(-1)??e[0]??{line:``,child:[]})===1&&n(r)>t-1;)r.pop();let i=` `.repeat(Ct(e[0]?.line??``)),a=Mt(e.filter(e=>r.includes(e)),t-1),o=e.filter(e=>!r.includes(e)).map(Tt),s=o.slice(0,10).join(`, `),c=o.length>10?`, ...`:``;return[...a,`${i}... ${o.length} more fields: ${s}${c}`]}let r=e.map(e=>({node:e,allotted:1})),i=t-e.length,a=(e,t)=>e.forEach((n,r)=>{let a=Math.min(t(n.node)-n.allotted,Math.floor(i/(e.length-r)));n.allotted+=a,i-=a});return a(r.filter(({node:e})=>O(e)>1).toSorted((e,t)=>O(e.node)-O(t.node)),O),a(r.toSorted((e,t)=>E(e.node)-e.allotted-(E(t.node)-t.allotted)),E),r.flatMap(({node:e,allotted:t})=>At(e,t))}function Nt(e,t){let n=e.requestBody?.[0],r={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:Ft(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]},i=Lt(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:dt(e)}:{...r,optionalInput:It(e),arrayInput:Rt(e),...i===void 0?{}:{paidPlan:i}}}function Pt(e){let t=dt(e),n=e=>e.filter(e=>e.required);return{...Nt(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function Ft(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function It(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 Lt(e){return e.response.find(({status:e})=>e===`402`)?.description}function Rt(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var zt=160,A=`Operation catalog matches`,Bt=[`whole`,`described`,`requiredDescribed`,`optionalNamed`],Vt=e=>`${[A,...e].join(`
|
|
14
|
+
`)}\n`,Ht=e=>gt([A,...e]);function Ut(e){if(!Array.isArray(e)||e.length===0||!e.every(Jt))return null;let t=e;for(let e of Bt){let n=[...t.flatMap(t=>Kt(t,e)),...Gt(t,e)];if(Ht(n))return Vt(n)}let n=e=>[...t.slice(0,e).flatMap(e=>Kt(e,`optionalNamed`)),...Gt(t.slice(0,e),`optionalNamed`),`... ${t.length-e} more operations omitted to fit ${w} UTF-8 bytes: ${t.slice(e).map(({operationId:e})=>e).join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`];return Vt(n([...t.keys()].findLast(e=>e>0&&Ht(n(e)))??1))}var Wt="the CLI's `aventure help <operationId> --data` prints every input";function Gt(e,t){return e.some(e=>`optionalDetailOmitted`in e)?[`... optional argument details omitted: the full list exceeds the result cap; ${Wt}.`]:t===`whole`||t===`described`||!e.some(e=>`argument`in e)?[]:[`... ${t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`} omitted to fit ${w} UTF-8 bytes; structuredContent carries them, and ${Wt}.`]}function Kt(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=>qt(e,e.required||t!==`requiredDescribed`,t)),...t===`optionalNamed`&&r.length>0?[` optional inputs: ${r.join(`, `)}`]:[]]}function qt(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<=zt?e.description:`${e.description.slice(0,157)}...`}`:i}function Jt(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 Yt(e){let t=t=>{let n=e.parameter.filter(e=>e.in===t&&e.required&&e.schemaDefault===void 0).map(Xt);return n.length===0?void 0:Object.fromEntries(n)},n=t(`path`),r=t(`query`),i=[...new Set((e.requestBody?.[0]?.requiredPath??[]).map(e=>e.replace(/[.[].*$/su,``)))];return{tool:ie(e.intent),operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:Object.fromEntries(i.map(e=>[e,`<${e}>`]))}}}function Xt(e){return[e.name,`<${e.name}>`]}function Zt(e){let t=Qt(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function Qt(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 j=2,$t=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 M(e,t){let n=F(t);n.length!==0&&(e.add(n),(n===`individual`||n===`individuals`)&&M(e,`person`),nn(e,en(n),n),nn(e,tn(n),n))}function en(e){if(e===`people`)return`person`;let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=j&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return`${e.slice(0,-3)}y`;if(e.length>j&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`)return e.slice(0,-1)}function tn(e){if(e===`person`)return`people`;if(e!==`new`)return e.length>=j&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e)?`${e.slice(0,-1)}ies`:e.endsWith(`s`)?void 0:`${e}s`}function nn(e,t,n){t!==void 0&&t!==n&&t.length>=j&&/^[a-z]+$/u.test(t)&&e.add(t)}function N(e){let t=new Set(P(e)),n=Array.from(t);for(let e of n)M(t,e);return t}function rn(e){return P(e).map(N)}function an(e,t){if(e.length===0)return!1;let n=N(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function P(e){return F(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!$t.has(e))}function F(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 on=/\b(?:https?:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:\/\S*)?/giu,sn=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/giu,cn=/^[a-z0-9]+(?:-[a-z0-9]+)+$/u,ln=250,un=40,dn=100;function fn(e,t){let n=new Set,r=[],i=/\bslugs?\b/iu.test(e);return{text:e.replace(sn,()=>(n.add(`uuid`),` `)).replace(on,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&&cn.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=cn.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 pn(e,t,n){return e===`uuid`?/(?:^id|Id)$/u.test(t)&&n.includes(`{${t}}`):t===e}function mn(e,t){let n=new Set;for(let r of e){let e=new Set;M(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 hn(e,t,n){if(n.intent!==`read`&&n.intent!==`lookup`)return 0;let r=new Set(P(n.summary)),i=0;for(let t of e.kind)n.directParameterName.some(e=>pn(t,e,n.path))&&(i+=ln,r.has(t)&&(i+=un));if(i===0)return 0;let a=new Set(P(`${n.summary} ${n.description}`));return(t.size>0?t.has(n.resource):e.urlPathWord.some(e=>{let t=new Set;return M(t,e),[...t].some(e=>a.has(e))}))&&(i+=dn),i}var gn=40,_n=4,vn=3,yn=1,bn=new Map;function xn(e){let t=bn.get(e);if(t!==void 0)return t;let n=p(),r=ne(n.paths,e),i=r===null?new Map:oe(n,r.operation.responses,vn);return bn.set(e,i),i}function Sn(e,t,n){let r=0,i=new Map;for(let[e,a]of n){if(t.has(e.toLowerCase())&&(r+=gn*(4-a)/4),a>yn)continue;let n=new Set;for(let t of P(e))M(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<=yn&&(r+=_n*(2-e))}return r}var Cn=5,wn=.5,Tn=15,En=30,Dn=2,On=.5;function kn(e,t,n){let r=t.map(e=>({item:e,fields:n(e)})),i=fn(e,new Set(r.flatMap(({fields:e})=>e.cliPath))),a=mn(i.urlPathWord,r.map(({fields:e})=>e)),o=F(i.text);if(o.length===0&&i.kind.size===0)return t.map(e=>({item:e,score:1}));let s=N(o),c=rn(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))+hn(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.parameter,...(e.requestBody??[]).flatMap(e=>e.parameter)];return{...e,cliPath:e.projection.cliPath,enumParameter:t.map(e=>({values:e.itemSchemaEnum??e.schemaEnum??[],direct:e.name===e.inputName})),parameterName:t.flatMap(e=>[e.name,e.inputName]),directParameterName:e.parameter.map(e=>e.name),parameterDescription:[...e.parameter,...e.requestBody??[],...(e.requestBody??[]).flatMap(e=>e.parameter)].map(({description:e})=>e),responseFieldLevel:xn(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)*wn,a=r.filter(({score:e})=>e>=i),o=e.limit===void 0||!Number.isFinite(e.limit)?Cn: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.map(e=>Nt(e,c.length===1));return{summary:A,data:m(ee(A,u,{counts:l}))?u:c.map(Pt),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:t,termForm:n,queryWord:r},i){let a=zn(i),o=Ln(i),s=0;a.some(t=>t===e)&&(s+=100),a.some(t=>t.includes(e))&&(s+=40),s+=Rn(e,a);let c=new Set(a.flatMap(P));for(let e of t)a.some(t=>t===e)?s+=20:c.has(e)&&(s+=8);for(let e of i.cliPath){let n=new Set;M(n,e),[...n].some(e=>t.has(e))&&(s+=Tn)}an(n,o)&&(s+=200),i.parameterName.some(t=>F(t)===e)&&(s+=En);let l=new Set(i.parameterDescription.flatMap(P));for(let e of t)l.has(e)&&(s+=Dn);return s+=Vn(t,i.enumParameter),[`list`,`search`,`find`,`browse`].some(e=>t.has(e))&&/^(?:list|search)[A-Z]/u.test(i.operationId)&&(s+=30),s+=Sn(n,r,i.responseFieldLevel),s-=Bn(e,t,i.description),_(i.intent)&&!In(r)?s*On:s}var Pn=`edit change set fix rename link unlink mark publish correct`.split(` `),Fn=new Set([...Object.entries(ce).filter(([,e])=>_(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(F).filter(e=>e.length>0)}function Rn(e,t){let n=P(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,Qt(e.description).useFor||e.description].map(F).filter(e=>e.length>0))]}function Bn(e,t,n){let r=F(Qt(n).notFor);if(r.length===0)return 0;let i=r.includes(e)?40:0,a=new Set(P(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=P(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 g(`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 g(`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=Ze.safeParse(Un(o));if(!s.success||s.data.resolution==null)return g(`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))?g(`No operation on this connection answers that request.`):ee(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.map(({sourceId:e})=>e).filter(e=>n.some(({operationId:t})=>t===e)),...d===void 0?{}:{operation:{operationId:d.operationId,apiRoute:`${d.method} ${d.path}`,...Zt(d),mcpCall: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:Yt(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=f({detail:d(),field:d().nullish(),scope:o([`entity`,`person`,`news`])}),Kn=o([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),qn=Object.assign(n([Kn,d()]),{enum:Kn.enum}),I=f({modeRequested:qn,modeUsed:qn}),Jn=f({answerUnavailable:l(),entity:I,news:I,person:I,rejection:i(Gn),unavailable:i(o([`entity`,`person`,`news`]))}),Yn=f({acceleratorParticipation:i(ke),detail:i(be)}),L=f({core:y,enrichment:Ie,fundraiseRound:i(Ce),research:Yn,semanticMatch:ve.nullish()}),Xn=o([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),Zn=f({compositeScore:u().nullish(),cosineScore:u().nullish(),curatedAsOf: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(),curatedRelationshipType:d().nullish(),curatedSource:d().nullish(),derivedFromEntityId:t().nullish(),matchedSectionWeight:u().nullish(),origin:Xn,rank:s(),sharedSectionCount:s().nullish()}),Qn=f({entity:L,similarity:Zn}),$n=o([`aventureBlog`,`personalBlog`,`employerBlog`,`linkedin`,`xTwitter`,`medium`,`substack`,`other`]),er=f({author:d().nullish(),createdAt:r({offset:!0}),externalId:d().nullish(),id:t(),isCurrent:l(),lastFetchedAt:r({offset:!0}).nullish(),mentionedEntityId:i(t()),mentionedPersonId:i(t()),owner:c,publishedAt:r({offset:!0}).nullish(),summary:d().nullish(),summaryGeneratedAt:r({offset:!0}).nullish(),title:d().nullish(),topic:d().nullish(),type:$n,updatedAt:r({offset:!0}),url:d()}),tr=o([`low`,`medium`,`high`]),nr=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:tr.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:r({offset:!0}).nullish(),valueType:xe}),rr=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:nr,id:d()}),ir=f({fundraiseInvestorJoin:l(),fundraiseTransaction:l(),operatingStatus:l(),relationship:l()}),ar=o([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),or=o([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),sr=f({acquiredEntity:y,acquirerEntity:y,amount:u().int().nullish(),announcedAt: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(),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(),completedAt: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(),createdAt:r({offset:!0}).nullish(),currency:d().nullish(),dataConfidence:Pe.nullish(),evidence:ir,fundraiseTransactionId:t().nullish(),investorJoinId:t().nullish(),isCurrent:l().nullish(),publicSource:Le.nullish(),relationshipId:s(),status:ar,transactionStatus:or.nullish(),updatedAt:r({offset:!0}).nullish()}),cr=o([`SAFE`,`Convertible Note`,`Preferred Stock`,`Common Stock`,`Other Equity`,`Bond`,`Loan`,`Other Debt`,`Grant`,`Token`]),lr=f({amountInvested:u().nullish(),createdAt:r({offset:!0}),financialInstrumentType:cr.nullish(),id:t(),investor:c,leadInvestor:l(),transactionId:t(),updatedAt:r({offset:!0})}),ur=f({entity:Me,investorAttribution:i(Se),round:i(_e),roundCount:s()}),dr=f({core:y,fundingDetail:Fe.nullish(),similarity:Zn,urlLink:i(he)}),fr=f({compliance:Ne.nullish(),createdAt:r({offset:!0}).nullish(),id:s(),isCurrent:l().nullish(),isPrimary:l().nullish(),language:d().nullish(),owner:c,text:d(),textName:d().nullish(),textType:d(),updatedAt:r({offset:!0}).nullish()}),pr=o([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),mr=o([`fundraiseRound`,`researchDetail`]),hr=o([`preMoney`,`postMoney`,`reported`]),gr=f({amountRaised:u().int().nullish(),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)))?)?)?$/),confidence:tr,currency:d(),declaredBasis:hr,derivation:pr,detailId:s().nullish(),label:d().nullish(),source:mr,sourceRef:d(),valuationPostMoney:u().int().nullish(),valuationPreMoney:u().int().nullish()}),_r=f({createdAt:r({offset:!0}).nullish(),description:d().nullish(),forkCount:s(),githubId:u().int(),homepageUrl:d().nullish(),id:u().int(),isArchived:l(),isFork:l(),language:d().nullish(),license:d().nullish(),name:d(),ownerLogin:d(),repoCreatedAt:r({offset:!0}).nullish(),repoPushedAt:r({offset:!0}).nullish(),stargazerCount:s(),topic:i(d()),updatedAt:r({offset:!0}).nullish(),url:d()}),R=f({empty:l().optional(),sorted:l().optional(),unsorted:l().optional()}),z=f({offset:u().int().optional(),paged:l().optional(),pageNumber:s().optional(),pageSize:s().optional(),sort:R.optional(),unpaged:l().optional()}),vr=f({investorAttribution:i(Se),person:Ae,round:i(_e),roundCount:s()}),yr=o([`precomputed`,`live`]),br=f({compositeScore:u().nullish(),cosineScore:u().nullish(),matchedSectionWeight:u().nullish(),origin:yr,rank:s(),sharedSectionCount:s().nullish()}),xr=f({currentRole:je.nullish(),person:we,similarity:br}),Sr=o([`by`,`about`]),Cr=o([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),wr=f({canonicalUrl:d().nullish(),contentId:d(),contentType:Cr,createdAt:r({offset:!0}).nullish(),publishedAt:r({offset:!0}).nullish(),relation:Sr.nullish(),sourceDomain:d().nullish(),sourceName:d().nullish(),summary:d().nullish(),title:d(),topic:d().nullish(),updatedAt:r({offset:!0}).nullish(),url:d().nullish(),year:s().nullish()});f({content:i(er).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(n([me,ge])).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(rr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(y).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(sr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Me).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(lr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Ce).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(ur).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(L).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(je).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Ee).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(be).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Te).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Qn).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(dr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(fr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(he).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(gr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(_r).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(ye).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(we).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Ae).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Oe).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(vr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(xr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(wr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()});var Tr=f({content:i(L),number:s(),size:s(),totalElements:u().int(),totalPages:s()}),Er=f({content:i(ye),number:s(),size:s(),totalElements:u().int(),totalPages:s()}),Dr=f({content:i(we),number:s(),size:s(),totalElements:u().int(),totalPages:s()});f({content:i(De).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:z.optional(),size:s().optional(),sort:R.optional(),totalElements:u().int().optional(),totalPages:s().optional()});var Or=o([`entityRecord`,`researchSnippet`,`newsArticle`,`personRecord`,`fundraiseTransaction`]),kr=Object.assign(n([Or,d()]),{enum:Or.enum}),Ar=f({entityId:t(),source:kr,sourceId:d()}),jr=f({citation:i(Ar),text:d(),topic:d().nullish()}),Mr=f({citation:i(Ar),confidence:x,description:d().nullish(),heading:d().nullish(),paragraph:i(jr),relatedQuery:i(d()),shareable:l(),text:d(),title:d().nullish()}),Nr=f({sortPriority:o([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),Pr=f({max:r({offset:!0}).nullish(),min:r({offset:!0}).nullish()}),B=f({max:u().nullish(),min:u().nullish()}),V=f({max:s().nullish(),min:s().nullish()}),Fr=f({averageAmountInvestedUsdRange:i(B).optional(),largestAmountInvestedUsdRange:i(B).optional(),smallestAmountInvestedUsdRange:i(B).optional(),totalAmountInvestedUsdRange:i(B).optional(),totalInvestmentRange:i(V).optional()}),Ir=f({amountInvestedRange:i(B).optional(),amountRaisedRange:i(B).optional(),dateAnnouncedRange:Pr.nullish(),investedCompanyName:i(d()).optional(),investedCountry:i(d()).optional(),investedIndustry:i(d()).optional(),investedRound:i(d()).optional(),investorActivity:Fr.optional(),investorName:i(d()).optional(),lastRoundYearRange:i(V).optional(),rankByInvestmentActivity:l().nullish(),round:i(d()).optional(),totalRaisedRange:i(B).optional(),valuationRange:i(B).optional()}),Lr=o([`NONE`,`COMPANY_LISTING_READY`]),Rr=o([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),zr=o([`hostPath`,`domain`]),Br=e({acceleratorBrand:i(d()).optional(),acceleratorCohort:i(d()).optional(),acceleratorName:i(d()).optional(),acceleratorStatus:i(d()).optional(),affinity:i(d()).optional(),closedLast:l().optional(),employeeCountRange:i(V).optional(),entityId:i(t()).optional(),entityName:i(d()).optional(),featured:l().nullish(),fundraiseActivity:Ir.optional(),hasFundraising:l().nullish(),headquartersCity:i(d()).optional(),headquartersCountry:i(d()).optional(),headquartersState:i(d()).optional(),industry:i(d()).optional(),letter:d().nullish(),location:i(d()).optional(),logoOption:Nr.optional(),mainProduct:i(d()).optional(),operatingStatus:i(Rr).optional(),originCountry:i(d()).optional(),person:i(d()).optional(),portfolioHeadquartersCity:i(d()).optional(),portfolioHeadquartersCountry:i(d()).optional(),portfolioHeadquartersState:i(d()).optional(),qualityGate:Lr.optional(),rankByProminence:l().nullish(),semanticQuery:d().nullish(),slug:i(d().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:i(d()).optional(),suppressLateStage:l().nullish(),suppressNonOperating:l().nullish(),suppressZeroTotalRaised:l().nullish(),tag:i(d()).optional(),textSearch:d().nullish(),typeCustomer:i(d()).optional(),typeModel:i(d()).optional(),typeOwnership:i(d()).optional(),typeRecord:i(a).optional(),typeRevenue:i(d()).optional(),typeTechnologyUsed:i(d()).optional(),url:d().nullish(),urlDomain:d().nullish(),urlMatchMode:zr.nullish(),urlType:pe.nullish(),yearFoundedRange:i(V).optional()}),Vr=o([`discovery`,`profile`,`peer`,`comparison`]),Hr=o([`keyword`,`semantic`]),Ur=o([`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`]),Wr=Object.assign(n([Ur,d()]),{enum:Ur.enum}),Gr=f({descending:l(),field:Wr,sortKey:d().nullish()}),Kr=f({order:i(Gr),relevance:Hr.nullish()}),qr=f({confidence:x,execution:I,fallbackUsed:l(),filter:Br,intent:Vr,interpretation:d(),sort:Kr,subjectEntityName:i(d()),unsupported:d().nullish()}),Jr=f({changedAt:r({offset:!0}).nullish(),dataSourceUpdatedAt:r({offset:!0}).nullish(),pendingApproval:s().nullish(),sourceId:d().nullish(),status:d().nullish()}),Yr=f({fundManagerRelationshipSource:Jr.nullish(),fundraiseTransaction:Ce,fundraiseTransactionSource:Jr.nullish(),investorJoinSource:Jr.nullish()}),Xr=f({evidence:Yr,investor:c,semanticMatch:ve.nullish()}),Zr=f({entityId:t(),matchedOffering:y.nullish(),probability:u(),webUrl:i(d())}),Qr=f({entityId:t(),label:d(),publishedAt:r({offset:!0}).nullish(),score:u(),source:kr,sourceId:d(),text:d(),url:d().nullish()}),$r=f({answer:Mr.nullish(),interpretation:qr,investment:i(Xr),judgment:i(Zr),passage:i(Qr),peer:i(Qn),pendingWebQuery:i(d()),result:Tr,searchRequestId:t().nullish(),subject:i(L)}),ei=o([`auto-match`,`needs-review`,`approved`,`rejected`]),ti=f({createdAt:r({offset:!0}),entityId:t(),href:d().nullish(),internal:l(),matchStatus:ei.nullish(),mention:d().nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:a.nullish(),updatedAt:r({offset:!0})}),ni=f({entity:i(ti),newsId:s()}),ri=e({acceleratorBrand:i(d()).optional(),acceleratorCohort:i(d()).optional(),acceleratorName:i(d()).optional(),acceleratorStatus:i(d()).optional(),affinity:i(d()).optional(),closedLast:l().optional(),employeeCountRange:i(V).optional(),entityId:i(t()).optional(),entityName:i(d()).optional(),featured:l().nullish(),fundraiseActivity:Ir.optional(),hasFundraising:l().nullish(),headquartersCity:i(d()).optional(),headquartersCountry:i(d()).optional(),headquartersState:i(d()).optional(),industry:i(d()).optional(),letter:d().nullish(),location:i(d()).optional(),logoOption:Nr.optional(),mainProduct:i(d()).optional(),operatingStatus:i(Rr).optional(),originCountry:i(d()).optional(),person:i(d()).optional(),portfolioHeadquartersCity:i(d()).optional(),portfolioHeadquartersCountry:i(d()).optional(),portfolioHeadquartersState:i(d()).optional(),qualityGate:Lr.optional(),rankByProminence:l().nullish(),slug:i(d().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:i(d()).optional(),suppressLateStage:l().nullish(),suppressNonOperating:l().nullish(),suppressZeroTotalRaised:l().nullish(),tag:i(d()).optional(),textSearch:d().nullish(),typeCustomer:i(d()).optional(),typeModel:i(d()).optional(),typeOwnership:i(d()).optional(),typeRecord:i(a).optional(),typeRevenue:i(d()).optional(),typeTechnologyUsed:i(d()).optional(),url:d().nullish(),urlDomain:d().nullish(),urlMatchMode:zr.nullish(),urlType:pe.nullish(),yearFoundedRange:i(V).optional()}),ii=f({amountInvestedRange:i(B).nullish(),amountRaisedRange:i(B).nullish(),entityName:i(d()).nullish(),investedCompany:i(d()).nullish(),personTitle:i(d()).nullish(),round:i(d()).nullish(),totalInvestmentCount:i(V).nullish(),typeRecord:i(a).nullish()}),ai=f({arrayFilter:ii.optional(),entityFilter:ri.optional(),entityId:t().nullish(),entitySlug:d().nullish(),firstName:d().nullish(),includeAddress:l().nullish(),includeUrl:l().nullish(),investorActivity:Fr.optional(),isCurrent:l().nullish(),lastName:d().nullish(),letter:d().nullish(),personId:i(t()).max(200).optional(),personName:i(d()).optional(),role:d().nullish(),search:d().nullish(),semanticQuery:d().nullish(),status:d().nullish()}),oi=f({descending:l(),field:o([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`]),sortKey:d().nullish()}),si=f({order:i(oi),relevance:Hr.nullish()}),ci=f({confidence:x,execution:I,fallbackUsed:l(),filter:ai,interpretation:d(),sort:si,unsupported:d().nullish()}),li=f({interpretation:ci,investment:i(Xr),result:Dr,searchRequestId:t().nullish()}),ui=f({label:d(),query:d()}),di=f({key:d(),option:i(ui),prompt:d()}),fi=f({entity:$r,entityDetail:i(Me),news:Er,newsEntityMention:i(ni),person:li,personDetail:i(Ae),provenance:Jn,qualifier:di.nullish()});function pi(e,t){return e.map(e=>{let n=e.requestBody??[],r=[...e.parameters.map(e=>mi(e)),...n.flatMap(e=>e.parameter.map(t=>mi(t,n.length>1?e.contentType:void 0))),...hi(n)],i=[t,...e.cliPath].join(` `),a=_(e.intent),o=ae(e),s=n[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:a,destructive:le(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse||!se(e.path)||o===null?null:ie(o),body:{hasBody:s!==void 0,kind:s?.kind??null,...s!==void 0&&n.length>1?{contentType:s.contentType}:{},required:s?.required??!1,description:s?.description??``,requiredPath:s?.requiredPath??[]},flags:r,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},summary:e.summary,description:e.description,...e.deprecated===void 0?{}:{deprecated:e.deprecated}}})}function mi(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 hi(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 gi(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var _i=[`-id`,`-slug`,`-url`],vi=[`--id`,`--slug`,`--url`],yi=`/v1/lookup`,bi=`--from-file "<path>"`;function xi(e,t,n=te().bin[0]){let r=pi(t,n),i=r.find(t=>t.operationId===e);return i===void 0?[]:Ti(i,r)}function Si(e,t,n=te().bin[0]){let r=t.find(t=>t.operationId===e),[i]=r===void 0?[]:pi([r],n);return i&&wi(i,Oi(i,!1))}function Ci(e,t,n,r=te().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 Si(o.operationId,t,r)}function wi(e,t){return[e.cli.command,...t,`--data`].join(` `)}function Ti(e,t){return[`example: ${wi(e,Oi(e))}`,...Ei(e,t)]}function Ei(e,t){return gi(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} ${Ai(i)} --data`,o=t.find(e=>e.method===`POST`&&e.path===yi),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} ${Ai(s)} --data, then match.owner.${e.optionKey} when status is MATCHED`]})}var Di=/(?:^|\.)text$/u;function Oi(e,t=!0){let n=gi(e).filter(e=>e.required),r=e.body.kind===`json`&&n.some(e=>e.location===`body`&&Di.test(e.wireName))?n.filter(e=>e.location!==`body`):n,i=(n.length>0||!t?r:ki(e)).map(Ai);return(e.body.required||e.body.requiredPath.length>0)&&!r.some(e=>e.location===`body`)?[...i,bi]:i}function ki(e){let t=new Set;M(t,e.resource);for(let n of _i)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 vi){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function Ai(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}var ji=`aventure`;function Mi(e,t){let n=t.find(t=>t.operationId===e)?.cliPath;return n===void 0?void 0:`${ji} ${n.join(` `)}`}function Ni(e,t,n=e){return Si(e,t,`aventure`)??n}function Pi(e,t){let n=Ze.safeParse(e);if(!n.success)return null;let{answer:r,citation:i,confidence:a,resolution:o}=n.data;if(o!=null)return Fi(r,o,t);let s=r.trimEnd().split(`
|
|
15
|
+
`),c=new Set(i.flatMap(({sourceType:e,sourceId:n})=>{if(e!==Ve.options[0].enum.OPERATION)return[];let r=Mi(n,t);return r===void 0?[]:[r]}));return c.size>0&&s.push(``,`Commands:`,...[...c].map(e=>` ${e}`)),s.push(``,`Confidence: ${a}`),i.length===0?s:(s.push(`Sources (${i.length}):`),s.push(...i.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`})),s)}function Fi(e,t,n){let{outcome:r,operationId:i,probability:a,candidate:o,taskKey:s,taskPlan:c}=t,l=[c==null?e.trimEnd():Li(c)],u=[``,`Outcome: ${r}${a==null?``:` (probability ${a.toFixed(2)})`}`];switch(r){case S.enum.TASK_PLAN:return[...l,...c==null?[]:Ri(c,n),...u];case S.enum.OPERATION_ADVICE:{let e=o.filter(({sourceId:e})=>e!==i);return[...l,...i==null?[]:[``,`Command:`,` ${Ni(i,n)}`],...u,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case S.enum.CLARIFY:return[...l,...s==null?[]:[``,`Leading catalog task: ${s}`],...Bi(`Candidates:`,o,n),...u];case S.enum.ABSTAIN:return[...l,...Bi(`Nearest operations:`,o,n),...u];default:throw Error(`Unhandled help resolution outcome ${String(r)}`)}}function Ii(e,t){let n=Ye.safeParse(e);return n.success?[Li(n.data),...Ri(n.data,t)]:null}var Li=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function Ri(e,t){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})=>` ${e} (${t}): ${n}`)],``,`Steps:`,...e.step.flatMap(({step:n,cliCommand:r,writeGuidance:i},a)=>[` ${a+1}. ${n.stepKey===void 0?``:`${n.stepKey}: `}${Ni(n.operationId,t,r)}`,` ${n.instruction}`,...zi(e,a,i)]),...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function zi(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 Bi(e,t,n){if(t.length===0)return[];let r=t.map(({sourceId:e,excerpt:t})=>({command:Mi(e,n)??e,excerpt:t})),i=Math.max(...r.map(({command:e})=>e.length));return[``,e,...r.map(({command:e,excerpt:t})=>` ${e.padEnd(i)} # ${t}`)]}var H=30,Vi=8,U=10,Hi=2,Ui=[`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`],Wi=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]),Gi=[`interpretation`,`confidence`,`unsupported`,`execution`,`fallbackUsed`];function Ki(e,t,n){if(typeof t==`string`)return _t(t);let r=Ut(t);if(r!==null)return T(r);let i=ra(t);if(i===null)return null;let a=e.find(({operationId:e})=>e===i.operationId),{response:o,hiddenNote:s}=ue(a?.detailField,i.response),c={...i,response:o,parameters:a?.parameters??[]},l=Pi(c.response,e)??Ii(c.response,e);if(l!==null)return T(l.join(`
|
|
16
|
+
`),!0);let u=qi(c);if(u!==null)return T([...u,...s].join(`
|
|
17
|
+
`),!0,s.length>0);let d=[c.summary??n??c.operationId??`OpenAPI call succeeded`,`${c.method} ${c.endpoint}`],f=bt(Zi(c),117-s.length,w-b.byteLength(`${[...d,...s].join(`
|
|
18
|
+
`)}\n`,`utf8`));return T([...[...d,...f].filter(Boolean),...s].join(`
|
|
19
|
+
`),!0,s.length>0)}function qi({response:e,...t}){if(e===void 0||!Y(e)||!(`entity`in e&&`person`in e&&`news`in e))return null;let n=fi.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o}=n.data;return[...r.answer?Ji(r.answer):[],...o.unavailable.map(e=>`${e} unavailable: retry this scope later`),...o.answerUnavailable?[`answer unavailable: retry this search later`]:[],...o.rejection.map(({scope:e,detail:t})=>v(`${e} rejected: ${t}`)),[`entities:`,...W(r.result,t)].join(`
|
|
20
|
+
`),[`people:`,...W(i.result,t)].join(`
|
|
21
|
+
`),[`news:`,...W(a,t)].join(`
|
|
22
|
+
`)]}function Ji(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${v(e)}`).join(`
|
|
23
|
+
`)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>v(` - ${e}:${t} entity=${n}`)).join(`
|
|
24
|
+
`)}`;return[`answer:\n ${de(e.text).replaceAll(`
|
|
25
|
+
`,`
|
|
26
|
+
`)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function Yi(e){let t=ra(e)?.response,n=Y(t)?t.interpretation:void 0;if(!Y(n))return null;let r=I.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=K(n.filter),{unsupported:s,fallbackUsed:c}=n;return T([`strategy: requested=${i} used=${a}`,...Y(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${Xi(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``].filter(Boolean).join(`
|
|
27
|
+
`),!0)}var Xi=e=>X(e)?v(e):Array.isArray(e)&&e.every(X)?e.map(e=>v(e)).join(`, `):JSON.stringify(e);function Zi(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a}=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 o=i===void 0||n===`GET`?``:`status=${i}`,s=Y(t)&&!oa(t)?sa(t):null,c=s===null?void 0:Y(s.context.interpretation)?K(s.context):s.context,l=c!==void 0&&Y(c)?Object.entries(c):[],u=l.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(Y)),d=new Set(u.map(([e])=>e)),f=Object.fromEntries(l.filter(([e])=>!d.has(e)));return[o,...oa(t)?W(t,e,r):s===null?la(t)?ea(t.filter,t.meta):ua(t)?ea([...t.arrayFilterEntry,...t.rangeFilterEntry],t.filtersMeta):da(t)?ta(t):G(t,``):[...W(s.page,e,r),...Object.keys(f).length===0?[]:G(f,``),...u.flatMap(([e,t])=>[`${e}:`].concat(Qi(t)))]].filter(Boolean)}function W(e,t,n){let r=na(t),i=e.numberOfElements??e.content.length,a=(e.totalElements??0)-(e.number??0)*(e.size??0)-i,o=e.number===void 0?``:` page=${e.number}`,s=e.size===void 0?``:` size=${e.size}`,c=e.totalElements===void 0?``:` total=${e.totalElements}`,l=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,u=(e.number??0)+1,d=e.totalPages===void 0||u<e.totalPages,f=Z(`page`,t.parameters);return[`rows=${i}${o}${s}${c}${l}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${Q(n)}`,a<=0||n!==void 0?``:d&&i===e.size?`more: ${a} rows not shown; use ${f} or ${Z(`size`,t.parameters)} to see them`:`more: ${a} more matched but this response returns only these ${i}; narrow the query to reach them${d?` (${f} ${u} starts after this page)`:``}`,...Qi(e.content)].filter(Boolean)}function Qi(e){let t=e.filter(Y);if(t.length===0)return e.length===0?[`(empty)`]:ia(e,``);let n=$i(t);if(n.length===0)return ia(e.slice(0,H),``);let r=t.slice(0,H).map(e=>{let t=q(e);return n.map(e=>t[e]??``)}),i=n.map(e=>e.split(`.`).at(-1)??e),a=i.map((e,t)=>{let n=r.map(e=>e[t]??``),i=Math.max(e.length,...n.map(e=>e.length));return e===`id`||e.endsWith(`Id`)?i:Math.min(32,i)}),o=e=>e.map((e,t)=>fa(e,a[t]??12).padEnd(a[t]??12)).join(` `),s=[o(i),o(a.map(e=>`-`.repeat(e)))];return r.forEach(e=>s.push(o(e))),t.length>H&&s.push(`... ${t.length-H} more rows`),s}function $i(e){let t=e.map(e=>q(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=Ui.filter(e=>n.has(e)),i=new Set(r.map(aa)),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(aa(e))?!1:(n&&i.add(aa(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,Vi-s.length);return[...s,...c].slice(0,Vi)}function ea(e,t){let n=t!==void 0&&Y(t)?t:{},r=[`total`,`limit`].flatMap(e=>typeof n[e]==`number`?[` ${e}=${n[e]}`]:[]).join(``),i=[`filters=${e.length}${r}`];for(let t of e){let e=t.choiceOption.length,n=t.choiceOptionTotal===null?`unknown (degraded)`:t.choiceOptionTotal??e,r=t.choiceOptionTruncated===!0?` truncated`:``;i.push(`- ${t.filterKey} (${t.label}): choices ${e}/${n}${r}`),t.choiceOption.slice(0,U).forEach(e=>{i.push(` ${Z(t.filterKey)} ${Q(e.value)}`)}),e>U&&i.push(` ... ${e-U} more shown`)}return i}function ta(e){let t=Z(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,U).map(e=>`${t} ${Q(e)}`),e.result.length>U?`... ${e.result.length-U} more matches`:``].filter(Boolean)}function na({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Wi.has(e)&&t.length>0).map(([e,n])=>`${Z(e,t)} ${Q(n)}`)}function ra(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:h.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 G(e,t,n){if(e===void 0)return[];if(X(e))return[`${t}${fe(e,n)}`];if(Array.isArray(e))return ia(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if(X(i)){r.push(`${t}${n}: ${fe(i,n)}`);continue}r.push(`${t}${n}:`);for(let e of G(i,`${t} `,n))r.push(e)}return r.length===0?[`${t}(empty)`]:r}function ia(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e){if(X(i)){r.push(`${t}- ${fe(i,n)}`);continue}r.push(`${t}-`);for(let e of G(i,`${t} `))r.push(e)}return r}function K(e){if(e===void 0||X(e))return e===null||typeof e==`string`&&e.trim().length===0?void 0:e;if(Array.isArray(e)){let t=e.flatMap(e=>{let t=K(e);return t===void 0?[]:[t]});return t.length===0?void 0:t}let t=Object.entries(e).flatMap(([e,t])=>{let n=K(t);return n===void 0?[]:[[e,n]]});if(t.length!==0)return Object.fromEntries([...Gi.flatMap(e=>t.filter(([t])=>t===e)),...t.filter(([e])=>!Gi.includes(e))])}function q(e,t=``,n=0){return X(e)?t.length===0?{}:{[t]:v(e,t)}:n>Hi?{}:Array.isArray(e)?e[0]===void 0?{}:q(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 X(r)?[[i,v(r,i)]]:Object.entries(q(r,i,n+1))}))}var aa=e=>e.split(`.`,1)[0],oa=e=>Y(e)&&Array.isArray(e.content);function sa(e){let[t,...n]=Object.entries(e).filter(e=>oa(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 ca(e){return Y(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var la=e=>Y(e)&&J(e.filter),ua=e=>Y(e)&&J(e.arrayFilterEntry)&&J(e.rangeFilterEntry),J=e=>Array.isArray(e)&&e.every(ca),da=e=>Y(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>typeof e!=`object`||!e,Z=(e,t=[])=>t.find(({name:t})=>t===e)?.flag.split(` `)[0]??`--${e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}`,Q=e=>/^[A-Za-z0-9._:/@-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`,fa=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(0,t-3))}...`,pa=/\{([^}]+)\}/gu;function ma(e,t){let n=t.filter(e=>e.method===`GET`),r=t=>e.endpoint!==void 0&&t.endsWith(e.endpoint),i=t.find(t=>t.operationId===e.operationId),a=e.ok&&i!==void 0&&_(i.intent),o=[...a&&e.endpoint!==void 0?ga(e.endpoint.split(`?`)[0]??``,n,!1).map(e=>`${e} --data --to-file <path>`):[],...e.references.filter(e=>!r(e)).flatMap(ha).flatMap(e=>ga(e.pathname,n,!0)),...e.references.filter(r).flatMap(ha).flatMap(e=>_a(e,n))];return o.length===0?{write:a}:{exactRecovery:`Read the full result ${o.join(`; `)}.`,write:a}}function ha(e){return URL.canParse(e)?[new URL(e)]:[]}function ga(e,t,n){return t.flatMap(t=>{let r=[...t.path.matchAll(pa)].map(([,e])=>e),i=RegExp(`^${t.path.replace(pa,`([^/]+)`)}$`,`u`),a=n&&r.length===0?null:i.exec(e);if(a===null)return[];let o=r.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[$(r),a[n+1]??``]});return[`${va(t)}, ${ya(t,o)}`]})}function _a(e,t){let n=t.find(t=>t.path===e.pathname);return n===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${n.path}/`))return[];let r=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),i=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(r===void 0||i===void 0)return[];let a=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[$(t),ba(n)]}),o=[$(r),`<n>`,$(i),`<n>`];return[`${va(t)}, in windows: ${ya(t,[...a,...o])}, advancing ${$(r)} until a window returns fewer than ${$(i)} units`]})}function va(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function ya(e,t){return[ji,...e.cliPath,...t].join(` `)}function $(e){return e.flag.split(/\s+/u)[0]??e.flag}function ba(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function xa(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=Ea(t,C(e,t),n);if(t.legacyName===void 0)return r;let i=Ea(t,C(e,t,t.legacyName),n).flag;return i===r.flag?r:Object.assign(r,{legacyFlag:i})})}),n=e.requestBody?.map(n=>{let r=wa(e,t,n),i=Ca(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,errorResponse:e.errorResponse,successResponse:i,detailField:r?.detailField,parameters:t}})}function Sa(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 Ca(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 wa(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)=>Ta(e.name)-Ta(t.name)).flatMap(t=>{if(!t.required&&(r.has(t.inputName)||i.has(t.name)))return[];let n=Qe(e,t,r);return r.add(n),[Ea(t,n,`body`)]})}function Ta(e){let t=e.split(`.`).at(-1);return t===`min`?0:t===`max`?1:2}function Ea(e,t,n){let r=e.itemSchemaEnum??e.schemaEnum,i=ze(e.schemaType,e.itemSchemaType,e.schemaFormat,t);return{name:e.name,optionKey:t,flag:`${re(t)} ${e.schemaType===`boolean`?`[${i}]`:`<${i}>`}`,required:e.required&&e.schemaDefault===void 0,description:Re(e.description,r),schemaType:e.schemaType,schemaFormat:e.schemaFormat,itemSchemaType:e.itemSchemaType,defaultValue:Da(e.schemaDefault),choices:r,...e.envName===void 0?{}:{envName:e.envName},...e.visibility&&{visibility:e.visibility},location:n}}var Da=e=>Array.isArray(e)?e.map(String):typeof e==`number`?String(e):e;export{et as S,N as _,Yi as a,Nt as b,xi as c,pi as d,An as f,xn as g,Wn as h,Ki as i,Ci as l,jn as m,Sa as n,Di as o,kn as p,ma as r,gi as s,xa as t,Ti as u,P as v,T as x,F as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./detail-MEh1aLs6.js";export{e as EntityDetailSchema};
|
|
@@ -1 +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-BJgNYLKX.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()}),v=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`.split(`.`)),y=Object.assign(t([v,d()]),{enum:v.enum}),b=f({currency:d().nullish(),fundingRoundCount:o(),investorCount:o(),latestValuation:u().nullish(),mostRecentAmount:u().nullish(),mostRecentDate:s().nullish(),stage:y.nullish(),totalRaised:u(),totalRaisedUsd:u().nullish(),unconvertedRoundCount:o()}),x=f({expanded:d().nullish(),generatedDescription:d().nullish(),short:d().nullish()}),ce=a([`cloudflare`,`akamai`,`fastly`,`awsCloudfront`,`vercel`,`netlify`,`sucuri`,`incapsula`,`bunny`,`keycdn`,`cdn77`,`gcore`,`cdnetworks`,`azureCdn`,`leaseweb`,`digitalocean`,`stackpath`,`googlecloudCdn`,`none`,`unknown`]),le=a([`static`,`jsRequired`,`jsEnhanced`]),S=d(),C=f({crawlCdnProvider:ce.nullish(),crawlRenderMode:le.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:S}),w=f({address:r(p),classification:se,fundingDetail:b.nullish(),headquartersAddressId:o().nullish(),headquartersRemoteAsOf:n({offset:!0}).nullish(),text:x,urlLink:r(C)}),T=f({isMonogram:l(),logo:d().nullish(),logoSquare:d().nullish()}),ue=a([`alternativeDba`,`relatedLegal`]),E=f({displayable:l().nullish(),name:d(),type:ue.nullish()}),D=f({hasAcquisitions:l().default(!1).optional(),hasAnalysis:l(),hasEmployees:l(),hasFundraising:l(),hasNews:l(),productServiceSlug:r(d())}),O=f({defaultCurrency:d().nullish(),foundedYear:o().nullish(),id:e(),image:T,lastModifiedAt:n({offset:!0}).nullish(),nameAlias:r(E),nameBrand:d(),nameLegal:d().nullish(),operatingStatus:d().nullish(),publicId:d().regex(/^e[0-9A-Za-z]{11}$/).nullish(),publicUrl:d().nullish(),sitemap:D.nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255),typeRecord:i,updatedAt:n({offset:!0}).nullish()}),de=f({core:O,fundingDetail:b.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`]),fe=a([`direct`,`managedFund`]),j=f({round:d()}),M=f({amountInvested:u().nullish(),attributionType:fe,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:de.nullish(),id:e(),investorAttribution:M.nullish(),investorCount:o().nullish(),publicSource:k.nullish(),round:d().nullish(),sourceAttribution:r(M),updatedAt:n({offset:!0}).nullish(),valuationPostMoney:u().int().nullish(),valuationPreMoney:u().int().nullish()}),pe=f({fundingStage:y.nullish(),ownership:r(d()),pricingModel:r(d()),sellsTo:r(d()),totalRaised:u().nullish(),website:d().nullish()}),P=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:pe.nullish(),createdAt:n({offset:!0}).nullish(),detail:d().nullish(),entity:O,id:o().nullish(),isCurrent:l().nullish(),isPrimary:l().nullish(),publicSource:k.nullish(),get relationship(){return r(P)},relationshipType:d(),sourceEntityId:e().nullish(),targetEntityId:e().nullish(),updatedAt:n({offset:!0}).nullish()}),F=P,I=f({accelerator:O,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()}),L=a([`text`,`numeric`,`monetary`,`percentage`,`date`]),R=a([`pastDue`,`withinThreeMonths`,`threeToSixMonths`,`sixToTwelveMonths`,`twelveToTwentyFourMonths`,`beyondTwoYears`]),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)))?)?)?$/),bucket:R,monthsFromNow:o(),targetDate:n({offset:!0})}),B=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:z.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:L}),V=f({characterCount:o(),meetsRequirements:l(),violation:r(d()),wordCount:o()}),H=f({compliance:V.nullish(),entityId:e(),id:o(),publicSource:k.nullish(),text:d(),textType:d(),updatedAt:n({offset:!0}).nullish()}),me=f({acceleratorParticipation:r(I),detail:r(B),snippet:r(H)}),U=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()}),he=a([`nickname`,`maidenName`,`formerName`,`stageName`]),W=f({displayable:l().nullish(),name:d(),type:he.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:T,entityName:d().nullish(),entityOperatingStatus:d().nullish(),entitySlug:d().regex(/^[a-z0-9_-]+$/).max(255),entityType:i.nullish(),entityUrlLink:r(C),isCurrent:l().nullish(),personAddress:r(p),personId:e(),personImage:G,personName:d(),personSlug:d().regex(/^[a-z0-9_-]+$/).max(255),personUrlLink:r(C),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()}),ge=f({address:r(p),urlLink:r(C)}),_e=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:T,investorCount:o().nullish(),nameBrand:d(),round:d().nullish(),status:d().nullish(),valuationPostMoney:u().nullish()}),ve=f({entity:O,headquartersCity:d().nullish(),headquartersCountry:d().nullish(),headquartersRegion:d().nullish(),industry:d().nullish()}),q=f({amount:u().nullish(),company:ve,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:_e.nullish(),fundraiseTransactionId:e(),id:d(),investmentDate:n({offset:!0}),investorAttribution:M.nullish(),round:d().nullish()}),J=a([`entity`,`person`,`newsArticle`,`blogPost`,`text`,`classificationTag`,`classificationCode`,`product`,`service`,`agentHelpDoc`,`researchSnippet`,`sourceDocument`]),ye=Object.assign(t([J,d()]),{enum:J.enum}),Y=f({computedAt:n({offset:!0}),cosineDistance:u(),cosineScore:u(),modelVersion:d(),rank:o(),sourceHash:d(),sourceId:d(),sourceType:ye}),X=f({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:Y.nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255),suffix:d().nullish(),text:x,updatedAt:n({offset:!0}).nullish()}),Z=f({articleCount:o().nullish(),association:r(K),core:X,enrichment:ge,investment:r(q),nameAlias:r(W)}),Q=a([`ein`,`secCik`,`ticker`,`lei`,`duns`,`isin`,`cusip`,`crd`,`orcid`]),be=Object.assign(t([Q,d()]),{enum:Q.enum}),$=f({createdAt:n({offset:!0}),id:o(),identifier:d(),idType:be,owner:c,source:d().nullish(),updatedAt:n({offset:!0})}),xe=f({core:O,enrichment:w,fundraiseRound:r(N),newsArticle:r(U),person:r(Z),publicUrl:d().nullish(),relationship:r(F),research:me,sitemap:D,uniqueId:r($)});export{S as C,g as E,C as S,_ as T,j as _,Y as a,O as b,U as c,B as d,L as f,M as g,N as h,X as i,H as l,F as m,$ as n,q as o,I as p,Z as r,K as s,xe as t,V as u,A as v,b as w,w as x,k as y};
|
|
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-BJgNYLKX.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()}),v=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`.split(`.`)),y=Object.assign(t([v,d()]),{enum:v.enum}),b=f({currency:d().nullish(),fundingRoundCount:o(),investorCount:o(),latestValuation:u().nullish(),mostRecentAmount:u().nullish(),mostRecentDate:s().nullish(),stage:y.nullish(),totalRaised:u(),totalRaisedUsd:u().nullish(),unconvertedRoundCount:o()}),x=f({expanded:d().nullish(),generatedDescription:d().nullish(),short:d().nullish()}),ce=a([`cloudflare`,`akamai`,`fastly`,`awsCloudfront`,`vercel`,`netlify`,`sucuri`,`incapsula`,`bunny`,`keycdn`,`cdn77`,`gcore`,`cdnetworks`,`azureCdn`,`leaseweb`,`digitalocean`,`stackpath`,`googlecloudCdn`,`none`,`unknown`]),le=a([`static`,`jsRequired`,`jsEnhanced`]),S=d(),C=f({crawlCdnProvider:ce.nullish(),crawlRenderMode:le.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:S}),w=f({address:r(p),classification:se,fundingDetail:b.nullish(),headquartersAddressId:o().nullish(),headquartersRemoteAsOf:n({offset:!0}).nullish(),text:x,urlLink:r(C)}),T=f({isMonogram:l(),logo:d().nullish(),logoSquare:d().nullish()}),ue=a([`alternativeDba`,`relatedLegal`]),E=f({displayable:l().nullish(),name:d(),type:ue.nullish()}),D=f({hasAcquisitions:l().default(!1).optional(),hasAnalysis:l(),hasEmployees:l(),hasFundraising:l(),hasNews:l(),productServiceSlug:r(d())}),O=f({defaultCurrency:d().nullish(),foundedYear:o().nullish(),id:e(),image:T,lastModifiedAt:n({offset:!0}).nullish(),nameAlias:r(E),nameBrand:d(),nameLegal:d().nullish(),operatingStatus:d().nullish(),publicId:d().regex(/^e[0-9A-Za-z]{11}$/).nullish(),publicUrl:d().nullish(),sitemap:D.nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255),typeRecord:i,updatedAt:n({offset:!0}).nullish()}),de=f({core:O,fundingDetail:b.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`]),fe=a([`direct`,`managedFund`]),j=f({round:d()}),M=f({amountInvested:u().nullish(),attributionType:fe,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:de.nullish(),id:e(),investorAttribution:M.nullish(),investorCount:o().nullish(),publicSource:k.nullish(),round:d().nullish(),sourceAttribution:r(M),updatedAt:n({offset:!0}).nullish(),valuationPostMoney:u().int().nullish(),valuationPreMoney:u().int().nullish()}),pe=f({fundingStage:y.nullish(),ownership:r(d()),pricingModel:r(d()),sellsTo:r(d()),totalRaised:u().nullish(),website:d().nullish()}),P=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:pe.nullish(),createdAt:n({offset:!0}).nullish(),detail:d().nullish(),entity:O,id:o().nullish(),isCurrent:l().nullish(),isPrimary:l().nullish(),publicSource:k.nullish(),get relationship(){return r(P)},relationshipType:d(),sourceEntityId:e().nullish(),targetEntityId:e().nullish(),updatedAt:n({offset:!0}).nullish()}),F=P,I=f({accelerator:O,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()}),L=a([`text`,`numeric`,`monetary`,`percentage`,`date`]),R=a([`pastDue`,`withinThreeMonths`,`threeToSixMonths`,`sixToTwelveMonths`,`twelveToTwentyFourMonths`,`beyondTwoYears`]),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)))?)?)?$/),bucket:R,monthsFromNow:o(),targetDate:n({offset:!0})}),B=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:z.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:L}),V=f({characterCount:o(),meetsRequirements:l(),violation:r(d()),wordCount:o()}),H=f({compliance:V.nullish(),entityId:e(),id:o(),publicSource:k.nullish(),text:d(),textType:d(),updatedAt:n({offset:!0}).nullish()}),me=f({acceleratorParticipation:r(I),detail:r(B),snippet:r(H)}),U=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()}),he=a([`nickname`,`maidenName`,`formerName`,`stageName`]),W=f({displayable:l().nullish(),name:d(),type:he.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:T,entityName:d().nullish(),entityOperatingStatus:d().nullish(),entitySlug:d().regex(/^[a-z0-9_-]+$/).max(255),entityType:i.nullish(),entityUrlLink:r(C),isCurrent:l().nullish(),personAddress:r(p),personId:e(),personImage:G,personName:d(),personSlug:d().regex(/^[a-z0-9_-]+$/).max(255),personUrlLink:r(C),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()}),ge=f({address:r(p),urlLink:r(C)}),_e=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:T,investorCount:o().nullish(),nameBrand:d(),round:d().nullish(),status:d().nullish(),valuationPostMoney:u().nullish()}),ve=f({entity:O,headquartersCity:d().nullish(),headquartersCountry:d().nullish(),headquartersRegion:d().nullish(),industry:d().nullish()}),q=f({amount:u().nullish(),company:ve,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:_e.nullish(),fundraiseTransactionId:e(),id:d(),investmentDate:n({offset:!0}),investorAttribution:M.nullish(),round:d().nullish()}),J=a([`entity`,`person`,`newsArticle`,`blogPost`,`text`,`classificationTag`,`classificationCode`,`product`,`service`,`agentHelpDoc`,`researchSnippet`,`sourceDocument`]),ye=Object.assign(t([J,d()]),{enum:J.enum}),Y=f({computedAt:n({offset:!0}),cosineDistance:u(),cosineScore:u(),modelVersion:d(),rank:o(),sourceHash:d(),sourceId:d(),sourceType:ye}),X=f({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:Y.nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255),suffix:d().nullish(),text:x,updatedAt:n({offset:!0}).nullish()}),Z=f({articleCount:o().nullish(),association:r(K),core:X,enrichment:ge,investment:r(q),nameAlias:r(W)}),Q=a([`ein`,`secCik`,`ticker`,`lei`,`duns`,`isin`,`cusip`,`crd`,`orcid`,`folk`]),be=Object.assign(t([Q,d()]),{enum:Q.enum}),$=f({createdAt:n({offset:!0}),id:o(),identifier:d(),idType:be,owner:c,source:d().nullish(),updatedAt:n({offset:!0})}),xe=f({core:O,enrichment:w,fundraiseRound:r(N),newsArticle:r(U),person:r(Z),publicUrl:d().nullish(),relationship:r(F),research:me,sitemap:D,uniqueId:r($)});export{S as C,g as E,C as S,_ as T,j as _,Y as a,O as b,U as c,B as d,L as f,M as g,N as h,X as i,H as l,F as m,$ as n,q as o,I as p,Z as r,K as s,xe as t,V as u,A as v,b as w,w as x,k as y};
|