@aventurevc/mcp-server 0.8.293 → 0.8.295
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/chunks/{cli-help-policy-EqwYSBOi.js → cli-help-policy-Deq2HK0N.js} +1 -1
- package/dist/chunks/{contract-B6QqVAgo.js → contract-CX9HAGHi.js} +1 -1
- package/dist/chunks/{contract-parameter-DZFV8Cs1.js → contract-parameter-mZS0c0XX.js} +1 -1
- package/dist/chunks/detail-DWGAxQCw.js +1 -0
- package/dist/chunks/{env-nPHH8Y1V.js → env-IO7LXlXt.js} +1 -1
- package/dist/chunks/{env-B0nFdXns.js → env-PI64cCwx.js} +1 -1
- package/dist/chunks/{help-catalog-B8JUR6zB.js → help-catalog-C6fkJKH5.js} +1 -1
- package/dist/chunks/{help-intent-CGB8sWuW.js → help-intent-BC2IFohN.js} +1 -1
- package/dist/chunks/{logging-D5jL7iVk.js → logging-ButsTw7E.js} +1 -1
- package/dist/chunks/{logging-BLz3ITZ8.js → logging-zxCFTikI.js} +1 -1
- package/dist/chunks/mcp-generation-contract-BHut-X7K.js +1 -0
- package/dist/chunks/{oauth-discovery-z7QeRYlm.js → oauth-discovery-D18Ujgll.js} +1 -1
- package/dist/chunks/{openapi-call-Ch3_9dpf.js → openapi-call-DDz4nz41.js} +2 -2
- package/dist/chunks/openapi-snapshot.json +1 -1
- package/dist/chunks/{output-spill-CuQ24_Xn.js → output-spill-BF9ZDkbV.js} +1 -1
- package/dist/chunks/{request-replay-zWu_6Sak.js → request-replay-kYYWaojV.js} +1 -1
- package/dist/chunks/{response-problem-B6bUo9co.js → response-problem-DYOsRJri.js} +1 -1
- package/dist/chunks/result-envelope-C32KU3bV.js +1 -0
- package/dist/chunks/{sentry-DPdcv0tK.js → sentry-DbaEE272.js} +1 -1
- package/dist/chunks/{sentry-DKiL1mSi.js → sentry-DmtQl7sX.js} +1 -1
- package/dist/chunks/{streamable-http-B5uJtOCN.js → streamable-http-BbfFvywQ.js} +39 -39
- package/dist/chunks/text-response-B-gFFhrz.js +17 -0
- package/dist/chunks/{tool-policy-BnoDi0Yk.js → tool-policy-D9D165gJ.js} +1 -1
- package/dist/mcp-server/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/detail-CB3r4S8B.js +0 -1
- package/dist/chunks/mcp-generation-contract-hMifAAQ-.js +0 -1
- package/dist/chunks/result-envelope-5DwGbGQt.js +0 -1
- package/dist/chunks/text-response-P41LwuTT.js +0 -17
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,E as t,S as n,_ as r,a as i,b as a,c as o,d as s,g as c,i as l,n as u,p as d,s as f,w as p}from"./iso-l1vOidnb.js";import{t as m}from"./person-owner-BRGa5Dee.js";import{t as h}from"./type-C0VR7LD-.js";import{t as ee}from"./allowance-type-COW05L2h.js";import{Buffer as g}from"node:buffer";var _=d(()=>e([n(),c(),o(),i(),f(_),a(n(),_)])),v=l([`URL_DUPLICATE`,`STRICT_URL_LOOKUP`,`DUPLICATE_CREATE_REVIEW`,`CLASSIFICATION_INACTIVE_TAG`,`NEWS_SOURCE_URL`]),y=Object.assign(e([v,n()]),{enum:v.enum}),te=l([`REACTIVATE`,`ATTACH_INACTIVE`]),ne=r({availableOverrides:f(te),conflictType:y,slug:n(),tagId:s()}),b=r({externalId:n().nullish(),id:s(),publicationScore:s(),reason:f(n()),score:s(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish()}),x=r({externalId:n().nullish(),id:t(),name:n().nullish(),operatingStatus:n().nullish(),publicPath:n().nullish(),reason:f(n()),score:s().optional(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:h.nullish()}),S=r({candidate:f(x).nullish(),conflictType:y,newsCandidate:f(b).nullish(),overridePath:n().nullish(),threshold:s()}),C=r({conflictingArticleId:s(),conflictingArticleSlug:n(),conflictingArticleTitle:n(),conflictType:y}),w=r({candidateEntityId:f(t()),candidatePersonId:f(t()),conflictType:y,hint:n(),normalizedUrl:n().nullish(),url:n(),urlType:n().nullish()}),T=r({owner:m,urlId:s()}),re=r({conflictType:y,existingJoin:f(T),fragmentIgnored:o(),guidance:n(),normalizedUrl:n().nullish(),requestedOwner:m,url:n(),urlType:n()}),ie=e([re,w,S,ne,C]),ae=r({acceptedValue:f(n()).nullish(),action:l([`setField`,`setParameter`,`removeParameter`,`useEndpoint`,`reviewCandidates`,`authenticate`]),endpoint:n().nullish(),fieldPath:n().nullish(),parameter:n().nullish(),retryable:o().nullish()}),E=l([`source`,`record`,`disclaimer`,`voice`,`marketing`,`chained`,`structured`,`tense`,`temporal`,`factList`,`mojibake`,`markup`,`unsupported`,`legalSource`,`textContract`,`evidenceAuthority`,`internalRepetition`,`analysis`]),oe=Object.assign(e([E,n()]),{enum:E.enum}),se=r({overridable:o(),passage:n(),problem:oe,reason:n()}),D=l([`entity`,`person`,`news`,`blog`,`content`]),ce=r({deletedAt:u({offset:!0}).nullish(),id:n(),isHidden:o(),nameBrand:n().nullish(),resourceType:D,showOnSitemap:o(),slug:n()}),le=r({newUrl:n().nullish(),oldUrl:n(),targetCurrentSlug:n().nullish(),targetId:n().nullish(),targetResourceType:D.nullish()}),O=r({allowanceType:ee.nullish(),circuitBreaker:n().nullish(),code:e([l(`async_lookup_sign_in_required.not_authorized.rateLimited.rate_limited.subscription_required.subscription_canceled.subscription_past_due.subscription_paused.billing_allowance_exhausted.billing_additional_usage_cap_reached.billing_credit_checkout_closed.account_exists.origin_detail_capacity.origin_detail_shutdown.query_deadline_shed.suspectedShellStrip.suspected_shell_strip.prose_rejected.fundraise_evidence_unsupported.website_not_own_live_site.cvc_inherited_headcount.source_grounding_at_capacity.url_surface_misclassification.JOBRUNR_DISABLED.jobrunr_disabled.task_plan_operation_unserved.JOBRUNR_STORAGE_UNAVAILABLE.jobrunr_storage_unavailable.rbac_lookup_unavailable.GEOCODE_PROVIDER_ERROR.geocode_provider_error.sentry_api_error.frontend_cache_epoch_mode_not_targeted.image_blocklist_match.image_monochrome.image_too_small.image_wrong_aspect.image_monogram.image_unreadable.image_processing_error.image_brand_mismatch.image_reference_unavailable.logo_first_party_missing.logo_source_dead.image_photographic.web_crawl_fetch_failed.source_document_fetch_busy.primary_website_missing.news_rss_feed_fetch_failed.news_rss_article_fetch_failed.callback_connection_refused.callback_timeout.callback_tls_error.callback_http_4xx.callback_http_5xx.callback_challenge_failed.news_subscription_limit.r2_fetch_failed.r2_delete_failed.r2_upload_failed.source_document_body_unavailable.source_document_capture_limit_exceeded.news_similarity_embedding_unavailable.search_provider_not_configured.search_provider_error.search_still_running.lookup_still_running.sec_edgar_fetch_failed.github_fetch_failed.INFERENCE_PROVIDER_ERROR.inference_provider_error.INFERENCE_PROVIDER_RESPONSE_EMPTY.inference_provider_response_empty.INFERENCE_PROVIDER_INVALID_JSON.inference_provider_invalid_json.INFERENCE_PROFILES_MISSING.inference_profiles_missing.INFERENCE_PROFILE_API_KEY_MISSING.inference_profile_api_key_missing`.split(`.`)),n().max(128)]).nullish(),conflictingRecord:ce.nullish(),detail:n().optional(),details:ie.nullish(),disposition:l([`TRANSIENT`,`TERMINAL`]).nullish(),error:a(n(),n()).nullish(),existingRecordId:n().nullish(),existingRedirect:le.nullish(),feId:n().nullish(),field:n().nullish(),filedRunId:f(t()).nullish(),hammingDistance:c().int().nullish(),hint:n().nullish(),instance:n().optional(),limit:c().int().nullish(),limitType:e([l([`FORM`,`GLOBAL`,`SUBNET`,`IP`,`UNKNOWN`,`RESILIENCE4J`,`WEB_SEARCH`,`AGENT_HELP`,`NATURAL_SEARCH`,`BILLING_ALLOWANCE`,`BILLING_ADDITIONAL_USAGE`,`CLERK_PUBLIC_ADMISSION`,`CLERK_SCRIPT_LOAD`,`ORIGIN_DETAIL`,`INFERENCE_PROVIDER`]),n()]).nullish(),matchedBlocklistKey:n().nullish(),mediaType:n().nullish(),moderationReason:n().nullish(),path:n().nullish(),properties:a(n(),_).optional(),proseViolation:f(se).nullish(),remaining:c().int().nullish(),requiredRole:n().nullish(),resetAt:u({offset:!0}).nullish(),resolution:ae.nullish(),retryAfterSeconds:c().int().nullish(),spanId:n().nullish(),status:s().optional(),suggestion:n().nullish(),suggestions:a(n(),n()).nullish(),suspectedFragment:n().nullish(),title:n().optional(),traceId:n().nullish(),type:n().optional(),unknownParameters:f(n()).nullish(),used:c().int().nullish(),validParameters:f(n()).nullish(),value:n().nullish(),windowSeconds:c().int().nullish()}),ue=e=>e>=400&&e<500,de=e=>e>=500&&e<600,fe=1048576;function k(e){return e.ok&&e.operationId===`searchFederated`}function A(e,t=fe){if(!k(e))return;let n=`Search exceeds the ${t}-byte transport budget; the full result was retained without trimming.`;return e.warnings.includes(n)||g.byteLength(JSON.stringify(e),`utf8`)<=t?e:{...e,warnings:[...e.warnings,n]}}var j=e([n(),c(),o()]),M=r({number:c().optional(),size:c().optional(),numberOfElements:c().optional(),totalElements:c().optional(),totalPages:c().optional(),first:o().optional(),last:o().optional(),empty:o().optional()}),N=r({byteLength:c(),maxBytes:c(),omitted:f(n()),recovery:n()}),P=r({status:c(),title:n(),type:n()}).catchall(_.optional()).and(O),F=r({ok:o(),summary:n(),httpStatus:c().optional(),operationId:n().optional(),method:n().optional(),endpoint:n().optional(),format:l([`json`,`text`]).optional(),count:c().optional(),page:M.optional(),filters:a(n(),e([j,f(j)])).optional(),truncated:o().optional(),trimmed:f(n()).optional(),truncation:N.optional(),omitted:f(n()).default([]),ids:f(n()).default([]),counts:a(n(),c()).default({}),references:f(n()).default([]),warnings:f(n()).default([]),problem:P.optional(),data:p()}),I=5e4,L=[50,25,10,5,1],R=320,z=`data (kept the first row of each list)`,B=[{arrayLimit:1/0,rowLimit:1/0,stringLimit:24e3},{arrayLimit:1/0,rowLimit:1/0,stringLimit:1e4},...L.map(e=>({arrayLimit:e,rowLimit:1/0})),{arrayLimit:1,rowLimit:1/0,foldRows:!0}],V=1e3,pe=/^(?:bio|biography|body|content|description|evidence|fulltext|notes|snippet|summary|text)$/u,me=/(?:description|snippet|summary|text)$/u;function he(e){let t=F.safeParse(e);return t.success?t.data:null}function ge(e){let t=M.safeParse(e);return t.success&&Object.values(t.data).some(e=>e!==void 0)?t.data:void 0}function _e(e,t){if(t?.numberOfElements!==void 0)return t.numberOfElements;if(Array.isArray(e))return e.length;let n=$(e)?e.content:void 0;return Array.isArray(n)?n.length:void 0}function H(e,t,n={}){return{ok:!0,summary:e,...n,omitted:n.omitted??[],ids:n.ids??[],counts:n.counts??{},references:n.references??[],warnings:n.warnings??[],data:t}}function ve(e,t=[],n={}){return{...H(e,null,{...n,warnings:t}),ok:!1}}function ye(e,t={}){let n=A(e);if(n!==void 0)return n;let r=t.maxBytes??5e4;if(G(e,r))return e;let i={byteLength:g.byteLength(JSON.stringify(e),`utf8`),maxBytes:r},a=e.httpStatus??0;if(t.write===!0&&e.ok&&a>=200&&a<300)return be(e,i,t.exactRecovery);let o=e.ok?Se:`Refetch a narrower result through read operations using ids/references or filters; do not retry the failed operation.`,s=t.exactRecovery??t.narrowerRead??o,c=_.safeParse(JSON.parse(JSON.stringify(e.data))),l=t=>{let n=c.success?J(c.data,`data`,i,t):{value:Z(i),omitted:[`data`]};return{...e,truncated:!0,truncation:X(i,n.omitted,s),warnings:[...e.warnings,...t.rowLimit===1/0?[]:[Ce(t,s)],`response truncated (caps); follow truncation.recovery for the full result`],data:n.value}},u=t.foldRows!==!1,d=e;for(let e of B.filter(e=>u||e.foldRows!==!0))if(d=l(e),G(d,i.maxBytes))return d;let f=0;for(let t=2**Math.floor(Math.log2(q(e.data)));t>=1;t/=2)G(l({arrayLimit:1,rowLimit:f+t,foldRows:u}),i.maxBytes)&&(f+=t);if(f>0)return l({arrayLimit:1,rowLimit:f,foldRows:u});let p=(e,t=`data`)=>U(e,i,s,`response truncated (caps); metadata named in truncation.omitted was removed; follow truncation.recovery for the full result`,[t]),m=p(l({arrayLimit:1,rowLimit:1,foldRows:u}),z);if(q(e.data)>0&&G(m,i.maxBytes))return m;let h=Z(i);return p({...d,truncation:X(i,[`data`],s),data:h})}function be(e,t,n=`Read the full result through the GET operation on ${e.endpoint??`this route`}.`){let r={...e.counts},i=(e,n)=>{let a={};for(let[o,s]of Object.entries($(e)?e:{}))Array.isArray(s)?r[`${n}${o}`]=s.length:typeof s==`string`?a[o]=K(s,t,R):typeof s!=`object`||!s?a[o]=s:n===``&&o===`response`?a[o]=i(s,`response.`):o===`core`&&$(s)&&(a[o]={id:s.id});return a},a={...e,summary:`${e.method} succeeded (HTTP ${e.httpStatus}); response body omitted (${t.byteLength} bytes, over caps); do not retry the write`,truncated:!0,truncation:X(t,[`data`],n),counts:r,data:i(e.data,``)},o=[`data`];for(let r of[`references`,`ids`,`warnings`]){if(G(a,t.maxBytes))return a;o.push(r),Object.assign(a,{[r]:[],omitted:[...e.omitted,...o.slice(1)],truncation:X(t,o,n)})}return G(a,t.maxBytes)?a:U({...a,data:Z(t),warnings:[`response truncated (caps); do not retry the write`]},t,n,`response truncated (caps); metadata named in truncation.omitted was removed; do not retry the write`)}function U(e,t,n,r,i=[`data`]){if(G(e,t.maxBytes))return e;let a=e.warnings.slice(0,-1),o=e;if(o.problem!==void 0){let e=W(o.problem);if(JSON.stringify(e).length<JSON.stringify(o.problem).length&&(i.push(`problem`),o={...o,problem:e,truncation:X(t,i,n)},G(o,t.maxBytes)))return o}let s=[`filters`,`omitted`,`ids`,`counts`,`references`].filter(t=>Object.keys(e[t]??{}).length>0);if(i.push(...s),o={...o,filters:void 0,truncation:X(t,i,n),omitted:[],ids:[],counts:{},references:[],warnings:s.length===0?e.warnings:[...a,r]},G(o,t.maxBytes))return o;let c=e=>e===void 0?void 0:K(e,t),l={summary:K(o.summary,t),operationId:c(o.operationId),method:c(o.method),endpoint:c(o.endpoint),warnings:o.warnings.map(e=>K(e,t)),problem:o.problem&&W(o.problem,t)},u=new Map(Object.entries(o));for(let[e,t]of Object.entries(l))JSON.stringify(t)!==JSON.stringify(u.get(e))&&i.push(e);if(o={...o,...l,truncation:X(t,i,n)},G(o,t.maxBytes))return o;i.push(`warnings`),o.page!==void 0&&i.push(`page`);let d=K(o.summary,t,R);return d!==o.summary&&i.push(`summary`),{...o,summary:d,page:void 0,truncation:X(t,i,n),warnings:[r]}}function W(e,t){let n=e=>t===void 0?e:K(e,t);return{status:e.status,title:n(e.title),type:n(e.type),...e.detail===void 0?{}:{detail:n(e.detail)},...e.instance===void 0?{}:{instance:n(e.instance)},...e.code===void 0?{}:{code:typeof e.code==`string`?n(e.code):e.code},...e.retryAfterSeconds===void 0?{}:{retryAfterSeconds:e.retryAfterSeconds},...e.disposition==null?{}:{disposition:e.disposition},...e.resetAt===void 0?{}:{resetAt:e.resetAt}}}function G(e,t=I){let n=JSON.stringify(e);return n.length<3e4&&g.byteLength(n,`utf8`)<=t}function K(e,t,n=V){if(g.byteLength(JSON.stringify(e),`utf8`)<=n)return e;let r=Q(t),i=``,a=g.byteLength(JSON.stringify(r),`utf8`);for(let t of e){let e=g.byteLength(JSON.stringify(t),`utf8`)-2;if(a+e>n)break;i+=t,a+=e}return`${i.trimEnd()}${r}`}function q(e){return Array.isArray(e)?e.length:$(e)?Math.max(0,...Object.values(e).map(q)):0}function J(e,t,n,r){if(typeof e==`string`){let i=xe(we(t))||e.length>V,a=r.stringLimit??R;return!i||e.length<=a?{value:e,omitted:[]}:{value:`${e.slice(0,a).trimEnd()}${Q(n)}`,omitted:[t]}}if(typeof e!=`object`||!e)return{value:e,omitted:[]};if(Array.isArray(e))return Y(e,t,n,r);if(t===`data.response.entity.answer`||t===`data.response.answer`)return{value:e,omitted:[]};let i={},a=[],{foldDepth:o}=r;for(let[s,c]of Object.entries(e)){if(c===void 0)continue;let e=typeof c==`object`&&!!c;if(e&&o!==void 0&&(o===0||Array.isArray(c))){a.push(`${t.replaceAll(/\[\d+\]/gu,`[]`)}.${s} (folded)`);continue}let l=e&&o!==void 0?{...r,foldDepth:o-1}:r,u=J(c,`${t}.${s}`,n,l);i[s]=u.value,a.push(...u.omitted)}return{value:i,omitted:a}}function Y(e,t,n,r){let i=e.slice(0,r.rowLimit),a=r.foldRows===!0?1:r.foldDepth,o={...r,rowLimit:r.arrayLimit,foldDepth:a},s=i.map((e,r)=>J(e,`${t}[${r}]`,n,o)),c=s.flatMap(e=>e.omitted),l=`${t}[${i.length}..] (kept ${i.length} of ${e.length})`;return{value:s.map(e=>e.value),omitted:e.length>i.length?[...c,l]:c}}function xe(e){let t=e.toLowerCase();return pe.test(t)||me.test(t)}var Se=`Save the full response with --to-file <path>, then inspect the needed section; use narrower reads, filters, or pagination only where the operation supports them.`,X=(e,t,n)=>({...e,omitted:t.length===0?[`data`]:[...new Set(t)],recovery:K(n,e)}),Z=e=>({truncated:!0,...e}),Q=e=>`\n[truncated byteLength=${e.byteLength} maxBytes=${e.maxBytes}]`,Ce=({rowLimit:e,foldRows:t},n)=>`kept the first ${e} ${t===!0?`rows of each list with nested sections folded`:`whole rows of each list`}; ${n}`,we=e=>(e.split(`.`).at(-1)??e).replace(/\[\d+\]$/,``),$=e=>typeof e==`object`&&!!e&&!Array.isArray(e);export{ge as a,H as c,de as d,O as f,G as i,k as l,ye as n,he as o,_ as p,ve as r,_e as s,I as t,ue as u};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{A as e,C as t,E as n,S as r,_ as i,c as a,d as o,g as s,i as c,n as l,s as u,x as d}from"./iso-l1vOidnb.js";import{A as f,C as p,D as m,E as h,M as g,O as _,S as v,T as ee,_ as te,a as ne,b as re,c as ie,d as ae,f as oe,g as se,h as ce,i as le,j as ue,k as de,l as fe,m as pe,n as me,o as he,p as ge,r as y,s as _e,t as b,u as ve,v as ye,w as be,x,y as xe}from"./detail-CB3r4S8B.js";import{t as Se}from"./person-owner-BRGa5Dee.js";import{t as S}from"./entity-BtU2r6nM.js";import{t as C}from"./type-C0VR7LD-.js";import{t as Ce}from"./run-BmmFSDzn.js";import{p as we}from"./result-envelope-5DwGbGQt.js";import{a as Te,s as Ee}from"./tool-policy-BnoDi0Yk.js";import{a as w,c as De,i as Oe,l as ke,n as T,r as E,s as D,t as Ae}from"./text-field-jFKOGMzr.js";import{a as je,n as Me,o as Ne,r as Pe,s as O,t as Fe}from"./human-text-cap-dR2SJQJC.js";import{a as Ie,d as k,f as Le,m as A,o as Re,p as ze,u as Be,x as Ve}from"./help-catalog-B8JUR6zB.js";import{Buffer as He}from"node:buffer";function Ue(e){if(typeof e==`object`&&e&&!Array.isArray(e)&&Array.isArray(e.column)&&e.column.every(e=>typeof e==`string`)&&Array.isArray(e.row)&&e.row.every(e=>Array.isArray(e))){let t=e.column;return{column:t,record:e.row.map(e=>new Map(t.map((t,n)=>[t,We(e[n]??null)])))}}let t=Array.isArray(e)?e:typeof e==`object`&&e&&Array.isArray(e.content)?e.content:typeof e==`object`&&e&&Array.isArray(e.row)?e.row:[e],n=new Set,r=t.map(e=>{let t=new Map,r=(e,n)=>{if(Array.isArray(e))t.set(n,e.some(e=>typeof e==`object`&&!!e)?JSON.stringify(e):e.map(We).join(`; `));else if(typeof e==`object`&&e)for(let[t,i]of Object.entries(e))i!==void 0&&r(i,n===``?t:`${n}.${t}`);else t.set(n||`value`,e===null?``:String(e))};r(e,``);for(let e of t.keys())n.add(e);return t});return{column:[...n],record:r}}function We(e){return e===null?``:typeof e==`string`?e:JSON.stringify(e)}function j(e){return e.map(e=>{let t=/^[=+\-@\t\r]/u.test(e)?`'${e}`:e;return/[",\r\n]/u.test(t)?`"${t.replaceAll(`"`,`""`)}"`:t}).join(`,`)+`\r
|
|
2
|
-
`}function Ge(e){let{column:t,record:n}=Ue(e);return t.length===0?``:j(t)+n.map(e=>j(t.map(t=>e.get(t)??``))).join(``)}function Ke(t){let n=we.safeParse(JSON.parse(JSON.stringify(t??null)));if(!n.success)throw Error(`Response is not JSON, so it cannot be written as CSV: ${e(n.error)}`);return Ge(n.data)}var M=`aventure`;function N(e,t,n=`cli`){let r=t.find(t=>t.operationId===e);if(n===`mcp`&&r?.tool!==void 0){let e=Re(r);return`${e.tool} ${JSON.stringify(e.arguments)}`}let i=r?.cliPath;return i===void 0?void 0:`${M} ${i.join(` `)}`}function qe(e,t,n=e,r=`cli`){return r===`mcp`?N(e,t,r)??e:Ve(e,t,`aventure`)??n}function Je(e,t,n=`cli`){let r=Be.safeParse(e);if(!r.success)return null;let{answer:i,citation:a,confidence:o,resolution:s}=r.data;if(s!=null)return Ye(i,s,t,n);let c=i.trimEnd().split(`
|
|
3
|
-
`),l=new Set(a.flatMap(({sourceType:e,sourceId:r})=>{if(e!==ze.options[0].enum.OPERATION)return[];let i=N(r,t,n);return i===void 0?[]:[i]}));return l.size>0&&c.push(``,n===`mcp`?`MCP calls:`:`Commands:`,...[...l].map(e=>` ${e}`)),c.push(``,`Confidence: ${o}`),a.length===0||(c.push(`Sources (${a.length}):`),c.push(...a.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`}))),c}function Ye(e,t,n,r){let{outcome:i,operationId:a,probability:o,candidate:s,taskKey:c,taskPlan:l}=t,u=[l==null?e.trimEnd():Ze(l)],d=[``,`Outcome: ${i}${o==null?``:` (probability ${o.toFixed(2)})`}`];switch(i){case k.enum.TASK_PLAN:return[...u,...l==null?[]:Qe(l,n,r),...d];case k.enum.OPERATION_ADVICE:{let e=s.filter(({sourceId:e})=>e!==a);return[...u,...a==null?[]:[``,r===`mcp`?`MCP call:`:`Command:`,` ${qe(a,n,a,r)}`],...d,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case k.enum.CLARIFY:return[...u,...c==null?[]:[``,`Leading catalog task: ${c}`],...et(`Candidates:`,s,n,r),...d];case k.enum.ABSTAIN:return[...u,...et(`Nearest operations:`,s,n,r),...d];default:throw Error(`Unhandled help resolution outcome ${String(i)}`)}}function Xe(e,t,n=`cli`){let r=Le.safeParse(e);return r.success?[Ze(r.data),...Qe(r.data,t,n)]:null}var Ze=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function Qe(e,t,n){return e.step.length===0?[``,`This catalog task has no planned steps yet.`]:[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n,required:r})=>` ${e} (${t}, ${r===!1?`optional`:`required`}): ${n}`)],``,`Steps:`,...e.step.flatMap(({step:r,cliCommand:i,writeGuidance:a},o)=>[` ${o+1}. ${r.stepKey===void 0?``:`${r.stepKey}: `}${qe(r.operationId,t,i,n)}`,` ${r.instruction}`,...$e(e,o,a)]),...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function $e(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 et(e,t,n,r){if(t.length===0)return[];let i=t.map(({sourceId:e,excerpt:t})=>({command:N(e,n,r)??e,excerpt:t})),a=Math.max(...i.map(({command:e})=>e.length));return[``,e,...i.map(({command:e,excerpt:t})=>` ${e.padEnd(a)} # ${t}`)]}var tt=/\{([^}]+)\}/gu,nt=/(?:^r|R)evision$/u;function rt(e,t,n=`cli`){let r=t.filter(e=>e.method===`GET`&&(n===`cli`||e.binaryResponse!==!0)),i=t=>e.endpoint!==void 0&&t.endsWith(e.endpoint),a=t.find(t=>t.operationId===e.operationId),o=e.ok&&a!==void 0&&Te(a.intent),s=[...o&&e.endpoint!==void 0?ct(e.endpoint.split(`?`)[0]??``,r,!1,n,ot(e.data)).map(e=>n===`mcp`?e:`${e} --data --to-file <path>`):[],...e.references.filter(e=>!i(e)).flatMap(st).flatMap(e=>ct(e.pathname,r,!0,n)),...e.references.filter(i).flatMap(st).flatMap(e=>lt(e,r,n))],c=n===`mcp`?it:void 0;return s.length===0?{write:o,narrowerRead:c}:{exactRecovery:`Read the full result ${s.join(`; `)}.`,write:o,narrowerRead:c}}var it=`Refetch a narrower result: call aventure_help with q set to the read intent, then call aventure_read with its operationId and declared query or pathParams, using ids/references, filters, or smaller query.page/query.size windows.`;function at(e){return`Inline output is truncated; full payload written to ${e}; read it with your file tool.`}function ot(e){let t=typeof e==`object`&&e&&`response`in e?e.response:null;return typeof t==`object`&&t?new Map(Object.entries(t).flatMap(([e,t])=>Number.isInteger(t)&&nt.test(e)?[[e,String(t)]]:[])):new Map}function st(e){return URL.canParse(e)?[new URL(e)]:[]}function ct(e,t,n,r,i=new Map){let a=t.filter(t=>t.path===e);return(a.length>0?a:t).flatMap(t=>{let a=[...t.path.matchAll(tt)].map(([,e])=>e),o=RegExp(`^${t.path.replace(tt,`([^/]+)`)}$`,`u`),s=n&&a.length===0?null:o.exec(e);if(s===null)return[];let c=t.parameters.flatMap(e=>{let t=e.location===`query`?i.get(e.name):void 0;return t===void 0?[]:[{parameter:e,pin:t}]});if(r===`mcp`)return[ut(t,{pathParams:Object.fromEntries(a.map((e,t)=>[e??``,decodeURIComponent(s[t+1]??``)])),...c.length===0?{}:{query:Object.fromEntries(c.map(({parameter:e,pin:t})=>[e.name,t]))}})];let l=a.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[P(r),s[n+1]??``]}),u=c.flatMap(({parameter:e,pin:t})=>[P(e),t]);return[`${dt(t)}, ${ft(t,[...l,...u])}`]})}function lt(e,t,n){let r=t.find(t=>t.path===e.pathname);return r===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${r.path}/`))return[];let i=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),a=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(i===void 0||a===void 0)return[];if(n===`mcp`)return[`in windows: ${ut(t,{query:{...Object.fromEntries([...e.searchParams].filter(([e])=>t.parameters.some(t=>t.location===`query`&&t.name===e))),[i.name]:`<offset>`,[a.name]:`<limit>`}})}, advancing query.${i.name} until a window returns fewer than query.${a.name} units`];let o=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[P(t),pt(n)]}),s=[P(i),`<n>`,P(a),`<n>`];return[`${dt(t)}, in windows: ${ft(t,[...o,...s])}, advancing ${P(i)} until a window returns fewer than ${P(a)} units`]})}function ut(e,t){return`${Ee(e)} ${JSON.stringify({operationId:e.operationId,...t})}`}function dt(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function ft(e,t){return[M,...e.cliPath,...t].join(` `)}function P(e){return e.flag.split(/\s+/u)[0]??e.flag}function pt(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}var mt=i({detail:r(),field:r().nullish(),scope:c([`entity`,`person`,`news`])}),ht=c([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),gt=Object.assign(t([ht,r()]),{enum:ht.enum}),F=i({modeRequested:gt,modeUsed:gt}),_t=i({answerUnavailable:a(),entity:F,incompleteScope:u(c([`entity`,`person`,`news`])).optional(),news:F,person:F,rejection:u(mt),unavailable:u(c([`entity`,`person`,`news`]))}),vt=i({acceleratorParticipation:u(te),detail:u(se)}),I=i({core:S,enrichment:m,fundraiseRound:u(x),profileStatus:re.optional(),provider:xe.nullish(),research:vt,semanticMatch:he.nullish()}),yt=c([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),bt=i({compositeScore:s().nullish(),cosineScore:s().nullish(),curatedAsOf:r().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:r().nullish(),curatedSource:r().nullish(),derivedFromEntityId:n().nullish(),matchedSectionWeight:s().nullish(),origin:yt,rank:o(),sharedSectionCount:o().nullish()}),xt=i({entity:I,similarity:bt}),St=i({fundraiseInvestorJoin:a(),fundraiseTransaction:a(),operatingStatus:a(),relationship:a()}),Ct=c([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),wt=c([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),Tt=i({acquiredEntity:S,acquirerEntity:S,amount:s().int().nullish(),announcedAt:r().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:r().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:r().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:l({offset:!0}).nullish(),currency:r().nullish(),dataConfidence:be.nullish(),evidence:St,fundraiseTransactionId:n().nullish(),investorJoinId:n().nullish(),isCurrent:a().nullish(),publicSource:ee.nullish(),relationshipId:o(),status:Ct,transactionStatus:wt.nullish(),updatedAt:l({offset:!0}).nullish()}),Et=i({entity:b,investorAttribution:u(v),round:u(p),roundCount:o()}),Dt=i({core:S,fundingDetail:f.nullish(),similarity:bt,urlLink:u(_)}),Ot=i({compliance:ce.nullish(),createdAt:l({offset:!0}).nullish(),get expandedText(){return Ot.nullish()},expandedTextId:o().nullish(),id:o(),isCurrent:a().nullish(),isPrimary:a().nullish(),language:r().nullish(),owner:Se,text:r(),textName:r().nullish(),textType:r(),updatedAt:l({offset:!0}).nullish()}),kt=Ot,At=c([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),jt=c([`fundraiseRound`,`researchDetail`]),Mt=c([`preMoney`,`postMoney`,`reported`]),Nt=i({amountRaised:s().int().nullish(),asOfDate:r().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:fe,currency:r(),declaredBasis:Mt,derivation:At,detailId:o().nullish(),label:r().nullish(),source:jt,sourceRef:r(),valuationPostMoney:s().int().nullish(),valuationPreMoney:s().int().nullish()}),Pt=i({createdAt:l({offset:!0}).nullish(),description:r().nullish(),forkCount:o(),githubId:s().int(),homepageUrl:r().nullish(),id:s().int(),isArchived:a(),isFork:a(),language:r().nullish(),license:r().nullish(),name:r(),ownerLogin:r(),repoCreatedAt:l({offset:!0}).nullish(),repoPushedAt:l({offset:!0}).nullish(),stargazerCount:o(),topic:u(r()),updatedAt:l({offset:!0}).nullish(),url:r()}),L=i({empty:a().optional(),sorted:a().optional(),unsorted:a().optional()}),R=i({offset:s().int().optional(),paged:a().optional(),pageNumber:o().optional(),pageSize:o().optional(),sort:L.optional(),unpaged:a().optional()}),Ft=i({investorAttribution:u(v),person:y,round:u(p),roundCount:o()}),It=c([`by`,`about`]),Lt=c([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),Rt=i({canonicalUrl:r().nullish(),contentId:r(),contentType:Lt,createdAt:l({offset:!0}).nullish(),publishedAt:l({offset:!0}).nullish(),relation:It.nullish(),sourceDomain:r().nullish(),sourceName:r().nullish(),summary:r().nullish(),title:r(),topic:r().nullish(),updatedAt:l({offset:!0}).nullish(),url:r().nullish(),year:o().nullish()});i({content:u(ae).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(t([g,ue])).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(ie).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(S).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Tt).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(b).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(h).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(x).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Et).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(I).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(ve).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(ye).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(se).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(pe).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(xt).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Dt).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(kt).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(_).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Nt).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Pt).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Ce).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(oe).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(ne).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(y).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(_e).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Ft).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(le).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()}),i({content:u(Rt).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()});var zt=i({content:u(I),number:o(),size:o(),totalElements:s().int(),totalPages:o()}),Bt=i({content:u(oe),number:o(),size:o(),totalElements:s().int(),totalPages:o()}),Vt=i({content:u(ne),number:o(),size:o(),totalElements:s().int(),totalPages:o()});i({content:u(me).optional(),empty:a().optional(),first:a().optional(),last:a().optional(),number:o().optional(),numberOfElements:o().optional(),pageable:R.optional(),size:o().optional(),sort:L.optional(),totalElements:s().int().optional(),totalPages:o().optional()});var Ht=c([`entityRecord`,`researchSnippet`,`newsArticle`,`personRecord`,`fundraiseTransaction`,`webProfile`]),Ut=Object.assign(t([Ht,r()]),{enum:Ht.enum}),Wt=i({entityId:n(),source:Ut,sourceId:r()}),Gt=i({title:r(),url:r()}),Kt=i({citation:u(Wt),text:r(),topic:r().nullish(),webSource:u(Gt).optional()}),qt=i({citation:u(Wt),confidence:A,description:r().nullish(),heading:r().nullish(),paragraph:u(Kt),relatedQuery:u(r()),shareable:a(),text:r(),title:r().nullish()}),Jt=i({enrichmentRunId:n().nullish(),entityId:n()}),Yt=i({sortPriority:c([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),Xt=i({max:l({offset:!0}).nullish(),min:l({offset:!0}).nullish()}),z=i({max:s().nullish(),min:s().nullish()}),B=i({max:o().nullish(),min:o().nullish()}),Zt=i({averageAmountInvestedUsdRange:u(z).optional(),largestAmountInvestedUsdRange:u(z).optional(),smallestAmountInvestedUsdRange:u(z).optional(),totalAmountInvestedUsdRange:u(z).optional(),totalInvestmentRange:u(B).optional()}),Qt=c([`any`,`every`]),$t=i({amountInvestedRange:u(z).optional(),amountRaisedRange:u(z).optional(),dateAnnouncedRange:Xt.nullish(),investedAmountRaisedRange:u(z).optional(),investedCompanyName:u(r()).optional(),investedCountry:u(r()).optional(),investedIndustry:u(r()).optional(),investedRound:u(r()).optional(),investorActivity:Zt.optional(),investorName:u(r()).optional(),investorNameMatch:Qt.nullish(),lastRoundYearRange:u(B).optional(),rankByInvestmentActivity:a().nullish(),round:u(r()).optional(),totalRaisedRange:u(z).optional(),valuationRange:u(z).optional()}),en=c([`NONE`,`COMPANY_LISTING_READY`]),tn=c([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),nn=c([`hostPath`,`domain`]),rn=d({acceleratorBrand:u(r()).optional(),acceleratorCohort:u(r()).optional(),acceleratorName:u(r()).optional(),acceleratorStatus:u(r()).optional(),affinity:u(r()).optional(),closedLast:a().optional(),employeeCountRange:u(B).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:$t.optional(),hasFundraising:a().nullish(),headquartersCity:u(r()).optional(),headquartersCountry:u(r()).optional(),headquartersState:u(r()).optional(),industry:u(r()).optional(),letter:r().nullish(),location:u(r()).optional(),logoOption:Yt.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(tn).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:en.optional(),rankByProminence:a().nullish(),semanticQuery:r().nullish(),slug:u(r().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:u(r()).optional(),suppressLateStage:a().nullish(),suppressNonOperating:a().nullish(),suppressZeroTotalRaised:a().nullish(),tag:u(r()).optional(),textSearch:r().nullish(),typeCustomer:u(r()).optional(),typeModel:u(r()).optional(),typeOwnership:u(r()).optional(),typeRecord:u(C).optional(),typeRevenue:u(r()).optional(),typeTechnologyUsed:u(r()).optional(),url:r().nullish(),urlDomain:r().nullish(),urlMatchMode:nn.nullish(),urlType:de.nullish(),yearFoundedRange:u(B).optional()}),an=d({acceleratorBrand:u(r()).optional(),acceleratorCohort:u(r()).optional(),acceleratorName:u(r()).optional(),acceleratorStatus:u(r()).optional(),affinity:u(r()).optional(),closedLast:a().optional(),employeeCountRange:u(B).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:$t.optional(),hasFundraising:a().nullish(),headquartersCity:u(r()).optional(),headquartersCountry:u(r()).optional(),headquartersState:u(r()).optional(),industry:u(r()).optional(),letter:r().nullish(),location:u(r()).optional(),logoOption:Yt.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(tn).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:en.optional(),rankByProminence:a().nullish(),slug:u(r().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:u(r()).optional(),suppressLateStage:a().nullish(),suppressNonOperating:a().nullish(),suppressZeroTotalRaised:a().nullish(),tag:u(r()).optional(),textSearch:r().nullish(),typeCustomer:u(r()).optional(),typeModel:u(r()).optional(),typeOwnership:u(r()).optional(),typeRecord:u(C).optional(),typeRevenue:u(r()).optional(),typeTechnologyUsed:u(r()).optional(),url:r().nullish(),urlDomain:r().nullish(),urlMatchMode:nn.nullish(),urlType:de.nullish(),yearFoundedRange:u(B).optional()}),on=i({entityFilter:an.nullish(),isCurrent:a().nullish(),personTitle:u(r()).optional()}),sn=c([`CURRENT`,`PAST`,`ANY`]),cn=i({amountInvestedRange:u(z).nullish(),amountRaisedRange:u(z).nullish(),entityName:u(r()).nullish(),investedCompany:u(r()).nullish(),personTitle:u(r()).nullish(),round:u(r()).nullish(),totalInvestmentCount:u(B).nullish(),typeRecord:u(C).nullish()}),ln=i({additionalAssociation:on.nullish(),arrayFilter:cn.optional(),entityFilter:an.optional(),entityId:n().nullish(),entitySlug:r().nullish(),firstName:r().nullish(),includeAddress:a().nullish(),includeUrl:a().nullish(),investorActivity:Zt.optional(),isCurrent:a().nullish(),lastName:r().nullish(),letter:r().nullish(),nameQuery:r().nullish(),personId:u(n()).max(200).optional(),personName:u(r()).optional(),rankByEmployer:a().nullish(),role:r().nullish(),search:r().nullish(),semanticQuery:r().nullish(),status:r().nullish(),tenure:sn.nullish()}),un=c([`discovery`,`profile`,`peer`,`comparison`]),dn=c([`keyword`,`semantic`]),fn=c([`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`,`NOTABLE_ACTIVITY_AT`,`ACCELERATOR_BRAND`,`ACCELERATOR_COHORT`,`HEADQUARTERS_COUNTRY`,`EMPLOYEE_COUNT`]),pn=Object.assign(t([fn,r()]),{enum:fn.enum}),mn=i({descending:a(),field:pn,sortKey:r().nullish()}),hn=i({order:u(mn),relevance:dn.nullish()}),gn=i({confidence:A,execution:F,fallbackUsed:a(),filter:rn,intent:un,interpretation:r(),personAssociation:ln.nullish(),sort:hn,subjectEntityName:u(r()),unsupported:r().nullish()}),V=i({changedAt:l({offset:!0}).nullish(),dataSourceUpdatedAt:l({offset:!0}).nullish(),pendingApproval:o().nullish(),sourceId:r().nullish(),status:r().nullish()}),_n=i({fundManagerRelationshipSource:V.nullish(),fundraiseTransaction:x,fundraiseTransactionSource:V.nullish(),investorJoinSource:V.nullish()}),vn=i({evidence:_n,investor:Se,semanticMatch:he.nullish()}),yn=i({entityId:n(),matchedOffering:S.nullish(),probability:s(),webUrl:u(r())}),bn=i({entityId:n(),label:r(),publishedAt:l({offset:!0}).nullish(),score:s(),source:Ut,sourceId:r(),text:r(),url:r().nullish()}),xn=i({answer:qt.nullish(),filing:u(Jt).nullish(),interpretation:gn,investment:u(vn),judgment:u(yn),passage:u(bn),peer:u(xt),pendingWebQuery:u(r()),personLead:a(),result:zt,searchRequestId:n().nullish(),subject:u(I)}),Sn=i({entity:u(ge),newsId:o()}),Cn=i({descending:a(),field:c([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`]),sortKey:r().nullish()}),wn=i({order:u(Cn),relevance:dn.nullish()}),Tn=i({confidence:A,employerSemanticQuery:r().nullish(),execution:F,fallbackUsed:a(),filter:ln,interpretation:r(),sort:wn,unsupported:r().nullish()}),En=i({currentCompany:r().nullish(),headline:r().nullish(),id:n(),location:r().nullish(),name:r(),named:r(),organizationEvidence:c([`headline`,`profile`,`none`]).nullish(),photoUrl:r().nullish(),profileUrl:r(),slug:r().regex(/^[a-z0-9_-]+$/).max(255)}),Dn=i({interpretation:Tn,investment:u(vn),personLead:a(),profile:u(En),result:Vt,searchRequestId:n().nullish()}),On=i({label:r(),query:r()}),kn=i({key:r(),option:u(On),prompt:r()}),An=i({entity:xn,entityDetail:u(b),news:Bt,newsEntityMention:u(Sn),person:Dn,personDetail:u(y),personLead:a(),provenance:_t,qualifier:kn.nullish(),section:u(c([`person`,`company`,`productService`,`investor`])).optional()}),H=30,U=8,W=10,jn=2,Mn=[`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`],Nn=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]);function Pn(e,t,n,{trailer:r=[],...i}={}){let a=i.transport??`cli`;if(typeof t==`string`)return Ne(t,i,r);let o=Ie(t,r,a);if(o!==null)return Pe(o,r,i);let s=Gn(t);if(s===null)return null;let c=e.find(({operationId:e})=>e===s.operationId),l=ke(c?.detailField,s.response),u=[...l.hiddenNote,...r],d=(e,t)=>Me([e.trimEnd(),...t].join(`
|
|
4
|
-
`),{appendNewline:!0,preservedTrailerLines:t.length>0?t.length:void 0,...i}),f=c?.parameters??[],p={...s,response:l.response,parameters:f,transport:a},m=Je(p.response,e,a)??Xe(p.response,e,a);if(m!==null)return d(m.join(`
|
|
5
|
-
`),r);let h=Fn(p);if(h!==null)return d(h.join(`
|
|
6
|
-
`),u);let g=[p.summary??n??p.operationId??`OpenAPI call succeeded`,`${p.method} ${p.endpoint}`],_=je(zn(p),117-u.length,Fe-He.byteLength(`${[...g,...u].join(`
|
|
7
|
-
`)}\n`,`utf8`),i);return d([...g,..._].filter(Boolean).join(`
|
|
8
|
-
`),u)}function Fn({response:e,...t}){let n=An.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o}=n.data;return[...r.answer?In(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})=>w(`${e} rejected: ${t}`)),[`entities:`,...G(r.result,t)].join(`
|
|
9
|
-
`),[`people:`,...G(i.result,t)].join(`
|
|
10
|
-
`),[`news:`,...G(a,t)].join(`
|
|
11
|
-
`)]}function In(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${w(e)}`).join(`
|
|
12
|
-
`)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>w(` - ${e}:${t} entity=${n}`)).join(`
|
|
13
|
-
`)}`;return[`answer:\n ${Oe(e.text).replaceAll(`
|
|
14
|
-
`,`
|
|
15
|
-
`)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function Ln(e){let t=Gn(e)?.response,n=Q(t)?t.interpretation:void 0;if(!Q(n))return null;let r=F.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=Ae(n.filter),{unsupported:s,fallbackUsed:c}=n,l=[`strategy: requested=${i} used=${a}`,...Q(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${Rn(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``];return Me(l.filter(Boolean).join(`
|
|
16
|
-
`),{appendNewline:!0})}var Rn=e=>$(e)?w(e):Array.isArray(e)&&e.every($)?e.map(e=>w(e)).join(`, `):JSON.stringify(e);function zn(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a,transport:o}=e;if(t===void 0)return a!==void 0&&i!==void 0?[`status=${i} redirect=${a}`]:i===void 0?[]:[`status=${i} no response body`];let s=i===void 0||n===`GET`?``:`status=${i}`,c=Q(t)&&!X(t)?Kn(t):null,l=c===null?void 0:Q(c.context.interpretation)?Ae(c.context):c.context,u=l!==void 0&&Q(l)?Object.entries(l):[],d=u.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(Q)),f=new Set(d.map(([e])=>e)),p=Object.fromEntries(u.filter(([e])=>!f.has(e)));return[s,...X(t)?G(t,e,r):c===null?Jn(t)?Hn(t,[`filter`],t.meta,o):Yn(t)?Hn(t,[`arrayFilterEntry`,`rangeFilterEntry`],t.filtersMeta,o):Xn(t)?Un(t,o):typeof t==`string`?t.split(`
|
|
17
|
-
`):K(t,``):[...G(c.page,e,r),...Object.keys(p).length===0?[]:K(p,``),...d.flatMap(([e,t])=>[`${e}:`].concat(Bn(t,o)))]].filter(Boolean)}function G(e,t,n){let r=Wn(t),i=e.numberOfElements??e.content.length,a=Math.min(e.content.length,H),o=Math.max(1,a),s=(e.number??0)*(e.size??i),c=(e.totalElements??0)-s-i,l=e.number===void 0?``:` page=${e.number}`,u=e.size===void 0?``:` size=${e.size}`,d=e.totalElements===void 0?``:` total=${e.totalElements}`,f=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,p=(e.number??0)+1,m=e.totalPages===void 0||p<e.totalPages,h=T(`page`,t.parameters);return[`rows=${i}${l}${u}${d}${f}`,a>=i?``:`page rows omitted: ${i-a} (${a}/${i} shown); ${e.content.length>a?O(t.transport,`.content`):`reread with ${T(`size`,t.parameters)} ${o} and ${h} ${Math.floor((s+a)/o)} through ${Math.floor((s+i-1)/o)} (MCP: size, page); pages start at 0`}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${D(n)}`,c<=0||n!==void 0?``:m&&i===e.size?`more: ${c} rows not shown; use ${h} or ${T(`size`,t.parameters)} to see them`:`more: ${c} more matched but this response returns only these ${i}; narrow the query to reach them${m?` (${h} ${p} starts after this page)`:``}`,...Bn(e.content.slice(0,a),t.transport)].filter(Boolean)}function Bn(e,t){if(!e.every(Q))return q(e,``);let n=e.filter(Q);if(n.length===0)return e.length===0?[`(empty)`]:q(e,``);let r=Vn(n);if(r.length===0)return q(e,``);let i=n.slice(0,H).map(e=>{let t=J(e);return r.map(e=>t[e]??``)}),a=r.map(e=>e.split(`.`).at(-1)??e),o=a.map((e,t)=>{let n=i.map(e=>e[t]??``),r=Math.max(e.length,...n.map(e=>e.length));return e===`id`||e.endsWith(`Id`)?r:Math.min(32,r)}),s=e=>e.map((e,t)=>De(e,o[t]??12).padEnd(o[t]??12)).join(` `),c=[s(a),s(o.map(e=>`-`.repeat(e)))];return i.forEach(e=>c.push(s(e))),n.length>H&&c.push(`... ${n.length-H} more rows omitted; ${O(t)}`),c}function Vn(e){let t=e.map(e=>J(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=Mn.filter(e=>n.has(e)),i=new Set(r.map(Y)),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(Y(e))?!1:(n&&i.add(Y(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,U-s.length);return[...s,...c].slice(0,U)}function Hn(e,t,n,r){let i=t.flatMap(t=>e[t].map((e,n)=>({...e,path:`.${t}[${n}].choiceOption`}))),a=n!==void 0&&Q(n)?n:{},o=[`total`,`limit`].flatMap(e=>typeof a[e]==`number`?[` ${e}=${a[e]}`]:[]).join(``),s=[`filters=${i.length}${o}`];for(let e of i){let t=e.choiceOption.length,n=e.choiceOptionTotal===null?`unknown (degraded)`:e.choiceOptionTotal??t,i=e.choiceOptionTruncated===!0?` truncated`:``;s.push(`- ${e.filterKey} (${e.label}): choices ${t}/${n}${i}`),e.choiceOption.slice(0,W).forEach(t=>{s.push(` ${T(e.filterKey)} ${D(t.value)}`)}),t>W&&s.push(` ... ${t-W} choices omitted for ${e.filterKey}; ${O(r,e.path)}`)}return s}function Un(e,t){let n=T(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,W).map(e=>`${n} ${D(e)}`),e.result.length>W?`... ${e.result.length-W} matches omitted; ${O(t,`.result`)}`:``].filter(Boolean)}function Wn({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Nn.has(e)&&t.length>0).map(([e,n])=>`${T(e,t)} ${D(n)}`)}function Gn(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:we.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 K(e,t,n){if(e===void 0)return[];if($(e))return[`${t}${E(e,n)}`];if(Array.isArray(e))return q(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if($(i))r.push(`${t}${n}: ${E(i,n)}`);else{r.push(`${t}${n}:`);for(let e of K(i,`${t} `,n))r.push(e)}}return r.length===0?[`${t}(empty)`]:r}function q(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e)if($(i))r.push(`${t}- ${E(i,n)}`);else{r.push(`${t}-`);for(let e of K(i,`${t} `))r.push(e)}return r}function J(e,t=``,n=0){return $(e)?t.length===0?{}:{[t]:w(e,t)}:n>jn?{}:Array.isArray(e)?e[0]===void 0?{}:J(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 $(r)?[[i,w(r,i)]]:Object.entries(J(r,i,n+1))}))}var Y=e=>e.split(`.`,1)[0],X=e=>Q(e)&&Array.isArray(e.content);function Kn(e){let[t,...n]=Object.entries(e).filter(e=>X(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 qn(e){return Q(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var Jn=e=>Q(e)&&Z(e.filter),Yn=e=>Q(e)&&Z(e.arrayFilterEntry)&&Z(e.rangeFilterEntry),Z=e=>Array.isArray(e)&&e.every(qn),Xn=e=>Q(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),Q=e=>typeof e==`object`&&!!e&&!Array.isArray(e),$=e=>typeof e!=`object`||!e;export{Ke as a,rt as i,Ln as n,at as r,Pn as t};
|