@aventurevc/aventure-cli 0.8.76 → 0.8.78
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 +1 -1
- package/dist/chunks/aventure-cli-hpd3fPE8.js +65 -0
- package/dist/chunks/{client--UaNCLVR.js → client-C3I7JR3D.js} +2 -2
- package/dist/chunks/oauth-bearer-credential-C6L4GeJB.js +11 -0
- package/dist/chunks/{oauth-login-rh8n9t3f.js → oauth-login-BTpHdyLg.js} +4 -4
- package/dist/chunks/oauth-login-Cyl3LbGB.js +1 -0
- package/dist/chunks/openapi-commands-DFLoPm5r.js +1 -0
- package/dist/chunks/provider-catalog-viCxdHql.js +1 -0
- package/dist/chunks/text-field-BSRRAcXA.js +3 -0
- package/dist/chunks/text-response-CXJJHB87.js +14 -0
- package/package.json +3 -3
- package/dist/chunks/aventure-cli-AHys1uqo.js +0 -65
- package/dist/chunks/oauth-bearer-credential-DRYDxm-C.js +0 -11
- package/dist/chunks/oauth-login-BmkZPbTs.js +0 -1
- package/dist/chunks/openapi-commands-D0RBXihY.js +0 -1
- package/dist/chunks/provider-catalog-ufOScOPu.js +0 -1
- package/dist/chunks/text-field-BUdd9Hgw.js +0 -3
- package/dist/chunks/text-response-DVWM84wy.js +0 -14
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{C as e,Di as t,Oi as n,ki as r,x as i}from"./client--UaNCLVR.js";import{C as a,O as o,T as s,i as c,l,n as u,o as d,p as f,r as p,t as m,u as h,v as g,w as _,y as v}from"./person-owner-BJgNYLKX.js";import{a as ee,n as y,o as te,r as b,t as x}from"./text-field-BUdd9Hgw.js";import{C as ne,S as re,T as ie,_ as ae,a as oe,b as S,c as se,d as ce,f as le,g as ue,h as de,i as C,l as fe,m as pe,n as me,o as he,p as ge,r as w,s as _e,t as T,u as ve,v as ye,w as be,x as xe,y as Se}from"./detail-DkA3f27M.js";var E=d([`HIGH`,`MEDIUM`,`LOW`]),Ce=d([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`]),we=v({excerpt:_(),sourceId:_(),sourceType:Ce,sourceVersion:_().nullish()}),Te=v({instruction:_(),operationId:_(),stepKey:_()}),Ee=v({cliCommand:_(),mcpTool:_().nullish(),step:Te}),De=d([`ENTITY`,`TEXT`]),Oe=v({description:_(),key:_(),type:De}),ke=v({catalogRevision:f(),gateId:l(_()),input:l(Oe),step:l(Ee),taskKey:_()}),Ae=d([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),je=v({candidate:l(we),operationId:_().nullish(),outcome:Ae,probability:g().nullish(),taskKey:_().nullish(),taskPlan:ke.nullish()}),Me=v({answer:_(),citation:l(we),confidence:E,resolution:je.nullish()});function Ne(e,t,n=t.inputName){if(t.in===`body`)return n;let r=Ue.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?He(D(n!==`id`&&n!==`slug`?n:`${Ie(e.path)}${ze(n)}`),t):r.inputName}function Pe(e,t,n=Re(e)){return Fe(Le(e,t),new Set(n))}function Fe(e,t){if(!t.has(e))return e;let n=`body${ze(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function Ie(e){return We.find(([,t])=>t.test(e))?.[0]??`record`}function Le(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=Be(t);return He(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?D(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function Re(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>Ne(e,t)))}function ze(e){return e.replace(/^./u,e=>e.toUpperCase())}function D(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 Be(e){let t=D(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?Ve(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function Ve(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function He(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var Ue=[{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`}],We=[[`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 Ge(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>Ke(t,Ne(e,t))),r=(t?.parameter??[]).map(t=>Ke(t,Pe(e,t)));return{selector:n.filter(e=>e.location===`path`||qe(e)),pagination:n.filter(Je),filter:[...n.filter(O),...r.filter(O)],body:r.filter(e=>!O(e))}}function Ke(e,t){return{name:e.in===`body`?t:e.name,flag:i(t),required:e.required,location:e.in,description:e.description||`${e.name} ${e.in} parameter`}}function qe(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function Je(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function O(e){return e.location!==`path`&&!qe(e)&&!Je(e)}function Ye(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:Xe(e)};return t?{...r,resource:e.resource,bodySchemaName:n?.schemaName??null,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:Ge(e)}:r}function Xe(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}var Ze=160;function Qe(e){return!Array.isArray(e)||e.length===0||!e.every($e)?null:`Operation catalog matches\n${e.flatMap(e=>[`${e.operationId} ${e.method} ${e.path} (aventure_${e.intent})`,` ${e.summary}`,` required: ${e.requiredInput.length===0?`none`:e.requiredInput.join(`, `)}`,...`argument`in e?Object.values(e.argument).flat().map(e=>` ${e.name} (${e.location}${e.required?`, required`:``}): ${e.description.length<=Ze?e.description:`${e.description.slice(0,157)}...`}`):[]]).join(`
|
|
2
|
-
`)}\n`}function $e(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 et(t){let n=e=>t.parameter.filter(t=>t.in===e&&t.required&&t.schemaDefault===void 0),r=[...new Set((t.requestBody?.[0]?.requiredPath??[]).map(e=>e.split(/[.[]/u)[0]))];return{tool:e(t.intent),operationId:t.operationId,pathParams:Object.fromEntries(n(`path`).map(tt)),query:Object.fromEntries(n(`query`).map(tt)),...t.requestBody===void 0?{}:{body:Object.fromEntries(r.map(e=>[e,`<${e}>`]))}}}function tt(e){return[e.name,`<${e.name}>`]}function nt(e){let t=k(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function k(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 A=2,rt=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 j(e,t){let n=P(t);n.length!==0&&(e.add(n),(n===`individual`||n===`individuals`)&&j(e,`person`),ot(e,it(n),n),ot(e,at(n),n))}function it(e){if(e===`people`)return`person`;let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=A&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return`${e.slice(0,-3)}y`;if(e.length>A&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`)return e.slice(0,-1)}function at(e){return e===`person`?`people`:e.length>=A&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e)?`${e.slice(0,-1)}ies`:e.endsWith(`s`)?void 0:`${e}s`}function ot(e,t,n){t!==void 0&&t!==n&&t.length>=A&&/^[a-z]+$/u.test(t)&&e.add(t)}function M(e){let t=new Set(N(e)),n=Array.from(t);for(let e of n)j(t,e);return t}function st(e){return N(e).map(M)}function ct(e,t){if(e.length===0)return!1;let n=M(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function N(e){return P(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!rt.has(e))}function P(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 lt=/\b(?:https?:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:\/\S*)?/giu,ut=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/giu,dt=/^[a-z0-9]+(?:-[a-z0-9]+)+$/u,ft=250,pt=40,mt=100;function ht(e,t){let n=new Set,r=[],i=/\bslugs?\b/iu.test(e);return{text:e.replace(ut,()=>(n.add(`uuid`),` `)).replace(lt,e=>{n.add(`url`);let t=e.replace(/^(?:https?:\/\/)?[^/]+/iu,``).split(/[?#]/u)[0].split(`/`).filter(e=>e.length>0).map(e=>e.toLowerCase()),i=t.at(-1);return i!==void 0&&dt.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=dt.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 gt(e,t,n){return e===`uuid`?/(?:^id|Id)$/u.test(t)&&n.includes(`{${t}}`):t===e}function _t(e,t){let n=new Set;for(let r of e){let e=new Set;j(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 vt(e,t,n){if(n.intent!==`read`&&n.intent!==`lookup`)return 0;let r=new Set(N(n.summary)),i=0;for(let t of e.kind)n.directParameterName.some(e=>gt(t,e,n.path))&&(i+=ft,r.has(t)&&(i+=pt));if(i===0)return 0;let a=new Set(N(`${n.summary} ${n.description}`));return(t.size>0?t.has(n.resource):e.urlPathWord.some(e=>{let t=new Set;return j(t,e),[...t].some(e=>a.has(e))}))&&(i+=mt),i}var yt=5,bt=.5,xt=15,St=30,Ct=2;function wt(e,t,n){let r=t.map(e=>({item:e,fields:n(e)})),i=ht(e,new Set(r.flatMap(({fields:e})=>e.cliPath))),a=_t(i.urlPathWord,r.map(({fields:e})=>e)),o=P(i.text);if(o.length===0&&i.kind.size===0)return t.map(e=>({item:e,score:1}));let s=M(o),c=st(o);return r.map(({item:e,fields:t})=>({item:e,fields:t,score:(o.length===0?0:Ot(o,s,c,t))+vt(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 Tt(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)}}function Et(e,t){let n=wt(e.q?.trim()??``,t.filter(t=>Dt(e,t)),Tt),r=(n[0]?.score??0)*bt,i=n.filter(({score:e})=>e>=r),a=e.limit===void 0||!Number.isFinite(e.limit)?yt:e.limit,o=Math.min(i.length,Math.max(0,Math.trunc(a))),s=i.slice(0,o).map(({item:e})=>e),c=s.map(e=>Ye(e,s.length===1));return{summary:`Operation catalog matches`,data:c,counts:{totalOperations:t.length,matched:i.length,returned:c.length}}}function Dt(e,t){let n=e.root?.trim().toLowerCase();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 Ot(e,t,n,r){let i=jt(r),a=kt(r),o=0;i.some(t=>t===e)&&(o+=100),i.some(t=>t.includes(e))&&(o+=40),o+=At(e,i);let s=new Set(i.flatMap(N));for(let e of t)i.some(t=>t===e)?o+=20:s.has(e)&&(o+=8);for(let e of r.cliPath){let n=new Set;j(n,e),[...n].some(e=>t.has(e))&&(o+=xt)}ct(n,a)&&(o+=200),r.parameterName.some(t=>P(t)===e)&&(o+=St);let c=new Set(r.parameterDescription.flatMap(N));for(let e of t)c.has(e)&&(o+=Ct);return o+=Nt(t,r.enumParameter),[`list`,`search`,`find`,`browse`].some(e=>t.has(e))&&/^(?:list|search)[A-Z]/u.test(r.operationId)&&(o+=30),o-=Mt(e,t,r.description),o}function kt(e){return[e.operationId,e.cliPath.join(` `),e.summary].map(P).filter(e=>e.length>0)}function At(e,t){let n=N(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 jt(e){return[...new Set([e.operationId,e.method,e.path,e.resource,e.intent,e.cliPath.join(` `),e.summary,k(e.description).useFor||e.description].map(P).filter(e=>e.length>0))]}function Mt(e,t,n){let r=P(k(n).notFor);if(r.length===0)return 0;let i=r.includes(e)?40:0,a=new Set(N(r));for(let e of t)r===e?i+=20:a.has(e)&&(i+=8);return i}function Nt(e,t){let n=0;for(let{values:r,direct:i}of t)r.some(t=>Pt(e,t))&&(n+=i?40:10);return n}function Pt(e,t){let n=N(t);return n.length>0&&n.every(t=>e.has(t))}var Ft=3,It=200;function Lt(e,n){let{operationId:r}=e;if(r===void 0||n.some(e=>e.operationId===r))return null;let i=Et({q:[r,...Rt(e)].join(` `),limit:Ft},n),a=i.summary===`Operation catalog matches`?i.data:[],o=a.map(e=>`${e.operationId} (${e.method} ${e.path})`);return t(`Operation ${r} is not in the MCP catalog.${o.length===0?``:` Closest operations: ${o.join(`, `)}.`}`,a.map(e=>`Use operationId ${e.operationId} with aventure_${e.intent}: ${e.method} ${e.path}; required inputs: ${e.requiredInput.length===0?`none`:e.requiredInput.join(`, `)}.`))}function Rt(e){let t=e.body,n=typeof t==`object`&&t&&!Array.isArray(t)?Object.entries(t):[];return[...Object.entries(e.pathParams??{}),...Object.entries(e.query??{}),...n].flatMap(([e,t])=>typeof t==`string`&&t.length<=It?[e,t]:[e])}function zt(e){return typeof e.data==`object`&&e.data!==null&&`response`in e.data?e.data.response:void 0}async function Bt(e,r,i,a){let o=e.q?.trim()??``;if(o.length===0)return t(`Provide q to resolve a request to one operation.`);let s=i.find(({resource:e,intent:t,deprecated:n})=>e===`help`&&t===`search`&&n!==!0);if(s===void 0)return t(`This build ships no help resolve operation.`);let c=await a(s,{body:{question:o,resolve:!0,...e.scope===void 0?{}:{scope:e.scope===`read`?`READ`:`WRITE`}}});if(!c.ok)return{...c,data:null};let l=Me.safeParse(zt(c));if(!l.success||l.data.resolution==null)return t(`The help resolve operation returned no resolution.`);let{answer:u,resolution:d}=l.data,f=e=>r.find(t=>t.operationId===e),p=f(d.operationId),m=d.taskPlan??void 0,h=(m?.step??[]).map(({step:e})=>({...e,contract:f(e.operationId)})),g=[...d.operationId!=null&&p===void 0?[d.operationId]:[],...h.filter(({contract:e})=>e===void 0).map(e=>e.operationId)];return n(`Help resolution`,{outcome:d.outcome,probability:d.probability,answer:u,candidate:d.candidate.map(({sourceId:e})=>e),...p===void 0?{}:{operation:{operationId:p.operationId,apiRoute:`${p.method} ${p.path}`,...nt(p),bodySchemaName:p.requestBody?.[0]?.schemaName??null,mcpCall:et(p)}},...d.taskKey==null?{}:{taskKey:d.taskKey},...m===void 0?{}:{taskPlan:{taskKey:m.taskKey,catalogRevision:m.catalogRevision,input:m.input,gateId:m.gateId,step:h.map(({contract:e,...t})=>e===void 0?t:{...t,mcpCall:et(e)})}}},{warnings:g.map(e=>`Operation ${e} is not callable on this connection.`)})}var Vt=v({detail:_(),field:_().nullish(),scope:d([`entity`,`person`,`news`])}),Ht=s([d([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),_()]),F=v({modeRequested:Ht,modeUsed:Ht}),Ut=v({entity:F,news:F,person:F,rejection:l(Vt),unavailable:l(d([`entity`,`person`,`news`]))}),Wt=v({acceleratorParticipation:l(ge),detail:l(ce)}),I=v({core:S,enrichment:xe,fundraiseRound:l(ue),research:Wt,semanticMatch:oe.nullish()}),Gt=d([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),Kt=v({compositeScore:g().nullish(),cosineScore:g().nullish(),curatedAsOf:p().nullish(),curatedRelationshipType:_().nullish(),curatedSource:_().nullish(),derivedFromEntityId:o().nullish(),matchedSectionWeight:g().nullish(),origin:Gt,rank:f(),sharedSectionCount:f().nullish()}),qt=v({entity:I,similarity:Kt}),Jt=d([`aventureBlog`,`personalBlog`,`employerBlog`,`linkedin`,`xTwitter`,`medium`,`substack`,`other`]),Yt=v({author:_().nullish(),createdAt:c({offset:!0}),externalId:_().nullish(),id:o(),isCurrent:h(),lastFetchedAt:c({offset:!0}).nullish(),mentionedEntityId:l(o()),mentionedPersonId:l(o()),owner:m,publishedAt:c({offset:!0}).nullish(),summary:_().nullish(),summaryGeneratedAt:c({offset:!0}).nullish(),title:_().nullish(),topic:_().nullish(),type:Jt,updatedAt:c({offset:!0}),url:_()}),Xt=d([`low`,`medium`,`high`]),Zt=v({asOfDate:c({offset:!0}).nullish(),dataConfidence:Xt.nullish(),dateValue:c({offset:!0}).nullish(),numericValue:g().nullish(),referenceValue:_().nullish(),source:_().nullish(),textValue:_().nullish(),updatedAt:c({offset:!0}).nullish(),valueType:le}),Qt=v({asOfDate:c({offset:!0}),fact:Zt,id:_()}),$t=v({fundraiseInvestorJoin:h(),fundraiseTransaction:h(),operatingStatus:h(),relationship:h()}),en=d([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),tn=d([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),nn=v({acquiredEntity:S,acquirerEntity:S,amount:g().int().nullish(),announcedAt:c({offset:!0}).nullish(),asOf:p().nullish(),completedAt:c({offset:!0}).nullish(),createdAt:c({offset:!0}).nullish(),currency:_().nullish(),dataConfidence:Se.nullish(),evidence:$t,fundraiseTransactionId:o().nullish(),investorJoinId:o().nullish(),publicSource:de.nullish(),relationshipId:f(),status:en,transactionStatus:tn.nullish(),updatedAt:c({offset:!0}).nullish()}),rn=d([`SAFE`,`Convertible Note`,`Preferred Stock`,`Common Stock`,`Other Equity`,`Bond`,`Loan`,`Other Debt`,`Grant`,`Token`]),an=v({amountInvested:g().nullish(),createdAt:c({offset:!0}),financialInstrumentType:rn.nullish(),id:o(),investor:m,leadInvestor:h(),transactionId:o(),updatedAt:c({offset:!0})}),on=v({entity:T,investorAttribution:l(ae),round:l(ye),roundCount:f()}),sn=v({core:S,similarity:Kt,urlLink:l(re)}),cn=v({compliance:ve.nullish(),createdAt:c({offset:!0}).nullish(),id:f(),isCurrent:h().nullish(),isPrimary:h().nullish(),language:_().nullish(),owner:m,text:_(),textName:_().nullish(),textType:_(),updatedAt:c({offset:!0}).nullish()}),ln=d([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),un=d([`fundraiseRound`,`researchDetail`]),dn=d([`preMoney`,`postMoney`,`reported`]),fn=v({amountRaised:g().int().nullish(),asOfDate:c({offset:!0}),confidence:Xt,currency:_(),declaredBasis:dn,derivation:ln,detailId:f().nullish(),label:_().nullish(),source:un,sourceRef:_(),valuationPostMoney:g().int().nullish(),valuationPreMoney:g().int().nullish()}),pn=v({createdAt:c({offset:!0}).nullish(),description:_().nullish(),forkCount:f(),githubId:g().int(),homepageUrl:_().nullish(),id:g().int(),isArchived:h(),isFork:h(),language:_().nullish(),license:_().nullish(),name:_(),ownerLogin:_(),repoCreatedAt:c({offset:!0}).nullish(),repoPushedAt:c({offset:!0}).nullish(),stargazerCount:f(),topic:l(_()),updatedAt:c({offset:!0}).nullish(),url:_()}),L=v({empty:h().optional(),sorted:h().optional(),unsorted:h().optional()}),R=v({offset:g().int().optional(),paged:h().optional(),pageNumber:f().optional(),pageSize:f().optional(),sort:L.optional(),unpaged:h().optional()}),mn=v({investorAttribution:l(ae),person:w,round:l(ye),roundCount:f()}),hn=d([`precomputed`,`live`]),gn=v({compositeScore:g().nullish(),cosineScore:g().nullish(),matchedSectionWeight:g().nullish(),origin:hn,rank:f(),sharedSectionCount:f().nullish()}),_n=v({currentRole:_e.nullish(),person:C,similarity:gn}),vn=d([`by`,`about`]),yn=d([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),bn=v({canonicalUrl:_().nullish(),contentId:_(),contentType:yn,createdAt:c({offset:!0}).nullish(),publishedAt:c({offset:!0}).nullish(),relation:vn.nullish(),sourceDomain:_().nullish(),sourceName:_().nullish(),summary:_().nullish(),title:_(),topic:_().nullish(),updatedAt:c({offset:!0}).nullish(),url:_().nullish(),year:f().nullish()});v({content:l(Yt).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(s([ie,be])).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(Qt).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(S).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(nn).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(T).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(an).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(ue).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(on).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(I).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(_e).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(pe).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(ce).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(fe).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(qt).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(sn).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(cn).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(re).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(fn).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(pn).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(se).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(C).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(w).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(he).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(mn).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(_n).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()}),v({content:l(bn).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()});var xn=v({content:l(I),number:f(),size:f(),totalElements:g().int(),totalPages:f()}),Sn=v({content:l(se),number:f(),size:f(),totalElements:g().int(),totalPages:f()}),Cn=v({content:l(C),number:f(),size:f(),totalElements:g().int(),totalPages:f()});v({content:l(me).optional(),empty:h().optional(),first:h().optional(),last:h().optional(),number:f().optional(),numberOfElements:f().optional(),pageable:R.optional(),size:f().optional(),sort:L.optional(),totalElements:g().int().optional(),totalPages:f().optional()});var wn=s([d([`entityRecord`,`researchSnippet`,`newsArticle`]),_()]),Tn=v({entityId:o(),source:wn,sourceId:_()}),En=v({citation:l(Tn),text:_(),topic:_().nullish()}),Dn=v({citation:l(Tn),confidence:E,paragraph:l(En),relatedQuery:l(_()),text:_()}),On=v({sortPriority:d([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),z=v({max:g().nullish(),min:g().nullish()}),B=v({max:f().nullish(),min:f().nullish()}),kn=v({averageAmountInvestedUsdRange:l(z).optional(),largestAmountInvestedUsdRange:l(z).optional(),smallestAmountInvestedUsdRange:l(z).optional(),totalAmountInvestedUsdRange:l(z).optional(),totalInvestmentRange:l(B).optional()}),An=v({amountInvestedRange:l(z).optional(),amountRaisedRange:l(z).optional(),investedCompanyName:l(_()).optional(),investorActivity:kn.optional(),lastRoundYearRange:l(B).optional(),round:l(_()).optional(),totalRaisedRange:l(z).optional(),valuationRange:l(z).optional()}),jn=d([`NONE`,`COMPANY_LISTING_READY`]),Mn=d([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),Nn=d([`hostPath`,`domain`]),Pn=a({acceleratorBrand:l(_()).optional(),acceleratorCohort:l(_()).optional(),acceleratorName:l(_()).optional(),acceleratorStatus:l(_()).optional(),affinity:l(_()).optional(),closedLast:h().optional(),employeeCountRange:l(B).optional(),entityId:l(o()).optional(),entityName:l(_()).optional(),featured:h().nullish(),fundraiseActivity:An.optional(),hasFundraising:h().nullish(),headquartersCity:l(_()).optional(),headquartersCountry:l(_()).optional(),headquartersState:l(_()).optional(),industry:l(_()).optional(),letter:_().nullish(),location:l(_()).optional(),logoOption:On.optional(),mainProduct:l(_()).optional(),operatingStatus:l(Mn).optional(),person:l(_()).optional(),portfolioHeadquartersCity:l(_()).optional(),portfolioHeadquartersCountry:l(_()).optional(),portfolioHeadquartersState:l(_()).optional(),qualityGate:jn.optional(),semanticQuery:_().nullish(),slug:l(_().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:l(_()).optional(),suppressNonOperating:h().nullish(),suppressZeroTotalRaised:h().nullish(),tag:l(_()).optional(),textSearch:_().nullish(),typeCustomer:l(_()).optional(),typeModel:l(_()).optional(),typeOwnership:l(_()).optional(),typeRecord:l(u).optional(),typeRevenue:l(_()).optional(),typeTechnologyUsed:l(_()).optional(),url:_().nullish(),urlDomain:_().nullish(),urlMatchMode:Nn.nullish(),urlType:ne.nullish(),yearFoundedRange:l(B).optional()}),Fn=d([`discovery`,`profile`,`peer`,`comparison`]),In=d([`keyword`,`semantic`]),Ln=v({descending:h(),field:d([`ID`,`NAME_BRAND`,`YEAR_FOUNDED`,`STATUS_OPERATING`,`UPDATED_AT`,`CREATED_AT`,`TOTAL_RAISED`,`AMOUNT_INVESTED`,`RECENT_INVESTMENT_AT`,`STAGE`,`MOST_RECENT_AMOUNT`,`LATEST_VALUATION`,`MOST_RECENT_DATE`,`ACCELERATOR_BRAND`,`ACCELERATOR_COHORT`,`HEADQUARTERS_COUNTRY`,`EMPLOYEE_COUNT`])}),Rn=v({order:l(Ln),relevance:In.nullish()}),zn=v({confidence:E,execution:F,fallbackUsed:h(),filter:Pn,intent:Fn,interpretation:_(),sort:Rn,subjectEntityName:l(_()),unsupported:_().nullish()}),Bn=v({entity:I,probability:g(),webUrl:l(_())}),Vn=v({entityId:o(),label:_(),publishedAt:c({offset:!0}).nullish(),score:g(),source:wn,sourceId:_(),text:_(),url:_().nullish()}),Hn=v({answer:Dn.nullish(),interpretation:zn,judgment:l(Bn),passage:l(Vn),peer:l(qt),pendingWebQuery:l(_()),result:xn,subject:l(I)}),Un=d([`auto-match`,`needs-review`,`approved`,`rejected`]),Wn=v({createdAt:c({offset:!0}),entityId:o(),href:_().nullish(),internal:h(),matchStatus:Un.nullish(),mention:_().nullish(),slug:_().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:u.nullish(),updatedAt:c({offset:!0})}),Gn=v({entity:l(Wn),newsId:f()}),Kn=v({amountInvestedRange:l(z).nullish(),amountRaisedRange:l(z).nullish(),entityName:l(_()).nullish(),investedCompany:l(_()).nullish(),personTitle:l(_()).nullish(),round:l(_()).nullish(),totalInvestmentCount:l(B).nullish(),typeRecord:l(u).nullish()}),qn=v({arrayFilter:Kn.optional(),entityId:o().nullish(),entitySlug:_().nullish(),firstName:_().nullish(),includeAddress:h().nullish(),includeUrl:h().nullish(),investorActivity:kn.optional(),isCurrent:h().nullish(),lastName:_().nullish(),letter:_().nullish(),personId:l(o()).max(200).optional(),personName:l(_()).optional(),role:_().nullish(),search:_().nullish(),semanticQuery:_().nullish(),status:_().nullish()}),Jn=v({descending:h(),field:d([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`])}),Yn=v({order:l(Jn),relevance:In.nullish()}),Xn=v({confidence:E,execution:F,fallbackUsed:h(),filter:qn,interpretation:_(),sort:Yn,unsupported:_().nullish()}),Zn=v({interpretation:Xn,result:Cn}),Qn=v({entity:Hn,entityDetail:l(T),news:Sn,newsEntityMention:l(Gn),person:Zn,personDetail:l(w),provenance:Ut}),$n=120,er=`aventure`,V=30,tr=8,H=10,nr=2,rr=[`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`],ir=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]),ar=[`interpretation`,`confidence`,`unsupported`,`execution`,`fallbackUsed`],or=new Map(te.map(({operationId:e,projection:t})=>[e,`${er} ${t.cliPath.join(` `)}`]));function sr(e,t){if(typeof e==`string`)return y(e);let n=Qe(e);if(n!==null)return n;let r=vr(e);if(r===null)return null;let{response:i,hiddenNote:a}=ee(r.operationId,r.response),o={...r,response:i},s=yr(o.response);if(s!==null)return`${Er(s.map(y)).join(`
|
|
3
|
-
`)}\n`;let c=cr(o.response,o.endpoint);if(c!==null)return`${[...Er(c),...a].join(`
|
|
4
|
-
`)}\n`;let l=o.summary??t??o.operationId??`OpenAPI call succeeded`,u=fr(o);return`${[...Er([l,`${o.method} ${o.endpoint}`,...u].filter(e=>e.length>0)),...a].join(`
|
|
5
|
-
`)}\n`}function cr(e,t){if(e===void 0||!X(e)||!(`entity`in e&&`person`in e&&`news`in e))return null;let n=Qn.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o}=n.data,s=r.answer;return[...s==null?[]:lr(s),...o.unavailable.map(e=>`${e} unavailable: retry this scope later`),...o.rejection.map(({scope:e,detail:t})=>b(`${e} rejected: ${t}`)),[`entities:`,...U(r.result,t,void 0)].join(`
|
|
6
|
-
`),[`people:`,...U(i.result,t,void 0)].join(`
|
|
7
|
-
`),[`news:`,...U(a,t,void 0)].join(`
|
|
8
|
-
`)]}function lr(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${b(e)}`).join(`
|
|
9
|
-
`)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>b(` - ${e}:${t} entity=${n}`)).join(`
|
|
10
|
-
`)}`;return[`answer:\n ${y(e.text).replaceAll(`
|
|
11
|
-
`,`
|
|
12
|
-
`)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function ur(e){let t=vr(e)?.response,n=t!==void 0&&X(t)?t.interpretation:void 0;if(n===void 0||!X(n))return null;let r=F.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=K(n.filter??null),{unsupported:s,fallbackUsed:c}=n;return`${[`strategy: requested=${i} used=${a}`,...o!==void 0&&X(o)?[`constraints:`,...Object.entries(o).map(([e,t])=>` ${e}: ${dr(t)}`)]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``].filter(Boolean).join(`
|
|
13
|
-
`)}\n`}var dr=e=>Z(e)?b(e):Array.isArray(e)&&e.every(Z)?e.map(e=>b(e)).join(`, `):JSON.stringify(e);function fr(e){let{response:t,method:n,endpoint:r,nextCursor:i,httpStatus:a,location:o}=e;if(t===void 0)return o!==void 0&&a!==void 0?[`status=${a} redirect=${o}`]:a===void 0?[]:[`status=${a} no response body`];let s=a===void 0||n===`GET`?``:`status=${a}`,c=X(t)&&!J(t)?br(t):null,l=c===null?void 0:X(c.context.interpretation)?K(c.context):c.context,u=l!==void 0&&X(l)?Object.entries(l):[],d=u.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(X)),f=new Set(d.map(([e])=>e)),p=Object.fromEntries(u.filter(([e])=>!f.has(e)));return[s,...J(t)?U(t,r,i):c===null?Sr(t)?hr(t.filter,t.meta):Cr(t)?hr([...t.arrayFilterEntry,...t.rangeFilterEntry],t.filtersMeta):wr(t)?gr(t):W(t,``):[...U(c.page,r,i),...Object.keys(p).length===0?[]:W(p,``),...d.flatMap(([e,t])=>[`${e}:`].concat(pr(t)))]].filter(Boolean)}function U(e,t,n){let r=_r(t);return[`rows=${e.numberOfElements??e.content.length}${e.number===void 0?``:` page=${e.number}`}${e.size===void 0?``:` size=${e.size}`}${e.totalElements===void 0?``:` total=${e.totalElements}`}${e.totalPages===void 0?``:` totalPages=${e.totalPages}`}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${$(n)}`,...pr(e.content)].filter(Boolean)}function pr(e){let t=e.filter(X);if(t.length===0)return e.length===0?[`(empty)`]:G(e,``);let n=mr(t);if(n.length===0)return G(e.slice(0,V),``);let r=t.slice(0,V).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)=>Tr(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>V&&s.push(`... ${t.length-V} more rows`),s}function mr(e){let t=new Set(e.flatMap(e=>Object.keys(q(e)))),n=rr.filter(e=>t.has(e)),r=[...t].filter(e=>!n.includes(e)).filter(e=>!e.toLowerCase().includes(`logo`)).slice(0,tr-n.length);return[...n,...r].slice(0,tr)}function hr(e,t){let n=t!==void 0&&X(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,H).forEach(e=>{i.push(` ${Q(t.filterKey)} ${$(e.value)}`)}),e>H&&i.push(` ... ${e-H} more shown`)}return i}function gr(e){let t=Q(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,H).map(e=>`${t} ${$(e)}`),e.result.length>H?`... ${e.result.length-H} more matches`:``].filter(Boolean)}function _r(e){let t=e.indexOf(`?`);return t<0?[]:[...new URLSearchParams(e.slice(t+1)).entries()].filter(([e,t])=>!ir.has(e)&&t.length>0).map(([e,t])=>`${Q(e)} ${$(t)}`)}function vr(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=Reflect.get(e,`method`),n=Reflect.get(e,`endpoint`);if(typeof t!=`string`||typeof n!=`string`)return null;let i=Reflect.get(e,`operationId`),a=Reflect.get(e,`summary`),o=Reflect.get(e,`httpStatus`),s=Reflect.get(e,`location`),c=Reflect.get(e,`nextCursor`),l=Reflect.get(e,`response`),u=l===void 0?void 0:r.safeParse(l);return u!==void 0&&!u.success?null:{method:t,endpoint:n,httpStatus:typeof o==`number`?o:void 0,location:typeof s==`string`?s:void 0,operationId:typeof i==`string`?i:void 0,summary:typeof a==`string`?a:void 0,nextCursor:typeof c==`string`&&c.length>0?c:void 0,response:u?.data}}function W(e,t,n){if(e===void 0)return[];if(Z(e))return[`${t}${x(e,n)}`];if(Array.isArray(e))return G(e,t,n);let r=[];for(let[n,i]of Object.entries(e)){if(Z(i)){r.push(`${t}${n}: ${x(i,n)}`);continue}r.push(`${t}${n}:`);for(let e of W(i,`${t} `,n))r.push(e)}return r.length===0?[`${t}(empty)`]:r}function G(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e){if(Z(i)){r.push(`${t}- ${x(i,n)}`);continue}r.push(`${t}-`);for(let e of W(i,`${t} `))r.push(e)}return r}function K(e){if(Z(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([...ar.flatMap(e=>t.filter(([t])=>t===e)),...t.filter(([e])=>!ar.includes(e))])}function yr(e){let t=Me.safeParse(e);if(!t.success)return null;let{answer:n,citation:r,confidence:i}=t.data,a=n.trimEnd().split(`
|
|
14
|
-
`),o=new Set(r.flatMap(({sourceType:e,sourceId:t})=>{if(e!==Ce.enum.OPERATION)return[];let n=or.get(t);return n===void 0?[]:[n]}));return o.size>0&&a.push(``,`Commands:`,...[...o].map(e=>` ${e}`)),a.push(``,`Confidence: ${i}`),r.length===0?a:(a.push(`Sources (${r.length}):`),a.push(...r.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`})),a)}function q(e,t=``,n=0){return Z(e)?t.length===0?{}:{[t]:b(e,t)}:n>nr?{}:Array.isArray(e)?e.length===0?{}:q(e[0],t,n+1):Object.fromEntries(Object.entries(e).flatMap(([e,r])=>{let i=t.length===0?e:`${t}.${e}`;return Z(r)?[[i,b(r,i)]]:Object.entries(q(r,i,n+1))}))}var J=e=>X(e)&&Array.isArray(e.content);function br(e){let[t,...n]=Object.entries(e).filter(e=>J(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 xr(e){return X(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var Sr=e=>X(e)&&Y(e.filter),Cr=e=>X(e)&&Y(e.arrayFilterEntry)&&Y(e.rangeFilterEntry),Y=e=>Array.isArray(e)&&e.every(xr),wr=e=>X(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),X=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Z=e=>typeof e!=`object`||!e,Q=e=>`--${e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}`,$=e=>/^[A-Za-z0-9._:/@-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`,Tr=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(0,t-3))}...`,Er=e=>e.length<=$n?e:[...e.slice(0,$n),`... ${e.length-$n} more lines: the record continues past this fold; read the omitted section through its sub-resource operation (aventure_help names it), or request responseFormat json for the whole record.`];export{Et as a,P as c,wt as i,ur as n,Bt as o,Lt as r,j as s,sr as t};
|