@aventurevc/aventure-cli 0.8.183 → 0.8.185
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/command-catalog.compact.txt +5 -1
- package/dist/aventure-cli/index.js +1 -1
- package/dist/aventure-cli/unified-operations.json +62 -4
- package/dist/chunks/api-key-bearer-credential-B-1UINE8.js +1 -0
- package/dist/chunks/{api-key-bearer-credential-Cxons3cm.js → api-key-bearer-credential-BYpoThef.js} +1 -1
- package/dist/chunks/{aventure-cli-ZrfLeo3x.js → aventure-cli-g54kxG8S.js} +3 -3
- package/dist/chunks/{cli-help-policy-CEZmY2LL.js → cli-help-policy-RGOSoZ1Z.js} +1 -1
- package/dist/chunks/contract-CQeFe7mk.js +27 -0
- package/dist/chunks/{dist-9kkSpcmP.js → dist-Ce24grer.js} +2 -2
- package/dist/chunks/{env-gpTPURvt.js → env-YDNggcP1.js} +1 -1
- package/dist/chunks/logging-C5C6Bsga.js +1 -0
- package/dist/chunks/{logging-D_7xwm_N.js → logging-CDCaRpiW.js} +1 -1
- package/dist/chunks/mcp-generation-contract-B6pMxUtz.js +1 -0
- package/dist/chunks/mcp-generation-contract-Ch56aEHy.js +1 -0
- package/dist/chunks/{oauth-bearer-credential-BbDjUDbF.js → oauth-bearer-credential-4hGvDZoQ.js} +2 -2
- package/dist/chunks/oauth-bearer-credential-DJ2PA6d4.js +1 -0
- package/dist/chunks/oauth-login-BLRUSc5A.js +1 -0
- package/dist/chunks/{oauth-login-aa5m1Kuc.js → oauth-login-BiXKKdqF.js} +1 -1
- package/dist/chunks/openapi-commands-C0WAjaN3.js +1 -0
- package/dist/chunks/openapi-commands-K3hFzG4D.js +1 -0
- package/dist/chunks/output-mode-BW9Jfk5x.js +1 -0
- package/dist/chunks/output-mode-QxmCrOJw.js +1 -0
- package/dist/chunks/{output-spill-BRyuNqcH.js → output-spill-CvlQjh5i.js} +1 -1
- package/dist/chunks/provider-catalog-BxkTk-Lo.js +1 -0
- package/dist/chunks/{response-problem-D6NByFDg.js → response-problem-DEZ2kyCp.js} +1 -1
- package/dist/chunks/result-envelope-D5wNfKzB.js +1 -0
- package/dist/chunks/startup-auth-BCJtMtHx.js +1 -0
- package/dist/chunks/startup-auth-BJ3mNNZp.js +1 -0
- package/dist/chunks/tool-policy-D7R8FUUe.js +1 -0
- package/package.json +3 -3
- package/dist/chunks/api-key-bearer-credential-BQEuNZq_.js +0 -1
- package/dist/chunks/contract-BnIEMW_J.js +0 -27
- package/dist/chunks/logging-B7HscXAR.js +0 -1
- package/dist/chunks/mcp-generation-contract-BP4h0kA3.js +0 -1
- package/dist/chunks/mcp-generation-contract-wxtUVCwc.js +0 -1
- package/dist/chunks/oauth-bearer-credential-CrAMYo89.js +0 -1
- package/dist/chunks/oauth-login-E8UJj8UQ.js +0 -1
- package/dist/chunks/openapi-commands-Bn5UfQTY.js +0 -1
- package/dist/chunks/openapi-commands-XSw0ZcJR.js +0 -1
- package/dist/chunks/output-mode-ClwZIjEf.js +0 -1
- package/dist/chunks/output-mode-DTYU9WPD.js +0 -1
- package/dist/chunks/provider-catalog-B3ghWM0D.js +0 -1
- package/dist/chunks/result-envelope-BQn5YxYv.js +0 -1
- package/dist/chunks/startup-auth-BgliDNpy.js +0 -1
- package/dist/chunks/startup-auth-V9kB5Weo.js +0 -1
- package/dist/chunks/tool-policy-CrjzsCMg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./commander-BB7CDPLs.js";import{t}from"./result-envelope-D5wNfKzB.js";import{t as n}from"./output-spill-CvlQjh5i.js";var r=`${t/1e3}KB`,i=[{flags:`--text`,description:`Print text (terminal default).`,conflicts:[`data`,`dataFull`,`json`]},{flags:`--data`,description:`Print data JSON (piped default); over ${r} prints a truncated envelope, not the payload; use --to-file.`,conflicts:[`text`,`dataFull`,`json`]},{flags:`--data-full`,description:`Print uncapped JSON for bounded programs; never LLM agents.`,conflicts:[`text`,`data`,`json`,`toFile`]},{flags:`--to-file <path>`,description:`Write the response to <path> and print only a receipt: {spilledTo, byteLength} for an API read, else a 'spilled <bytes> bytes to <path>' line; a failure still prints inline.`,conflicts:[`dataFull`]},{flags:`--json`,description:`Print the stable JSON envelope (capped at ${r}).`,conflicts:[`text`,`data`,`dataFull`]},{flags:`--all-fields`,description:`Print text including the detail fields --text hides; --data and --json already carry every field.`,conflicts:[]}],a=new Intl.ListFormat(`en`,{type:`disjunction`});function o(t){let n=i.map(t=>({spec:t,option:new e(t.flags)}));for(let{spec:e,option:r}of n){let i=n.filter(({option:t})=>e.conflicts.some(e=>e===t.attributeName())).flatMap(({option:e})=>e.long??[]);r.description=i.length===0?e.description:`${e.description} Cannot combine with ${a.format(i)}.`,t.addOption(r.conflicts([...e.conflicts]))}return t}function s(e,t=`auto`){return d(e.toFile)&&n(e.toFile),e.json===!0?`json`:e.dataFull===!0?`data-full`:e.data===!0?`data`:e.text===!0||e.allFields===!0?`text`:u(e)||t===`auto`&&!process.stdout.isTTY?`data`:`text`}function c(e){if(e.includes(`--text`))return!1;let t=e.includes(`--json`)||e.includes(`--data`)||e.includes(`--data-full`);return e.includes(`--all-fields`)&&!t?!1:t||e.includes(`--agent-chassis`)&&e.includes(`--agent-model`)||!process.stdout.isTTY}function l(e){return e===`data`||e===`data-full`||e===`json`}function u(e){return d(e.agentChassis)&&d(e.agentModel)}function d(e){return typeof e==`string`&&e.trim().length>0}export{s as i,c as n,l as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./output-mode-BW9Jfk5x.js";export{e as cliMachineOutputSelected};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./result-envelope-
|
|
1
|
+
import{i as e}from"./result-envelope-D5wNfKzB.js";import{dirname as t}from"node:path";import{mkdirSync as n,writeFileSync as r}from"node:fs";import{Buffer as i}from"node:buffer";var a;function o(e){a=e}function s(e){return typeof e!=`object`||!e||Array.isArray(e)||!Reflect.has(e,`method`)||!Reflect.has(e,`endpoint`)||!(`response`in e)||e.response===void 0?e:e.response}function c(o){let c=a;if(c===void 0)return o;a=void 0;let u=o.data,d=o.ok?u instanceof Uint8Array?u:typeof u==`string`?i.from(u,`utf8`):l(s(u)):l(o);try{n(t(c),{recursive:!0}),r(c,d)}catch(t){return e(`could not spill output to '${c}'`,[String(t)])}return o.ok?typeof u!=`object`||!u||u instanceof Uint8Array||s(u)===u?{...o,data:`spilled ${d.byteLength} bytes to '${c}'`}:{...o,data:{...u,response:{spilledTo:c,byteLength:d.byteLength}}}:o}function l(e){return i.from(JSON.stringify(e,null,2),`utf8`)}export{s as n,c as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e,y as t}from"./person-owner-BJgNYLKX.js";import{Vr as n}from"./dist-Ce24grer.js";var r=t({clerkPublishableKey:e().nullish(),oauthClient:n.nullish()});export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,w as t}from"./person-owner-BJgNYLKX.js";import{d as n,u as r}from"./result-envelope-
|
|
1
|
+
import{S as e,w as t}from"./person-owner-BJgNYLKX.js";import{d as n,u as r}from"./result-envelope-D5wNfKzB.js";var i=/(?:authorization|api-key|secret|token)/iu,a=/^x-cli-[a-z0-9-]*secret$/iu;function o(r,i,a={}){let o=d(a);o.length>0&&(i=s(i,o));let l=e(t(),n).safeParse(i);if(!l.success)return{status:r,title:`HTTP ${r}`,type:`about:blank`,code:void 0,detail:typeof i==`string`?i:void 0};let u=c(l.data),f=typeof u.status==`number`?u.status:r;return{...u,status:f,title:typeof u.title==`string`?u.title:`HTTP ${f}`,type:typeof u.type==`string`?u.type:`about:blank`,detail:typeof u.detail==`string`?u.detail:void 0}}function s(e,t){return typeof e==`string`?f(e,t):typeof e!=`object`||!e?e:Array.isArray(e)?e.map(e=>s(e,t)):Object.fromEntries(Object.entries(e).map(([e,n])=>[f(e,t),s(n,t)]))}function c(e){let t=r.safeParse(e);if(t.success)return e;let n=new Set(t.error.issues.map(e=>String(e.path[0])));return Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))}function l(e,t){if(u(t))return{status:e.status,title:`CLI authorization broker request failed`};let n=d(t),r={};for(let[t,i]of Object.entries(e))i!=null&&(r[t]=typeof i==`object`?JSON.stringify(s(i,n)):typeof i==`string`?f(i,n):i);return r}function u(e){return Object.keys(e).some(e=>a.test(e))}function d(e){let t=[];for(let[n,r]of Object.entries(e)){if(!i.test(n))continue;let e=r.trim();if(e.length===0)continue;t.push(e);let a=e.indexOf(` `);if(a>0){let n=e.slice(a+1).trim();n.length>0&&t.push(n)}}return t}function f(e,t){let n=e;for(let e of t)e!=null&&e.length>0&&(n=n.replaceAll(e,`<redacted>`));return n}function p(e,t){if(u(t))return{status:e.status,title:`CLI authorization broker request failed`,type:`about:blank`,detail:`Broker diagnostic text was suppressed at the CLI credential boundary.`,...h(e)};let n=d(t);if(n.length===0)return e;let r=t=>{let r=e[t];return typeof r==`string`?{[t]:f(r,n)}:{}},i=t=>{let r=e[t];return r==null?{}:{[t]:Object.fromEntries(Object.entries(r).map(([e,t])=>[f(e,n),f(t,n)]))}},a=t=>{let r=e[t];return Array.isArray(r)?{[t]:r.map(e=>f(e,n))}:{}};return{status:e.status,title:f(e.title,n),type:f(e.type,n),...r(`detail`),...r(`hint`),...r(`field`),...r(`suggestion`),...r(`requiredRole`),...r(`existingRecordId`),...i(`suggestions`),...i(`error`),...a(`unknownParameters`),...a(`validParameters`),...e.details===void 0?{}:{details:e.details},...e.resolution===void 0?{}:{resolution:e.resolution},...e.code===void 0?{}:{code:e.code},...e.disposition==null?{}:{disposition:e.disposition},...Array.isArray(e.proseViolation)?{proseViolation:e.proseViolation.map(e=>({...e,passage:f(e.passage,n),reason:f(e.reason,n)}))}:{},...r(`traceId`),...r(`spanId`),...e.limitType===void 0?{}:{limitType:e.limitType},...e.allowanceType===void 0?{}:{allowanceType:e.allowanceType},...e.limit===void 0?{}:{limit:e.limit},...e.used===void 0?{}:{used:e.used},...e.remaining===void 0?{}:{remaining:e.remaining},...e.resetAt===void 0?{}:{resetAt:e.resetAt},...e.windowSeconds===void 0?{}:{windowSeconds:e.windowSeconds},...e.filedRunId?{filedRunId:e.filedRunId}:{},...h(e)}}function m(e,t){if(_(e.retryAfterSeconds)!==void 0)return e;let n=g(t.get(`retry-after`));return n===void 0?e:{...e,retryAfterSeconds:n}}function h(e){let t=_(e.retryAfterSeconds);return t===void 0?{}:{retryAfterSeconds:t}}function g(e){let t=e?.trim()??``;if(/^\d+$/u.test(t))return _(Number(t));let n=/[a-z]/iu.test(t)?new Date(t).getTime():NaN;return Number.isNaN(n)?void 0:_(Math.ceil((n-Date.now())/1e3))}function _(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:void 0}export{p as a,m as c,d as i,o as n,g as o,f as r,_ as s,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,O as t,S as n,T as r,h as i,i as a,l as o,n as s,o as c,p as l,s as u,t as d,u as f,v as p,w as m,y as h}from"./person-owner-BJgNYLKX.js";import{Buffer as g}from"node:buffer";var _=i(()=>r([m(),p(),f(),u(),o(_),n(m(),_)])),v=c([`URL_DUPLICATE`,`STRICT_URL_LOOKUP`,`DUPLICATE_CREATE_REVIEW`,`CLASSIFICATION_INACTIVE_TAG`,`NEWS_SOURCE_URL`]),y=Object.assign(r([v,m()]),{enum:v.enum}),ee=c([`REACTIVATE`,`ATTACH_INACTIVE`]),te=h({availableOverrides:o(ee),conflictType:y,slug:m(),tagId:l()}),b=h({externalId:m().nullish(),id:l(),reason:o(m()),score:l(),slug:m().regex(/^[a-z0-9_-]+$/).max(255).nullish()}),ne=h({externalId:m().nullish(),id:t(),name:m().nullish(),operatingStatus:m().nullish(),publicPath:m().nullish(),reason:o(m()),score:l().optional(),slug:m().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:s.nullish()}),re=h({candidate:o(ne).nullish(),conflictType:y,newsCandidate:o(b).nullish(),overridePath:m().nullish(),threshold:l()}),ie=h({conflictingArticleId:l(),conflictingArticleSlug:m(),conflictingArticleTitle:m(),conflictType:y}),ae=h({candidateEntityId:o(t()),candidatePersonId:o(t()),conflictType:y,hint:m(),normalizedUrl:m().nullish(),url:m(),urlType:m().nullish()}),oe=h({owner:d,urlId:l()}),x=h({conflictType:y,existingJoin:o(oe),fragmentIgnored:f(),guidance:m(),normalizedUrl:m().nullish(),requestedOwner:d,url:m(),urlType:m()}),se=r([x,ae,re,te,ie]),ce=h({acceptedValue:o(m()).nullish(),action:c([`setField`,`setParameter`,`removeParameter`,`useEndpoint`,`reviewCandidates`,`authenticate`]),endpoint:m().nullish(),fieldPath:m().nullish(),parameter:m().nullish(),retryable:f().nullish()}),S=c([`source`,`record`,`disclaimer`,`voice`,`marketing`,`chained`,`structured`,`tense`,`temporal`,`factList`,`mojibake`,`unsupported`,`legalSource`,`textContract`]),C=Object.assign(r([S,m()]),{enum:S.enum}),w=h({overridable:f(),passage:m(),problem:C,reason:m()}),T=c([`entity`,`person`,`news`,`blog`,`content`]),E=h({deletedAt:a({offset:!0}).nullish(),id:m(),isHidden:f(),nameBrand:m().nullish(),resourceType:T,showOnSitemap:f(),slug:m()}),le=h({newUrl:m().nullish(),oldUrl:m(),targetCurrentSlug:m().nullish(),targetId:m().nullish(),targetResourceType:T.nullish()}),D=c([`COMPANY`,`PERSON`,`ENTITY_VIEW`,`ENTITY_BRAND`,`PERSON_VIEW`,`WEB_SEARCH`]),ue=Object.assign(r([D,m()]),{enum:D.enum}),O=h({allowanceType:ue.nullish(),circuitBreaker:m().nullish(),code:r([c(`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.suspectedShellStrip.suspected_shell_strip.prose_rejected.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_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(`.`)),m().max(128)]).nullish(),conflictingRecord:E.nullish(),detail:m().optional(),details:se.nullish(),disposition:c([`TRANSIENT`,`TERMINAL`]).nullish(),error:n(m(),m()).nullish(),existingRecordId:m().nullish(),existingRedirect:le.nullish(),feId:m().nullish(),field:m().nullish(),filedRunId:o(t()).nullish(),hammingDistance:p().int().nullish(),hint:m().nullish(),instance:m().optional(),limit:p().int().nullish(),limitType:r([c([`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`]),m()]).nullish(),matchedBlocklistKey:m().nullish(),mediaType:m().nullish(),moderationReason:m().nullish(),parseError:m().nullish(),path:m().nullish(),properties:n(m(),_).optional(),proseViolation:o(w).nullish(),remaining:p().int().nullish(),requiredRole:m().nullish(),resetAt:a({offset:!0}).nullish(),resolution:ce.nullish(),retryAfterSeconds:p().int().nullish(),spanId:m().nullish(),status:l().optional(),suggestion:m().nullish(),suggestions:n(m(),m()).nullish(),suspectedFragment:m().nullish(),title:m().optional(),traceId:m().nullish(),type:m().optional(),unknownParameters:o(m()).nullish(),used:p().int().nullish(),validParameters:o(m()).nullish(),value:m().nullish(),windowSeconds:p().int().nullish()}),de=e=>e>=500&&e<600,k=r([m(),p(),f()]),fe=h({number:p().optional(),size:p().optional(),numberOfElements:p().optional(),totalElements:p().optional(),totalPages:p().optional(),first:f().optional(),last:f().optional(),empty:f().optional()}),A=h({byteLength:p(),maxBytes:p(),omitted:o(m()),recovery:m()}),j=h({status:p(),title:m(),type:m()}).catchall(_.optional()).and(O);h({ok:f(),summary:m(),httpStatus:p().optional(),operationId:m().optional(),method:m().optional(),endpoint:m().optional(),format:c([`json`,`text`]).optional(),count:p().optional(),page:fe.optional(),filters:n(m(),r([k,o(k)])).optional(),truncated:f().optional(),truncation:A.optional(),omitted:o(m()).default([]),ids:o(m()).default([]),counts:n(m(),p()).default({}),references:o(m()).default([]),warnings:o(m()).default([]),problem:j.optional(),data:e()});var M=5e4,N=[50,25,10,5,1],P=320,F=[{arrayLimit:1/0,rowLimit:1/0,stringLimit:24e3},{arrayLimit:1/0,rowLimit:1/0,stringLimit:1e4},...N.map(e=>({arrayLimit:e,rowLimit:1/0}))],I=1e3,L=/^(?:bio|biography|body|content|description|evidence|fulltext|notes|snippet|summary|text)$/u,R=/(?:description|snippet|summary|text)$/u;function z(e){let t=Z(e)?e:null;if(t===null)return;let n={number:Q(t,`number`),size:Q(t,`size`),numberOfElements:Q(t,`numberOfElements`),totalElements:Q(t,`totalElements`),totalPages:Q(t,`totalPages`),first:$(t,`first`),last:$(t,`last`),empty:$(t,`empty`)};return Object.values(n).some(e=>e!==void 0)?n:void 0}function B(e,t){if(t?.numberOfElements!==void 0)return t.numberOfElements;if(Array.isArray(e))return e.length;let n=Z(e)?e.content:void 0;return Array.isArray(n)?n.length:void 0}function V(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 pe(e,t=[],n={}){return{...V(e,null,{...n,warnings:t}),ok:!1}}function me(e,t={}){let n=g.byteLength(JSON.stringify(e),`utf8`);if(n<=5e4)return e;let r=e.httpStatus??0;if(t.write===!0&&e.ok&&r>=200&&r<300)return he(e,n,t.exactRecovery);let i=t.exactRecovery??`Refetch a narrower result: use ids/references, a more specific list read (e.g. entities relationships list, entities people list, or news list --owner-entity-id), filters, or smaller pages with page and size.`,a=_.safeParse(JSON.parse(JSON.stringify(e.data))),o=t=>{let r=a.success?q(a.data,`data`,n,t):{value:Y(n),omitted:[`data`]};return{...e,truncated:!0,truncation:J(n,r.omitted,i),warnings:[...e.warnings,...t.rowLimit===1/0?[]:[ye(t.rowLimit)],`response truncated (>50KB); read the section through its sub-resource operation, or request a smaller page, a compact projection where the operation offers one, or a narrower server-side filter`],data:r.value}},s=e;for(let e of F)if(s=o(e),W(s))return s;let c=0;for(let t=2**Math.floor(Math.log2(K(e.data)));t>=1;t/=2)W(o({arrayLimit:1,rowLimit:c+t}))&&(c+=t);return c>0?o({arrayLimit:1,rowLimit:c}):H({...s,truncation:J(n,[`data`],i),data:Y(n)},n,i,`response truncated (>50KB); metadata named in truncation.omitted was removed; read the section through its sub-resource operation, or request a smaller page, a compact projection where the operation offers one, or a narrower server-side filter`)}function he(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(Z(e)?e:{}))Array.isArray(s)?r[`${n}${o}`]=s.length:typeof s==`string`?a[o]=G(s,t,P):typeof s!=`object`||!s?a[o]=s:n===``&&o===`response`&&(a[o]=i(s,`response.`));return a},a={...e,summary:`${e.method} succeeded (HTTP ${e.httpStatus}); response body omitted (${t} bytes, over the 50KB cap); do not retry the write`,truncated:!0,truncation:J(t,[`data`],n),counts:r,data:i(e.data,``)},o=a,s=[`data`],c={};for(let r of[`references`,`ids`,`warnings`]){if(W(o))return o;s.push(r),c[r]=[],o={...a,...c,omitted:[...e.omitted,...s.slice(1)],truncation:J(t,s,n)}}return W(o)?o:H({...o,data:Y(t),warnings:[`response truncated (>50KB); do not retry the write`]},t,n,`response truncated (>50KB); metadata named in truncation.omitted was removed; do not retry the write`)}function H(e,t,n,r){if(W(e))return e;let i=e.warnings.slice(0,-1),a=[`data`],o=e;if(o.problem!==void 0){let e=U(o.problem);if(JSON.stringify(e).length<JSON.stringify(o.problem).length&&(a.push(`problem`),o={...o,problem:e,truncation:J(t,a,n)},W(o)))return o}let s=[];if(e.filters!==void 0&&s.push(`filters`),e.omitted.length>0&&s.push(`omitted`),e.ids.length>0&&s.push(`ids`),Object.keys(e.counts).length>0&&s.push(`counts`),e.references.length>0&&s.push(`references`),a.push(...s),o={...o,filters:void 0,truncation:J(t,a,n),omitted:[],ids:[],counts:{},references:[],warnings:s.length===0?e.warnings:[...i,r]},W(o))return o;let c=e=>e===void 0?void 0:G(e,t),l={summary:G(o.summary,t),operationId:c(o.operationId),method:c(o.method),endpoint:c(o.endpoint),warnings:o.warnings.map(e=>G(e,t)),problem:o.problem&&U(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))&&a.push(e);if(o={...o,...l,truncation:J(t,a,n)},W(o))return o;a.push(`warnings`),o.page!==void 0&&a.push(`page`);let d=G(o.summary,t,P);return d!==o.summary&&a.push(`summary`),{...o,summary:d,page:void 0,truncation:J(t,a,n),warnings:[r]}}function U(e,t){let n=e=>t===void 0?e:G(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}}}function W(e){return g.byteLength(JSON.stringify(e),`utf8`)<=M}function G(e,t,n=I){if(g.byteLength(JSON.stringify(e),`utf8`)<=n)return e;let r=X(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 K(e){return Array.isArray(e)?e.length:Z(e)?Math.max(0,...Object.values(e).map(K)):0}function q(e,t,n,r){if(typeof e==`string`){let i=_e(be(t))||e.length>I,a=r.stringLimit??P;return!i||e.length<=a?{value:e,omitted:[]}:{value:`${e.slice(0,a).trimEnd()}${X(n)}`,omitted:[t]}}if(typeof e!=`object`||!e)return{value:e,omitted:[]};if(Array.isArray(e))return ge(e,t,n,r);if(t===`data.response.entity.answer`||t===`data.response.answer`)return{value:e,omitted:[]};let i={},a=[];for(let[o,s]of Object.entries(e)){if(s===void 0)continue;let e=q(s,`${t}.${o}`,n,r);i[o]=e.value,a.push(...e.omitted)}return{value:i,omitted:a}}function ge(e,t,n,r){let i=e.slice(0,r.rowLimit),a={...r,rowLimit:r.arrayLimit},o=i.map((e,r)=>q(e,`${t}[${r}]`,n,a)),s=o.flatMap(e=>e.omitted),c=`${t}[${i.length}..] (kept ${i.length} of ${e.length})`;return{value:o.map(e=>e.value),omitted:e.length>i.length?[...s,c]:s}}function _e(e){let t=e.toLowerCase();return L.test(t)||R.test(t)}var ve=`Refetch a narrower result: use ids/references, a more specific list read (e.g. entities relationships list, entities people list, or news list --owner-entity-id), filters, or smaller pages with page and size.`;function J(e,t,n){return{byteLength:e,maxBytes:M,omitted:t.length===0?[`data`]:[...new Set(t)],recovery:G(n,e)}}function Y(e){return{truncated:!0,byteLength:e,maxBytes:M}}function X(e){return`\n[truncated byteLength=${e} maxBytes=${M}]`}var ye=e=>`kept the first ${e} whole rows of each list; read the rest ${e} at a time: rerun a paged read with --size ${e} and --page 1, 2, … (MCP: size, page), or a batch read with at most ${e} ids per call`;function be(e){return(e.split(`.`).at(-1)??e).replace(/\[\d+\]$/,``)}var Z=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Q(e,t){return typeof e[t]==`number`?e[t]:void 0}function $(e,t){return typeof e[t]==`boolean`?e[t]:void 0}export{W as a,V as c,_ as d,pe as i,de as l,ve as n,z as o,me as r,B as s,M as t,O as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./startup-auth-BJ3mNNZp.js";export{e as commandAuthMaterializationMode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./commander-BB7CDPLs.js";import{o as r,u as i}from"./env-YDNggcP1.js";import{c as a,i as o}from"./result-envelope-D5wNfKzB.js";import{_ as s}from"./tool-policy-D7R8FUUe.js";import{r as c}from"./cli-help-policy-RGOSoZ1Z.js";function l(e,t){return e.parameters.filter(e=>e.required&&t[e.optionKey]===void 0).map(e=>e.flag)}function u(e,t){return(e.requestBody?.length??0)>1&&typeof t.contentType==`string`?t.contentType:void 0}var d=e=>typeof e==`string`&&e.trim()===``;function f(e,t){let n=new Set([...t.parameters,...(t.requestBody??[]).flatMap(({parameter:e})=>e)].filter(e=>e.required).map(e=>e.optionKey));for(let t of e.options){let r=t.attributeName(),i=e.getOptionValue(r);if(!(Array.isArray(i)?i.some(d):d(i)))continue;let a=Array.isArray(i)?i.filter(e=>!d(e)):[];if(a.length>0){e.setOptionValue(r,a);continue}n.has(r)&&e.error(`error: option '${t.flags}' requires a value`),e.setOptionValue(r,void 0)}}function p(e){return e.split(` `)[0]??e}function m(e){if(e.requestBody===void 0||e.requestBody.length===0){let[t,n]=e.parameters.filter(e=>e.required);return n===void 0&&t?.schemaType===`string`?t:void 0}if(e.requestBody.length!==1||e.parameters.some(e=>e.required))return;let t=e.requestBody[0]?.parameter??[],n=t.filter(e=>e.required);if(n.length===1&&n[0]?.schemaType===`string`)return n[0];if(n.length!==0||e.intent!==`search`)return;let r=t.filter(e=>{let t=e.name.split(`.`).at(-1);return e.schemaType===`string`&&(t===`query`||t===`search`)});return r.length===1?r[0]:void 0}function h(e,t,n){let r=t.join(` `).trim();return r.length===0?a(`No positional text`,n):n[e.optionKey]===void 0?a(`Positional text parsed`,{...n,[e.optionKey]:r}):o(`Unexpected argument "${r}": ${p(e.flag)} already sets this value, and this command has no subcommand by that name. Drop "${r}".`)}var g={addresses:{summary:`List Address Links`,section:`administration`},"addresses links":{summary:`Returns entity and person association ids, owner ids, and nullable roles for a physical address, including historical associations`},agents:{summary:`Deprecated: Answer a Natural-Language Platform Help Question`,section:`cli`},"agents help":{summary:`Deprecated: use help ask (POST /v1/help) with the same body`},auth:{summary:`Sign-in, session, API key, and CLI authorization endpoints`,section:`account`},"auth api-key":{summary:`Get Current API Key`},"auth me":{summary:`Current User Permissions`},"auth me permissions":{summary:`Returns the current caller's resolved roles and permissions`},"auth providers":{summary:`Get the Sign-In Options`},billing:{summary:`Plans, prices, subscription, usage, and upgrades`,section:`account`},"billing additional-usage":{summary:`Update Additional Usage Settings`},"billing ai-credits":{summary:`Read the Current AI Credit Allowance`},"billing checkout-sessions":{summary:`Create or Recover a Checkout Session`},"billing credit-purchases":{summary:`Read a Prepaid Credit Purchase Confirmation`},"billing plan-change-previews":{summary:`Preview a Subscription Plan Change`},"billing plan-changes":{summary:`Change the Subscription Plan`},"billing plans":{summary:`List Subscription Tiers and Plans`},"billing portal-sessions":{summary:`Create a Hosted Billing Portal Session`},"billing subscription":{summary:`Read the Current Billing Subscription`},"billing subscription next-charge":{summary:`Preview the Next Subscription Charge`},"billing subscription payment-profile":{summary:`Read Your Card on File and Introductory Offer`},directory:{summary:`List Shared Directory Views`,section:`researchData`},"directory shared":{summary:`Share a Directory View`},"directory shared slug":{summary:`Read a Shared Directory View by Slug`},enrichments:{summary:`Enrich Many Companies and People`,section:`researchData`},entities:{summary:`Companies and funds: people, funding, and news`,section:`researchData`},"entities acquisitions":{summary:`Acquisitions a company made or was part of`},"entities addresses":{summary:`A company's recorded office and headquarters addresses`},"entities blog-posts":{summary:`External blog and article links for entities and people`},"entities brand":{summary:`Get a Company's Names, Logos, Links, and Tags`},"entities classifications":{summary:`Classification tags on a company, and suggested tags`},"entities classifications catalog":{summary:`Get the Company Classification Taxonomy`},"entities classifications suggestions":{summary:`Suggest Classifications for a Company`},"entities classifications tags":{summary:`List Classification Tags`},"entities content":{summary:`Publications about one company or person, and platform-wide publication search`},"entities content facets":{summary:`Count a Company's Publications`},"entities employee-counts":{summary:`List a Company's Headcount Over Time`},"entities enrichments":{summary:`Enrich One Company, Product, or Service`},"entities filters":{summary:`Filter options for company listings: available values, refinement, and option search`},"entities fundraise-investor-joins":{summary:`List the Investors in a Funding Round`},"entities fundraise-rounds":{summary:`List a Company's Funding Rounds`},"entities investments":{summary:`List the Investments a Company Made`},"entities investor-activity":{summary:`Get Investor Activity`},"entities investors":{summary:`List a Company's Investors`},"entities logo":{summary:`Get a Company Logo`},"entities lookup-exact":{summary:`Read Full Entity Detail by aVenture Profile URL, Slug, Website, or Domain`},"entities people":{summary:`People linked to companies, and the role each one holds`},"entities person-investors":{summary:`List Person Investors`},"entities relationships":{summary:`Relationships between companies, investors, and other organizations`},"entities relationships types":{summary:`List Entity Relationship Types`},"entities repositories":{summary:`List a Company's GitHub Repositories`},"entities research":{summary:`Get the Research Gathered About a Company`},"entities research-details":{summary:`List Research Details`},"entities research-details types":{summary:`List the Accepted Research Detail Types`},"entities research-snippets":{summary:`List Research Snippets`},"entities research-snippets types":{summary:`List the Accepted Research Snippet Types`},"entities sec":{summary:`Get SEC EDGAR Facts for a Public Company`},"entities similar":{summary:`Similar companies and lean similar-company summaries by id`},"entities similar summary":{summary:`Get Similar Company Summaries by ID`},"entities slug":{summary:`Get a Company's Slug`},"entities texts":{summary:`Descriptions and other written text for companies and people`},"entities texts types":{summary:`List the Accepted Company Text Types`},"entities trending-news":{summary:`List Trending News About a Company`},"entities types":{summary:`List the Accepted typeRecord Values`},"entities unique-ids":{summary:`External identifiers and the records they name`},"entities urls":{summary:`Websites, social profiles, and other URLs for companies and people`},"entities valuations":{summary:`List a Company's Valuation Over Time`},help:{summary:`Answer a Natural-Language Platform Help Question`,section:`cli`},lookup:{summary:`Read a Company, Product, Service, or Person Identity`,section:`researchData`},"lookup-from-file":{summary:`Identify a Company, Product, Service, or Person by Name, URL, or ID`,section:`researchData`},"lookup-jobs":{summary:`Async article and bulk name identification`,section:`researchData`},"lookup-mentions":{summary:`Identify Every Company and Person a Page or Screenshot Names`,section:`researchData`},metrics:{summary:`Get Platform Totals for Companies, Funding, and People`,section:`cli`},news:{summary:`News linked to the companies and people in it`,section:`researchData`},"news feedback":{summary:`Submit News Feedback`},"news related-entities":{summary:`List the Entities a News Article Is About`},"news subscriptions":{summary:`List Entity News Subscriptions`},"news subscriptions test-events":{summary:`Send a Test News Event`},"news thumbnail":{summary:`Get News Thumbnail`},people:{summary:`Founders and investors, and what they back`,section:`researchData`},"people addresses":{summary:`A person's recorded addresses`},"people blog-posts":{summary:`External blog and article links for entities and people`},"people content":{summary:`Publications about one company or person, and platform-wide publication search`},"people content facets":{summary:`Count a Person's Publications`},"people enrichments":{summary:`Enrich One Person`},"people entities":{summary:`People linked to companies, and the role each one holds`},"people filters":{summary:`Filter options for people listings and option search`},"people graph":{summary:`Get Person Graph`},"people investments":{summary:`List a Person's Investments`},"people investor-activity":{summary:`Get Person Investor Activity`},"people lookup-exact":{summary:`Read One Person's Full Detail by aVenture Profile URL, Slug, or URL`},"people photo":{summary:`Get Person Photo`},"people repositories":{summary:`List a Person's GitHub Repositories`},"people similar":{summary:`List People Similar to One Person`},"people texts":{summary:`Descriptions and other written text for companies and people`},"people texts types":{summary:`List the Accepted Person Text Types`},"people unique-ids":{summary:`External identifiers and the records they name`},"people urls":{summary:`Websites, social profiles, and other URLs for companies and people`},"research-runs":{summary:`Research requests you file for a company, Product, Service, or person, and their progress`,section:`researchData`},"research-runs presets":{summary:`List Research Presets`},resolve:{summary:`Deprecated: Resolve an Entity or Person by Identifier Token`,section:`researchData`},search:{summary:`Search Companies, People, and News Together`,section:`researchData`},"search link":{summary:`Search From a Page URL`},"search link jobs":{summary:`Get a Link Search Job`},"search natural":{summary:`Find companies and people in natural language`},"search shared":{summary:`Search companies, people, and news, or by URL`},"search shared slug":{summary:`Read a Shared Search by Slug`},"unique-ids":{summary:`External identifiers and the records they name`,section:`researchData`},"unique-ids types":{summary:`List the Accepted Unique Identifier Types`},"url-types":{summary:`List URL Types`,section:`researchData`},web:{summary:`Search the Live Web`,section:`researchData`},"web searches":{summary:`Get an Async Web Search Job`},"web searches jobs":{summary:"Reads the web-search job a `Prefer: respond-async` search accepted"}};function _(e){return b(e,v())}function v(){return!!i().userBearerToken?.trim()}function y(e){return v()||!c(e,g)}function b(e,t){return t?e:e.filter(e=>!c(e.cliPath[0],g)||e.visibility!==`private`).map(x)}function x(e){let t=e.parameters.filter(S),n=e.requestBody?.map(e=>{let t=e.parameter.filter(S);return t.length===e.parameter.length?e:{...e,parameter:t}}),r=n?.every((t,n)=>t===e.requestBody?.[n]);return t.length===e.parameters.length&&r!==!1?e:{...e,parameters:t,requestBody:n}}var S=e=>e.visibility!==`private`;function C(i,a){let o=i.indexOf(`--`),l=i.slice(0,o===-1?i.length:o);if(l.some(e=>e===`--version`||e===`-V`))return`none`;let d=new n().exitOverride().configureOutput({writeErr:()=>void 0}).addOption(new e(`--environment <environment>`,`route all API calls to a mapped API environment`).choices([...r()])).addOption(new e(`--content-type <media-type>`)).addOption(new e(`--ask <question>`)),f=d.parseOptions([...i]).operands,p=d.opts().environment;p!==void 0&&(process.env.API_ENV=p);let m=a.find(e=>w(f,e.cliPath)),h=m===void 0?void 0:u(m,d.opts());if(m!==void 0&&h!==void 0){let e=s(m.requestBody??[],h);if(!e.ok)throw new t(e.summary)}let _=f.at(0);if(_===void 0)return`stored`;if(_===`update`||_===`auth`&&m===void 0)return`none`;let v=d.opts().ask;return l.some(e=>e===`--help`||e===`-h`)?(m??(_===`help`&&v===void 0?a.find(e=>w(f.slice(1),e.cliPath)):void 0))!==void 0||c(_,g)?`stored`:`none`:c(_,g)?`required`:_===`help`?m===void 0?v===void 0?`stored`:f.length===1?`required`:`none`:`required`:_===`agents`&&f[1]===`setup`?`required`:[`command-catalog`,`completion`].includes(_)?`optional`:_===`batch`?`required`:m===void 0?`optional`:`required`}function w(e,t){return t.every((t,n)=>e[n]===t)}export{g as a,l as c,h as d,_ as i,f as l,C as n,u as o,b as r,p as s,y as t,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./commander-BB7CDPLs.js";import{C as t,S as n,T as r,g as i,h as a,l as o,o as s,u as c,v as l,w as u,y as d}from"./person-owner-BJgNYLKX.js";import{c as f,d as p,i as m}from"./result-envelope-D5wNfKzB.js";import{basename as h,extname as ee}from"node:path";import{AsyncLocalStorage as te}from"node:async_hooks";import{readFile as ne}from"node:fs/promises";function g(e){return new URL(e,`https://placeholder.invalid`).pathname}function _(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean);return n.length!==r.length||r.some(re)?!1:n.every((e,t)=>v(e)||e===r[t])}function v(e){let t=e.slice(1,-1);return e.startsWith(`{`)&&e.endsWith(`}`)&&t.length>0&&!t.includes(`/`)&&!t.includes(`{`)&&!t.includes(`}`)}function re(e){if(v(e))return!0;let t=e.toLowerCase(),n=e.slice(3,-3);return t.startsWith(`%7b`)&&t.endsWith(`%7d`)&&n.length>0&&!n.includes(`/`)&&!n.includes(`%`)&&!n.includes(`{`)&&!n.includes(`}`)}var y=new te,b=()=>y.getStore()?.requestId,ie=()=>y.getStore()?.userBearerToken;function ae(e,t){return y.run({...y.getStore(),requestId:e},t)}function x(e,t){return y.run({...y.getStore(),userBearerToken:e},t)}var S=[`get`,`post`,`put`,`patch`,`delete`],C={get:`GET`,post:`POST`,put:`PUT`,patch:`PATCH`,delete:`DELETE`},oe=e=>C[e];function se(e){let t=e.toLowerCase(),n=S.find(e=>e===t);if(n===void 0)throw Error(`Unsupported OpenAPI method: ${e}`);return n}var ce=[`oauth`,`start`,`poll`,`acknowledge`,`revoke`],w=t({name:u().regex(/^[A-Z][A-Z0-9_]*$/u)}),T=r([i(`private`),d({scope:u().optional(),value:u().optional()})]),E=a(()=>d({$ref:u().optional(),description:u().optional(),type:r([u(),o(u())]).optional(),format:u().optional(),default:p.optional(),enum:o(p).optional(),"x-extensible-enum":o(p).optional(),"x-aventure-parsed-enum":c().optional(),readOnly:c().optional(),items:E.optional(),minItems:l().int().nonnegative().optional(),maxItems:l().int().nonnegative().optional(),properties:n(u(),E).optional(),required:o(u()).optional(),oneOf:o(E).optional(),anyOf:o(E).optional(),allOf:o(E).optional(),propertyNames:E.optional(),additionalProperties:r([E,c()]).optional(),"x-aventure-visibility":T.optional(),"x-aventure-cli-conflicts":o(o(u().min(1)).min(2)).min(1).optional(),"x-aventure-env":w.optional(),"x-aventure-detail":i(!0).optional(),"x-aventure-operation-only":o(u().min(1)).min(1).optional()})),le=d({in:u(),name:u(),required:c().optional(),description:u().optional(),schema:E.optional(),"x-aventure-visibility":T.optional(),"x-aventure-legacy-name":t({name:u().trim().min(1)}).optional()}).superRefine((e,t)=>{let n=e[`x-aventure-legacy-name`]?.name;n!==void 0&&(e.in!==`path`&&t.addIssue({code:`custom`,path:[`x-aventure-legacy-name`],message:`x-aventure-legacy-name is valid only for path parameters`}),n===e.name&&t.addIssue({code:`custom`,path:[`x-aventure-legacy-name`,`name`],message:`Legacy path parameter name must differ from its canonical name`}))}),D=n(u(),d({schema:E.optional()})),ue=d({description:u().optional(),content:D.optional(),"x-aventure-standard-response":c().optional()}),O=d({description:u().optional(),required:c().optional(),content:D.optional()}),de=t({auth:s([`none`,`read`]).optional()}).optional(),k=r([i(``),u().regex(/^(?:\/(?:[^~/]|~[01])*)+$/)]),A=t({readOperationId:u().min(1),writePointer:k,readPointer:k}),j=u().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)* [a-z0-9]+(?:-[a-z0-9]+)*$/u),M=u().regex(/^[a-z][A-Za-z0-9]*$/u),N=u().regex(/^--(?:no-)?[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u),P=t({command:j,role:s(ce),summary:u().trim().min(1).optional(),description:u().trim().min(1).optional(),bodyOption:o(M).min(1).optional(),localOption:o(t({optionKey:M,flag:N,description:u().trim().min(1)})).min(1).optional()}).superRefine((t,n)=>{let r=[t.bodyOption??[],(t.localOption??[]).map(e=>e.optionKey),(t.localOption??[]).map(e=>e.flag)].some(e=>new Set(e).size!==e.length),i=(t.localOption??[]).some(t=>new e(t.flag).attributeName()!==t.optionKey);(r||i)&&n.addIssue({code:`custom`,message:`Composite CLI options must be unique and match their local flags`})}).optional(),F=d({operationId:u(),summary:u().optional(),description:u().optional(),tags:o(u()).optional(),deprecated:c().optional(),hidden:c().optional(),security:o(n(u(),o(u()))).optional(),parameters:o(le).optional(),requestBody:O.optional(),responses:n(u(),ue),"x-aventure-visibility":T.optional(),"x-aventure-tool":de,"x-aventure-mutation-readback":A.optional(),"x-aventure-cli-composite":P}).superRefine((e,t)=>{let n=e.parameters??[];for(let[e,r]of n.entries()){let i=r[`x-aventure-legacy-name`]?.name;r.in===`path`&&i!==void 0&&n.some((t,n)=>n!==e&&t.in===`path`&&(t.name===i||t[`x-aventure-legacy-name`]?.name===i))&&t.addIssue({code:`custom`,path:[`parameters`,e,`x-aventure-legacy-name`,`name`],message:`Legacy path parameter name '${i}' collides with another declared path parameter`})}}),I=d(Object.fromEntries(S.map(e=>[e,F.optional()]))),L=d({$ref:u().optional(),description:u().optional(),type:r([u(),o(u())]).optional(),format:u().optional(),default:p.optional(),enum:o(p).optional(),"x-extensible-enum":o(p).optional(),"x-aventure-parsed-enum":c().optional(),readOnly:c().optional(),items:E.optional(),minItems:l().int().nonnegative().optional(),maxItems:l().int().nonnegative().optional(),oneOf:o(E).optional(),anyOf:o(E).optional(),allOf:o(E).optional(),propertyNames:E.optional(),additionalProperties:r([E,c()]).optional(),properties:n(u(),E).optional(),required:o(u()).optional(),"x-aventure-visibility":T.optional(),"x-aventure-cli-conflicts":o(o(u().min(1)).min(2)).min(1).optional(),"x-aventure-env":w.optional(),"x-aventure-detail":i(!0).optional(),"x-aventure-noun":t({one:u().trim().min(1),other:u().trim().min(1)}).optional()});d({info:d({description:u().optional()}).optional(),tags:o(d({name:u(),description:u().optional(),"x-aventure-cli":t({section:s([`researchData`,`account`,`administration`,`cli`])}).optional()})).optional(),paths:n(u(),I),webhooks:n(u(),d({post:d({description:u(),requestBody:O})})).optional(),components:d({schemas:n(u(),L)})}).superRefine((e,t)=>{for(let[n,r]of Object.entries(e.paths))for(let i of S){let a=r[i]?.[`x-aventure-mutation-readback`];a!==void 0&&B(e.paths,a.readOperationId)===null&&t.addIssue({code:`custom`,path:[`paths`,n,i,`x-aventure-mutation-readback`,`readOperationId`],message:`mutation readback names '${a.readOperationId}', which no operation in this document emits`})}});var R=new Set([`page`,`size`,`sort`]);function z(e){return e?.$ref?.startsWith(`#/components/schemas/`)===!0?e.$ref.slice(21):void 0}function B(e,t){for(let[n,r]of Object.entries(e))for(let e of S){let i=r[e];if(i?.operationId===t)return{method:e,template:n,operation:i}}return null}function V(e,t,n){let r=g(n),i=e[r]?.[t];if(i)return{method:t,template:r,operation:i};for(let[n,i]of Object.entries(e)){let e=i[t];if(e&&_(n,r))return{method:t,template:n,operation:e}}return null}function H(e,t,n=e){return e.replace(/\{([^}]+)}/g,(...e)=>{let r=e[1],i=t[r];if(i==null)throw Error(`Missing path parameter '${r}' for ${n}`);return encodeURIComponent(String(i))})}function fe(e,t,n){let r=t;for(let i of e.parameters??[]){let e=i[`x-aventure-legacy-name`]?.name;if(i.in!==`path`||e===void 0)continue;let a=t[e];if(Object.hasOwn(t,e)&&a!==void 0){if(Object.hasOwn(t,i.name))throw Error(`Path parameters '${i.name}' and legacy alias '${e}' were both supplied for ${n}`);r===t&&(r={...t}),r[i.name]=a,delete r[e]}}return r}function pe(e,t){let n={};for(let r of e.parameters??[]){if(r.in!==`query`||R.has(r.name))continue;let e=t?.[r.name]??me(r.schema?.default);e!==void 0&&(n[r.name]=e)}return Object.keys(n).length===0?void 0:n}function me(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`||Array.isArray(e)&&e.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return e}var U=3e4;async function he(e,t,n,r){let i=G(W(e.requestBody?.content),n);if(!i.ok||i.data===null)return m(i.summary,i.warnings);let a=i.data;if(e.requestBody?.required===!0&&t===void 0&&a?.kind!==`multipart`)return m(`Request body is required.`);if(a?.kind===`multipart`)return await ve(e.requestBody?.required===!0,a.schema,t);let o=a?.contentType??r;return f(`Request body prepared`,{...t===void 0?{}:{body:t},...o===void 0?{}:{contentType:o}})}function ge(e){if(typeof e!=`string`)return f(`Request body unchanged`,e);let t=e.trimStart().slice(0,1);if(t!==`{`&&t!==`[`)return f(`Request body unchanged`,e);try{let t=p.safeParse(JSON.parse(e));if(!t.success)throw t.error;return f(`Request body parsed`,t.data)}catch(e){return m(`Request body string must be valid JSON: ${e instanceof Error?e.message:String(e)}`)}}function _e(e,t){let n=e?.schema;if(n===void 0)return!1;let r=z(n),i=n.type??(r===void 0?void 0:t[r]?.type);return Array.isArray(i)?i.includes(`array`):i===`array`}function W(e){let t=Object.entries(e??{});return[...t.flatMap(e=>Ee(e[0])?[K(e,`json`)]:[]),...t.flatMap(e=>De(e[0])?[K(e,`multipart`)]:[])]}function G(e,t){if(t===void 0)return f(`Default request content selected`,e[0]);let n=Z(t),r=e.find(e=>Z(e.contentType)===n);return r===void 0?m(`Request Content-Type '${t}' is not supported. Supported choices: ${e.map(({contentType:e})=>e).join(`, `)||`none`}.`):f(`Explicit request content selected`,r)}function K(e,t){let n=e[1].schema;return{contentType:e[0],kind:t,...n===void 0?{}:{schema:n}}}async function ve(e,t,n){if(!e&&n==null)return f(`Optional multipart body omitted`,{});let r=ye(n);if(!r.ok||r.data===null)return m(r.summary,r.warnings);let i=new FormData;for(let e of be(t)){let t=r.data[e.name];if(t==null){if(e.required)return m(`Multipart body requires '${e.name}'.`);continue}if(Array.isArray(t)&&t.length<(e.schema.minItems??0))return m(`Multipart part '${e.name}' requires more entries.`);if(Array.isArray(t)&&t.length>(e.schema.maxItems??2**53-1))return m(`Multipart part '${e.name}' has too many entries.`);if(q(e.schema)||J(e.schema)){let n=J(e.schema)?t:[t];if(!Array.isArray(n)||n.some(e=>typeof e!=`string`))return m(`Multipart part '${e.name}' must contain file paths or URLs.`);for(let t of n){if(typeof t!=`string`)continue;let n=await Se(t);if(!n.ok||n.data===null)return m(n.summary,n.warnings);i.append(e.name,n.data.blob,n.data.filename)}}else if(xe(e.schema,t)){let n=JSON.stringify(t);i.append(e.name,new Blob([n],{type:`application/json`}),`${e.name}.json`)}else{let n=Y(i,e.name,t);if(!n.ok)return n}}return f(`Multipart body prepared`,{body:i})}function ye(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=Object.fromEntries(Object.entries(e));return f(`Multipart input parsed`,t)}return m(`Multipart request body must be a JSON object keyed by form part name.`)}function be(e){let t=new Set(e?.required??[]);return Object.entries(e?.properties??{}).map(([e,n])=>({name:e,schema:n,required:t.has(e)}))}function q(e){return e.type===`string`&&e.format===`binary`}function J(e){return e.type===`array`&&e.items!==void 0&&q(e.items)}function xe(e,t){return typeof t!=`object`||!t||Array.isArray(t)?!1:e.type===`object`||typeof e.$ref==`string`&&e.$ref.length>0}function Y(e,t,n){if(Array.isArray(n)){for(let r of n){let n=Y(e,t,r);if(!n.ok)return n}return f(`Multipart scalar array appended`,null)}return typeof n==`object`?m(`Multipart part '${t}' must be scalar.`):(e.append(t,String(n)),f(`Multipart scalar appended`,null))}async function Se(e){return Te(e)?await Ce(e):b()===void 0?await we(e):m(`MCP callers cannot upload local files: pass an http(s) URL as the multipart part, or send media by sourceUrl in a JSON body. Local file paths are CLI-only.`)}async function Ce(e){let t=new AbortController,n=setTimeout(()=>t.abort(),U);try{let n=new URL(e),r=await fetch(e,{signal:t.signal});if(!r.ok)return m(`Failed to fetch media URL: ${r.status} ${r.statusText}`);let i=r.headers.get(`content-type`)?.split(`;`)[0]?.trim()??X(n.pathname)??``,a=new Blob([await r.arrayBuffer()],{type:i});return f(`URL media fetched`,{blob:a,filename:h(n.pathname)||`upload`})}catch(e){return t.signal.aborted?m(`Failed to fetch media URL: timed out after ${U}ms.`):m(`Failed to fetch media URL: ${e instanceof Error?e.message:String(e)}`)}finally{clearTimeout(n)}}async function we(e){try{let t=X(e)??``,n=await ne(e);return f(`File media read`,{blob:new Blob([n],{type:t}),filename:h(e)})}catch(t){return m(`Failed to read media file '${e}': ${t instanceof Error?t.message:String(t)}`)}}function Te(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}function X(e){return Oe[ee(e).toLowerCase()]}function Ee(e){let t=Z(e);return t===`*/*`||t===`application/json`||t.endsWith(`+json`)}function De(e){return Z(e)===`multipart/form-data`}var Z=e=>e.split(`;`)[0]?.trim().toLowerCase()??``,Oe={".gif":`image/gif`,".heic":`image/heic`,".heif":`image/heif`,".jpeg":`image/jpeg`,".jpg":`image/jpeg`,".png":`image/png`,".webp":`image/webp`};function ke(e,t,n){let r=new Map,i=(t,a,o)=>{let s=z(t);if(a>n||s!==void 0&&o.includes(s))return;let c=s===void 0?o:[...o,s],l=je(e,t);for(let e of[...l.items===void 0?[]:[l.items],...l.oneOf??[],...l.anyOf??[],...l.allOf??[]])i(e,a,c);for(let[e,t]of Object.entries(l.properties??{}))r.set(e,Math.min(r.get(e)??a,a)),i(t,a+1,c)};for(let[e,n]of Object.entries(t))e.startsWith(`2`)&&i(Ae(n.content),0,[]);return r}function Ae(e){return e?.[`application/json`]?.schema??Object.values(e??{}).find(e=>e.schema!==void 0)?.schema}function je(e,t){let n=z(t);return{...n===void 0?void 0:e.components.schemas[n],...t}}function Me(e){return e===`write`||e===`delete`}function Ne(e,t){return e===`DELETE`||t===`delete`}var Pe=`Shell-safe input: single-quote string flag values that contain $; use --from-file or stdin for JSON bodies, multiline text, and free text with currency amounts.`;function Fe(e,t){let n=e===`array`?t:e;return n===void 0||n===`string`}var Q={add:`write`,answer:`search`,ask:`search`,attach:`write`,audit:`read`,batch:`lookup`,convert:`write`,create:`write`,delete:`delete`,enrich:`write`,filter:`search`,get:`read`,import:`write`,join:`write`,list:`read`,lookup:`lookup`,merge:`write`,preview:`lookup`,reconcile:`write`,remove:`delete`,replace:`write`,resolve:`lookup`,search:`search`,status:`read`,suggest:`read`,update:`write`,upload:`write`};function Ie(e){let t=/^[a-z]+/u.exec(e)?.[0];if(t===void 0)throw Error(`operationId '${e}' has no verb`);return t}function Le(e){return e!==`/v1/auth/api-key`&&!/^\/v1\/sitemap(?:\/|$)/u.test(e)}var Re=/(?:^|-)(?:runs|jobs)$/u;function ze(e){switch(e.intent){case`read`:case`lookup`:case`search`:case`status`:case`job`:return e.intent;case`write`:{let t=Ie(e.operationId);return t===`enrich`||t===`create`&&Re.test(e.cliPath.at(-2)??``)?`job`:null}case`delete`:return null;default:{let t=e.intent;throw Error(`No public MCP intent for ${String(t)}`)}}}function Be(e){let t=Object.entries(e.responses).filter(([e])=>e.startsWith(`2`));return t.length>0&&t.every(([,e])=>Object.values(e.content??{}).some(e=>Ve(e.schema)))}function Ve(e){return e?.format===`byte`||e?.format===`binary`}function He(e){return`aventure_${e}`}function $(e){return e.replace(/([a-z0-9])([A-Z])/gu,`$1-$2`).replace(/[^A-Za-z0-9]+/gu,`-`).replace(/^-+|-+$/gu,``).toLowerCase()}var Ue=e=>`--${$(e)}`;export{x as A,se as C,b as D,z as E,ie as O,B as S,V as T,G as _,Ue as a,H as b,He as c,ze as d,ke as f,_e as g,W as h,Fe as i,g as j,ae as k,Le as l,he as m,Q as n,Ne as o,ge as p,Be as r,Me as s,Pe as t,$ as u,S as v,pe as w,fe as x,oe as y};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aventurevc/aventure-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.185",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Command-line access to aVenture research data on companies, people, funding, and news.",
|
|
6
6
|
"homepage": "https://docs.aventure.vc/cli",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"aventurePublicApi": {
|
|
35
35
|
"repository": "aventurevc/aventure-docs",
|
|
36
|
-
"commit": "
|
|
36
|
+
"commit": "d01366ea2b21551a356105e09c7475d53aabd355",
|
|
37
37
|
"openapiPath": "openapi/openapi.json",
|
|
38
|
-
"openapiSha256": "
|
|
38
|
+
"openapiSha256": "d0250e2a73b3ea3ac5a8a2f9761fc2a7f2a76e68e5123fc1efd8a77929cca541"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {}
|
|
41
41
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./api-key-bearer-credential-Cxons3cm.js";export{e as materializeCliApiKeyBearerCredential};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{C as e,O as t,T as n,i as r,l as i,n as a,o,p as s,t as c,u as l,v as u,w as d,y as f}from"./person-owner-BJgNYLKX.js";import{Fr as p}from"./dist-9kkSpcmP.js";import{a as m,c as ee,d as h,i as g}from"./result-envelope-BQn5YxYv.js";import{a as te}from"./package-DPDX5zmx.js";import{S as ne,a as re,c as ie,d as ae,f as oe,l as se,n as ce,o as le,s as _}from"./tool-policy-CrjzsCMg.js";import{a as ue,n as de,r as v,t as fe}from"./text-field-BoNdbrtA.js";import{C as y,D as pe,E as me,O as he,S as ge,T as _e,_ as ve,a as ye,b as be,c as xe,d as Se,f as Ce,g as we,h as Te,i as Ee,k as De,l as Oe,m as ke,n as Ae,o as je,p as Me,r as Ne,s as Pe,t as Fe,u as Ie,v as Le,w as Re,x as ze,y as Be}from"./detail-DIjiKrvq.js";import{a as Ve,o as He}from"./cli-help-policy-CEZmY2LL.js";import{Buffer as b}from"node:buffer";var x=o([`HIGH`,`MEDIUM`,`LOW`]),Ue=o([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),We=Object.assign(n([Ue,d()]),{enum:Ue.enum}),Ge=f({excerpt:d(),sourceId:d(),sourceType:We,sourceVersion:d().nullish()}),Ke=f({instruction:d(),operationId:d(),stepKey:d().optional()}),qe=f({body:d(),expectation:d(),method:i(d()),override:d(),reject:i(d()),typeCatalog:d()}),Je=f({cliCommand:d(),mcpTool:d().nullish(),step:Ke,writeGuidance:qe.nullish()}),Ye=o([`ENTITY`,`TEXT`,`WRITER_BRIEF`]),Xe=Object.assign(n([Ye,d()]),{enum:Ye.enum}),Ze=f({allowedValue:d().nullish(),description:d(),key:d(),type:Xe}),Qe=f({catalogRevision:s().optional(),gateId:i(d()).optional(),input:i(Ze),step:i(Je),taskKey:d().optional()}),S=o([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),$e=f({candidate:i(Ge),operationId:d().nullish(),outcome:S,probability:u().nullish(),taskKey:d().nullish(),taskPlan:Qe.nullish()}),et=f({answer:d(),citation:i(Ge),confidence:x,resolution:$e.nullish()});function C(e,t,n=t.inputName){if(t.in===`body`)return n;let r=ft.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?dt(ct(n!==`id`&&n!==`slug`?n:`${it(e.path)}${st(n)}`),t):r.inputName}function tt(e,t,n=ot(e)){return nt(at(e,t),new Set(n))}function nt(e,t){if(!t.has(e))return e;let n=`body${st(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function rt(e,t,n){return`${e}[${t}].${n}`}function it(e){return pt.find(([,t])=>t.test(e))?.[0]??`record`}function at(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=lt(t);return dt(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?ct(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function ot(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>C(e,t)))}function st(e){return e.replace(/^./u,e=>e.toUpperCase())}function ct(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 lt(e){let t=ct(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?ut(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function ut(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function dt(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var ft=[{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`}],pt=[[`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 mt(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>ht(t,C(e,t))),r=(t?.parameter??[]).map(t=>ht(t,tt(e,t)));return{selector:n.filter(e=>e.location===`path`||gt(e)),pagination:n.filter(_t),filter:[...n.filter(vt),...r.filter(vt)],body:r.filter(e=>!vt(e))}}function ht(e,t){let{in:n,inputName:r,...i}=e;return{...i,name:e.in===`body`?t:e.name,flag:re(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function gt(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function _t(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function vt(e){return e.location!==`path`&&!gt(e)&&!_t(e)}var w=16e3,yt=(e,t=w)=>e.length<=120&&b.byteLength(`${e.join(`
|
|
2
|
-
`)}\n`,`utf8`)<=t,T=(e,t=!1,n=!1,r=1)=>{let i=de(e),a=t||i.endsWith(`
|
|
3
|
-
`),o=i.endsWith(`
|
|
4
|
-
`)?i.slice(0,-1):i,s=o.length===0?[]:o.split(`
|
|
5
|
-
`),c=b.byteLength(`${s.join(`
|
|
6
|
-
`)}\n`,`utf8`);if(s.length<=120&&c<=16e3)return`${s.join(`
|
|
7
|
-
`)}${a?`
|
|
8
|
-
`:``}`;let l=n?Math.min(Math.max(1,r),118):0,u=l>0?s.slice(-l):[],d=u.length===0?s:s.slice(0,-u.length),f=[s.length>120?`120 physical lines`:``,c>16e3?`${w} UTF-8 bytes`:``].filter(Boolean).join(` and `),p=e=>de(`... output truncated: ${e} more lines omitted to stay within ${f}; recover omitted response content with narrower server-side filters, the relevant sub-resource operation (aventure_help names it), or responseFormat json.`),m=(e,t)=>[...e,...u,t].join(`
|
|
9
|
-
`),ee=120-u.length-1,h=d.slice(0,ee),g=p(s.length-h.length-u.length);for(;b.byteLength(`${m(h,g)}\n`,`utf8`)>w;){if(h.length>0)h=h.slice(0,-1);else if(u.length>0)u=u.slice(1);else break;g=p(s.length-h.length-u.length)}return`${m(h,g)}${a?`
|
|
10
|
-
`:``}`},bt=e=>T(Ct(e.trimEnd().split(`
|
|
11
|
-
`),120).join(`
|
|
12
|
-
`),e.endsWith(`
|
|
13
|
-
`)),xt=new Set([`core`,`nameFull`,`nameBrand`,`name`,`title`,`fundingDetail`,`round`,`dateAnnounced`,`amountRaised`,`person`,`fundraiseRound`]),St=5;function Ct(e,t,n=w){let r=e=>e.length<=t&&yt(e,n);if(r(e))return e;let i=wt(e),a=e=>[...jt(i,e-1),`... output folded to fit 120 lines and ${w} UTF-8 bytes; "(+N lines)" and "N more" mark hidden content; read it whole with responseFormat json, --data --to-file <path>, or the section's sub-resource operation.`],o=2,s=t,c=a(o);for(;o<=s;){let e=Math.floor((o+s)/2),t=a(e);r(t)?(c=t,o=e+1):s=e-1}return c}function wt(e){let t={line:``,child:[]},n=[{node:t,indent:-1}];for(let t of e){let e=D(t);for(;n.length>1&&(n.at(-1)?.indent??-1)>=e;)n.pop();let r={line:t,child:[]};n.at(-1)?.node.child.push(r),n.push({node:r,indent:e})}return t.child}var Tt=new WeakMap,E=e=>{let t=Tt.get(e);if(t!==void 0)return t;let n=e.child.reduce((e,t)=>e+E(t),1);return Tt.set(e,n),n},D=e=>e.length-e.trimStart().length,Et=/^(?:- ?|\d+\.(?: |$))/u,Dt=e=>(e.line.trimStart().replace(Et,``).split(/[:= ]/u)[0]??``).split(`.`).at(-1)?.replace(/\[\d+\]$/u,``)??``,Ot=e=>xt.has(Dt(e)),O=e=>Ot(e)||!A(e)&&e.child.some(O),k=e=>Ot(e)?E(e):O(e)?e.child.reduce((e,t)=>e+k(t),1):1,A=e=>Et.test(e.line.trimStart()),kt=e=>e.line.trimStart().startsWith(`... `),At=e=>[e.line,...e.child.flatMap(At)];function jt(e,t){if(e.reduce((e,t)=>e+E(t),0)<=t)return e.flatMap(At);if(!e.some(A)||!e.every(e=>A(e)||kt(e)))return Pt(e,t);let n=e.filter(kt).map(({line:e})=>e);return[...Nt(e.filter(A),t-n.length),...n]}function Mt(e,t){return t>=E(e)?At(e):t<=1?[`${e.line} (+${E(e)-1} lines)`]:[e.line,...jt(e.child,t-1)]}function Nt(e,t){let n=Math.max(1,Math.floor((t-1)/Math.min(e.length,St))),r=[],i=0;for(let a of e){let e=Math.min(n,E(a));if(r.length+e>t-1)break;r.push(...Mt(a,e)),i+=1}let a=` `.repeat(D(e[0]?.line??``));return i===e.length?r:[...r,`${a}... ${e.length-i} more`]}function Pt(e,t){let n=e=>e.reduce((e,t)=>e+k(t),0);if(e.length>t||n(e)>t&&e.some(e=>k(e)===1)){let r=e.toSorted((e,t)=>Number(O(t))-Number(O(e))||E(e)-E(t)).slice(0,Math.max(0,t-1));for(;r.length>1&&k(r.at(-1)??e[0]??{line:``,child:[]})===1&&n(r)>t-1;)r.pop();let i=` `.repeat(D(e[0]?.line??``)),a=Pt(e.filter(e=>r.includes(e)),t-1),o=e.filter(e=>!r.includes(e)).map(Dt),s=o.slice(0,10).join(`, `),c=o.length>10?`, ...`:``;return[...a,`${i}... ${o.length} more fields: ${s}${c}`]}let r=e.map(e=>({node:e,allotted:1})),i=t-e.length,a=(e,t)=>e.forEach((n,r)=>{let a=Math.min(t(n.node)-n.allotted,Math.floor(i/(e.length-r)));n.allotted+=a,i-=a});return a(r.filter(({node:e})=>k(e)>1).toSorted((e,t)=>k(e.node)-k(t.node)),k),a(r.toSorted((e,t)=>E(e.node)-e.allotted-(E(t.node)-t.allotted)),E),r.flatMap(({node:e,allotted:t})=>Mt(e,t))}function Ft(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:Lt(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]},i=zt(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:mt(e)}:{...r,optionalInput:Rt(e),arrayInput:Bt(e),...i===void 0?{}:{paidPlan:i}}}function It(e){let t=mt(e),n=e=>e.filter(e=>e.required);return{...Ft(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function Lt(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function Rt(e){let t=e.requestBody?.[0],n=new Set(t?.requiredPath??[]);return{query:e.parameter.filter(e=>e.in===`query`&&!e.required).map(({name:e})=>e),body:(t?.parameter??[]).filter(({name:e})=>!n.has(e)).map(({name:e})=>e)}}function zt(e){return e.response.find(({status:e})=>e===`402`)?.description}function Bt(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var Vt=160,j=`Operation catalog matches`,Ht=[`whole`,`described`,`requiredDescribed`,`optionalNamed`],Ut=e=>`${[j,...e].join(`
|
|
14
|
-
`)}\n`,Wt=e=>yt([j,...e]);function Gt(e){if(!Array.isArray(e)||e.length===0||!e.every(Xt))return null;let t=e;for(let e of Ht){let n=[...t.flatMap(t=>Jt(t,e)),...qt(t,e)];if(Wt(n))return Ut(n)}let n=e=>[...t.slice(0,e).flatMap(e=>Jt(e,`optionalNamed`)),...qt(t.slice(0,e),`optionalNamed`),`... ${t.length-e} more operations omitted to fit ${w} UTF-8 bytes: ${t.slice(e).map(({operationId:e})=>e).join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`];return Ut(n([...t.keys()].findLast(e=>e>0&&Wt(n(e)))??1))}var Kt="the CLI's `aventure help <operationId> --data` prints every input";function qt(e,t){return e.some(e=>`optionalDetailOmitted`in e)?[`... optional argument details omitted: the full list exceeds the result cap; ${Kt}.`]:t===`whole`||t===`described`||!e.some(e=>`argument`in e)?[]:[`... ${t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`} omitted to fit ${w} UTF-8 bytes; structuredContent carries them, and ${Kt}.`]}function Jt(e,t){let n=`argument`in e?Object.values(e.argument).flat():[],r=n.filter(({required:e})=>!e).map(({name:e})=>e);return[`${e.operationId} ${e.method} ${e.path} (aventure_${e.intent})`,` ${e.summary}`,` required: ${e.requiredInput.length===0?`none`:e.requiredInput.join(`, `)}`,` responseContentType: ${e.responseContentType.length===0?`none`:e.responseContentType.join(`, `)}`,...`optionalInput`in e?Object.entries(e.optionalInput).filter(([,e])=>e.length>0).map(([e,t])=>` optional ${e}: ${t.join(`, `)}`):[],...`arrayInput`in e&&e.arrayInput.length>0?[` JSON array inputs: ${e.arrayInput.join(`, `)}`]:[],...`paidPlan`in e&&e.paidPlan!==void 0?[` paid plan: ${e.paidPlan}`]:[],...n.filter(({required:e})=>e||t!==`optionalNamed`).map(e=>Yt(e,e.required||t!==`requiredDescribed`,t)),...t===`optionalNamed`&&r.length>0?[` optional inputs: ${r.join(`, `)}`]:[]]}function Yt(e,t,n){let r=[e.location,e.required?`required`:void 0,e.schemaType,e.schemaFormat,e.schemaEnum===void 0?void 0:`choices: ${e.schemaEnum.join(`, `)}`,e.itemSchemaEnum===void 0?void 0:`item choices: ${e.itemSchemaEnum.join(`, `)}`,e.schemaDefault===void 0?void 0:`default: ${JSON.stringify(e.schemaDefault)}`,e.itemSchemaType===void 0?void 0:`items: ${e.itemSchemaType}${e.itemSchemaFormat===void 0?``:` (${e.itemSchemaFormat})`}`].filter(e=>e!==void 0).join(`, `),i=` ${e.name} (${r})`;return t?`${i}: ${n===`whole`||e.description.length<=Vt?e.description:`${e.description.slice(0,157)}...`}`:i}function Xt(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 Zt(e){let t=t=>{let n=e.parameter.filter(e=>e.in===t&&e.required&&e.schemaDefault===void 0).map(Qt);return n.length===0?void 0:Object.fromEntries(n)},n=t(`path`),r=t(`query`),i=[...new Set((e.requestBody?.[0]?.requiredPath??[]).map(e=>e.replace(/[.[].*$/su,``)))];return{tool:ie(e.intent),operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:Object.fromEntries(i.map(e=>[e,`<${e}>`]))}}}function Qt(e){return[e.name,`<${e.name}>`]}function $t(e){let t=en(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function en(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 M=2,tn=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 N(e,t){let n=I(t);n.length!==0&&(e.add(n),(n===`individual`||n===`individuals`)&&N(e,`person`),an(e,nn(n),n),an(e,rn(n),n))}function nn(e){if(e===`people`)return`person`;let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=M&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return`${e.slice(0,-3)}y`;if(e.length>M&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`)return e.slice(0,-1)}function rn(e){if(e===`person`)return`people`;if(e!==`new`)return e.length>=M&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e)?`${e.slice(0,-1)}ies`:e.endsWith(`s`)?void 0:`${e}s`}function an(e,t,n){t!==void 0&&t!==n&&t.length>=M&&/^[a-z]+$/u.test(t)&&e.add(t)}function P(e){let t=new Set(F(e)),n=Array.from(t);for(let e of n)N(t,e);return t}function on(e){return F(e).map(P)}function sn(e,t){if(e.length===0)return!1;let n=P(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function F(e){return I(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!tn.has(e))}function I(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 cn=/\b(?:https?:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:\/\S*)?/giu,ln=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/giu,un=/^[a-z0-9]+(?:-[a-z0-9]+)+$/u,dn=250,fn=40,pn=100;function mn(e,t){let n=new Set,r=[],i=/\bslugs?\b/iu.test(e);return{text:e.replace(ln,()=>(n.add(`uuid`),` `)).replace(cn,e=>{n.add(`url`);let t=e.replace(/^(?:https?:\/\/)?[^/]+/iu,``).replace(/[?#].*$/su,``).split(`/`).filter(e=>e.length>0).map(e=>e.toLowerCase()),i=t.at(-1);return i!==void 0&&un.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=un.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 hn(e,t,n){return e===`uuid`?/(?:^id|Id)$/u.test(t)&&n.includes(`{${t}}`):t===e}function gn(e,t){let n=new Set;for(let r of e){let e=new Set;N(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 _n(e,t,n){if(n.intent!==`read`&&n.intent!==`lookup`)return 0;let r=new Set(F(n.summary)),i=0;for(let t of e.kind)n.directParameterName.some(e=>hn(t,e,n.path))&&(i+=dn,r.has(t)&&(i+=fn));if(i===0)return 0;let a=new Set(F(`${n.summary} ${n.description}`));return(t.size>0?t.has(n.resource):e.urlPathWord.some(e=>{let t=new Set;return N(t,e),[...t].some(e=>a.has(e))}))&&(i+=pn),i}var vn=40,yn=4,bn=3,xn=1,Sn=new Map;function Cn(e){let t=Sn.get(e);if(t!==void 0)return t;let n=p(),r=ne(n.paths,e),i=r===null?new Map:oe(n,r.operation.responses,bn);return Sn.set(e,i),i}function wn(e,t,n){let r=0,i=new Map;for(let[e,a]of n){if(t.has(e.toLowerCase())&&(r+=vn*(4-a)/4),a>xn)continue;let n=new Set;for(let t of F(e))N(n,t);for(let e of n)i.set(e,Math.min(i.get(e)??a,a))}for(let t of e){let e=Math.min(...[...t].map(e=>i.get(e)??1/0));e<=xn&&(r+=yn*(2-e))}return r}var Tn=5,En=.5,Dn=15,On=30,kn=2,An=.5;function jn(e,t,n){let r=t.map(e=>({item:e,fields:n(e)})),i=mn(e,new Set(r.flatMap(({fields:e})=>e.cliPath))),a=gn(i.urlPathWord,r.map(({fields:e})=>e)),o=I(i.text);if(o.length===0&&i.kind.size===0)return t.map(e=>({item:e,score:1}));let s=P(o),c=on(o),l=new Set(i.text.toLowerCase().split(/[^a-z0-9]+/u));return r.map(({item:e,fields:t})=>({item:e,fields:t,score:(o.length===0?0:Fn({normalizedQuery:o,tokens:s,termForm:c,queryWord:l},t))+_n(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 Mn(e){let t=[...e.parameter,...(e.requestBody??[]).flatMap(e=>e.parameter)];return{...e,cliPath:e.projection.cliPath,enumParameter:t.map(e=>({values:e.itemSchemaEnum??e.schemaEnum??[],direct:e.name===e.inputName})),parameterName:t.flatMap(e=>[e.name,e.inputName]),directParameterName:e.parameter.map(e=>e.name),parameterDescription:[...e.parameter,...e.requestBody??[],...(e.requestBody??[]).flatMap(e=>e.parameter)].map(({description:e})=>e),responseFieldLevel:Cn(e.operationId)}}function Nn(e,t){let n=e.q?.trim()??``,r=jn(n,t.filter(t=>Pn(e,t)&&(n.length>0||t.deprecated!==!0)),Mn),i=(r[0]?.score??0)*En,a=r.filter(({score:e})=>e>=i),o=e.limit===void 0||!Number.isFinite(e.limit)?Tn:e.limit,s=Math.min(a.length,Math.max(0,Math.trunc(o))),c=a.slice(0,s).map(({item:e})=>e),l={totalOperations:t.length,matched:a.length,returned:c.length},u=c.map(e=>Ft(e,c.length===1));return{summary:j,data:m(ee(j,u,{counts:l}))?u:c.map(It),counts:l}}function Pn(e,t){let{root:n}=e;return!(e.method!==void 0&&t.method!==e.method||e.scope!==void 0&&t.projection.scope!==e.scope||n&&t.resource!==n&&t.projection.cliPath[0]!==n)}function Fn({normalizedQuery:e,tokens:t,termForm:n,queryWord:r},i){let a=Vn(i),o=zn(i),s=0;a.some(t=>t===e)&&(s+=100),a.some(t=>t.includes(e))&&(s+=40),s+=Bn(e,a);let c=new Set(a.flatMap(F));for(let e of t)a.some(t=>t===e)?s+=20:c.has(e)&&(s+=8);for(let e of i.cliPath){let n=new Set;N(n,e),[...n].some(e=>t.has(e))&&(s+=Dn)}sn(n,o)&&(s+=200),i.parameterName.some(t=>I(t)===e)&&(s+=On);let l=new Set(i.parameterDescription.flatMap(F));for(let e of t)l.has(e)&&(s+=kn);return s+=Un(t,i.enumParameter),[`list`,`search`,`find`,`browse`].some(e=>t.has(e))&&/^(?:list|search)[A-Z]/u.test(i.operationId)&&(s+=30),s+=wn(n,r,i.responseFieldLevel),s-=Hn(e,t,i.description),_(i.intent)&&!Rn(r)?s*An:s}var In=`edit change set fix rename link unlink mark publish correct`.split(` `),Ln=new Set([...Object.entries(ce).filter(([,e])=>_(e)).map(([e])=>e),...In]);function Rn(e){return[...e].some(e=>Ln.has(e))}function zn(e){return[e.operationId,e.cliPath.join(` `),e.summary].map(I).filter(e=>e.length>0)}function Bn(e,t){let n=F(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 Vn(e){return[...new Set([e.operationId,e.method,e.path,e.resource,e.intent,e.cliPath.join(` `),e.summary,en(e.description).useFor||e.description].map(I).filter(e=>e.length>0))]}function Hn(e,t,n){let r=I(en(n).notFor);if(r.length===0)return 0;let i=r.includes(e)?40:0,a=new Set(F(r));for(let e of t)r===e?i+=20:a.has(e)&&(i+=8);return i}function Un(e,t){let n=0;for(let{values:r,direct:i}of t)r.some(t=>Wn(e,t))&&(n+=i?40:10);return n}function Wn(e,t){let n=F(t);return n.length>0&&n.every(t=>e.has(t))}function Gn(e){return typeof e.data==`object`&&e.data!==null&&`response`in e.data?e.data.response:void 0}async function Kn(e,t,n,r){let i=e.q?.trim()??``;if(i.length===0)return g(`Provide q to resolve a request to one operation.`);let a=n.find(({resource:e,intent:t,deprecated:n})=>e===`help`&&t===`search`&&n!==!0);if(a===void 0)return g(`This build ships no help resolve operation.`);let o=await r(a,{body:{question:i,resolve:!0,...e.scope===void 0?{}:{scope:e.scope===`read`?`READ`:`WRITE`}}});if(!o.ok)return{...o,data:null};let s=et.safeParse(Gn(o));if(!s.success||s.data.resolution==null)return g(`The help resolve operation returned no resolution.`);let{answer:c,resolution:l}=s.data,u=e=>t.find(t=>t.operationId===e),d=u(l.operationId),f=l.taskPlan??void 0,p=(f?.step??[]).map(({step:e})=>({step:e,contract:u(e.operationId)})),m=[...new Set([...l.operationId!=null&&d===void 0?[l.operationId]:[],...p.filter(({contract:e})=>e===void 0).map(({step:e})=>e.operationId)])];return m.some(e=>!n.some(t=>t.operationId===e))?g(`No operation on this connection answers that request.`):ee(m.length===0?`Help resolution`:`Help resolution this connection cannot finish: it cannot run ${m.join(`, `)}.`,{outcome:l.outcome,probability:l.probability,answer:c,candidate:l.candidate.map(({sourceId:e})=>e).filter(e=>n.some(({operationId:t})=>t===e)),...d===void 0?{}:{operation:{operationId:d.operationId,apiRoute:`${d.method} ${d.path}`,...$t(d),mcpCall:Zt(d)}},...(l.taskKey,{}),...f===void 0?{}:{taskPlan:{input:f.input,step:p.map(({contract:e,step:{stepKey:t,instruction:n,operationId:r}})=>e===void 0?{instruction:n,operationId:r}:{instruction:n,mcpCall:Zt(e)})}}},{warnings:m.map(e=>n.some(t=>t.operationId===e)?`Operation ${e} is in this server's catalog, but your grant does not allow it.`:`Operation ${e} is outside this server's catalog, so no credential runs it here.`)})}var qn=f({detail:d(),field:d().nullish(),scope:o([`entity`,`person`,`news`])}),Jn=o([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),Yn=Object.assign(n([Jn,d()]),{enum:Jn.enum}),L=f({modeRequested:Yn,modeUsed:Yn}),Xn=f({answerUnavailable:l(),entity:L,news:L,person:L,rejection:i(qn),unavailable:i(o([`entity`,`person`,`news`]))}),Zn=f({acceleratorParticipation:i(we),detail:i(Te)}),R=f({core:y,enrichment:Re,fundraiseRound:i(Le),research:Zn,semanticMatch:je.nullish()}),Qn=o([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),$n=f({compositeScore:u().nullish(),cosineScore:u().nullish(),curatedAsOf:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),curatedRelationshipType:d().nullish(),curatedSource:d().nullish(),derivedFromEntityId:t().nullish(),matchedSectionWeight:u().nullish(),origin:Qn,rank:s(),sharedSectionCount:s().nullish()}),er=f({entity:R,similarity:$n}),tr=f({fundraiseInvestorJoin:l(),fundraiseTransaction:l(),operatingStatus:l(),relationship:l()}),nr=o([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),rr=o([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),ir=f({acquiredEntity:y,acquirerEntity:y,amount:u().int().nullish(),announcedAt:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),asOf:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),completedAt:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),createdAt:r({offset:!0}).nullish(),currency:d().nullish(),dataConfidence:ze.nullish(),evidence:tr,fundraiseTransactionId:t().nullish(),investorJoinId:t().nullish(),isCurrent:l().nullish(),publicSource:ge.nullish(),relationshipId:s(),status:nr,transactionStatus:rr.nullish(),updatedAt:r({offset:!0}).nullish()}),ar=o([`SAFE`,`Convertible Note`,`Preferred Stock`,`Common Stock`,`Other Equity`,`Bond`,`Loan`,`Other Debt`,`Grant`,`Token`]),or=f({amountInvested:u().nullish(),createdAt:r({offset:!0}),financialInstrumentType:ar.nullish(),id:t(),investor:c,leadInvestor:l(),transactionId:t(),updatedAt:r({offset:!0})}),sr=f({entity:Fe,investorAttribution:i(Be),round:i(be),roundCount:s()}),cr=f({core:y,fundingDetail:pe.nullish(),similarity:$n,urlLink:i(_e)}),lr=f({compliance:ke.nullish(),createdAt:r({offset:!0}).nullish(),id:s(),isCurrent:l().nullish(),isPrimary:l().nullish(),language:d().nullish(),owner:c,text:d(),textName:d().nullish(),textType:d(),updatedAt:r({offset:!0}).nullish()}),ur=o([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),dr=o([`fundraiseRound`,`researchDetail`]),fr=o([`preMoney`,`postMoney`,`reported`]),pr=f({amountRaised:u().int().nullish(),asOfDate:d().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),confidence:Oe,currency:d(),declaredBasis:fr,derivation:ur,detailId:s().nullish(),label:d().nullish(),source:dr,sourceRef:d(),valuationPostMoney:u().int().nullish(),valuationPreMoney:u().int().nullish()}),mr=f({createdAt:r({offset:!0}).nullish(),description:d().nullish(),forkCount:s(),githubId:u().int(),homepageUrl:d().nullish(),id:u().int(),isArchived:l(),isFork:l(),language:d().nullish(),license:d().nullish(),name:d(),ownerLogin:d(),repoCreatedAt:r({offset:!0}).nullish(),repoPushedAt:r({offset:!0}).nullish(),stargazerCount:s(),topic:i(d()),updatedAt:r({offset:!0}).nullish(),url:d()}),z=f({empty:l().optional(),sorted:l().optional(),unsorted:l().optional()}),B=f({offset:u().int().optional(),paged:l().optional(),pageNumber:s().optional(),pageSize:s().optional(),sort:z.optional(),unpaged:l().optional()}),hr=f({investorAttribution:i(Be),person:Ne,round:i(be),roundCount:s()}),gr=o([`by`,`about`]),_r=o([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),vr=f({canonicalUrl:d().nullish(),contentId:d(),contentType:_r,createdAt:r({offset:!0}).nullish(),publishedAt:r({offset:!0}).nullish(),relation:gr.nullish(),sourceDomain:d().nullish(),sourceName:d().nullish(),summary:d().nullish(),title:d(),topic:d().nullish(),updatedAt:r({offset:!0}).nullish(),url:d().nullish(),year:s().nullish()});f({content:i(Se).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(n([De,he])).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(xe).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(y).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(ir).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Fe).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(or).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Le).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(sr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(R).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Ie).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(ve).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Te).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Me).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(er).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(cr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(lr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(_e).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(pr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(mr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Ce).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(ye).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Ne).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Pe).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(hr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(Ee).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()}),f({content:i(vr).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()});var yr=f({content:i(R),number:s(),size:s(),totalElements:u().int(),totalPages:s()}),br=f({content:i(Ce),number:s(),size:s(),totalElements:u().int(),totalPages:s()}),xr=f({content:i(ye),number:s(),size:s(),totalElements:u().int(),totalPages:s()});f({content:i(Ae).optional(),empty:l().optional(),first:l().optional(),last:l().optional(),number:s().optional(),numberOfElements:s().optional(),pageable:B.optional(),size:s().optional(),sort:z.optional(),totalElements:u().int().optional(),totalPages:s().optional()});var Sr=o([`entityRecord`,`researchSnippet`,`newsArticle`,`personRecord`,`fundraiseTransaction`]),Cr=Object.assign(n([Sr,d()]),{enum:Sr.enum}),wr=f({entityId:t(),source:Cr,sourceId:d()}),Tr=f({citation:i(wr),text:d(),topic:d().nullish()}),Er=f({citation:i(wr),confidence:x,description:d().nullish(),heading:d().nullish(),paragraph:i(Tr),relatedQuery:i(d()),shareable:l(),text:d(),title:d().nullish()}),Dr=f({sortPriority:o([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),Or=f({max:r({offset:!0}).nullish(),min:r({offset:!0}).nullish()}),V=f({max:u().nullish(),min:u().nullish()}),H=f({max:s().nullish(),min:s().nullish()}),kr=f({averageAmountInvestedUsdRange:i(V).optional(),largestAmountInvestedUsdRange:i(V).optional(),smallestAmountInvestedUsdRange:i(V).optional(),totalAmountInvestedUsdRange:i(V).optional(),totalInvestmentRange:i(H).optional()}),Ar=f({amountInvestedRange:i(V).optional(),amountRaisedRange:i(V).optional(),dateAnnouncedRange:Or.nullish(),investedCompanyName:i(d()).optional(),investedCountry:i(d()).optional(),investedIndustry:i(d()).optional(),investedRound:i(d()).optional(),investorActivity:kr.optional(),investorName:i(d()).optional(),lastRoundYearRange:i(H).optional(),rankByInvestmentActivity:l().nullish(),round:i(d()).optional(),totalRaisedRange:i(V).optional(),valuationRange:i(V).optional()}),jr=o([`NONE`,`COMPANY_LISTING_READY`]),Mr=o([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),Nr=o([`hostPath`,`domain`]),Pr=e({acceleratorBrand:i(d()).optional(),acceleratorCohort:i(d()).optional(),acceleratorName:i(d()).optional(),acceleratorStatus:i(d()).optional(),affinity:i(d()).optional(),closedLast:l().optional(),employeeCountRange:i(H).optional(),entityId:i(t()).optional(),entityName:i(d()).optional(),featured:l().nullish(),fundraiseActivity:Ar.optional(),hasFundraising:l().nullish(),headquartersCity:i(d()).optional(),headquartersCountry:i(d()).optional(),headquartersState:i(d()).optional(),industry:i(d()).optional(),letter:d().nullish(),location:i(d()).optional(),logoOption:Dr.optional(),mainProduct:i(d()).optional(),operatingStatus:i(Mr).optional(),originCountry:i(d()).optional(),person:i(d()).optional(),portfolioHeadquartersCity:i(d()).optional(),portfolioHeadquartersCountry:i(d()).optional(),portfolioHeadquartersState:i(d()).optional(),qualityGate:jr.optional(),rankByProminence:l().nullish(),semanticQuery:d().nullish(),slug:i(d().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:i(d()).optional(),suppressLateStage:l().nullish(),suppressNonOperating:l().nullish(),suppressZeroTotalRaised:l().nullish(),tag:i(d()).optional(),textSearch:d().nullish(),typeCustomer:i(d()).optional(),typeModel:i(d()).optional(),typeOwnership:i(d()).optional(),typeRecord:i(a).optional(),typeRevenue:i(d()).optional(),typeTechnologyUsed:i(d()).optional(),url:d().nullish(),urlDomain:d().nullish(),urlMatchMode:Nr.nullish(),urlType:me.nullish(),yearFoundedRange:i(H).optional()}),Fr=o([`discovery`,`profile`,`peer`,`comparison`]),Ir=o([`keyword`,`semantic`]),Lr=o([`ID`,`NAME_BRAND`,`YEAR_FOUNDED`,`STATUS_OPERATING`,`UPDATED_AT`,`CREATED_AT`,`NEXT_DUE_AT`,`DATA_COMPLETION_COVERAGE`,`TOTAL_RAISED`,`AMOUNT_INVESTED`,`RECENT_INVESTMENT_AT`,`STAGE`,`MOST_RECENT_AMOUNT`,`LATEST_VALUATION`,`MOST_RECENT_DATE`,`ACCELERATOR_BRAND`,`ACCELERATOR_COHORT`,`HEADQUARTERS_COUNTRY`,`EMPLOYEE_COUNT`]),Rr=Object.assign(n([Lr,d()]),{enum:Lr.enum}),zr=f({descending:l(),field:Rr,sortKey:d().nullish()}),Br=f({order:i(zr),relevance:Ir.nullish()}),Vr=f({confidence:x,execution:L,fallbackUsed:l(),filter:Pr,intent:Fr,interpretation:d(),sort:Br,subjectEntityName:i(d()),unsupported:d().nullish()}),Hr=f({changedAt:r({offset:!0}).nullish(),dataSourceUpdatedAt:r({offset:!0}).nullish(),pendingApproval:s().nullish(),sourceId:d().nullish(),status:d().nullish()}),Ur=f({fundManagerRelationshipSource:Hr.nullish(),fundraiseTransaction:Le,fundraiseTransactionSource:Hr.nullish(),investorJoinSource:Hr.nullish()}),Wr=f({evidence:Ur,investor:c,semanticMatch:je.nullish()}),Gr=f({entityId:t(),matchedOffering:y.nullish(),probability:u(),webUrl:i(d())}),Kr=f({entityId:t(),label:d(),publishedAt:r({offset:!0}).nullish(),score:u(),source:Cr,sourceId:d(),text:d(),url:d().nullish()}),qr=f({answer:Er.nullish(),interpretation:Vr,investment:i(Wr),judgment:i(Gr),passage:i(Kr),peer:i(er),pendingWebQuery:i(d()),result:yr,searchRequestId:t().nullish(),subject:i(R)}),Jr=o([`auto-match`,`needs-review`,`approved`,`rejected`]),Yr=f({createdAt:r({offset:!0}),entityId:t(),href:d().nullish(),internal:l(),matchStatus:Jr.nullish(),mention:d().nullish(),slug:d().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:a.nullish(),updatedAt:r({offset:!0})}),Xr=f({entity:i(Yr),newsId:s()}),Zr=e({acceleratorBrand:i(d()).optional(),acceleratorCohort:i(d()).optional(),acceleratorName:i(d()).optional(),acceleratorStatus:i(d()).optional(),affinity:i(d()).optional(),closedLast:l().optional(),employeeCountRange:i(H).optional(),entityId:i(t()).optional(),entityName:i(d()).optional(),featured:l().nullish(),fundraiseActivity:Ar.optional(),hasFundraising:l().nullish(),headquartersCity:i(d()).optional(),headquartersCountry:i(d()).optional(),headquartersState:i(d()).optional(),industry:i(d()).optional(),letter:d().nullish(),location:i(d()).optional(),logoOption:Dr.optional(),mainProduct:i(d()).optional(),operatingStatus:i(Mr).optional(),originCountry:i(d()).optional(),person:i(d()).optional(),portfolioHeadquartersCity:i(d()).optional(),portfolioHeadquartersCountry:i(d()).optional(),portfolioHeadquartersState:i(d()).optional(),qualityGate:jr.optional(),rankByProminence:l().nullish(),slug:i(d().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:i(d()).optional(),suppressLateStage:l().nullish(),suppressNonOperating:l().nullish(),suppressZeroTotalRaised:l().nullish(),tag:i(d()).optional(),textSearch:d().nullish(),typeCustomer:i(d()).optional(),typeModel:i(d()).optional(),typeOwnership:i(d()).optional(),typeRecord:i(a).optional(),typeRevenue:i(d()).optional(),typeTechnologyUsed:i(d()).optional(),url:d().nullish(),urlDomain:d().nullish(),urlMatchMode:Nr.nullish(),urlType:me.nullish(),yearFoundedRange:i(H).optional()}),Qr=f({amountInvestedRange:i(V).nullish(),amountRaisedRange:i(V).nullish(),entityName:i(d()).nullish(),investedCompany:i(d()).nullish(),personTitle:i(d()).nullish(),round:i(d()).nullish(),totalInvestmentCount:i(H).nullish(),typeRecord:i(a).nullish()}),$r=f({arrayFilter:Qr.optional(),entityFilter:Zr.optional(),entityId:t().nullish(),entitySlug:d().nullish(),firstName:d().nullish(),includeAddress:l().nullish(),includeUrl:l().nullish(),investorActivity:kr.optional(),isCurrent:l().nullish(),lastName:d().nullish(),letter:d().nullish(),personId:i(t()).max(200).optional(),personName:i(d()).optional(),role:d().nullish(),search:d().nullish(),semanticQuery:d().nullish(),status:d().nullish()}),ei=f({descending:l(),field:o([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`]),sortKey:d().nullish()}),ti=f({order:i(ei),relevance:Ir.nullish()}),ni=f({confidence:x,execution:L,fallbackUsed:l(),filter:$r,interpretation:d(),sort:ti,unsupported:d().nullish()}),ri=f({interpretation:ni,investment:i(Wr),result:xr,searchRequestId:t().nullish()}),ii=f({label:d(),query:d()}),ai=f({key:d(),option:i(ii),prompt:d()}),oi=f({entity:qr,entityDetail:i(Fe),news:br,newsEntityMention:i(Xr),person:ri,personDetail:i(Ne),provenance:Xn,qualifier:ai.nullish()});function si(e,t){return e.map(e=>{let n=e.requestBody??[],r=[...e.parameters.map(e=>ci(e)),...n.flatMap(e=>e.parameter.map(t=>ci(t,n.length>1?e.contentType:void 0))),...li(n)],i=[t,...e.cliPath].join(` `),a=_(e.intent),o=ae(e),s=n[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:a,destructive:le(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse||!se(e.path)||o===null?null:ie(o),body:{hasBody:s!==void 0,kind:s?.kind??null,...s!==void 0&&n.length>1?{contentType:s.contentType}:{},required:s?.required??!1,description:s?.description??``,requiredPath:s?.requiredPath??[]},flags:r,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},summary:e.summary,description:e.description,...e.deprecated===void 0?{}:{deprecated:e.deprecated}}})}function ci(e,t){let n=e.flag.split(/\s+/u);return{name:n[0]??e.flag,optionKey:e.optionKey,wireName:e.name,location:e.location,required:e.required,placeholder:n.length<=1?null:n.slice(1).join(` `),description:e.description,choices:e.choices??[],...t===void 0?{}:{contentType:t}}}function li(e){if((e?.length??0)<=1)return[];let t=e?.map(({contentType:e})=>e)??[];return[{name:`--content-type`,optionKey:`contentType`,wireName:`Content-Type`,location:`body`,required:!1,placeholder:`<media-type>`,description:`Select the request body encoding, never an uploaded file's media type; omit for ${t[0]}.`,choices:t}]}function ui(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var di=[`-id`,`-slug`,`-url`],fi=[`--id`,`--slug`,`--url`],pi=`/v1/lookup`,mi=`--from-file "<path>"`;function hi(e,t,n=te().bin[0]){let r=si(t,n),i=r.find(t=>t.operationId===e);return i===void 0?[]:yi(i,r)}function gi(e,t,n=te().bin[0]){let r=t.find(t=>t.operationId===e),[i]=r===void 0?[]:si([r],n);return i&&vi(i,Si(i,!1))}function _i(e,t,n,r=te().bin[0]){let i=e=>{let t=e.findIndex((e,t)=>n[t]!==e);return t===-1?e.length:t},a=`${n[0]} get`,[o,s]=t.filter(({method:t,path:n,parameters:r,cliPath:o})=>{let s=r.filter(({location:e})=>e===`path`),[c]=s;return t===`GET`&&s.length===1&&c?.flag.split(/\s+/u)[0]===e&&n.endsWith(`/{${c.name}}`)&&(i(o)>1||o.join(` `)===a)}).toSorted((e,t)=>i(t.cliPath)-i(e.cliPath));if(o!==void 0&&(s===void 0||i(s.cliPath)!==i(o.cliPath)))return gi(o.operationId,t,r)}function vi(e,t){return[e.cli.command,...t,`--data`].join(` `)}function yi(e,t){return[`example: ${vi(e,Si(e))}`,...bi(e,t)]}function bi(e,t){return ui(e).flatMap(e=>{if(!e.required||!e.optionKey.endsWith(`Id`))return[];let n=`${e.optionKey.slice(0,-2)}Slug`,r=t.find(e=>e.method===`GET`&&/\/lookup(?:-exact)?$/u.test(e.path)&&e.flags.some(e=>e.optionKey===n)),i=r?.flags.find(e=>e.optionKey===n);if(r===void 0||i===void 0)return[];let a=`${r.cli.command} ${wi(i)} --data`,o=t.find(e=>e.method===`POST`&&e.path===pi),s=o?.flags.find(e=>e.optionKey===`name`),c=o?.flags.find(e=>e.optionKey===`kind`),l=c?.choices.find(t=>e.optionKey.toUpperCase().startsWith(t)),u=`lookup: ${e.name} from a slug: ${a}`;return o===void 0||s===void 0||c===void 0||l===void 0?[u]:[u,`lookup: ${e.name} from a name or URL: ${o.cli.command} ${c.name} ${l} ${wi(s)} --data, then match.owner.${e.optionKey} when status is MATCHED`]})}var xi=/(?:^|\.)text$/u;function Si(e,t=!0){let n=ui(e).filter(e=>e.required),r=e.body.kind===`json`&&n.some(e=>e.location===`body`&&xi.test(e.wireName))?n.filter(e=>e.location!==`body`):n,i=(n.length>0||!t?r:Ci(e)).map(wi);return(e.body.required||e.body.requiredPath.length>0)&&!r.some(e=>e.location===`body`)?[...i,mi]:i}function Ci(e){let t=new Set;N(t,e.resource);for(let n of di)for(let r of t){let t=e.flags.find(e=>e.name===`--${r}${n}`);if(t!==void 0)return[t]}for(let t of fi){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function wi(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}var Ti=`aventure`;function Ei(e,t){let n=t.find(t=>t.operationId===e)?.cliPath;return n===void 0?void 0:`${Ti} ${n.join(` `)}`}function Di(e,t,n=e){return gi(e,t,`aventure`)??n}function Oi(e,t){let n=et.safeParse(e);if(!n.success)return null;let{answer:r,citation:i,confidence:a,resolution:o}=n.data;if(o!=null)return ki(r,o,t);let s=r.trimEnd().split(`
|
|
15
|
-
`),c=new Set(i.flatMap(({sourceType:e,sourceId:n})=>{if(e!==We.options[0].enum.OPERATION)return[];let r=Ei(n,t);return r===void 0?[]:[r]}));return c.size>0&&s.push(``,`Commands:`,...[...c].map(e=>` ${e}`)),s.push(``,`Confidence: ${a}`),i.length===0?s:(s.push(`Sources (${i.length}):`),s.push(...i.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`})),s)}function ki(e,t,n){let{outcome:r,operationId:i,probability:a,candidate:o,taskKey:s,taskPlan:c}=t,l=[c==null?e.trimEnd():ji(c)],u=[``,`Outcome: ${r}${a==null?``:` (probability ${a.toFixed(2)})`}`];switch(r){case S.enum.TASK_PLAN:return[...l,...c==null?[]:Mi(c,n),...u];case S.enum.OPERATION_ADVICE:{let e=o.filter(({sourceId:e})=>e!==i);return[...l,...i==null?[]:[``,`Command:`,` ${Di(i,n)}`],...u,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case S.enum.CLARIFY:return[...l,...s==null?[]:[``,`Leading catalog task: ${s}`],...Pi(`Candidates:`,o,n),...u];case S.enum.ABSTAIN:return[...l,...Pi(`Nearest operations:`,o,n),...u];default:throw Error(`Unhandled help resolution outcome ${String(r)}`)}}function Ai(e,t){let n=Qe.safeParse(e);return n.success?[ji(n.data),...Mi(n.data,t)]:null}var ji=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function Mi(e,t){return e.step.length===0?[``,`This catalog task has no planned steps yet.`]:[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n})=>` ${e} (${t}): ${n}`)],``,`Steps:`,...e.step.flatMap(({step:n,cliCommand:r,writeGuidance:i},a)=>[` ${a+1}. ${n.stepKey===void 0?``:`${n.stepKey}: `}${Di(n.operationId,t,r)}`,` ${n.instruction}`,...Ni(e,a,i)]),...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function Ni(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 Pi(e,t,n){if(t.length===0)return[];let r=t.map(({sourceId:e,excerpt:t})=>({command:Ei(e,n)??e,excerpt:t})),i=Math.max(...r.map(({command:e})=>e.length));return[``,e,...r.map(({command:e,excerpt:t})=>` ${e.padEnd(i)} # ${t}`)]}var U=30,Fi=8,W=10,Ii=2,Li=[`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`],Ri=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]),zi=[`interpretation`,`confidence`,`unsupported`,`execution`,`fallbackUsed`];function Bi(e,t,n){if(typeof t==`string`)return bt(t);let r=Gt(t);if(r!==null)return T(r);let i=Zi(t);if(i===null)return null;let a=e.find(({operationId:e})=>e===i.operationId),{response:o,hiddenNote:s}=ue(a?.detailField,i.response),c={...i,response:o,parameters:a?.parameters??[]},l=Oi(c.response,e)??Ai(c.response,e);if(l!==null)return T(l.join(`
|
|
16
|
-
`),!0);let u=Vi(c);if(u!==null)return T([...u,...s].join(`
|
|
17
|
-
`),!0,s.length>0);let d=[c.summary??n??c.operationId??`OpenAPI call succeeded`,`${c.method} ${c.endpoint}`],f=Ct(Gi(c),117-s.length,w-b.byteLength(`${[...d,...s].join(`
|
|
18
|
-
`)}\n`,`utf8`));return T([...[...d,...f].filter(Boolean),...s].join(`
|
|
19
|
-
`),!0,s.length>0)}function Vi({response:e,...t}){if(e===void 0||!Y(e)||!(`entity`in e&&`person`in e&&`news`in e))return null;let n=oi.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o}=n.data;return[...r.answer?Hi(r.answer):[],...o.unavailable.map(e=>`${e} unavailable: retry this scope later`),...o.answerUnavailable?[`answer unavailable: retry this search later`]:[],...o.rejection.map(({scope:e,detail:t})=>v(`${e} rejected: ${t}`)),[`entities:`,...G(r.result,t)].join(`
|
|
20
|
-
`),[`people:`,...G(i.result,t)].join(`
|
|
21
|
-
`),[`news:`,...G(a,t)].join(`
|
|
22
|
-
`)]}function Hi(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${v(e)}`).join(`
|
|
23
|
-
`)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>v(` - ${e}:${t} entity=${n}`)).join(`
|
|
24
|
-
`)}`;return[`answer:\n ${de(e.text).replaceAll(`
|
|
25
|
-
`,`
|
|
26
|
-
`)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function Ui(e){let t=Zi(e)?.response,n=Y(t)?t.interpretation:void 0;if(!Y(n))return null;let r=L.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=q(n.filter),{unsupported:s,fallbackUsed:c}=n;return T([`strategy: requested=${i} used=${a}`,...Y(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${Wi(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``].filter(Boolean).join(`
|
|
27
|
-
`),!0)}var Wi=e=>X(e)?v(e):Array.isArray(e)&&e.every(X)?e.map(e=>v(e)).join(`, `):JSON.stringify(e);function Gi(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a}=e;if(t===void 0)return a!==void 0&&i!==void 0?[`status=${i} redirect=${a}`]:i===void 0?[]:[`status=${i} no response body`];let o=i===void 0||n===`GET`?``:`status=${i}`,s=Y(t)&&!ea(t)?ta(t):null,c=s===null?void 0:Y(s.context.interpretation)?q(s.context):s.context,l=c!==void 0&&Y(c)?Object.entries(c):[],u=l.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(Y)),d=new Set(u.map(([e])=>e)),f=Object.fromEntries(l.filter(([e])=>!d.has(e)));return[o,...ea(t)?G(t,e,r):s===null?ra(t)?Ji(t.filter,t.meta):ia(t)?Ji([...t.arrayFilterEntry,...t.rangeFilterEntry],t.filtersMeta):oa(t)?Yi(t):K(t,``):[...G(s.page,e,r),...Object.keys(f).length===0?[]:K(f,``),...u.flatMap(([e,t])=>[`${e}:`].concat(Ki(t)))]].filter(Boolean)}function G(e,t,n){let r=Xi(t),i=e.numberOfElements??e.content.length,a=(e.totalElements??0)-(e.number??0)*(e.size??0)-i,o=e.number===void 0?``:` page=${e.number}`,s=e.size===void 0?``:` size=${e.size}`,c=e.totalElements===void 0?``:` total=${e.totalElements}`,l=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,u=(e.number??0)+1,d=e.totalPages===void 0||u<e.totalPages,f=Z(`page`,t.parameters);return[`rows=${i}${o}${s}${c}${l}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${Q(n)}`,a<=0||n!==void 0?``:d&&i===e.size?`more: ${a} rows not shown; use ${f} or ${Z(`size`,t.parameters)} to see them`:`more: ${a} more matched but this response returns only these ${i}; narrow the query to reach them${d?` (${f} ${u} starts after this page)`:``}`,...Ki(e.content)].filter(Boolean)}function Ki(e){let t=e.filter(Y);if(t.length===0)return e.length===0?[`(empty)`]:Qi(e,``);let n=qi(t);if(n.length===0)return Qi(e.slice(0,U),``);let r=t.slice(0,U).map(e=>{let t=J(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)=>sa(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>U&&s.push(`... ${t.length-U} more rows`),s}function qi(e){let t=e.map(e=>J(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=Li.filter(e=>n.has(e)),i=new Set(r.map($i)),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($i(e))?!1:(n&&i.add($i(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,Fi-s.length);return[...s,...c].slice(0,Fi)}function Ji(e,t){let n=t!==void 0&&Y(t)?t:{},r=[`total`,`limit`].flatMap(e=>typeof n[e]==`number`?[` ${e}=${n[e]}`]:[]).join(``),i=[`filters=${e.length}${r}`];for(let t of e){let e=t.choiceOption.length,n=t.choiceOptionTotal===null?`unknown (degraded)`:t.choiceOptionTotal??e,r=t.choiceOptionTruncated===!0?` truncated`:``;i.push(`- ${t.filterKey} (${t.label}): choices ${e}/${n}${r}`),t.choiceOption.slice(0,W).forEach(e=>{i.push(` ${Z(t.filterKey)} ${Q(e.value)}`)}),e>W&&i.push(` ... ${e-W} more shown`)}return i}function Yi(e){let t=Z(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,W).map(e=>`${t} ${Q(e)}`),e.result.length>W?`... ${e.result.length-W} more matches`:``].filter(Boolean)}function Xi({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Ri.has(e)&&t.length>0).map(([e,n])=>`${Z(e,t)} ${Q(n)}`)}function Zi(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:void 0},[n,r,i]=[t(`method`),t(`endpoint`),t(`nextCursor`)];if(n===void 0||r===void 0)return null;let a=Reflect.get(e,`httpStatus`),o=Reflect.get(e,`response`),s=o===void 0?void 0:h.safeParse(o);return s!==void 0&&!s.success?null:{method:n,endpoint:r,httpStatus:typeof a==`number`?a:void 0,location:t(`location`),operationId:t(`operationId`),summary:t(`summary`),nextCursor:i===``?void 0:i,response:s?.data}}function K(e,t,n){if(e===void 0)return[];if(X(e))return[`${t}${fe(e,n)}`];if(Array.isArray(e))return Qi(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if(X(i)){r.push(`${t}${n}: ${fe(i,n)}`);continue}r.push(`${t}${n}:`);for(let e of K(i,`${t} `,n))r.push(e)}return r.length===0?[`${t}(empty)`]:r}function Qi(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e){if(X(i)){r.push(`${t}- ${fe(i,n)}`);continue}r.push(`${t}-`);for(let e of K(i,`${t} `))r.push(e)}return r}function q(e){if(e===void 0||X(e))return e===null||typeof e==`string`&&e.trim().length===0?void 0:e;if(Array.isArray(e)){let t=e.flatMap(e=>{let t=q(e);return t===void 0?[]:[t]});return t.length===0?void 0:t}let t=Object.entries(e).flatMap(([e,t])=>{let n=q(t);return n===void 0?[]:[[e,n]]});if(t.length!==0)return Object.fromEntries([...zi.flatMap(e=>t.filter(([t])=>t===e)),...t.filter(([e])=>!zi.includes(e))])}function J(e,t=``,n=0){return X(e)?t.length===0?{}:{[t]:v(e,t)}:n>Ii?{}: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 X(r)?[[i,v(r,i)]]:Object.entries(J(r,i,n+1))}))}var $i=e=>e.split(`.`,1)[0],ea=e=>Y(e)&&Array.isArray(e.content);function ta(e){let[t,...n]=Object.entries(e).filter(e=>ea(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 na(e){return Y(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var ra=e=>Y(e)&&aa(e.filter),ia=e=>Y(e)&&aa(e.arrayFilterEntry)&&aa(e.rangeFilterEntry),aa=e=>Array.isArray(e)&&e.every(na),oa=e=>Y(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>typeof e!=`object`||!e,Z=(e,t=[])=>t.find(({name:t})=>t===e)?.flag.split(` `)[0]??`--${e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}`,Q=e=>/^[A-Za-z0-9._:/@-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`,sa=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(0,t-3))}...`,ca=/\{([^}]+)\}/gu;function la(e,t){let n=t.filter(e=>e.method===`GET`),r=t=>e.endpoint!==void 0&&t.endsWith(e.endpoint),i=t.find(t=>t.operationId===e.operationId),a=e.ok&&i!==void 0&&_(i.intent),o=[...a&&e.endpoint!==void 0?da(e.endpoint.split(`?`)[0]??``,n,!1).map(e=>`${e} --data --to-file <path>`):[],...e.references.filter(e=>!r(e)).flatMap(ua).flatMap(e=>da(e.pathname,n,!0)),...e.references.filter(r).flatMap(ua).flatMap(e=>fa(e,n))];return o.length===0?{write:a}:{exactRecovery:`Read the full result ${o.join(`; `)}.`,write:a}}function ua(e){return URL.canParse(e)?[new URL(e)]:[]}function da(e,t,n){return t.flatMap(t=>{let r=[...t.path.matchAll(ca)].map(([,e])=>e),i=RegExp(`^${t.path.replace(ca,`([^/]+)`)}$`,`u`),a=n&&r.length===0?null:i.exec(e);if(a===null)return[];let o=r.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[$(r),a[n+1]??``]});return[`${pa(t)}, ${ma(t,o)}`]})}function fa(e,t){let n=t.find(t=>t.path===e.pathname);return n===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${n.path}/`))return[];let r=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),i=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(r===void 0||i===void 0)return[];let a=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[$(t),ha(n)]}),o=[$(r),`<n>`,$(i),`<n>`];return[`${pa(t)}, in windows: ${ma(t,[...a,...o])}, advancing ${$(r)} until a window returns fewer than ${$(i)} units`]})}function pa(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function ma(e,t){return[Ti,...e.cliPath,...t].join(` `)}function $(e){return e.flag.split(/\s+/u)[0]??e.flag}function ha(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function ga(e){return e.toSorted((e,t)=>e.projection.cliPath.length-t.projection.cliPath.length||e.projection.cliPath.join(` `).localeCompare(t.projection.cliPath.join(` `))||e.operationId.localeCompare(t.operationId)).map(e=>{let t=e.parameter.flatMap(t=>{if(t.in!==`path`&&t.in!==`query`&&t.in!==`header`)return[];let n=t.in;return(t.in===`query`&&t.itemProperty!==void 0?t.itemProperty:[t]).map(t=>{let r=xa(t,C(e,t),n);if(t.legacyName===void 0)return r;let i=xa(t,C(e,t,t.legacyName),n).flag;return i===r.flag?r:Object.assign(r,{legacyFlag:i})})}),n=e.requestBody?.map(n=>{let r=ya(e,t,n),i=va(n.cliConflicts,r),a=i.length===0?{}:{cliConflicts:i};return Object.assign({},n,{parameter:r},a)}),r=e.response.find(({status:e})=>e.startsWith(`2`)),i=r?.schemaName?.replace(/Schema$/,``);return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliPath:e.projection.cliPath,summary:e.summary,description:e.description,binaryResponse:e.binaryResponse?!0:void 0,explain:e.explain?!0:void 0,deprecated:e.deprecated?!0:void 0,requestBody:n,mutationReadback:e.mutationReadback,scope:e.projection.scope,auth:e.projection.auth,visibility:e.projection.visibility,errorResponse:e.errorResponse,successResponse:i,detailField:r?.detailField,parameters:t}})}function _a(e,t){let[n,r]=e.filter(e=>e.role===t);if(n===void 0||r!==void 0)throw Error(`Generated composite CLI role '${t}' is incomplete`);return n}function va(e,t){let n=new Map(t.map(({name:e,optionKey:t})=>[e,t]));return(e??[]).map(e=>e.map(e=>{let t=n.get(e);if(t===void 0)throw Error(`x-aventure-cli-conflicts field '${e}' was removed from the generated CLI projection`);return t}))}function ya(e,t,n){let r=new Set(t.map(e=>e.optionKey));(e.requestBody?.length??0)>1&&r.add(`contentType`);let i=new Set(t.filter(e=>e.location===`path`).map(e=>e.name));return n.parameter.toSorted((e,t)=>ba(e.name)-ba(t.name)).flatMap(t=>{if(!t.required&&(r.has(t.inputName)||i.has(t.name)))return[];let n=tt(e,t,r);return r.add(n),[xa(t,n,`body`)]})}function ba(e){let t=e.split(`.`).at(-1);return t===`min`?0:t===`max`?1:2}function xa(e,t,n){let r=e.itemSchemaEnum??e.schemaEnum,i=He(e.schemaType,e.itemSchemaType,e.schemaFormat,t);return{name:e.name,optionKey:t,flag:`${re(t)} ${e.schemaType===`boolean`?`[${i}]`:`<${i}>`}`,required:e.required&&e.schemaDefault===void 0,description:Ve(e.description,r),schemaType:e.schemaType,schemaFormat:e.schemaFormat,itemSchemaType:e.itemSchemaType,defaultValue:Sa(e.schemaDefault),choices:r,...e.envName===void 0?{}:{envName:e.envName},...e.visibility&&{visibility:e.visibility},location:n}}var Sa=e=>Array.isArray(e)?e.map(String):typeof e==`number`?String(e):e;export{rt as S,P as _,Ui as a,Ft as b,hi as c,si as d,Mn as f,Cn as g,Kn as h,Bi as i,_i as l,Nn as m,_a as n,xi as o,jn as p,la as r,ui as s,ga as t,yi as u,F as v,T as x,I as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,o as t}from"./logging-D_7xwm_N.js";export{t as logWarn,e as setStderrLogging};
|