@aventurevc/aventure-cli 0.8.232 → 0.8.234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aventure-cli/index.js +1 -1
- package/dist/aventure-cli/unified-operations.json +1 -1
- package/dist/chunks/{api-key-bearer-credential-B0ulZ4jd.js → api-key-bearer-credential-BYlgsMzT.js} +1 -1
- package/dist/chunks/{api-key-bearer-credential-BbO1Igh-.js → api-key-bearer-credential-BfapI4GF.js} +1 -1
- package/dist/chunks/aventure-cli-Mw-1_dTS.js +11 -0
- package/dist/chunks/builtin-agent-setup-B2Xvqera.js +1 -0
- package/dist/chunks/builtin-auth-DMch5_Qr.js +24 -0
- package/dist/chunks/builtin-batch-DdGyCjlR.js +1 -0
- package/dist/chunks/builtin-research-run-wait-Bt9OvAua.js +1 -0
- package/dist/chunks/builtin-update--0nJHghm.js +3 -0
- package/dist/chunks/builtin-update-BHfaX07C.js +1 -0
- package/dist/chunks/{cli-help-policy-BfaoryK2.js → cli-help-policy-DdcHm_F7.js} +1 -1
- package/dist/chunks/commander-D8IVfzyC.js +1 -0
- package/dist/chunks/completion-Dp4J48n-.js +20 -0
- package/dist/chunks/completion-setup-CwJt88xW.js +6 -0
- package/dist/chunks/contract-BEa-OAos.js +1 -0
- package/dist/chunks/dist-CGgP_Pxz.js +1 -0
- package/dist/chunks/generated-option-order-DH8yCg4h.js +1 -0
- package/dist/chunks/help-intent-DwGb0FsW.js +1 -0
- package/dist/chunks/human-text-cap-BcNmIPQA.js +16 -0
- package/dist/chunks/{logging-D2cJNH4n.js → logging-BnHashoK.js} +1 -1
- package/dist/chunks/logging-DtglvosR.js +1 -0
- package/dist/chunks/{mcp-generation-contract-XxGTW_nR.js → mcp-generation-contract-D0mlhvEk.js} +1 -1
- package/dist/chunks/{mcp-generation-contract-CdNJO_dx.js → mcp-generation-contract-XdtSQ9XZ.js} +1 -1
- package/dist/chunks/oauth-bearer-credential-BDMQm1Fl.js +8 -0
- package/dist/chunks/oauth-bearer-credential-CSXltMWD.js +1 -0
- package/dist/chunks/oauth-login-DPJiepMK.js +1 -0
- package/dist/chunks/{oauth-login-cF8Q80is.js → oauth-login-Dv8IU1A0.js} +4 -4
- package/dist/chunks/openapi-call-BXNankCJ.js +1 -0
- package/dist/chunks/openapi-call-EbYqYmT1.js +96 -0
- package/dist/chunks/{openapi-commands-ClS0g5Ao.js → openapi-commands-BlMzQV8z.js} +1 -1
- package/dist/chunks/openapi-commands-CKb-tN3f.js +1 -0
- package/dist/chunks/openapi-snapshot-Ctna6Elf.js +1 -0
- package/dist/chunks/operation-invocation-fkSqlOfs.js +2 -0
- package/dist/chunks/operations-BvFUUN0I.js +2 -0
- package/dist/chunks/operations-catalog-BtQV3yhB.js +1 -0
- package/dist/chunks/operations-catalog-D7efFKII.js +7 -0
- package/dist/chunks/operations-metadata-CWAJpFoN.js +2 -0
- package/dist/chunks/output-Bkxx3rfs.js +5 -0
- package/dist/chunks/output-l_425-ID.js +1 -0
- package/dist/chunks/{package-DPDX5zmx.js → package-CZBWjlYb.js} +1 -1
- package/dist/chunks/package-DxrXjUBK.js +1 -0
- package/dist/chunks/parse-error-hint-FY0I0Srq.js +6 -0
- package/dist/chunks/payload-operand-guard-BVp_alVX.js +1 -0
- package/dist/chunks/private-readback-DX42Bf2b.js +1 -0
- package/dist/chunks/provider-catalog-Dy5L5Zvr.js +1 -0
- package/dist/chunks/reference-recovery-B5XrUTWu.js +15 -0
- package/dist/chunks/runtime-identity-COBUpkxY.js +1 -0
- package/dist/chunks/runtime-identity-Cme_U1eh.js +1 -0
- package/dist/chunks/startup-auth-Cxu4aTuj.js +1 -0
- package/dist/chunks/startup-auth-DGKzN-4Y.js +1 -0
- package/dist/chunks/{tool-policy-BjOSkLem.js → tool-policy-TAT9-UP4.js} +1 -1
- package/package.json +3 -3
- package/dist/chunks/aventure-cli-ZHyAeMkx.js +0 -77
- package/dist/chunks/commander-wH7TO4kY.js +0 -1
- package/dist/chunks/contract-BMHAMOPG.js +0 -16
- package/dist/chunks/dist-Dr9VgZFR.js +0 -111
- package/dist/chunks/logging-WPLQQZUz.js +0 -1
- package/dist/chunks/oauth-bearer-credential-B3Y8Lrxe.js +0 -8
- package/dist/chunks/oauth-bearer-credential-FuvlLNjb.js +0 -1
- package/dist/chunks/oauth-login-C1wWcfNA.js +0 -1
- package/dist/chunks/openapi-commands-Kos4EQNi.js +0 -1
- package/dist/chunks/package-zL1GOs0L.js +0 -1
- package/dist/chunks/provider-catalog-SgEjcFVp.js +0 -1
- package/dist/chunks/runtime-identity-ChLiOrMh.js +0 -1
- package/dist/chunks/runtime-identity-DWyecGw5.js +0 -1
- package/dist/chunks/startup-auth-CIGeUrGQ.js +0 -1
- package/dist/chunks/startup-auth-DusJtRGD.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as e,f as t,l as n,o as r,s as i,u as a}from"./tool-policy-TAT9-UP4.js";import{T as o,l as s,o as c,p as l,u,v as d,w as f,y as p}from"./person-owner-C0YuWKvY.js";import{a as m}from"./package-CZBWjlYb.js";import{i as ee,t as h}from"./human-text-cap-BcNmIPQA.js";var g=c([`HIGH`,`MEDIUM`,`LOW`]),te=c([`PAID_PLAN`,`DAILY_ALLOWANCE`]),_=c([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),v=Object.assign(o([_,f()]),{enum:_.enum}),y=p({billingAccess:te.nullish(),excerpt:f(),sourceId:f(),sourceType:v,sourceVersion:f().nullish()}),ne=p({instruction:f(),operationId:f(),planTaskKey:s(f()).optional(),stepKey:f().optional()}),re=p({body:f(),expectation:f(),method:s(f()),override:f(),reject:s(f()),typeCatalog:f()}),ie=p({cliCommand:f(),mcpTool:f().nullish(),step:ne,writeGuidance:re.nullish()}),b=c([`ENTITY`,`TEXT`,`WRITER_BRIEF`]),ae=Object.assign(o([b,f()]),{enum:b.enum}),oe=p({allowedValue:f().nullish(),description:f(),key:f(),required:u().default(!0).optional(),type:ae}),x=p({catalogRevision:l().optional(),gateId:s(f()).optional(),input:s(oe),step:s(ie),taskKey:f().optional()}),se=c([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),ce=p({candidate:s(y),operationId:f().nullish(),outcome:se,probability:d().nullish(),taskKey:f().nullish(),taskPlan:x.nullish()}),le=p({answer:f(),citation:s(y),confidence:g,resolution:ce.nullish()});function S(e,t,n=t.inputName){if(t.in===`body`)return n;let r=_e.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?E(T(n!==`id`&&n!==`slug`?n:`${fe(e.path)}${w(n)}`),t):r.inputName}function C(e,t,n=me(e)){return ue(pe(e,t),new Set(n))}function ue(e,t){if(!t.has(e))return e;let n=`body${w(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function de(e,t,n){return`${e}[${t}].${n}`}function fe(e){return ve.find(([,t])=>t.test(e))?.[0]??`record`}function pe(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=he(t);return E(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?T(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function me(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>S(e,t)))}function w(e){return e.replace(/^./u,e=>e.toUpperCase())}function T(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 he(e){let t=T(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?ge(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function ge(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function E(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var _e=[{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`}],ve=[[`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 D(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>O(t,S(e,t))),r=(t?.parameter??[]).map(t=>O(t,C(e,t)));return{selector:n.filter(e=>e.location===`path`||k(e)),pagination:n.filter(A),filter:[...n.filter(j),...r.filter(j)],body:r.filter(e=>!j(e))}}function O(e,t){let{in:n,inputName:i,...a}=e;return{...a,flag:r(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function k(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function A(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function j(e){return e.location!==`path`&&!k(e)&&!A(e)}function M(e){return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,scope:e.projection.scope,requiredInput:xe(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]}}function N(e,t){let n=e.requestBody?.[0],r=M(e),i=P(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:D(e)}:{...r,optionalInput:Se(e),arrayInput:Ce(e),...i===void 0?{}:{paidPlan:i}}}function ye(e){let t=D(e),n=e=>e.filter(e=>e.required);return{...N(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function be(e){let{cli:t,scope:n,...r}=M(e),i=P(e);return{...r,...i===void 0?{}:{paidPlan:i},optionalDetailOmitted:!0}}function xe(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function Se(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 P(e){return e.response.find(({status:e})=>e===`402`)?.description}function Ce(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var F=160,I=`Operation catalog matches`,we=[`whole`,`described`,`requiredDescribed`,`optionalNamed`],L=e=>`${[I,...e].join(`
|
|
2
|
+
`)}\n`;function Te(e,t=[]){if(!Array.isArray(e)||e.length===0||!e.every(De))return null;let n=e,r=e=>ee([I,...e,...t]);for(let e of we){let t=[...n.flatMap(t=>B(t,e)),...z(n,e)];if(r(t))return L(t)}let i=e=>[...n.slice(0,e).flatMap(e=>B(e,`optionalNamed`)),...z(n.slice(0,e),`optionalNamed`),`... ${n.length-e} more operations omitted to fit ${h} UTF-8 bytes: ${n.slice(e).map(({operationId:e})=>e).join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`];return L(i([...n.keys()].findLast(e=>e>0&&r(i(e)))??1))}var R=`call aventure_help with q=<operationId> and limit=1; inspect structuredContent.data argument and optionalInput for the retained inputs`;function z(e,t){let n=e.flatMap(e=>`argument`in e?Object.values(e.argument).flat():[]),r=t===`whole`?0:n.filter(e=>e.description.length>F&&(t===`described`||e.required)).length,i=r===0?[]:[`... ${r} argument descriptions shortened; inspect structuredContent.data[].argument for full descriptions.`];if(e.some(e=>`optionalDetailOmitted`in e))return[...i,e.some(e=>`argument`in e)?`... optional argument details omitted: the full list exceeds the result cap; ${R}.`:`... optional inputs omitted: the full list exceeds the result cap; call aventure_help with q=<operationId> and limit=1 to read one operation's inputs.`];if(t===`whole`||!e.some(e=>`argument`in e))return[];if(t===`described`)return i;let a=t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`,o=n.filter(({required:e})=>!e).length;return[...i,`... ${o} ${a} omitted to fit ${h} UTF-8 bytes; structuredContent carries them, and ${R}.`]}function B(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=>Ee(e,e.required||t!==`requiredDescribed`,t)),...t===`optionalNamed`&&r.length>0?[` optional inputs: ${r.join(`, `)}`]:[]]}function Ee(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<=F?e.description:`${e.description.slice(0,157)}...`}`:i}function De(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 V(e){let t=t=>{let n=(`parameter`in e?e.parameter:e.parameters.map(e=>({...e,in:e.location,schemaDefault:e.defaultValue}))).filter(e=>e.in===t&&e.required&&e.schemaDefault===void 0).map(({name:e})=>[e,`<${e}>`]);return n.length===0?void 0:Object.fromEntries(n)},r=t(`path`),i=t(`query`);return{tool:n(e.intent),arguments:{operationId:e.operationId,...r===void 0?{}:{pathParams:r},...i===void 0?{}:{query:i},...e.requestBody===void 0?{}:{body:ke(e)}}}}var Oe=4;function ke(e){let t=e.requestBody?.[0];if(t===void 0)return{};if(t.requiredPath.length>0||e.intent!==`lookup`||t.schemaType===`array`)return Ae(t.requiredPath);let n=t.parameter;return Object.fromEntries(n.flatMap(e=>{let{name:t,schemaType:n,schemaFormat:r}=e,i=`optionKey`in e?e.choices:e.schemaEnum;return t.includes(`.`)||n!==`string`||r!==void 0?[]:i===void 0?[[t,`<${t}>`]]:i.length>Oe?[]:[[t,`<${i.join(`|`)}>`]]}))}function Ae(e){let t={},n=e.filter(t=>!e.some(e=>e.startsWith(`${t}.`)||e.startsWith(`${t}[]`)));for(let e of n){let n=e.split(`.`),r=n.slice(0,-1).reduce(je,t);r[n.at(-1)??e]=`<${e}>`}return t}function je(e,t){let n=t.replace(/\[\]$/u,``),r=e[n],i=Array.isArray(r)?r[0]:r;if(typeof i==`object`&&i&&!Array.isArray(i))return i;let a={};return e[n]=t.endsWith(`[]`)?[a]:a,a}function Me(e){let t=P(e);return{mcpCall:V(e),...t===void 0?{}:{paidPlan:t}}}function Ne(e){let t=H(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function H(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 U=2,Pe=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 W(e,t){let n=J(t);n.length!==0&&(e.add(n),(n===`individual`||n===`individuals`)&&W(e,`person`),G(e,Fe(n),n),G(e,Ie(n),n))}function Fe(e){if(e===`people`)return`person`;let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=U&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return`${e.slice(0,-3)}y`;let n=e.endsWith(`es`)?e.slice(0,-2):``;if(n.length>=U&&n!==`us`&&/(?:s|ss|sh|ch|x|z)$/u.test(n))return n;if(e.length>U&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`)return e.slice(0,-1)}function Ie(e){if(e===`person`)return`people`;if(e!==`new`&&e!==`news`&&e!==`status`&&e!==`us`){if(e.length>=U&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e))return`${e.slice(0,-1)}ies`;if(!(e.length>=U&&e.endsWith(`es`)))return e.length>=U&&/(?:s|ss|sh|ch|x|z)$/u.test(e)?`${e}es`:e.endsWith(`s`)?void 0:`${e}s`}}function G(e,t,n){t!==void 0&&t!==n&&t.length>=U&&/^[a-z]+$/u.test(t)&&e.add(t)}function K(e){let t=new Set(q(e)),n=Array.from(t);for(let e of n)W(t,e);return t}function Le(e){return q(e).map(K)}function Re(e,t){if(e.length===0)return!1;let n=K(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function q(e){return J(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!Pe.has(e))}function J(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`)}function Y(r,o){return r.map(r=>{let s=r.requestBody??[],c=[...r.parameters.map(e=>X(e)),...s.flatMap(e=>e.parameter.map(t=>X(t,s.length>1?e.contentType:void 0))),...ze(s)],l=[o,...r.cliPath].join(` `),u=r.mutates===!0||e(r.intent),d=t(r),f=s[0];return{operationId:r.operationId,method:r.method,path:r.path,resource:r.resource,intent:r.intent,scope:r.scope,mutates:u,destructive:i(r.method,r.intent),auth:r.auth,cli:{command:l,path:r.cliPath},mcpTool:r.binaryResponse||!a(r.path)||d===null?null:n(d),body:{hasBody:f!==void 0,kind:f?.kind??null,...f!==void 0&&s.length>1?{contentType:f.contentType}:{},required:f?.required??!1,description:f?.description??``,requiredPath:f?.requiredPath??[]},flags:c,errorResponse:r.errorResponse,...r.successResponse===void 0?{}:{successResponse:r.successResponse},summary:r.summary,description:r.description,...r.deprecated===void 0?{}:{deprecated:r.deprecated}}})}function X(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 ze(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 Z(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var Be=[`-id`,`-slug`,`-url`],Ve=[`--id`,`--slug`,`--url`],He=`/v1/lookup`,Ue=`--from-file "<path>"`;function We(e,t,n=m().bin[0]){let r=Y(t,n),i=r.find(t=>t.operationId===e);return i===void 0?[]:qe(i,r)}function Q(e,t,n=m().bin[0]){let r=t.find(t=>t.operationId===e),[i]=r===void 0?[]:Y([r],n);return i&&Ke(i,Xe(i,!1))}function Ge(e,t,n,r=m().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 Q(o.operationId,t,r)}function Ke(e,t){return[e.cli.command,...t,`--data`].join(` `)}function qe(e,t){return[`example: ${Ke(e,Xe(e))}`,...Je(e,t)]}function Je(e,t){return Z(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} ${$(i)} --data`,o=t.find(e=>e.method===`POST`&&e.path===He),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} ${$(s)} --data, then match.owner.${e.optionKey} when status is MATCHED`]})}var Ye=/(?:^|\.)text$/u;function Xe(e,t=!0){let n=Z(e),r=n.filter(e=>e.required),i=e.body.kind===`json`&&n.some(e=>e.location===`body`&&Ye.test(e.wireName)&&(e.required||!e.wireName.includes(`.`))),a=i?r.filter(e=>e.location!==`body`):r,o=(r.length>0||!t?a:Ze(e)).map($);return i||(e.body.required||e.body.requiredPath.length>0)&&!a.some(e=>e.location===`body`)?[...o,Ue]:o}function Ze(e){let t=new Set;W(t,e.resource);for(let n of Be)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 Ve){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function $(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}export{g as A,C,se as D,le as E,x as O,ye as S,de as T,Me as _,qe as a,N as b,W as c,q as d,J as f,Ne as g,H as h,Ge as i,v as k,Re as l,I as m,Z as n,Y as o,Le as p,We as r,Q as s,Ye as t,K as u,Te as v,S as w,be as x,V as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./commander-DEj7N1b9.js";import{l as t}from"./tool-policy-TAT9-UP4.js";import{c as n}from"./result-envelope-BKQSGfkH.js";import{a as r}from"./package-CZBWjlYb.js";import{t as i}from"./output-Bkxx3rfs.js";import{i as a,t as o}from"./output-mode-CMdKmp9N.js";import{a as s,i as c,o as l,r as u,t as d}from"./operations-catalog-D7efFKII.js";import{dirname as f,resolve as p}from"node:path";import{mkdirSync as m,writeFileSync as h}from"node:fs";function g(e,t=new Date){let n=y(e);return{schemaVersion:1,generatedFrom:`MCP_GENERATION_CONTRACT`,generatedAt:t.toISOString(),totalOperations:n.length,note:`Projection of MCP_GENERATION_CONTRACT - see mcp/scripts/build-unified-operations.ts header for SSOT rules.`,operations:n}}function _(e){return`${JSON.stringify(e,null,2)}\n`}function v(e,t){let n=p(e),r=_(t);return m(f(n),{recursive:!0}),h(n,r),{target:n,byteLength:Buffer.byteLength(r,`utf8`),totalOperations:t.totalOperations}}function y(e){return e.map(e=>({operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliCommand:e.projection.cliPath.join(` `),cliPath:e.projection.cliPath,mcpTool:t(e.intent),bodySchemaName:e.requestBody?.[0]?.schemaName??null,bodySchemaImport:e.requestBody?.[0]?.schemaImport??null,auth:e.projection.auth,scope:e.projection.scope,destructive:e.projection.destructive})).toSorted((e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)||e.operationId.localeCompare(t.operationId))}var b=`Match only the first canonical or CLI-alias command segment`,x=[`text`,`lines`,`compact`,`json`,`ndjson`];function S(e,t,n=r().bin[0]){let i=e.command(`command-catalog`).summary(`LLM agent only: search generated CLI metadata`).description([`LLM agent only: search and dump generated ${n} command metadata.`,`This is read-only command metadata derived from the generated OpenAPI command specs.`,`Use --format lines for rg/grep/ag/ack and --format ndjson|json for ast-grep/sg/parsers.`,"Use --format compact for one `cli · summary · requiredFlags` row per operation."].join(`
|
|
2
|
+
`));i.addHelpText(`after`,()=>`\nShipped compact catalog of operations callable without an admin grant, greppable without\nrunning this CLI (dump --format compact lists every operation your credential reaches):\n ${d(n)}\n`),C(i,t,n),w(i,t,n),T(i,t,n),E(i)}function C(t,n,r){let i=t.command(`search`).summary(`Search generated operations`).description(`Search generated operation metadata without calling the API.`).argument(`[query...]`,`Search query; same as --q.`).option(`--q <query>`,`Search generated command metadata`).option(`--root <root>`,b).addOption(new e(`--scope <scope>`,`Filter by required auth scope`).choices([`read`,`write`,`all`]).default(`all`)).addOption(new e(`--mutates <mutates>`,`Filter mutating operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new e(`--destructive <destructive>`,`Filter destructive operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new e(`--intent <intent>`,`Filter by operation intent`).choices([`read`,`lookup`,`search`,`write`,`delete`,`status`,`all`]).default(`all`)).addOption(new e(`--method <method>`,`Filter by HTTP method`).choices([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`all`]).default(`all`)).option(`--limit <count>`,`Maximum rows to return`,`20`).addOption(new e(`--format <format>`,`Text/file render format`).choices(x)).option(`--output <path>`,`Write rendered output to a file`);o(i),i.action(function(e){let t=this.optsWithGlobals(),i=a(t,`text`),o=u(t,e),c=(o.q?.trim()??``)===``?n.filter(({deprecated:e})=>e!==!0):n;s(o,c,i,r)})}function w(t,n,r){let i=t.command(`show`).summary(`Show one generated operation`).description(`Show one generated operation by command path or operationId.`).option(`--command <command>`,`CLI command path, with or without ${r} prefix`).option(`--operation-id <operationId>`,`Generated OpenAPI operationId`).addOption(new e(`--format <format>`,`Text/file render format`).choices([`usage`,`lines`,`compact`,`json`,`ndjson`]).default(`usage`)).option(`--output <path>`,`Write rendered output to a file`);o(i),i.action(function(){let e=this.optsWithGlobals();l(e,n,a(e,`text`),r)})}function T(t,n,r){let i=t.command(`dump`).summary(`Dump generated operations`).description(`Dump generated operations for rg/grep/ag/ack or JSON/NDJSON tooling.`).option(`--root <root>`,b).addOption(new e(`--scope <scope>`,`Filter by required auth scope`).choices([`read`,`write`,`all`]).default(`all`)).addOption(new e(`--mutates <mutates>`,`Filter mutating operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new e(`--destructive <destructive>`,`Filter destructive operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new e(`--intent <intent>`,`Filter by operation intent`).choices([`read`,`lookup`,`search`,`write`,`delete`,`status`,`all`]).default(`all`)).addOption(new e(`--method <method>`,`Filter by HTTP method`).choices([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`all`]).default(`all`)).option(`--limit <count>`,`Maximum rows to return`).addOption(new e(`--format <format>`,`Text/file render format`).choices(x)).option(`--output <path>`,`Write rendered output to a file`);o(i),i.action(function(){let e=this.optsWithGlobals(),t=a(e,`text`);s(e,n,t,r)})}function E(e){let t=e.command(`unified`).summary(`Dump unified CLI/API/MCP operation JSON`).description(`Dump the flat unified operations JSON projected from MCP_GENERATION_CONTRACT.`).option(`--output <path>`,`Write unified operations JSON to a file`);o(t),t.action(async function(){let e=this.optsWithGlobals(),t=a(e,`text`),{MCP_GENERATION_CONTRACT:r}=await import(`./mcp-generation-contract-XdtSQ9XZ.js`);if(t===`text`&&e.output===void 0&&(e.text===!0||e.allFields===!0)){i({mode:t},n(`Unified operations JSON`,`Use --output <path> to write the unified operations JSON.`,{counts:{totalOperations:r.length}}));return}let o=g(r);if(e.output!==void 0){let r=v(e.output,o);i({mode:t},n(`Unified operations JSON written`,{outputPath:r.target,byteLength:r.byteLength,schemaVersion:o.schemaVersion},{counts:{totalOperations:r.totalOperations}}))}else t===`text`?c(`Unified operations JSON`,_(o)):i({mode:t},n(`Unified operations JSON`,o,{counts:{totalOperations:o.totalOperations}}))})}export{S as registerOperationsCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{o as writeShowResult}from"./operations-catalog-D7efFKII.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{c as e,r as t}from"./result-envelope-BKQSGfkH.js";import{a as n}from"./package-CZBWjlYb.js";import{r}from"./output-spill-5SehC7pV.js";import"./startup-auth-DGKzN-4Y.js";import{t as i}from"./output-Bkxx3rfs.js";import{n as a,r as o}from"./operations-metadata-CWAJpFoN.js";import{fileURLToPath as s}from"node:url";import{dirname as c,resolve as l}from"node:path";import{existsSync as u,writeFileSync as d}from"node:fs";var f=`dist/aventure-cli/command-catalog.compact.txt`,p=` · `,m=`-`;function h(e=n().bin[0]){return l(g(c(s(import.meta.url)),e),f)}function g(e,t){let n=e;for(;;){if(u(l(n,`package.json`)))return n;let r=c(n);if(r===n)throw Error(`No package.json above ${e}; ${t} is not in a package layout.`);n=r}}function _(e,t){let n=t.join(` `).trim();return n.length===0?e:{...e,q:e.q===void 0?n:`${e.q} ${n}`}}function v(e,t,r,o=n().bin[0]){let s=a(e,t,o);!s.ok||s.data===null?i({mode:r},s):b({opts:e,mode:r,data:s.data,defaultFormat:`lines`,rendered:C(s.data,S(e.format,`lines`)),summary:`Generated operation matches`})}function y(e,t,r,a=n().bin[0]){let s=o(e,t,a);!s.ok||s.data===null?i({mode:r},s):b({opts:e,mode:r,data:s.data,defaultFormat:`usage`,rendered:w(s.data,S(e.format,`usage`)),summary:`Generated operation detail`})}function b(n){let r=n.mode,a=S(n.opts.format,n.defaultFormat),o=n.opts.text===!0||n.opts.allFields===!0;if(n.opts.output===void 0&&o&&(a===`json`||a===`ndjson`)){i({mode:r},t(`--text or --all-fields cannot be combined with --format json or ndjson`,[`Omit the text flag for machine output, or use --format lines, compact, or text.`]));return}let s=n.opts.output===void 0&&r===`text`&&`count`in n.data&&n.data.count.matched===0&&(o||n.opts.format===void 0||a===`text`)?`No generated operations matched.`:n.rendered,c=s.endsWith(`
|
|
2
|
+
`)?s:`${s}\n`;n.opts.output===void 0?r===`text`?x(n.summary,c):i({mode:r},e(n.summary,n.data,{counts:A(n.data)})):(d(n.opts.output,c),i({mode:r},e(n.summary,{outputPath:n.opts.output,byteLength:Buffer.byteLength(c,`utf8`),format:a},{counts:A(n.data)})))}function x(t,n){let a=r(e(t,n));!a.ok||a.data===null?i({mode:`text`},a):process.stdout.write(a.data.endsWith(`
|
|
3
|
+
`)?a.data:`${a.data}\n`)}function S(e,t){return e??t}function C(e,t){return t===`json`?JSON.stringify(e,null,2):t===`ndjson`?e.operation.map(e=>JSON.stringify(e)).join(`
|
|
4
|
+
`):t===`text`?D(e.operation):t===`compact`?e.operation.map(T).join(`
|
|
5
|
+
`):e.operation.map(O).join(`
|
|
6
|
+
`)}function w(e,t){return t===`json`?JSON.stringify(e,null,2):t===`ndjson`?JSON.stringify(e.operation):t===`lines`?O(e.operation):t===`compact`?T(e.operation):e.usage}function T(e){let t=E(e);return[e.cli.command,e.summary,t.length===0?m:t.join(` `)].join(p)}function E(e){return e.flags.filter(t=>t.required&&(t.contentType===void 0||t.contentType===e.body.contentType)).map(e=>e.name)}function D(e){return e.map(e=>`${e.cli.command}\n ${O(e)}`).join(`
|
|
7
|
+
`)}function O(e){let t=E(e);return[k(`operationId`,e.operationId),k(`scope`,e.scope),k(`mutates`,String(e.mutates)),k(`destructive`,String(e.destructive)),k(`intent`,e.intent),k(`resource`,e.resource),k(`cli`,e.cli.command),e.mcpTool===null?``:k(`mcpTool`,e.mcpTool),k(`method`,e.method),k(`path`,e.path),k(`auth`,e.auth),k(`flags`,[...new Set(e.flags.map(e=>e.name))].join(` `)),k(`requiredFlags`,t.join(` `)),k(`bodyKind`,e.body.kind??``),k(`bodyRequired`,String(e.body.required)),k(`summary`,e.summary)].filter(e=>e.length>0).join(` `)}function k(e,t){return t.length===0?``:`${e}=${JSON.stringify(t)}`}function A(e){return`count`in e?e.count:{returned:1}}export{v as a,x as i,C as n,y as o,_ as r,h as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as e,r as t}from"./result-envelope-BKQSGfkH.js";import{a as n}from"./package-CZBWjlYb.js";import{a as r,f as i,n as a,o}from"./operation-invocation-fkSqlOfs.js";import{a as s,n as c}from"./help-intent-DwGb0FsW.js";function l(r,a,l=n().bin[0]){let u=r.limit===void 0?void 0:Number(r.limit);if(u!==void 0&&(r.limit?.trim()===``||!Number.isInteger(u)||u<0))return t(`Invalid --limit value: ${JSON.stringify(r.limit)} (expected a non-negative integer)`,["Pass a non-negative integer, e.g. `--limit 20`."]);let d=o(a,l),f=i(r.root??``),m=[...new Set(d.map(({cli:e})=>i(e.path.at(0)??``)))].toSorted();if(f.length>0&&!m.includes(f))return t(`Unknown --root value: ${JSON.stringify(r.root)}`,[`Pass one of: ${m.join(`, `)}.`]);let h=c(r.q??``,d.filter(e=>p(e,r)),e=>({...e,cliPath:e.cli.path,enumParameter:e.flags.map(({choices:e,location:t})=>({values:e,direct:t!==`body`})),parameterName:e.flags.flatMap(({wireName:e,optionKey:t})=>[e,t]),directParameterName:e.flags.filter(({location:e})=>e!==`body`).map(({wireName:e})=>e),parameterDescription:[e.body.description,...e.flags.map(({description:e})=>e)],responseFieldLevel:s(e.operationId)})).map(({item:e})=>e),g=h.slice(0,u);return e(`Operation catalog matches`,{operation:g,count:{totalOperations:a.length,matched:h.length,returned:g.length}})}function u(r,i,a=n().bin[0]){let s=o(i,a),c=r.operationId===void 0?d(s,r.command):s.find(e=>e.operationId===r.operationId);if(c===void 0){let e=v(r.command??``),n=s.map(e=>e.cli.command).filter(t=>t.startsWith(`${a} ${e} `));if(n.length>0)return t(`${e} is a command group; show one of its subcommands.`,[`Run \`${a} command-catalog show --command "<subcommand>"\` with one of:`,...n]);let o=e.split(` `),c=new Set([...[...o.keys()].map(e=>o.slice(e+1).join(` `)),...o.slice(1).map((e,t)=>o.toSpliced(t,2,`${o[t]}-${e}`).join(` `))]),u=l({q:r.command??r.operationId},i,a),d=[...s.filter(({cli:e})=>e.path.length>1&&c.has(e.path.join(` `))).toSorted((e,t)=>t.cli.path.length-e.cli.path.length),...u.data?.operation??[]];return t(`Generated operation not found`,[...[...new Set(d.map(({cli:e,operationId:t})=>`${e.command} (operationId ${t})`))].slice(0,3).map(e=>`closest: ${e}`),`List candidates with \`${a} command-catalog search "<text>"\`.`])}return e(`Generated operation detail`,{operation:c,usage:h(c,s)})}function d(e,t){if(t===void 0)return;let{bin:r}=n(),i=v(t,r);return e.find(e=>v(e.cli.command,r)===i)}var f=(e,t)=>e===void 0||e===`all`||e===`any`||e===String(t);function p(e,t){return(t.root===void 0||m(e,t.root))&&f(t.scope,e.scope)&&f(t.mutates,e.mutates)&&f(t.destructive,e.destructive)&&f(t.intent,e.intent)&&f(t.method,e.method)}function m(e,t){let n=i(t);return n.length===0||i(e.cli.path.at(0)??``)===n}function h(e,t){let n=a(e);return[`cli: ${e.cli.command}`,`${e.method} ${e.path}`,`operationId: ${e.operationId}`,`resource: ${e.resource}`,`intent: ${e.intent}`,`scope: ${e.scope}`,`mutates: ${e.mutates}`,`destructive: ${e.destructive}`,`mcpTool: ${e.mcpTool??`unavailable (CLI-only operation)`}`,e.body.hasBody?`body: kind=${e.body.kind??`unknown`} required=${e.body.required} requiredPath=${e.body.requiredPath.join(`,`)}`:`body: none`,...e.successResponse===void 0?[]:[`success: ${e.successResponse}`],...[!0,!1].flatMap(t=>[`path`,`query`,`header`,`body`].map(r=>{let i=n.filter(e=>e.required===t&&e.location===r),a=_(`${t?`required`:`optional`} ${r} flags`,i);return t&&r===`body`&&e.body.kind===`json`&&i.length>0?`${a} (required unless --from-file sets JSON key(s) ${i.map(({wireName:e})=>e).join(`, `)})`:a})),...r(e,t),...g(e.errorResponse),``,e.summary,e.description].filter(e=>e.length>0).join(`
|
|
2
|
+
`)}function g(e){return e.length===0?[]:[`Errors:`,...e.map(({status:e,description:t})=>` ${e} ${t}`)]}function _(e,t){return`${e}: ${t.length===0?`none`:t.map(e=>e.name).join(` `)}`}function v(e,t=n().bin){let[r=``,...i]=e.trim().split(/\s+/u);return(t.includes(r)?i:[r,...i]).join(` `)}export{l as n,u as r,g as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{o as e}from"./logging-BnHashoK.js";import{n as t}from"./result-envelope-BKQSGfkH.js";import{a as n}from"./package-CZBWjlYb.js";import{n as r,r as i}from"./output-spill-5SehC7pV.js";import{n as a}from"./human-text-cap-BcNmIPQA.js";import{i as o,n as s,r as c,t as l}from"./reference-recovery-B5XrUTWu.js";import{t as u}from"./openapi-commands-CKb-tN3f.js";function d(e,t){let n=t.data,r=`jobId`,i=`statusUrl`,a=t.rolloverJob?.jobId??(typeof n==`object`&&n&&r in n&&typeof n[r]==`string`?n[r]:void 0),o=t.rolloverJob?.statusUrl??t.headers.location??(typeof n==`object`&&n&&i in n&&typeof n[i]==`string`?n[i]:void 0),s=t.headers[`retry-after`],c=`Pending: ${e.operationId??`request`}${a===void 0?``:` job ${a}`} is still running.`+(s===void 0?``:` Retry-After: ${s}.`)+(o===void 0?``:` Poll GET ${o} for the result.`);return{...e,summary:c,warnings:[...e.warnings,c],ids:a===void 0?e.ids:[...new Set([...e.ids,a])],references:o===void 0?e.references:[...new Set([...e.references,o])]}}function f(e){let n=t(e,g(e));return S(n),process.stdout.write(`${JSON.stringify(n)}\n`),n}function p(e){let n=t(e,{...g(e),foldRows:!1});S(n);let r=c(u,n.data,n.summary),i=[];if(n.ok&&r!==null){let e=m(n);i.push(r.endsWith(`
|
|
2
|
+
`)?r.slice(0,-1):r),i.push(...e),process.stdout.write(a(i.join(`
|
|
3
|
+
`),{appendNewline:!0,preservedTrailerLines:e.length}));return}let o=n.ok?`OK`:`FAIL`;i.push(`[${o}] ${n.summary}`),!n.ok&&n.problem!==void 0&&i.push(...v(n.problem)),i.push(...m(n)),process.stdout.write(a(i.join(`
|
|
4
|
+
`),{appendNewline:!0}))}function m(e){let t=[];e.ids.length>0&&t.push(` ids: ${e.ids.join(`, `)}`);for(let[n,r]of Object.entries(e.counts))t.push(` ${n}: ${r}`);for(let n of e.references)t.push(` ref: ${n}`);if(e.truncation!==void 0){let n=e.truncation.omitted.join(`, `);t.push(` truncated: byteLength=${e.truncation.byteLength} maxBytes=${e.truncation.maxBytes} omitted=${n}`,` recovery: ${e.truncation.recovery}`)}for(let n of e.warnings)t.push(` warn: ${n}`);return t}function h(e,n){let a=i(n);if(e.mode===`data`||e.mode===`data-full`){let n=e.mode===`data`?t(a,g(a)):a;S(n),process.stdout.write(`${JSON.stringify(n.ok&&n.truncated!==!0?r(n.data):n)}\n`),n.ok||(process.exitCode=1);return}let o=e.mode===`json`?f(a):a;e.mode===`text`&&p(o),o.ok||(process.exitCode=1)}function g(e){let t=s(e,u);if(t.write===!0||!e.ok)return t;let n=l(e,u);return n===void 0?t:{...t,exactRecovery:`Inline output is truncated. ${n}`}}function _(e,t){if(typeof t==`object`&&t&&`httpStatus`in t&&t.httpStatus===202)return;let n=o(t);n===null?(process.stderr.write(`explain: the response carried no search interpretation
|
|
5
|
+
`),process.exitCode=1):(e===`text`?process.stdout:process.stderr).write(n)}function v(e){let t=[];typeof e.code==`string`&&t.push(` code: ${e.code}`),typeof e.detail==`string`&&t.push(` detail: ${e.detail}`),typeof e.hint==`string`&&t.push(` hint: ${e.hint}`),typeof e.suggestion==`string`&&t.push(` suggestion: ${e.suggestion}`);let n=Object.entries(e.suggestions??{});if(n.length>0){let e=n.map(([e,t])=>`${e}=${t}`).join(`; `);t.push(` suggestions: ${e}`)}return typeof e.requiredRole==`string`&&t.push(` requiredRole: ${e.requiredRole}`),t.push(...y(e),...b(`unknownParameters`,e.unknownParameters),...b(`validParameters`,e.validParameters),...x(e.resolution)),t}function y(e){let t=[];return typeof e.limitType==`string`&&t.push(`limitType=${e.limitType}`),typeof e.used==`number`&&t.push(`used=${e.used}`),typeof e.limit==`number`&&t.push(`limit=${e.limit}`),typeof e.remaining==`number`&&t.push(`remaining=${e.remaining}`),typeof e.resetAt==`string`&&t.push(`resetAt=${e.resetAt}`),typeof e.windowSeconds==`number`&&t.push(`windowSeconds=${e.windowSeconds}`),typeof e.retryAfterSeconds==`number`&&t.push(`retryAfterSeconds=${e.retryAfterSeconds}`),t.length>0?[` meter: ${t.join(` `)}`]:[]}function b(e,t){return t!=null&&t.length>0?[` ${e}: ${t.join(`, `)}`]:[]}function x(e){if(e==null)return[];let t=[`action=${e.action}`];return typeof e.parameter==`string`&&t.push(`parameter=${e.parameter}`),typeof e.fieldPath==`string`&&t.push(`fieldPath=${e.fieldPath}`),typeof e.endpoint==`string`&&t.push(`endpoint=${e.endpoint}`),e.acceptedValue!==null&&e.acceptedValue!==void 0&&e.acceptedValue.length>0&&t.push(`acceptedValue=${e.acceptedValue.join(`, `)}`),typeof e.retryable==`boolean`&&t.push(`retryable=${e.retryable}`),[` resolution: ${t.join(` `)}`]}function S(t){if(t.ok&&t.warnings.length===0)return;let r=t.truncation===void 0?t.warnings:[...t.warnings,`omitted: ${t.truncation.omitted.join(`, `)}`,`recovery: ${t.truncation.recovery}`];e({component:n().bin[0],event:t.ok?`command_warning`:`command_failed`,message:r.length>0?r.join(` | `):t.summary,fields:{warningCount:t.warnings.length,summary:t.summary}})}export{d as a,_ as i,p as n,f as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as emit,r as emitJson,i as emitSearchExplanation,a as pendingResult}from"./output-Bkxx3rfs.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./runtime-identity-
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./runtime-identity-Cme_U1eh.js";import{resolve as i}from"node:path";import{existsSync as a}from"node:fs";var o=`@aventurevc/aventure-cli`,s=`@aventurevc/mcp-server`,c=`aventure`,l=`https://registry.npmjs.org/`,u=[o,s,``,``];function d(e){let{entryPath:n,manifest:r,manifestPath:i,packageRoot:a}=t(e);return f(r,i,a,n)}function f(t,r,o,s){let c=Reflect.get(t,`name`);if(!p(c))throw n(`${r} has unsupported package name ${String(c)}`);let l=e(t,`version`,r),u=a(i(o,`aventure-cli`,`index.ts`))?o:null,d=_(Reflect.get(t,`bin`),`${r} bin`);return{bin:v(m(t,r,o,s)??d,r),entryPath:s,name:c,packageRoot:o,registry:y(t,r,u!==null),version:l,workingTreeRoot:u}}function p(e){return u.some(t=>t===e)}function m(e,t,i,a){let o=Reflect.get(e,`aventurePublish`);if(o===void 0)return;if(!r(o))throw n(`${t} aventurePublish must be an object`);let s=Reflect.get(o,`variants`);if(!r(s))throw n(`${t} aventurePublish.variants is required`);let c=new Set(a.slice(i.length).split(/[\\/]/u));for(let e of Object.keys(s)){let n=h(s,e,t),r=Reflect.get(n,`directory`);if(typeof r==`string`&&c.has(r))return g(n,e,t)}return g(h(s,`cli`,t),`cli`,t)}function h(e,t,i){let a=Reflect.get(e,t);if(!r(a))throw n(`${i} aventurePublish.variants.${t} is required`);return a}function g(e,t,r){let i=_(Reflect.get(e,`bin`),`${r} aventurePublish.variants.${t}.bin`);if(i===void 0)throw n(`${r} aventurePublish.variants.${t}.bin is required`);return i}function _(e,t){if(e!==void 0){if(!r(e))throw n(`${t} must be an object`);return Object.entries(e).map(([e,r])=>{if(typeof r!=`string`)throw n(`${t}.${e} must be a string`);return[e,r]})}}function v(e,t){let[r,...i]=(e??[]).map(([e])=>e);if(r===void 0)throw n(`${t} defines no bin`);return[r,...i]}function y(e,t,i){let a=Reflect.get(e,`publishConfig`);if(a===void 0){if(i)return``;throw n(`${t} publishConfig.registry is required outside a working tree`)}if(!r(a))throw n(`${t} publishConfig must be an object`);let o=Reflect.get(a,`registry`);if(o!==``&&o!==`https://registry.npmjs.org/`)throw n(`${t} has unsupported publishConfig.registry ${String(o)}`);return o}export{d as a,l as i,o as n,s as r,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as readRuntimePackage}from"./package-CZBWjlYb.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as e}from"./tool-policy-TAT9-UP4.js";import{i as t,r as n}from"./operation-invocation-fkSqlOfs.js";import{a as r,o as i}from"./startup-auth-DGKzN-4Y.js";import{t as a}from"./openapi-commands-CKb-tN3f.js";import{n as o}from"./operations-metadata-CWAJpFoN.js";import{n as s}from"./operations-catalog-D7efFKII.js";import{a as c,t as l}from"./payload-operand-guard-BVp_alVX.js";function u(e,t){return e.message.match(RegExp(`${t} '([^']+)'`,`iu`))?.[1]?.split(/\s+/u)[0]}function d(e){return e.flags.split(` `)[0]??e.flags}function f(e,t){let n=u(t,`required option`),r=e.options.findIndex(e=>d(e)===n);if(r<0)return;let i=new Set((M(c(e))?.parameters??[]).flatMap(e=>e.location===`path`?[e.optionKey]:[])),a=e.options.slice(r+1).find(t=>{let n=e.getOptionValue(t.attributeName());return i.has(t.attributeName())&&typeof n==`string`&&n!==``});if(a!==void 0)return`hint: ${n} is still required for this nested command; supplied child selector ${d(a)} does not replace the parent selector.`}var p=[[`--search`,`--query`,`--q`,`--term`,`--keyword`],[`--size`,`--limit`,`--page-size`,`--per-page`],[`--transaction-id`,`--fundraise-round-id`]];function m(e){let t=new Set(e.options.map(d)),n=process.argv.indexOf(`--`),r=new Set(n<0?process.argv:process.argv.slice(0,n));return e.args.filter(e=>r.has(e)&&/^--[^-=]/u.test(e)).map(e=>e.split(`=`)[0]??e).filter(e=>!t.has(e))}function h(e){let t=M(c(e))?.parameters??[],n=m(e).flatMap(n=>{let r=p.find(e=>e.includes(n))?.find(t=>e.options.some(e=>d(e)===t))??t.filter(({name:e})=>`--${e.replace(/[A-Z]/gu,`-$&`).toLowerCase()}`===n).map(e=>e.flag.split(` `)[0])[0];return r===void 0?[]:[`use ${r}, not ${n}`]});return n.length===0?void 0:`hint: ${n.join(`; `)}`}function g(e){return e.commands.length===0?[e]:e.commands.flatMap(g)}function _(e){return e.parent===null?e:_(e.parent)}function v(e,t){let n=t=>{let n=c(t).slice(c(e).length);return n.length*2+ +![`get`,`list`].includes(n.at(-1)??``)};return t.toSorted((e,t)=>n(e)-n(t))[0]}function y(e){return/^[A-Za-z0-9_./:=@+-]+$/u.test(e)?e:`'${e.replaceAll(`'`,`'"'"'`)}'`}function b(e,t){let n=[...e.options,...e.createHelp().visibleOptions(e)];for(let t=e.parent;t!==null;t=t.parent)n.push(...t.options);let r=t,i;for(let e=0;e<t.length;e++){let a=t[e];if(a===void 0||a===`--`)break;if(!a.startsWith(`-`)||a===`-`||i?.variadic&&Number.isFinite(Number(a)))continue;let o=a.indexOf(`=`),s=o<0?a:a.slice(0,o);if(i=n.find(e=>e.short===s||e.long===s),i===void 0||o>=0&&!i.required&&!i.optional){r=[`--help`];break}o<0&&(i.required||i.optional&&!t[e+1]?.startsWith(`-`))&&e++}return[_(e).name(),...c(e),...r].map(y).join(` `)}function x(e,t){let n=u(t,`unknown option`);if(n===void 0||e.commands.length===0)return;let r=v(e,g(e).filter(e=>e.options.some(e=>d(e)===n)));return r===void 0?void 0:`hint: run: ${b(r,process.argv.slice(2+c(e).length))}`}function S(e){return e!==void 0&&Object.hasOwn(i,e)}function C(e,t){return t.reduce((e,t)=>e?.commands.find(e=>e.name()===t),e)}function w(e,t){let n=c(e),r=[...n.slice(1),t];if(!S(n.at(0))||!S(r.at(0)))return;let i=C(_(e),r);if(i===void 0)return;let a=i;for(let e of process.argv.slice(2+n.length+1)){if(e.startsWith(`-`))break;let t=a.commands.find(t=>t.name()===e);if(t===void 0)break;r.push(e),a=t}return r}function T(e,t){let[n]=c(e);if(n===void 0||!S(n))return;let r=[n,t];return C(_(e),r)?.commands.length===0?r:void 0}function E(e){let[t,...n]=e.args;if(t===void 0)return[];let r=g(_(e)).map(c),i=n.findIndex((e,t)=>{let i=[...n.slice(0,t),e];return!r.some(e=>e.some((t,n)=>t===i[0]&&i.every((t,r)=>e[n+r]===t)))});return[t,...i<0?n:n.slice(0,i)]}function D(e,t,n=[]){let i=c(e),o=r(a).map(e=>e.cliPath).filter(e=>e[0]!==i[0]&&e.length>=t.length&&t.every((n,r)=>e[e.length-t.length+r]===n)),s=o.find(e=>e.length===t.length&&e.every((e,n)=>e===t[n]))??(o.length===1?o[0]:void 0);if(s===void 0)return;let l=C(_(e),s);return l===void 0?void 0:`hint: run: ${b(l,n)}`}function O(e,t,n){if(!A(t))return;let r=C(_(e),t);if(r===void 0)return;let i=e.args.slice(n.length),a=i.findIndex(e=>e.startsWith(`-`));return`hint: Did you mean: ${b(r,a<0?[]:i.slice(a))}`}function k(e){let t=c(e);if(t.at(1)!==void 0&&S(t.at(0)))return`hint: inspect generated command group: ${[_(e).name(),...t,`--help`].map(y).join(` `)}`}function A(t,n){let r=M(t)?.intent;return r!==void 0&&(n===void 0||e(r)===n)}var j=new Map(a.toReversed().map(e=>[e.cliPath.join(` `),e])),M=e=>j.get(e.join(` `));function N(e){let t=c(e).join(` `),i=r(a),o=i.find(e=>e.cliPath.join(` `)===t);return o===void 0?[]:n(o.operationId,i,_(e).name()).map(e=>`hint: ${e}`)}function P(e){let t=c(e);if(S(t.at(0))&&A(t))return`hint: inspect generated command: ${[_(e).name(),...t,`--help`].map(y).join(` `)}`}function F(t){let n=new Set,r=[];for(let i of a){let a=C(t,i.cliPath);if(a===void 0)continue;let o=a.options.map(d);if(e(i.intent))r.push(o);else for(let e of o)n.add(e)}let[i=[],...o]=r;return new Set(i.filter(e=>!n.has(e)&&o.every(t=>t.includes(e))))}function I(e,t){let n=c(e);if(A(n,!1)&&F(_(e)).has(t))return`hint: ${n.join(` `)} is a read operation; ${t} is a deprecated compatibility option only on mutation commands`}function L(e,t,n=!0){let i=_(e),l=i.commands.find(e=>e.name()===`command-catalog`),u=l?.commands.find(e=>e.name()===`search`);if(l===void 0||u===void 0)return;let f=[i.name(),l.name(),u.name(),t],p=c(e).at(0),m=u.options.find(e=>d(e)===`--root`),h=n&&m!==void 0&&S(p)?p:void 0;m!==void 0&&h!==void 0&&f.push(d(m),h);let g=r(a),v=o({q:t,root:h,limit:`3`},g,i.name()),b=v.ok&&v.data!==null?s(v.data,`compact`):``;return[`hint: search generated commands: ${f.map(y).join(` `)}`,...b===``?[]:[`hint: closest commands (command · summary · required flags):`],...b.split(`
|
|
2
|
+
`).filter(Boolean).map(e=>` ${e}`)].join(`
|
|
3
|
+
`)}function R(e,n=``){if(e.commands.length>0&&!A(c(e)))return;let i=e.options.flatMap(e=>e.hidden?[]:[d(e)]),o=r(a),s=t(n,o,c(e),_(e).name());return`${s===void 0?``:`hint: an id you already hold is read with: ${s}\n`}hint: ${c(e).join(` `)} accepts: ${i.join(` `)}`}function z(e,t){let n=u(t,`unknown command`);if(n===void 0||t.message.includes(`
|
|
4
|
+
(Did you mean `))return;let r=E(e),i=process.argv.slice(2+c(e).length);if(r.length>0&&r.every((e,t)=>i[t]===e)){let t=D(e,r);if(t!==void 0)return t}let a=c(e),o=[...a.slice(0,-1),`${a.at(-1)}-${n}`,...r.slice(1)],s=(A(o)?o:void 0)??w(e,n)??T(e,n);if(s!==void 0)return O(e,s,r)??L(e,s.join(` `),!1);let l=r.join(` `)||n,d=k(e)??L(e,l),f=[...a,...r.slice(1)];return[d,r.length===a.length+a.length&&a.at(-1)===a.at(0)?O(e,f,r)?.replace(/^hint: Did you mean: /u,` `)+` · `:f.slice(1,-1).length>0?O(e,f,r):void 0].filter(e=>e!==void 0).join(`
|
|
5
|
+
`)||void 0}function B(e){return t=>{if(t.code===`commander.missingMandatoryOptionValue`){let n=e.options.filter(t=>t.mandatory&&e.getOptionValue(t.attributeName())===void 0);if(n.length>1){let e=n.map(e=>e.flags.split(`, `).at(-1)??e.flags);process.stderr.write(`error: missing required options: ${e.join(`, `)}\n`)}let r=m(e);for(let e of r)process.stderr.write(`error: unknown option '${e}'\n`);for(let n of[h(e)??(r.length>0?R(e):void 0),l(e),f(e,t),...N(e)])n!==void 0&&process.stderr.write(`${n}\n`)}else if(t.code===`commander.excessArguments`){let t=l(e)??P(e);t!==void 0&&process.stderr.write(`${t}\n`)}else if(t.code===`commander.unknownOption`){let n=u(t,`unknown option`),r=h(e)??x(e,t)??(n!==void 0&&!t.message.includes(`
|
|
6
|
+
(Did you mean `)?I(e,n)??D(e,[n.replace(/^--/u,``)],process.argv.slice(process.argv.indexOf(n)+1))??R(e,n)??L(e,c(e).slice(1).join(` `)||n.replace(/^--/u,``)):void 0);r!==void 0&&process.stderr.write(`${r}\n`)}else if(t.code===`commander.unknownCommand`){let n=z(e,t);n!==void 0&&process.stderr.write(`${n}\n`)}else if(t.code===`commander.helpDisplayed`){let[n]=e.args;if(n?.startsWith(`-`)===!1&&e.registeredArguments.length===0){let r=[_(e).name(),...c(e)].join(` `);t.exitCode=1,process.stderr.write(`hint: ${r} takes no '${n}' subcommand; the help shown is for ${r}\n`)}}throw t}}export{B as commandExitHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./commander-DEj7N1b9.js";function n(e){return e.parent===null?[]:[...n(e.parent),e.name()]}var r=class extends e{group;constructor(e){super(`-h, --help`,`display help for command`),this.group=e}is(e){if(e!==this.short&&e!==this.long)return!1;let t=this.group.args.at(0);return t===void 0||t.startsWith(`-`)?!0:this.group.commands.some(e=>e.name()===t||e.aliases().includes(t))}},i=/^error: unknown option '(.+)'$/mu,a=/\n\(Did you mean (--[^\s,?]+)\?\)$/u,o=class e extends t{createCommand(t){return new e(t)}error(e,t){return super.error(this.withoutSwitchSuggestion(e,t),t)}withoutSwitchSuggestion(e,t){if(t?.code!==`commander.unknownOption`)return e;let n=a.exec(e),r=n?.[1],o=i.exec(e)?.[1];return n===null||r===void 0||o===void 0||!this.suppliesValue(o)||!this.suggestsBareSwitch(r)?e:e.slice(0,n.index)}suppliesValue(e){let t=this.args.indexOf(e);if(t===-1)return!1;if(e.includes(`=`))return!0;let n=this.args[t+1];return n!==void 0&&(n===`-`||!n.startsWith(`-`)||Number.isFinite(Number(n)))}suggestsBareSwitch(e,t=this){let n=t.createHelp().visibleOptions(t).find(t=>t.long===e);return n===void 0?t.parent!==null&&this.suggestsBareSwitch(e,t.parent):!n.required&&!n.optional}};function s(e,t){if(e!==t)return;let n=c(t);n!==void 0&&t.error(`error: ${u(t)} takes text input, not a JSON object.\n${n}`,{code:`aventure.payloadOperand`})}function c(e){if(!process.argv.includes(`--`)&&e.args.some(l))return`hint: use the command's named options instead of a JSON payload; run --help to list them.`}function l(e){if(!e.startsWith(`{`))return!1;try{return typeof JSON.parse(e)==`object`}catch{return!1}}function u(e){let t=[];for(let n=e;n?.parent;n=n.parent)t.unshift(n.name());return t.join(` `)}export{n as a,r as i,s as n,o as r,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,r){return s(t?.includePrivate)||s(a(r))?`required`:o(e,n)?`preferred`:`none`}function t(e,t,n,i){return t?.scheduleEnrichment===void 0&&o(e,r)?{...t,scheduleEnrichment:!1}:t}var n=`includePrivate`,r=`scheduleEnrichment`;function i(e,t){let n=t.hasParseDefault||t.location!==`query`?void 0:t.optionKey===r?`This client sends false when omitted; pass true to queue research.`:void 0;return n===void 0||e.endsWith(n)?e:`${e} ${n}`}var a=e=>typeof e==`object`&&e&&!Array.isArray(e)?e.includePrivate:void 0,o=(e,t)=>(e.parameters??[]).some(e=>e.in===`query`&&e.name===t);function s(e){return e===null||typeof e==`object`?Array.isArray(e)&&e.some(s):e===!0||e===1||typeof e==`string`&&/^(true|on|yes|1)$/i.test(e.trim())}export{e as n,t as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e,y as t}from"./person-owner-C0YuWKvY.js";import{kr as n}from"./dist-CGgP_Pxz.js";var r=t({clerkPublishableKey:e().nullish(),oauthClient:n.nullish()});export{r as t};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{i as e,l as t}from"./tool-policy-TAT9-UP4.js";import{C as n,O as r,T as i,i as a,l as o,n as s,o as c,p as l,t as u,u as d,v as f,w as p,y as m}from"./person-owner-C0YuWKvY.js";import{p as h}from"./result-envelope-BKQSGfkH.js";import{a as g,c as ee,i as te,l as ne,n as _,r as v,s as y,t as re}from"./text-field-jFKOGMzr.js";import{a as ie,n as ae,o as oe,r as se,s as b,t as ce}from"./human-text-cap-BcNmIPQA.js";import{A as x,D as S,E as le,O as ue,k as de,s as fe,v as pe,y as me}from"./operation-invocation-fkSqlOfs.js";import{A as he,C as ge,D as _e,E as ve,O as ye,S as be,T as C,_ as xe,a as Se,b as Ce,c as we,d as Te,f as Ee,g as De,h as Oe,i as ke,j as Ae,k as je,l as Me,m as Ne,n as Pe,o as Fe,p as Ie,r as w,s as Le,t as T,u as Re,v as ze,w as Be,x as Ve,y as E}from"./detail-BTjlqGmV.js";import{Buffer as He}from"node:buffer";var Ue=m({detail:p(),field:p().nullish(),scope:c([`entity`,`person`,`news`])}),We=c([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),Ge=Object.assign(i([We,p()]),{enum:We.enum}),D=m({modeRequested:Ge,modeUsed:Ge}),Ke=m({answerUnavailable:d(),entity:D,news:D,person:D,rejection:o(Ue),unavailable:o(c([`entity`,`person`,`news`]))}),qe=m({acceleratorParticipation:o(De),detail:o(Oe)}),O=m({core:C,enrichment:ve,fundraiseRound:o(E),provider:ze.nullish(),research:qe,semanticMatch:Fe.nullish()}),Je=c([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),Ye=m({compositeScore:f().nullish(),cosineScore:f().nullish(),curatedAsOf:p().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:p().nullish(),curatedSource:p().nullish(),derivedFromEntityId:r().nullish(),matchedSectionWeight:f().nullish(),origin:Je,rank:l(),sharedSectionCount:l().nullish()}),Xe=m({entity:O,similarity:Ye}),Ze=m({fundraiseInvestorJoin:d(),fundraiseTransaction:d(),operatingStatus:d(),relationship:d()}),Qe=c([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),$e=c([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),et=m({acquiredEntity:C,acquirerEntity:C,amount:f().int().nullish(),announcedAt:p().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:p().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:p().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:a({offset:!0}).nullish(),currency:p().nullish(),dataConfidence:be.nullish(),evidence:Ze,fundraiseTransactionId:r().nullish(),investorJoinId:r().nullish(),isCurrent:d().nullish(),publicSource:ge.nullish(),relationshipId:l(),status:Qe,transactionStatus:$e.nullish(),updatedAt:a({offset:!0}).nullish()}),tt=m({entity:T,investorAttribution:o(Ce),round:o(Ve),roundCount:l()}),nt=m({core:C,fundingDetail:je.nullish(),similarity:Ye,urlLink:o(_e)}),rt=m({compliance:Ne.nullish(),createdAt:a({offset:!0}).nullish(),id:l(),isCurrent:d().nullish(),isPrimary:d().nullish(),language:p().nullish(),owner:u,text:p(),textName:p().nullish(),textType:p(),updatedAt:a({offset:!0}).nullish()}),it=c([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),at=c([`fundraiseRound`,`researchDetail`]),ot=c([`preMoney`,`postMoney`,`reported`]),st=m({amountRaised:f().int().nullish(),asOfDate:p().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:Me,currency:p(),declaredBasis:ot,derivation:it,detailId:l().nullish(),label:p().nullish(),source:at,sourceRef:p(),valuationPostMoney:f().int().nullish(),valuationPreMoney:f().int().nullish()}),ct=m({createdAt:a({offset:!0}).nullish(),description:p().nullish(),forkCount:l(),githubId:f().int(),homepageUrl:p().nullish(),id:f().int(),isArchived:d(),isFork:d(),language:p().nullish(),license:p().nullish(),name:p(),ownerLogin:p(),repoCreatedAt:a({offset:!0}).nullish(),repoPushedAt:a({offset:!0}).nullish(),stargazerCount:l(),topic:o(p()),updatedAt:a({offset:!0}).nullish(),url:p()}),k=m({empty:d().optional(),sorted:d().optional(),unsorted:d().optional()}),A=m({offset:f().int().optional(),paged:d().optional(),pageNumber:l().optional(),pageSize:l().optional(),sort:k.optional(),unpaged:d().optional()}),lt=m({investorAttribution:o(Ce),person:w,round:o(Ve),roundCount:l()}),ut=c([`by`,`about`]),dt=c([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),ft=m({canonicalUrl:p().nullish(),contentId:p(),contentType:dt,createdAt:a({offset:!0}).nullish(),publishedAt:a({offset:!0}).nullish(),relation:ut.nullish(),sourceDomain:p().nullish(),sourceName:p().nullish(),summary:p().nullish(),title:p(),topic:p().nullish(),updatedAt:a({offset:!0}).nullish(),url:p().nullish(),year:l().nullish()});m({content:o(Te).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(i([Ae,he])).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(we).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(C).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(et).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(T).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Be).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(E).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(tt).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(O).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Re).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(xe).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Oe).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Ie).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Xe).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(nt).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(rt).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(_e).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(st).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(ct).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Ee).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Se).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(w).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(Le).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(lt).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(ke).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()}),m({content:o(ft).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()});var pt=m({content:o(O),number:l(),size:l(),totalElements:f().int(),totalPages:l()}),mt=m({content:o(Ee),number:l(),size:l(),totalElements:f().int(),totalPages:l()}),ht=m({content:o(Se),number:l(),size:l(),totalElements:f().int(),totalPages:l()});m({content:o(Pe).optional(),empty:d().optional(),first:d().optional(),last:d().optional(),number:l().optional(),numberOfElements:l().optional(),pageable:A.optional(),size:l().optional(),sort:k.optional(),totalElements:f().int().optional(),totalPages:l().optional()});var gt=c([`entityRecord`,`researchSnippet`,`newsArticle`,`personRecord`,`fundraiseTransaction`,`webProfile`]),_t=Object.assign(i([gt,p()]),{enum:gt.enum}),vt=m({entityId:r(),source:_t,sourceId:p()}),yt=m({citation:o(vt),text:p(),topic:p().nullish()}),bt=m({citation:o(vt),confidence:x,description:p().nullish(),heading:p().nullish(),paragraph:o(yt),relatedQuery:o(p()),shareable:d(),text:p(),title:p().nullish()}),xt=m({enrichmentRunId:r().nullish(),entityId:r()}),St=m({sortPriority:c([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),Ct=m({max:a({offset:!0}).nullish(),min:a({offset:!0}).nullish()}),j=m({max:f().nullish(),min:f().nullish()}),M=m({max:l().nullish(),min:l().nullish()}),wt=m({averageAmountInvestedUsdRange:o(j).optional(),largestAmountInvestedUsdRange:o(j).optional(),smallestAmountInvestedUsdRange:o(j).optional(),totalAmountInvestedUsdRange:o(j).optional(),totalInvestmentRange:o(M).optional()}),N=m({amountInvestedRange:o(j).optional(),amountRaisedRange:o(j).optional(),dateAnnouncedRange:Ct.nullish(),investedCompanyName:o(p()).optional(),investedCountry:o(p()).optional(),investedIndustry:o(p()).optional(),investedRound:o(p()).optional(),investorActivity:wt.optional(),investorName:o(p()).optional(),lastRoundYearRange:o(M).optional(),rankByInvestmentActivity:d().nullish(),round:o(p()).optional(),totalRaisedRange:o(j).optional(),valuationRange:o(j).optional()}),P=c([`NONE`,`COMPANY_LISTING_READY`]),F=c([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),I=c([`hostPath`,`domain`]),Tt=n({acceleratorBrand:o(p()).optional(),acceleratorCohort:o(p()).optional(),acceleratorName:o(p()).optional(),acceleratorStatus:o(p()).optional(),affinity:o(p()).optional(),closedLast:d().optional(),employeeCountRange:o(M).optional(),entityId:o(r()).optional(),entityName:o(p()).optional(),featured:d().nullish(),fundraiseActivity:N.optional(),hasFundraising:d().nullish(),headquartersCity:o(p()).optional(),headquartersCountry:o(p()).optional(),headquartersState:o(p()).optional(),industry:o(p()).optional(),letter:p().nullish(),location:o(p()).optional(),logoOption:St.optional(),mainProduct:o(p()).optional(),operatingStatus:o(F).optional(),originCountry:o(p()).optional(),person:o(p()).optional(),portfolioHeadquartersCity:o(p()).optional(),portfolioHeadquartersCountry:o(p()).optional(),portfolioHeadquartersState:o(p()).optional(),qualityGate:P.optional(),rankByProminence:d().nullish(),semanticQuery:p().nullish(),slug:o(p().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:o(p()).optional(),suppressLateStage:d().nullish(),suppressNonOperating:d().nullish(),suppressZeroTotalRaised:d().nullish(),tag:o(p()).optional(),textSearch:p().nullish(),typeCustomer:o(p()).optional(),typeModel:o(p()).optional(),typeOwnership:o(p()).optional(),typeRecord:o(s).optional(),typeRevenue:o(p()).optional(),typeTechnologyUsed:o(p()).optional(),url:p().nullish(),urlDomain:p().nullish(),urlMatchMode:I.nullish(),urlType:ye.nullish(),yearFoundedRange:o(M).optional()}),Et=c([`discovery`,`profile`,`peer`,`comparison`]),Dt=c([`keyword`,`semantic`]),Ot=c([`ID`,`NAME_BRAND`,`YEAR_FOUNDED`,`STATUS_OPERATING`,`UPDATED_AT`,`CREATED_AT`,`NEXT_DUE_AT`,`DATA_COMPLETION_COVERAGE`,`TOTAL_RAISED`,`AMOUNT_INVESTED`,`RECENT_INVESTMENT_AT`,`STAGE`,`MOST_RECENT_AMOUNT`,`LATEST_VALUATION`,`MOST_RECENT_DATE`,`ACCELERATOR_BRAND`,`ACCELERATOR_COHORT`,`HEADQUARTERS_COUNTRY`,`EMPLOYEE_COUNT`]),kt=Object.assign(i([Ot,p()]),{enum:Ot.enum}),At=m({descending:d(),field:kt,sortKey:p().nullish()}),jt=m({order:o(At),relevance:Dt.nullish()}),Mt=m({confidence:x,execution:D,fallbackUsed:d(),filter:Tt,intent:Et,interpretation:p(),sort:jt,subjectEntityName:o(p()),unsupported:p().nullish()}),L=m({changedAt:a({offset:!0}).nullish(),dataSourceUpdatedAt:a({offset:!0}).nullish(),pendingApproval:l().nullish(),sourceId:p().nullish(),status:p().nullish()}),Nt=m({fundManagerRelationshipSource:L.nullish(),fundraiseTransaction:E,fundraiseTransactionSource:L.nullish(),investorJoinSource:L.nullish()}),R=m({evidence:Nt,investor:u,semanticMatch:Fe.nullish()}),Pt=m({entityId:r(),matchedOffering:C.nullish(),probability:f(),webUrl:o(p())}),Ft=m({entityId:r(),label:p(),publishedAt:a({offset:!0}).nullish(),score:f(),source:_t,sourceId:p(),text:p(),url:p().nullish()}),It=m({answer:bt.nullish(),filing:o(xt).nullish(),interpretation:Mt,investment:o(R),judgment:o(Pt),passage:o(Ft),peer:o(Xe),pendingWebQuery:o(p()),personLead:d(),result:pt,searchRequestId:r().nullish(),subject:o(O)}),Lt=c([`auto-match`,`needs-review`,`approved`,`rejected`]),Rt=m({createdAt:a({offset:!0}),entityId:r(),href:p().nullish(),internal:d(),matchStatus:Lt.nullish(),mention:p().nullish(),slug:p().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:s.nullish(),updatedAt:a({offset:!0})}),zt=m({entity:o(Rt),newsId:l()}),Bt=n({acceleratorBrand:o(p()).optional(),acceleratorCohort:o(p()).optional(),acceleratorName:o(p()).optional(),acceleratorStatus:o(p()).optional(),affinity:o(p()).optional(),closedLast:d().optional(),employeeCountRange:o(M).optional(),entityId:o(r()).optional(),entityName:o(p()).optional(),featured:d().nullish(),fundraiseActivity:N.optional(),hasFundraising:d().nullish(),headquartersCity:o(p()).optional(),headquartersCountry:o(p()).optional(),headquartersState:o(p()).optional(),industry:o(p()).optional(),letter:p().nullish(),location:o(p()).optional(),logoOption:St.optional(),mainProduct:o(p()).optional(),operatingStatus:o(F).optional(),originCountry:o(p()).optional(),person:o(p()).optional(),portfolioHeadquartersCity:o(p()).optional(),portfolioHeadquartersCountry:o(p()).optional(),portfolioHeadquartersState:o(p()).optional(),qualityGate:P.optional(),rankByProminence:d().nullish(),slug:o(p().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:o(p()).optional(),suppressLateStage:d().nullish(),suppressNonOperating:d().nullish(),suppressZeroTotalRaised:d().nullish(),tag:o(p()).optional(),textSearch:p().nullish(),typeCustomer:o(p()).optional(),typeModel:o(p()).optional(),typeOwnership:o(p()).optional(),typeRecord:o(s).optional(),typeRevenue:o(p()).optional(),typeTechnologyUsed:o(p()).optional(),url:p().nullish(),urlDomain:p().nullish(),urlMatchMode:I.nullish(),urlType:ye.nullish(),yearFoundedRange:o(M).optional()}),Vt=m({amountInvestedRange:o(j).nullish(),amountRaisedRange:o(j).nullish(),entityName:o(p()).nullish(),investedCompany:o(p()).nullish(),personTitle:o(p()).nullish(),round:o(p()).nullish(),totalInvestmentCount:o(M).nullish(),typeRecord:o(s).nullish()}),Ht=m({arrayFilter:Vt.optional(),entityFilter:Bt.optional(),entityId:r().nullish(),entitySlug:p().nullish(),firstName:p().nullish(),includeAddress:d().nullish(),includeUrl:d().nullish(),investorActivity:wt.optional(),isCurrent:d().nullish(),lastName:p().nullish(),letter:p().nullish(),personId:o(r()).max(200).optional(),personName:o(p()).optional(),role:p().nullish(),search:p().nullish(),semanticQuery:p().nullish(),status:p().nullish()}),Ut=m({descending:d(),field:c([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`]),sortKey:p().nullish()}),Wt=m({order:o(Ut),relevance:Dt.nullish()}),Gt=m({confidence:x,employerSemanticQuery:p().nullish(),execution:D,fallbackUsed:d(),filter:Ht,interpretation:p(),sort:Wt,unsupported:p().nullish()}),Kt=m({currentCompany:p().nullish(),headline:p().nullish(),id:r(),location:p().nullish(),name:p(),named:p(),organizationEvidence:c([`headline`,`profile`,`none`]).nullish(),photoUrl:p().nullish(),profileUrl:p(),slug:p().regex(/^[a-z0-9_-]+$/).max(255)}),qt=m({interpretation:Gt,investment:o(R),personLead:d(),profile:o(Kt),result:ht,searchRequestId:r().nullish()}),Jt=m({label:p(),query:p()}),Yt=m({key:p(),option:o(Jt),prompt:p()}),Xt=m({entity:It,entityDetail:o(T),news:mt,newsEntityMention:o(zt),person:qt,personDetail:o(w),personLead:d(),provenance:Ke,qualifier:Yt.nullish(),section:o(c([`person`,`company`,`productService`,`investor`])).optional()}),Zt=`aventure`;function z(e,t,n=`cli`){let r=t.find(t=>t.operationId===e);if(n===`mcp`&&r!==void 0){let e=me(r);return`${e.tool} ${JSON.stringify(e.arguments)}`}let i=r?.cliPath;return i===void 0?void 0:`${Zt} ${i.join(` `)}`}function Qt(e,t,n=e,r=`cli`){return r===`mcp`?z(e,t,r)??e:fe(e,t,`aventure`)??n}function $t(e,t,n=`cli`){let r=le.safeParse(e);if(!r.success)return null;let{answer:i,citation:a,confidence:o,resolution:s}=r.data;if(s!=null)return en(i,s,t,n);let c=i.trimEnd().split(`
|
|
2
|
+
`),l=new Set(a.flatMap(({sourceType:e,sourceId:r})=>{if(e!==de.options[0].enum.OPERATION)return[];let i=z(r,t,n);return i===void 0?[]:[i]}));return l.size>0&&c.push(``,n===`mcp`?`MCP calls:`:`Commands:`,...[...l].map(e=>` ${e}`)),c.push(``,`Confidence: ${o}`),a.length===0||(c.push(`Sources (${a.length}):`),c.push(...a.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`}))),c}function en(e,t,n,r){let{outcome:i,operationId:a,probability:o,candidate:s,taskKey:c,taskPlan:l}=t,u=[l==null?e.trimEnd():nn(l)],d=[``,`Outcome: ${i}${o==null?``:` (probability ${o.toFixed(2)})`}`];switch(i){case S.enum.TASK_PLAN:return[...u,...l==null?[]:rn(l,n,r),...d];case S.enum.OPERATION_ADVICE:{let e=s.filter(({sourceId:e})=>e!==a);return[...u,...a==null?[]:[``,r===`mcp`?`MCP call:`:`Command:`,` ${Qt(a,n,a,r)}`],...d,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case S.enum.CLARIFY:return[...u,...c==null?[]:[``,`Leading catalog task: ${c}`],...on(`Candidates:`,s,n,r),...d];case S.enum.ABSTAIN:return[...u,...on(`Nearest operations:`,s,n,r),...d];default:throw Error(`Unhandled help resolution outcome ${String(i)}`)}}function tn(e,t,n=`cli`){let r=ue.safeParse(e);return r.success?[nn(r.data),...rn(r.data,t,n)]:null}var nn=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function rn(e,t,n){return e.step.length===0?[``,`This catalog task has no planned steps yet.`]:[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n,required:r})=>` ${e} (${t}, ${r===!1?`optional`:`required`}): ${n}`)],``,`Steps:`,...e.step.flatMap(({step:r,cliCommand:i,writeGuidance:a},o)=>[` ${o+1}. ${r.stepKey===void 0?``:`${r.stepKey}: `}${Qt(r.operationId,t,i,n)}`,` ${r.instruction}`,...an(e,o,a)]),...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function an(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 on(e,t,n,r){if(t.length===0)return[];let i=t.map(({sourceId:e,excerpt:t})=>({command:z(e,n,r)??e,excerpt:t})),a=Math.max(...i.map(({command:e})=>e.length));return[``,e,...i.map(({command:e,excerpt:t})=>` ${e.padEnd(a)} # ${t}`)]}var B=30,sn=8,V=10,cn=2,ln=[`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`],un=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]);function dn(e,t,n,{transport:r=`cli`,trailer:i=[]}={}){if(typeof t==`string`)return oe(t,r,i);let a=pe(t,i);if(a!==null)return se(a,i,r);let o=Sn(t);if(o===null)return null;let s=e.find(({operationId:e})=>e===o.operationId),c=ne(s?.detailField,o.response),l=[...c.hiddenNote,...i],u=(e,t)=>ae([e.trimEnd(),...t].join(`
|
|
3
|
+
`),{appendNewline:!0,preservedTrailerLines:t.length>0?t.length:void 0,transport:r}),d=s?.parameters??[],f={...o,response:c.response,parameters:d,transport:r},p=$t(f.response,e,r)??tn(f.response,e,r);if(p!==null)return u(p.join(`
|
|
4
|
+
`),i);let m=fn(f);if(m!==null)return u(m.join(`
|
|
5
|
+
`),l);let h=[f.summary??n??f.operationId??`OpenAPI call succeeded`,`${f.method} ${f.endpoint}`],g=ie(gn(f),117-l.length,ce-He.byteLength(`${[...h,...l].join(`
|
|
6
|
+
`)}\n`,`utf8`),r);return u([...h,...g].filter(Boolean).join(`
|
|
7
|
+
`),l)}function fn({response:e,...t}){if(e===void 0||!Y(e)||!(`entity`in e&&`person`in e&&`news`in e))return null;let n=Xt.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o}=n.data;return[...r.answer?pn(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})=>g(`${e} rejected: ${t}`)),[`entities:`,...H(r.result,t)].join(`
|
|
8
|
+
`),[`people:`,...H(i.result,t)].join(`
|
|
9
|
+
`),[`news:`,...H(a,t)].join(`
|
|
10
|
+
`)]}function pn(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${g(e)}`).join(`
|
|
11
|
+
`)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>g(` - ${e}:${t} entity=${n}`)).join(`
|
|
12
|
+
`)}`;return[`answer:\n ${te(e.text).replaceAll(`
|
|
13
|
+
`,`
|
|
14
|
+
`)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function mn(e){let t=Sn(e)?.response,n=Y(t)?t.interpretation:void 0;if(!Y(n))return null;let r=D.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=re(n.filter),{unsupported:s,fallbackUsed:c}=n,l=[`strategy: requested=${i} used=${a}`,...Y(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${hn(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``];return ae(l.filter(Boolean).join(`
|
|
15
|
+
`),{appendNewline:!0})}var hn=e=>X(e)?g(e):Array.isArray(e)&&e.every(X)?e.map(e=>g(e)).join(`, `):JSON.stringify(e);function gn(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a,transport:o}=e;if(t===void 0)return a!==void 0&&i!==void 0?[`status=${i} redirect=${a}`]:i===void 0?[]:[`status=${i} no response body`];let s=i===void 0||n===`GET`?``:`status=${i}`,c=Y(t)&&!q(t)?Cn(t):null,l=c===null?void 0:Y(c.context.interpretation)?re(c.context):c.context,u=l!==void 0&&Y(l)?Object.entries(l):[],d=u.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(Y)),f=new Set(d.map(([e])=>e)),p=Object.fromEntries(u.filter(([e])=>!f.has(e)));return[s,...q(t)?H(t,e,r):c===null?Tn(t)?yn(t,[`filter`],t.meta,o):En(t)?yn(t,[`arrayFilterEntry`,`rangeFilterEntry`],t.filtersMeta,o):Dn(t)?bn(t,o):U(t,``):[...H(c.page,e,r),...Object.keys(p).length===0?[]:U(p,``),...d.flatMap(([e,t])=>[`${e}:`].concat(_n(t,o)))]].filter(Boolean)}function H(e,t,n){let r=xn(t),i=e.numberOfElements??e.content.length,a=Math.min(e.content.length,B),o=Math.max(1,a),s=(e.number??0)*(e.size??i),c=(e.totalElements??0)-s-i,l=e.number===void 0?``:` page=${e.number}`,u=e.size===void 0?``:` size=${e.size}`,d=e.totalElements===void 0?``:` total=${e.totalElements}`,f=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,p=(e.number??0)+1,m=e.totalPages===void 0||p<e.totalPages,h=_(`page`,t.parameters);return[`rows=${i}${l}${u}${d}${f}`,a>=i?``:`page rows omitted: ${i-a} (${a}/${i} shown); ${e.content.length>a?b(t.transport,`.content`):`reread with ${_(`size`,t.parameters)} ${o} and ${h} ${Math.floor((s+a)/o)} through ${Math.floor((s+i-1)/o)} (MCP: size, page); pages start at 0`}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${y(n)}`,c<=0||n!==void 0?``:m&&i===e.size?`more: ${c} rows not shown; use ${h} or ${_(`size`,t.parameters)} to see them`:`more: ${c} more matched but this response returns only these ${i}; narrow the query to reach them${m?` (${h} ${p} starts after this page)`:``}`,..._n(e.content.slice(0,a),t.transport)].filter(Boolean)}function _n(e,t){if(!e.every(Y))return W(e,``);let n=e.filter(Y);if(n.length===0)return e.length===0?[`(empty)`]:W(e,``);let r=vn(n);if(r.length===0)return W(e,``);let i=n.slice(0,B).map(e=>{let t=G(e);return r.map(e=>t[e]??``)}),a=r.map(e=>e.split(`.`).at(-1)??e),o=a.map((e,t)=>{let n=i.map(e=>e[t]??``),r=Math.max(e.length,...n.map(e=>e.length));return e===`id`||e.endsWith(`Id`)?r:Math.min(32,r)}),s=e=>e.map((e,t)=>ee(e,o[t]??12).padEnd(o[t]??12)).join(` `),c=[s(a),s(o.map(e=>`-`.repeat(e)))];return i.forEach(e=>c.push(s(e))),n.length>B&&c.push(`... ${n.length-B} more rows omitted; ${b(t)}`),c}function vn(e){let t=e.map(e=>G(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=ln.filter(e=>n.has(e)),i=new Set(r.map(K)),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(K(e))?!1:(n&&i.add(K(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,sn-s.length);return[...s,...c].slice(0,sn)}function yn(e,t,n,r){let i=t.flatMap(t=>e[t].map((e,n)=>({...e,path:`.${t}[${n}].choiceOption`}))),a=n!==void 0&&Y(n)?n:{},o=[`total`,`limit`].flatMap(e=>typeof a[e]==`number`?[` ${e}=${a[e]}`]:[]).join(``),s=[`filters=${i.length}${o}`];for(let e of i){let t=e.choiceOption.length,n=e.choiceOptionTotal===null?`unknown (degraded)`:e.choiceOptionTotal??t,i=e.choiceOptionTruncated===!0?` truncated`:``;s.push(`- ${e.filterKey} (${e.label}): choices ${t}/${n}${i}`),e.choiceOption.slice(0,V).forEach(t=>{s.push(` ${_(e.filterKey)} ${y(t.value)}`)}),t>V&&s.push(` ... ${t-V} choices omitted for ${e.filterKey}; ${b(r,e.path)}`)}return s}function bn(e,t){let n=_(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,V).map(e=>`${n} ${y(e)}`),e.result.length>V?`... ${e.result.length-V} matches omitted; ${b(t,`.result`)}`:``].filter(Boolean)}function xn({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!un.has(e)&&t.length>0).map(([e,n])=>`${_(e,t)} ${y(n)}`)}function Sn(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 U(e,t,n){if(e===void 0)return[];if(X(e))return[`${t}${v(e,n)}`];if(Array.isArray(e))return W(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if(X(i))r.push(`${t}${n}: ${v(i,n)}`);else{r.push(`${t}${n}:`);for(let e of U(i,`${t} `,n))r.push(e)}}return r.length===0?[`${t}(empty)`]:r}function W(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e)if(X(i))r.push(`${t}- ${v(i,n)}`);else{r.push(`${t}-`);for(let e of U(i,`${t} `))r.push(e)}return r}function G(e,t=``,n=0){return X(e)?t.length===0?{}:{[t]:g(e,t)}:n>cn?{}:Array.isArray(e)?e[0]===void 0?{}:G(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,g(r,i)]]:Object.entries(G(r,i,n+1))}))}var K=e=>e.split(`.`,1)[0],q=e=>Y(e)&&Array.isArray(e.content);function Cn(e){let[t,...n]=Object.entries(e).filter(e=>q(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 wn(e){return Y(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var Tn=e=>Y(e)&&J(e.filter),En=e=>Y(e)&&J(e.arrayFilterEntry)&&J(e.rangeFilterEntry),J=e=>Array.isArray(e)&&e.every(wn),Dn=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=/\{([^}]+)\}/gu;function On(t,n,r=`cli`){let i=n.filter(e=>e.method===`GET`&&(r===`cli`||e.binaryResponse!==!0)),a=e=>t.endpoint!==void 0&&e.endsWith(t.endpoint),o=n.find(e=>e.operationId===t.operationId),s=t.ok&&o!==void 0&&e(o.intent),c=[...s&&t.endpoint!==void 0?Mn(t.endpoint.split(`?`)[0]??``,i,!1,r).map(e=>r===`mcp`?e:`${e} --data --to-file <path>`):[],...t.references.filter(e=>!a(e)).flatMap(jn).flatMap(e=>Mn(e.pathname,i,!0,r)),...t.references.filter(a).flatMap(jn).flatMap(e=>Nn(e,i,r))],l=r===`mcp`?kn:void 0;return c.length===0?{write:s,narrowerRead:l}:{exactRecovery:`Read the full result ${c.join(`; `)}.`,write:s,narrowerRead:l}}var kn=`Refetch a narrower result: call aventure_help with q set to the read intent, then call aventure_read with its operationId and declared query or pathParams, using ids/references, filters, or smaller query.page/query.size windows.`;function An(t,n){let r=n.find(e=>e.operationId===t.operationId);if(!t.ok||r?.method!==`GET`||r.mutates===!0||e(r.intent)||t.endpoint===void 0)return;let i=new URL(t.endpoint,`https://localhost`),a=[...r.path.matchAll(Z)].map(([,e])=>e),o=RegExp(`^${r.path.replace(Z,`([^/]+)`)}$`,`u`).exec(i.pathname);if(o===null)return;let s=r.parameters.find(e=>e.location===`query`&&e.name===`compact`&&e.schemaType===`boolean`);s!==void 0&&i.searchParams.set(s.name,`true`);let c=[];for(let e of r.parameters){let t=e.location===`path`?[decodeURIComponent(o[a.indexOf(e.name)+1]??``)]:e.location===`query`?i.searchParams.getAll(e.name):[];if(e.required&&t.length===0)return;t.length>0&&c.push($(e),...t.map(In))}return`Run: \`${Q(r,[...c,`--data`,`--to-file`,`./aventure-output.json`])}\`. On success, the spill file contains the bare payload (top-level keys as returned), not the result envelope or a data.response wrapper.`}function jn(e){return URL.canParse(e)?[new URL(e)]:[]}function Mn(e,t,n,r){return t.flatMap(t=>{let i=[...t.path.matchAll(Z)].map(([,e])=>e),a=RegExp(`^${t.path.replace(Z,`([^/]+)`)}$`,`u`),o=n&&i.length===0?null:a.exec(e);if(o===null)return[];if(r===`mcp`)return[Pn(t,{pathParams:Object.fromEntries(i.map((e,t)=>[e??``,decodeURIComponent(o[t+1]??``)]))})];let s=i.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[$(r),o[n+1]??``]});return[`${Fn(t)}, ${Q(t,s)}`]})}function Nn(e,t,n){let r=t.find(t=>t.path===e.pathname);return r===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${r.path}/`))return[];let i=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),a=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(i===void 0||a===void 0)return[];if(n===`mcp`)return[`in windows: ${Pn(t,{query:{...Object.fromEntries([...e.searchParams].filter(([e])=>t.parameters.some(t=>t.location===`query`&&t.name===e))),[i.name]:`<offset>`,[a.name]:`<limit>`}})}, advancing query.${i.name} until a window returns fewer than query.${a.name} units`];let o=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[$(t),In(n)]}),s=[$(i),`<n>`,$(a),`<n>`];return[`${Fn(t)}, in windows: ${Q(t,[...o,...s])}, advancing ${$(i)} until a window returns fewer than ${$(a)} units`]})}function Pn(e,n){return`${t(e.intent)} ${JSON.stringify({operationId:e.operationId,...n})}`}function Fn(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function Q(e,t){return[Zt,...e.cliPath,...t].join(` `)}function $(e){return e.flag.split(/\s+/u)[0]??e.flag}function In(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}export{mn as i,On as n,dn as r,An as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{n as locateRuntimeManifest}from"./runtime-identity-Cme_U1eh.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fileURLToPath as e}from"node:url";import{dirname as t,resolve as n,sep as r}from"node:path";import{existsSync as i,readFileSync as a,realpathSync as o}from"node:fs";var s=[],c=8,l=e(import.meta.url),u=`aventure-`,d=new Set([``,``]),f,p;function m(){return f??=h(_()),f}function h({manifest:e,manifestPath:t}){return`${g(y(e,`name`,t))}/${y(e,`version`,t)} (${process.platform}; ${process.arch}) Node.js/${process.versions.node}`}function g(e){let t=e.slice(e.lastIndexOf(`/`)+1);return t.startsWith(u)||d.has(e)?t:`${u}${t}`}function _(e=l){if(e===l&&p)return p;let a;try{a=o(e)}catch(t){throw x(`cannot resolve ${e}`,t instanceof Error?t:void 0)}let s=t(a);for(let u=0;u<c;u+=1){let c=n(s,`package.json`);if(i(c)){let t={entryPath:a,manifest:v(c),manifestPath:c,packageRoot:s};return e===l?p=t:!p&&l.startsWith(`${s}${r}`)&&(p={...t,entryPath:o(l)}),t}let u=t(s);if(u===s)break;s=u}throw x(`no package.json found above ${e}`)}function v(e){let t;try{t=JSON.parse(a(e,`utf8`))}catch(t){throw x(`cannot parse ${e}`,t instanceof Error?t:void 0)}if(!b(t))throw x(`${e} must contain a JSON object`);return t}function y(e,t,n){let r=Reflect.get(e,t);if(typeof r!=`string`||r===``||r.trim()!==r)throw x(`${n} ${t} must be a non-empty, unpadded string`);return r}function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x(e,t){return Error(`aventure package metadata: ${e}`,{cause:t})}export{g as a,s as c,y as i,_ as n,m as o,x as r,h as s,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{n as commandAuthMaterializationMode,r as materializeCommandCredential}from"./startup-auth-DGKzN-4Y.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./commander-DEj7N1b9.js";import{_ as r,f as i,x as a}from"./logging-BnHashoK.js";import{y as o}from"./tool-policy-TAT9-UP4.js";import{c as s,r as c}from"./result-envelope-BKQSGfkH.js";import{r as l}from"./cli-help-policy-DdcHm_F7.js";function u(e,t){return e.parameters.filter(e=>e.required&&t[e.optionKey]===void 0).map(e=>e.flag)}function d(e,t){return(e.requestBody?.length??0)>1&&typeof t.contentType==`string`?t.contentType:void 0}var f=e=>typeof e==`string`&&e.trim()===``;function p(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(f):f(i)))continue;let a=Array.isArray(i)?i.filter(e=>!f(e)):[];a.length>0?e.setOptionValue(r,a):(n.has(r)&&e.error(`error: option '${t.flags}' requires a value`),e.setOptionValue(r,void 0))}}function m(e){return e.split(` `)[0]??e}function h(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 g(e,t,n){let r=t.join(` `).trim();return r.length===0?s(`No positional text`,n):n[e.optionKey]===void 0?s(`Positional text parsed`,{...n,[e.optionKey]:r}):c(`Unexpected argument "${r}": ${m(e.flag)} already sets this value, and this command has no subcommand by that name. Drop "${r}".`)}var _={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: Use Help Ask to Answer a 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 Companies, People, or a News Article's Mentions`,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 Portfolio Counts and Stage Mix`},"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 search":{summary:`Search Companies, Products, and Services`},"entities search jobs":{summary:`Get an Async Semantic Entity Search`},"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 v(e){return x(e,y())}function y(){return!!a().userBearerToken?.trim()}function b(e){return y()||!l(e,_)}function x(e,t){return t?e:e.filter(e=>!l(e.cliPath[0],_)||e.visibility!==`private`).map(S)}function S(e){let t=e.parameters.filter(C),n=e.requestBody?.map(e=>{let t=e.parameter.filter(C);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 C=e=>e.visibility!==`private`;async function w(e){if(e===`none`||process.env[i.authToken]?.trim())return;let{materializeCliOAuthBearerCredential:t,materializeSavedCliOAuthBearerCredential:n}=await import(`./oauth-bearer-credential-CSXltMWD.js`),{materializeCliApiKeyBearerCredential:r}=await import(`./api-key-bearer-credential-BYlgsMzT.js`);await(e===`stored`?n():t()),await r()}function T(i,a){let s=i.indexOf(`--`),c=i.slice(0,s===-1?i.length:s);if(c.some(e=>e===`--version`||e===`-V`))return`none`;let u=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=u.parseOptions([...i]).operands,p=u.opts().environment;p!==void 0&&(process.env.API_ENV=p);let m=a.find(e=>E(f,e.cliPath)),h=m===void 0?void 0:d(m,u.opts());if(m!==void 0&&h!==void 0){let e=o(m.requestBody??[],h);if(!e.ok)throw new t(e.summary)}let g=f.at(0);if(g===void 0)return`stored`;if(g===`update`||g===`auth`&&m===void 0)return`none`;let v=u.opts().ask;return c.some(e=>e===`--help`||e===`-h`)?(m??(g===`help`&&v===void 0?a.find(e=>E(f.slice(1),e.cliPath)):void 0))!==void 0||l(g,_)?`stored`:`none`:l(g,_)?`required`:g===`help`?m===void 0?v===void 0?`stored`:f.length===1?`required`:`none`:`required`:g===`agents`&&f[1]===`setup`?`required`:[`command-catalog`,`completion`].includes(g)?`optional`:g===`batch`?`required`:m===void 0?`optional`:`required`}function E(e,t){return t.every((t,n)=>e[n]===t)}export{v as a,m as c,h as d,g as f,x as i,u as l,T as n,_ as o,w as r,d as s,b as t,p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,O as t,S as n,_ as r,b as i,d as a,h as o,i as s,l as c,n as l,p as u,w as d,x as ee}from"./esm-BVGNzX-8.js";import{n as te}from"./commander-DEj7N1b9.js";import{$ as f,A as p,B as ne,C as re,D as ie,E as m,F as h,G as ae,L as oe,N as se,O as ce,U as le,V as ue,W as de,X as fe,Y as pe,Z as g,_t as me,at as he,ct as ge,gt as _e,it as ve,j as ye,k as _,mt as v,nt as be,pt as xe,rt as Se,s as Ce,st as y,tt as we,ut as b,vt as Te,w as Ee}from"./logging-D2cJNH4n.js";import{C as x,S,T as C,g as w,h as De,l as T,o as E,u as D,v as O,w as k,y as A}from"./person-owner-C0YuWKvY.js";import{c as j,p as M,r as N}from"./result-envelope-BKQSGfkH.js";import{a as Oe}from"./package-DPDX5zmx.js";import{basename as ke,extname as Ae}from"node:path";import{AsyncLocalStorage as je}from"node:async_hooks";import{readFile as Me}from"node:fs/promises";var Ne={name:`span`,countItems:e=>e.length},Pe=256,Fe=512;function Ie(e,t){let n=e&255|Pe;return t&&(n|=Fe),n}function Le(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:_(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>ze(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Re(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Ie(n.traceFlags,e.parentSpanContext?.isRemote)}}function Re(e,t){return{attributes:e.attributes?_(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Ie(e.context.traceFlags,e.context.isRemote)}}function ze(e,t){return{attributes:e.attributes?_(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Be(e,t){return{resourceSpans:He(e,t)}}function Ve(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function He(e,t){let n=Ve(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>Le(e,t));o.push({scope:ie(e[0].instrumentationScope,t),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=ce(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}l();var Ue={serializeRequest:e=>{let t=Be(e,m);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return c.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};we(),h(),p();function We(e){return new URL(e,`https://placeholder.invalid`).pathname}function Ge(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean);return n.length!==r.length||r.some(qe)?!1:n.every((e,t)=>Ke(e)||e===r[t])}function Ke(e){let t=e.slice(1,-1);return e.startsWith(`{`)&&e.endsWith(`}`)&&t.length>0&&!t.includes(`/`)&&!t.includes(`{`)&&!t.includes(`}`)}function qe(e){if(Ke(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 Je=`otlp_http_span_exporter`,Ye=class extends Te{constructor(e={}){super(Ee(re(e,`TRACES`,`v1/traces`,{"Content-Type":`application/json`}),Ue,Je,Ne,e.selfObsMeterProvider))}},Xe=`exception`,Ze=Symbol.for(`nodejs.util.inspect.custom`);function Qe(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function $e(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}l();var et=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:u.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=f.now(),this._performanceOffset=t-(this._performanceStartTime+f.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return c.warn(`Invalid attribute key: ${e}`),this;if(!xe(t))return c.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return c.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&c.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),pe(t)&&(pe(n)||(n=t),t=void 0);let i=v(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,l=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];a!==void 0&&l>=a?s++:(o[e]=this._truncateToSize(t),l++)}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&c.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=v(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];n!==void 0&&o>=n?a++:(i[e]=this._truncateToSize(t),o++)}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===u.UNSET||this.status.code===u.OK)return this;let t={code:e.code};return e.code===u.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&c.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?c.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(e),this._duration=ae(this.startTime,this.endTime),this._duration[0]<0&&(c.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&c.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&c.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(e){if(typeof e==`number`&&e<=f.now())return de(e+this._performanceOffset);if(typeof e==`number`)return g(e);if(e instanceof Date)return g(e.getTime());if(fe(e))return e;if(this._startTimeProvided)return g(Date.now());let t=f.now()-this._performanceStartTime;return le(this.startTime,g(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Se]=e:e&&(e.code?n[he]=e.code.toString():e.name&&(n[he]=e.name),e.message&&(n[Se]=e.message),e.stack&&(n[ve]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Xe,n,t):c.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);c.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(c.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[Ze](e,t,n){return $e(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:Qe(this.resource)}},e,t,n)}},P;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(P||={});var tt=`otel.component.name`,nt=`otel.component.type`,rt=`otel.span.parent.origin`,it=`otel.span.sampling_result`,at=`otel.sdk.processor.span.processed`,ot=`otel.sdk.processor.span.queue.capacity`,st=`otel.sdk.processor.span.queue.size`,ct=`otel.sdk.span.live`,lt=`otel.sdk.span.started`,ut=`batching_span_processor`,dt=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(lt,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ct,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=pt(t);if(this.startedSpans.add(1,{[rt]:ft(e),[it]:n}),t===P.NOT_RECORD)return()=>{};let r={[it]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function ft(e){return e?e.isRemote?`remote`:`local`:`none`}function pt(e){switch(e){case P.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case P.RECORD:return`RECORD_ONLY`;case P.NOT_RECORD:return`DROP`}}var mt=`2.11.0`;l(),h();var ht=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor;let n=t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,mt);this._tracerMetrics=new dt(n)}startSpan(e,t={},i=a.active()){t.root&&(i=s.deleteSpan(i));let l=s.getSpan(i);if(_e(i))return c.debug(`Instrumentation suppressed, returning Noop Span`),s.wrapSpanContext(n);let u=l?.spanContext(),ee=this._idGenerator.generateSpanId(),te,f,p;!u||!s.isSpanContextValid(u)?f=this._idGenerator.generateTraceId():(f=u.traceId,p=u.traceState,te=u);let ne=t.kind??o.INTERNAL,re=(t.links??[]).map(e=>({context:e.context,attributes:v(e.attributes)})),ie=v(t.attributes),m=this._sampler.shouldSample(i,f,e,ne,ie,re),h=this._tracerMetrics.startSpan(u,m.decision);p=m.traceState??p;let ae=m.decision===r.RECORD_AND_SAMPLED?d.SAMPLED:d.NONE,oe={traceId:f,spanId:ee,traceFlags:ae,traceState:p};if(m.decision===r.NOT_RECORD)return c.debug(`Recording is off, propagating context in a non-recording span`),s.wrapSpanContext(oe);let se=v(Object.assign(ie,m.attributes));return new et({resource:this._resource,scope:this.instrumentationScope,context:i,spanContext:oe,name:e,kind:ne,links:re,parentSpanContext:te,attributes:se,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:h})}startActiveSpan(e,t,n,r){let i,o,c;if(arguments.length<2)return;arguments.length===2?c=t:arguments.length===3?(i=t,c=n):(i=t,o=n,c=r);let l=o??a.active(),u=this.startSpan(e,i,l),d=s.setSpan(l,u);return a.with(d,c,void 0,u)}[Ze](e,t,n){return $e(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:Qe(this._resource)},spanLimits:this._spanLimits},e,t,n)}};h();var gt=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{b(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},F=class{shouldSample(){return{decision:P.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},I=class{shouldSample(){return{decision:P.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};l(),h();var L=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(b(Error(`ParentBasedSampler must have a root sampler configured`)),new I),this._remoteParentSampled=e.remoteParentSampled??new I,this._remoteParentNotSampled=e.remoteParentNotSampled??new F,this._localParentSampled=e.localParentSampled??new I,this._localParentNotSampled=e.localParentNotSampled??new F}shouldSample(e,t,n,r,a,o){let c=s.getSpanContext(e);return!c||!i(c)?this._root.shouldSample(e,t,n,r,a,o):c.isRemote?c.traceFlags&d.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,a,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,a,o):c.traceFlags&d.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,a,o):this._localParentNotSampled.shouldSample(e,t,n,r,a,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};we();var _t=new Map,vt=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=_t.get(e)??0;if(_t.set(e,r+1),this.standardAttrs={[nt]:e,[tt]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[be]:`queue_full`},this.processedSpans=t.createCounter(at,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(ot,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(st,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[be]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}};l(),h();var yt=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new oe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(c.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize);let n=e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):t();this._metrics=new vt(ut,n,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&d.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){this._finishedSpans.length>=this._maxQueueSize?(this._droppedSpansCount===0&&c.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1)):(this._droppedSpansCount>0&&(c.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);a.with(me(a.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===ue.SUCCESS?e():t(i.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{b(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,b(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},bt=class extends yt{onShutdown(){}},xt=8,St=16,Ct=class{generateTraceId=wt(St);generateSpanId=wt(xt)},R=Buffer.allocUnsafe(St);function wt(e){return function(){for(let t=0;t<e/4;t++)R.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<e&&!(R[t]>0);t++)t===e-1&&(R[e-1]=1);return R.toString(`hex`,0,e)}}l();var z;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(z||={});var Tt=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??ye();let n=e.spanProcessors??[];this._activeSpanProcessor=new gt(n),this._tracerOptions={resource:this._resource,sampler:e.sampler??new L({root:new I}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Ct,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return t()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new ht({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(e){let t=e?.timeoutMillis??this._forceFlushTimeoutMillis,n=this._activeSpanProcessor._spanProcessors.map(e=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${t} ms`)),r=z.timeout},t);e.forceFlush().then(()=>{clearTimeout(i),r!==z.timeout&&(r=z.resolved,n(r))}).catch(e=>{clearTimeout(i),r=z.error,n(e)})}));return new Promise((e,t)=>{Promise.all(n).then(n=>{let r=n.filter(e=>e!==z.resolved);r.length>0?t(r):e()}).catch(e=>t([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[Ze](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return $e(`TracerProvider`,{resource:{attributes:Qe(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}};l();var Et=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=this._ratio===1?4294967296:Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:ee(t)&&this._accumulate(t)<this._upperBound?P.RECORD_AND_SAMPLED:P.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}};l(),h();var B;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(B||={});var V=1;function Dt(){return{sampler:Ot(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:y(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:y(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:y(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:y(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:y(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:y(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:y(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:y(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}function Ot(){let e=ge(`OTEL_TRACES_SAMPLER`)??B.ParentBasedAlwaysOn;switch(e){case B.AlwaysOn:return new I;case B.AlwaysOff:return new F;case B.ParentBasedAlwaysOn:return new L({root:new I});case B.ParentBasedAlwaysOff:return new L({root:new F});case B.TraceIdRatio:return new Et(kt());case B.ParentBasedTraceIdRatio:return new L({root:new Et(kt())});default:return c.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${B.ParentBasedAlwaysOn}".`),new L({root:new I})}}function kt(){let e=y(`OTEL_TRACES_SAMPLER_ARG`);return e==null?(c.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${V}.`),V):e<0||e>1?(c.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${V}.`),V):e}h();function At(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??y(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??y(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??y(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??y(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,Object.assign({},e,{spanLimits:t})}h();var jt=class extends Tt{constructor(e={}){let t=ne({},Dt(),At(e));delete t.generalLimits,super(t)}};h();var Mt=class extends bt{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])if(t[e]===void 0){let r=y(n);r!==void 0&&(t[e]=r)}super({exporter:e,...t})}};l(),p();var Nt=`aventure-mcp-server`,Pt=`aventure=mcp`,Ft=`langfuse.session.id`,It=`/api/public/otel/v1/traces`,Lt=5e3,Rt=new Set([`langfuse.observation.input`,`langfuse.observation.output`,`langfuse.observation.status_message`]),zt=[`OTEL_EXPORTER_OTLP_HEADERS`,`OTEL_EXPORTER_OTLP_TRACES_HEADERS`],H,U;function W(e){return e?.trim()||void 0}function Bt(){return W(process.env.GIT_SHA)??W(process.env.SENTRY_RELEASE)??Oe().version}function Vt(){let e=W(process.env.LANGFUSE_BASE_URL),t=W(process.env.LANGFUSE_PUBLIC_KEY),n=W(process.env.LANGFUSE_SECRET_KEY);if(e!==void 0&&t!==void 0&&n!==void 0){for(let e of zt){let t=(process.env[e]??``).split(`,`).map(e=>e.split(`=`,1)[0]?.trim().toLowerCase()??``).filter(e=>e!==``&&e!==`authorization`);if(t.length>0)throw Error(`${e} sets ${t.join(`, `)}, which the Langfuse trace exporter would forward`)}return new Ye({url:new URL(It,e).href,headers:{Authorization:`Basic ${Buffer.from(`${t}:${n}`).toString(`base64`)}`,"x-langfuse-ingestion-version":`4`},timeoutMillis:Lt})}}function Ht(e){let t={};for(let[n,r]of Object.entries(e.attributes))Rt.has(n)||(t[n]=r);return{name:e.name,kind:e.kind,spanContext:()=>e.spanContext(),...e.parentSpanContext===void 0?{}:{parentSpanContext:e.parentSpanContext},startTime:e.startTime,endTime:e.endTime,status:e.status,attributes:t,links:e.links,events:e.events,duration:e.duration,ended:e.ended,resource:e.resource,instrumentationScope:e.instrumentationScope,droppedAttributesCount:e.droppedAttributesCount,droppedEventsCount:e.droppedEventsCount,droppedLinksCount:e.droppedLinksCount}}function Ut(e){return{export:(t,n)=>e.export(t.map(Ht),n),shutdown:()=>e.shutdown(),forceFlush:()=>e.forceFlush?.()??Promise.resolve()}}function Wt(){if(H!==void 0)return U;let e=W(process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT),t=[...e===void 0?[]:[Ut(new Ye({url:e,timeoutMillis:Lt}))],...[Vt()].filter(e=>e!==void 0)];return H=new jt({sampler:new I,resource:se({...Ce(),"service.version":Bt()}),spanProcessors:t.map(e=>new Mt(e,{exportTimeoutMillis:Lt}))}),U=t.length===0?void 0:H.getTracer(Nt),U}function Gt(){Wt()}var Kt=/^00-(?<traceId>[0-9a-f]{32})-(?<spanId>[0-9a-f]{16})-(?<flags>[0-9a-f]{2})$/u,qt=/[13579bdf]$/u;function Jt(t,n,r){let i=Wt();if(i===void 0)return;let a=Kt.exec(r??``)?.groups,c=a?.traceId===void 0||a.spanId===void 0?e:s.setSpanContext(e,{traceId:a.traceId,spanId:a.spanId,traceFlags:qt.test(a.flags??``)?d.SAMPLED:d.NONE,isRemote:!0});return i.startSpan(t,{kind:o.SERVER,attributes:{"langfuse.trace.name":t,...n,"langfuse.environment":Ce()[`deployment.environment.name`],"langfuse.release":Bt()}},c)}function Yt(e){let{traceId:t,spanId:n,traceFlags:r}=e.spanContext();return`00-${t}-${n}-${(r&d.SAMPLED)===0?`00`:`01`}`}function Xt(e,t,n){e.setAttributes(t),e.setStatus({code:n?u.ERROR:u.OK}),e.end()}async function Zt(){let e=H;H=void 0,U=void 0,await e?.shutdown()}var G=new je,Qt=()=>G.getStore()?.requestId,$t=()=>G.getStore()?.userBearerToken;function en(){let e=G.getStore(),t=[...e?.sessionId===void 0?[]:[`${Ft}=${encodeURIComponent(e.sessionId)}`],...e?.traceName===void 0?[]:[`langfuse.trace.name=${encodeURIComponent(e.traceName)}`],...e?.traceTag===void 0?[]:[`langfuse.trace.tags=${encodeURIComponent(e.traceTag.map(encodeURIComponent).join(`,`))}`]].join(`,`);return{...e?.requestId===void 0?{}:{"X-Client-Request-Id":e.requestId},...e?.traceparent===void 0?{}:{traceparent:e.traceparent,tracestate:Pt,...t.length===0?{}:{baggage:t}}}}function tn(e,t){return G.run({...G.getStore(),requestId:e},t)}function nn(e,t){return G.run({...G.getStore(),userBearerToken:e},t)}function rn(e,t){return G.run({...G.getStore(),...e},t)}A({bodyPath:k(),valueField:T(A({path:T(k().nullable()).readonly(),type:E([`object`,`array`,`string`,`number`,`integer`,`boolean`]),nullable:D()})).readonly()});var K=C([w(``),k().regex(/^(?:\/(?:[^~/]|~[01])*)+$/)]),an=x({readOperationId:k().min(1),writePointer:K,readPointer:K,readParameter:k().min(1).optional(),submittedMap:T(x({bodyPointer:K,readPointer:K,identityPointer:K})).min(1).optional()}),q=[`get`,`post`,`put`,`patch`,`delete`],on={get:`GET`,post:`POST`,put:`PUT`,patch:`PATCH`,delete:`DELETE`},sn=e=>on[e];function cn(e){let t=e.toLowerCase(),n=q.find(e=>e===t);if(n===void 0)throw Error(`Unsupported OpenAPI method: ${e}`);return n}var ln=[`oauth`,`start`,`poll`,`acknowledge`,`revoke`],un=x({name:k().regex(/^[A-Z][A-Z0-9_]*$/u)}),J=C([w(`private`),A({scope:k().optional(),value:k().optional()})]),Y=De(()=>A({$ref:k().optional(),description:k().optional(),type:C([k(),T(k())]).optional(),format:k().optional(),default:M.optional(),enum:T(M).optional(),"x-extensible-enum":T(M).optional(),"x-aventure-parsed-enum":D().optional(),readOnly:D().optional(),items:Y.optional(),minItems:O().int().nonnegative().optional(),maxItems:O().int().nonnegative().optional(),properties:S(k(),Y).optional(),required:T(k()).optional(),oneOf:T(Y).optional(),anyOf:T(Y).optional(),allOf:T(Y).optional(),propertyNames:Y.optional(),additionalProperties:C([Y,D()]).optional(),"x-aventure-visibility":J.optional(),"x-aventure-cli-conflicts":T(T(k().min(1)).min(2)).min(1).optional(),"x-aventure-env":un.optional(),"x-aventure-detail":w(!0).optional(),"x-aventure-operation-only":T(k().min(1)).min(1).optional()})),dn=A({in:k(),name:k(),required:D().optional(),description:k().optional(),schema:Y.optional(),"x-aventure-visibility":J.optional(),"x-aventure-legacy-name":x({name:k().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`}))}),fn=S(k(),A({schema:Y.optional()})),pn=A({description:k().optional(),content:fn.optional(),"x-aventure-standard-response":D().optional()}),mn=A({description:k().optional(),required:D().optional(),content:fn.optional()}),hn=x({auth:E([`none`,`read`]).optional(),mutates:D().optional()}).optional(),gn=k().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)* [a-z0-9]+(?:-[a-z0-9]+)*$/u),_n=k().regex(/^[a-z][A-Za-z0-9]*$/u),vn=k().regex(/^--(?:no-)?[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u),yn=x({command:gn,role:E(ln),summary:k().trim().min(1).optional(),description:k().trim().min(1).optional(),bodyOption:T(_n).min(1).optional(),localOption:T(x({optionKey:_n,flag:vn,description:k().trim().min(1)})).min(1).optional()}).superRefine((e,t)=>{let n=[e.bodyOption??[],(e.localOption??[]).map(e=>e.optionKey),(e.localOption??[]).map(e=>e.flag)].some(e=>new Set(e).size!==e.length),r=(e.localOption??[]).some(e=>new te(e.flag).attributeName()!==e.optionKey);(n||r)&&t.addIssue({code:`custom`,message:`Composite CLI options must be unique and match their local flags`})}).optional(),bn=A({operationId:k(),summary:k().optional(),description:k().optional(),tags:T(k()).optional(),deprecated:D().optional(),hidden:D().optional(),security:T(S(k(),T(k()))).optional(),parameters:T(dn).optional(),requestBody:mn.optional(),responses:S(k(),pn),"x-aventure-visibility":J.optional(),"x-aventure-tool":hn,"x-aventure-mutation-readback":an.optional(),"x-aventure-cli-composite":yn}).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`})}}),xn=A(Object.fromEntries(q.map(e=>[e,bn.optional()]))),Sn=A({$ref:k().optional(),description:k().optional(),type:C([k(),T(k())]).optional(),format:k().optional(),default:M.optional(),enum:T(M).optional(),"x-extensible-enum":T(M).optional(),"x-aventure-parsed-enum":D().optional(),readOnly:D().optional(),items:Y.optional(),minItems:O().int().nonnegative().optional(),maxItems:O().int().nonnegative().optional(),oneOf:T(Y).optional(),anyOf:T(Y).optional(),allOf:T(Y).optional(),propertyNames:Y.optional(),additionalProperties:C([Y,D()]).optional(),properties:S(k(),Y).optional(),required:T(k()).optional(),"x-aventure-visibility":J.optional(),"x-aventure-cli-conflicts":T(T(k().min(1)).min(2)).min(1).optional(),"x-aventure-env":un.optional(),"x-aventure-detail":w(!0).optional(),"x-aventure-noun":x({one:k().trim().min(1),other:k().trim().min(1)}).optional()});A({info:A({description:k().optional()}).optional(),tags:T(A({name:k(),description:k().optional(),"x-aventure-cli":x({section:E([`researchData`,`account`,`administration`,`cli`])}).optional()})).optional(),paths:S(k(),xn),webhooks:S(k(),A({post:A({description:k(),requestBody:mn})})).optional(),components:A({schemas:S(k(),Sn)})}).superRefine((e,t)=>{for(let[n,r]of Object.entries(e.paths))for(let i of q){let a=r[i]?.[`x-aventure-mutation-readback`];a!==void 0&&wn(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 Cn=new Set([`page`,`size`,`sort`]);function X(e){return e?.$ref?.startsWith(`#/components/schemas/`)===!0?e.$ref.slice(21):void 0}function wn(e,t){for(let[n,r]of Object.entries(e))for(let e of q){let i=r[e];if(i?.operationId===t)return{method:e,template:n,operation:i}}return null}function Tn(e,t,n){let r=We(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&&Ge(n,r))return{method:t,template:n,operation:e}}return null}function En(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 Dn(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 On(e,t){let n={};for(let r of e.parameters??[]){if(r.in!==`query`||Cn.has(r.name))continue;let e=t?.[r.name]??kn(r.schema?.default);e!==void 0&&(n[r.name]=e)}return Object.keys(n).length===0?void 0:n}function kn(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 An=3e4;async function jn(e,t,n,r){let i=In(Z(e.requestBody?.content),n);if(!i.ok||i.data===null)return N(i.summary,i.warnings);let a=i.data;if(e.requestBody?.required===!0&&t===void 0&&a?.kind!==`multipart`)return N(`Request body is required.`);if(a?.kind===`multipart`)return await Rn(e.requestBody?.required===!0,a.schema,t);let o=a?.contentType??r;return j(`Request body prepared`,{...t===void 0?{}:{body:t},...o===void 0?{}:{contentType:o}})}function Mn(e){if(typeof e!=`string`)return j(`Request body unchanged`,e);let t=e.trimStart().slice(0,1);if(t!==`{`&&t!==`[`)return j(`Request body unchanged`,e);try{let t=M.safeParse(JSON.parse(e));if(!t.success)throw t.error;return j(`Request body parsed`,t.data)}catch(e){return N(`Request body string must be valid JSON: ${e instanceof Error?e.message:String(e)}`)}}function Nn(e,t){let n=e?.schema;if(n===void 0)return!1;let r=X(n),i=n.type??(r===void 0?void 0:t[r]?.type);return Array.isArray(i)?i.includes(`array`):i===`array`}function Pn(e){return Z(e)[0]?.kind??`json`}function Fn(e){return e===void 0||Object.keys(e).length===0||Z(e).length>0}function Z(e){let t=Object.entries(e??{});return[...t.flatMap(e=>Xn(e[0])?[Ln(e,`json`)]:[]),...t.flatMap(e=>Zn(e[0])?[Ln(e,`multipart`)]:[])]}function In(e,t){if(t===void 0)return j(`Default request content selected`,e[0]);let n=Q(t),r=e.find(e=>Q(e.contentType)===n);return r===void 0?N(`Request Content-Type '${t}' is not supported. Supported choices: ${e.map(({contentType:e})=>e).join(`, `)||`none`}.`):j(`Explicit request content selected`,r)}function Ln(e,t){let n=e[1].schema;return{contentType:e[0],kind:t,...n===void 0?{}:{schema:n}}}async function Rn(e,t,n){if(!e&&n==null)return j(`Optional multipart body omitted`,{});let r=zn(n);if(!r.ok||r.data===null)return N(r.summary,r.warnings);let i=new FormData;for(let e of Bn(t)){let t=r.data[e.name];if(t==null){if(e.required)return N(`Multipart body requires '${e.name}'.`)}else{if(Array.isArray(t)&&t.length<(e.schema.minItems??0))return N(`Multipart part '${e.name}' requires more entries.`);if(Array.isArray(t)&&t.length>(e.schema.maxItems??2**53-1))return N(`Multipart part '${e.name}' has too many entries.`);if(Vn(e.schema)||Hn(e.schema)){let n=Hn(e.schema)?t:[t];if(!Array.isArray(n)||n.some(e=>typeof e!=`string`))return N(`Multipart part '${e.name}' must contain file paths or URLs.`);for(let t of n){if(typeof t!=`string`)continue;let n=await Gn(t);if(!n.ok||n.data===null)return N(n.summary,n.warnings);i.append(e.name,n.data.blob,n.data.filename)}}else if(Un(e.schema,t)){let n=JSON.stringify(t);i.append(e.name,new Blob([n],{type:`application/json`}),`${e.name}.json`)}else{let n=Wn(i,e.name,t);if(!n.ok)return n}}}return j(`Multipart body prepared`,{body:i})}function zn(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=Object.fromEntries(Object.entries(e));return j(`Multipart input parsed`,t)}return N(`Multipart request body must be a JSON object keyed by form part name.`)}function Bn(e){let t=new Set(e?.required??[]);return Object.entries(e?.properties??{}).map(([e,n])=>({name:e,schema:n,required:t.has(e)}))}function Vn(e){return e.type===`string`&&e.format===`binary`}function Hn(e){return e.type===`array`&&e.items!==void 0&&Vn(e.items)}function Un(e,t){return typeof t!=`object`||!t||Array.isArray(t)?!1:e.type===`object`||typeof e.$ref==`string`&&e.$ref.length>0}function Wn(e,t,n){if(Array.isArray(n)){for(let r of n){let n=Wn(e,t,r);if(!n.ok)return n}return j(`Multipart scalar array appended`,null)}return typeof n==`object`?N(`Multipart part '${t}' must be scalar.`):(e.append(t,String(n)),j(`Multipart scalar appended`,null))}async function Gn(e){return Jn(e)?Qt()===void 0?await Kn(e):N(`MCP media URL fetching is disabled. Pass the page as sourceUrl in the JSON body instead.`):Qt()===void 0?await qn(e):N(`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 Kn(e){let t=new AbortController,n=setTimeout(()=>t.abort(),An);try{let n=new URL(e),r=await fetch(e,{signal:t.signal});if(!r.ok)return N(`Failed to fetch media URL: ${r.status} ${r.statusText}`);let i=r.headers.get(`content-type`)?.split(`;`)[0]?.trim()??Yn(n.pathname)??``,a=new Blob([await r.arrayBuffer()],{type:i});return j(`URL media fetched`,{blob:a,filename:ke(n.pathname)||`upload`})}catch(e){return t.signal.aborted?N(`Failed to fetch media URL: timed out after ${An}ms.`):N(`Failed to fetch media URL: ${e instanceof Error?e.message:String(e)}`)}finally{clearTimeout(n)}}async function qn(e){try{let t=Yn(e)??``,n=await Me(e);return j(`File media read`,{blob:new Blob([n],{type:t}),filename:ke(e)})}catch(t){return N(`Failed to read media file '${e}': ${t instanceof Error?t.message:String(t)}`)}}function Jn(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}function Yn(e){return Qn[Ae(e).toLowerCase()]}function Xn(e){let t=Q(e);return t===`*/*`||t===`application/json`||t.endsWith(`+json`)}function Zn(e){return Q(e)===`multipart/form-data`}var Q=e=>e.split(`;`)[0]?.trim().toLowerCase()??``,Qn={".gif":`image/gif`,".heic":`image/heic`,".heif":`image/heif`,".jpeg":`image/jpeg`,".jpg":`image/jpeg`,".png":`image/png`,".webp":`image/webp`};function $n(e,t,n){let r=new Map,i=(t,a,o)=>{let s=X(t);if(a>n||s!==void 0&&o.includes(s))return;let c=s===void 0?o:[...o,s],l=tr(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(er(n.content),0,[]);return r}function er(e){return e?.[`application/json`]?.schema??Object.values(e??{}).find(e=>e.schema!==void 0)?.schema}function tr(e,t){let n=X(t);return{...n===void 0?void 0:e.components.schemas[n],...t}}function nr(e){if(e===`private`||typeof e==`object`&&(e.scope===`private`||e.value===`private`))return`private`}function rr(e){return e===`write`||e===`delete`}function ir(e){return rr(e)||e===`job`}function ar(e,t){return e===`DELETE`||t===`delete`}var or=`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 sr(e,t){let n=e===`array`?t:e;return n===void 0||n===`string`}function cr(e){let t=e.operation[`x-aventure-tool`];if(!mr(e.path,e.operation,e.method===`GET`&&t?.auth===`none`,e.includeBinary===!0))return null;let n=pr(e.operation.operationId),r=Tr(e.path,n),i=fr(r,n,e.method),a=lr(e.method,e.operation);if(a===null)return null;let o=t?.auth===`read`&&i===`write`?`lookup`:i,s=e.method===`GET`||a===`read`||a===`none`;return{resource:Er(e.path),intent:o,cliPath:r,scope:s&&!rr(o)?`read`:`write`,auth:a,visibility:nr(e.operation[`x-aventure-visibility`]),mutates:t?.mutates===!0||void 0,stdinBody:e.operation.requestBody!==void 0&&Pn(e.operation.requestBody.content)===`json`,destructive:ar(e.method,o)}}function lr(e,t){let n=t[`x-aventure-tool`]?.auth;if(n===`none`)return`none`;if(n===`read`)return`read`;if(e===`GET`&&(t.security?.length??0)===0)return`none`;let r=!1,i=!1,a=!1;for(let e of t.security??[]){let t=Object.keys(e);t.includes(`clientSecretAuth`)&&(r=!0),t.includes(`adminApiKeyAuth`)&&(a=!0),(t.includes(`bearerAuth`)||t.includes(`clerkApiKeyAuth`))&&(i=!0)}return e===`GET`&&r||r&&!a&&!i?`read`:a?`write`:i?`bearer`:e===`GET`?`read`:null}var ur={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`},dr=`status`;function fr(e,t,n){if(e.length===1&&e[0]===dr)return`status`;let r=Object.hasOwn(ur,t)?ur[t]:void 0;return r===void 0?n===`GET`?`read`:n===`DELETE`?`delete`:`write`:r}function pr(e){let t=/^[a-z]+/u.exec(e)?.[0];if(t===void 0)throw Error(`operationId '${e}' has no verb`);return t}function mr(e,t,n,r){return hr(e)&&t.hidden!==!0&&(n||!gr.some(t=>t.test(e)))&&Fn(t.requestBody?.content)&&(xr(t.responses)||r&&br(t))}function hr(e){return e.startsWith(`/v1/`)||e.startsWith(`/v2/`)}var gr=[/^\/v1\/auth\/(?:session|login|ui|registrations|password-resets|cli-authorizations)(?:\/|$)/u,/^\/v1\/addresses\/locations(?:\/|$)/u,/^\/v1\/entities\/\{entityId\}\/sites$/u,/^\/v1\/(?:chat\/completions|embeddings)$/u,/^\/v1\/observability(?:\/|$)/u,/^\/v1\/media\/identicons(?:\/|$)/u];function _r(e){return e!==`/v1/auth/api-key`&&!/^\/v1\/sitemap(?:\/|$)/u.test(e)}var vr=/(?:^|-)(?:runs|jobs)$/u;function yr(e){switch(e.intent){case`read`:case`lookup`:case`search`:case`status`:case`job`:return e.intent;case`write`:{let t=pr(e.operationId);return t===`enrich`||t===`create`&&vr.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 br(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=>wr(e.schema)))}function xr(e){return Object.entries(e).filter(([e])=>e.startsWith(`2`)).every(([,e])=>Sr(e.content))}function Sr(e){if(e===void 0)return!0;let t=Object.entries(e);return t.length===0||t.some(([e,t])=>Cr(e)&&!wr(t.schema))}function Cr(e){return e===`*/*`||e===`application/json`||e.endsWith(`+json`)}function wr(e){return e?.format===`byte`||e?.format===`binary`}function Tr(e,t){let n=kr(e).map($),r=n.length===1&&t===`get`&&!e.includes(`{`),i=n.some(e=>e.split(`-`).includes(t));return r||i?n:[...n,t]}function Er(e){return $(kr(e).at(0)??`system`)}function Dr(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 Or=e=>`--${$(e)}`;function kr(e){return Ar(e).filter(e=>!jr(e)&&!Mr(e))}function Ar(e){return e.split(`/`).filter(e=>e.length>0)}function jr(e){return/^v\d+$/u.test(e)}function Mr(e){return e.startsWith(`{`)&&e.endsWith(`}`)}export{en as A,Yt as B,Dn as C,Tn as D,On as E,Ft as F,Xt as I,Zt as L,tn as M,rn as N,X as O,nn as P,Jt as R,En as S,cn as T,We as V,Z as _,sr as a,q as b,rr as c,$ as d,yr as f,jn as g,Mn as h,ir as i,$t as j,Qt as k,Dr as l,$n as m,ur as n,Or as o,cr as p,br as r,ar as s,or as t,_r as u,Nn as v,wn as w,sn as x,In as y,Gt as z};
|
|
1
|
+
import{A as e,O as t,S as n,_ as r,b as i,d as a,h as o,i as s,l as c,n as l,p as u,w as d,x as ee}from"./esm-BVGNzX-8.js";import{n as te}from"./commander-DEj7N1b9.js";import{$ as f,A as p,B as ne,C as re,D as ie,E as m,F as h,G as ae,L as oe,N as se,O as ce,U as le,V as ue,W as de,X as fe,Y as pe,Z as g,_t as me,at as he,ct as ge,gt as _e,it as ve,j as ye,k as _,mt as v,nt as be,pt as xe,rt as Se,s as Ce,st as y,tt as we,ut as b,vt as Te,w as Ee}from"./logging-BnHashoK.js";import{C as x,S,T as C,g as w,h as De,l as T,o as E,u as D,v as O,w as k,y as A}from"./person-owner-C0YuWKvY.js";import{c as j,p as M,r as N}from"./result-envelope-BKQSGfkH.js";import{a as Oe}from"./package-CZBWjlYb.js";import{basename as ke,extname as Ae}from"node:path";import{AsyncLocalStorage as je}from"node:async_hooks";import{readFile as Me}from"node:fs/promises";var Ne={name:`span`,countItems:e=>e.length},Pe=256,Fe=512;function Ie(e,t){let n=e&255|Pe;return t&&(n|=Fe),n}function Le(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:_(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>ze(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Re(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Ie(n.traceFlags,e.parentSpanContext?.isRemote)}}function Re(e,t){return{attributes:e.attributes?_(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Ie(e.context.traceFlags,e.context.isRemote)}}function ze(e,t){return{attributes:e.attributes?_(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Be(e,t){return{resourceSpans:He(e,t)}}function Ve(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function He(e,t){let n=Ve(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>Le(e,t));o.push({scope:ie(e[0].instrumentationScope,t),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=ce(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}l();var Ue={serializeRequest:e=>{let t=Be(e,m);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return c.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};we(),h(),p();function We(e){return new URL(e,`https://placeholder.invalid`).pathname}function Ge(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean);return n.length!==r.length||r.some(qe)?!1:n.every((e,t)=>Ke(e)||e===r[t])}function Ke(e){let t=e.slice(1,-1);return e.startsWith(`{`)&&e.endsWith(`}`)&&t.length>0&&!t.includes(`/`)&&!t.includes(`{`)&&!t.includes(`}`)}function qe(e){if(Ke(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 Je=`otlp_http_span_exporter`,Ye=class extends Te{constructor(e={}){super(Ee(re(e,`TRACES`,`v1/traces`,{"Content-Type":`application/json`}),Ue,Je,Ne,e.selfObsMeterProvider))}},Xe=`exception`,Ze=Symbol.for(`nodejs.util.inspect.custom`);function Qe(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function $e(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}l();var et=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:u.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=f.now(),this._performanceOffset=t-(this._performanceStartTime+f.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return c.warn(`Invalid attribute key: ${e}`),this;if(!xe(t))return c.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return c.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&c.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),pe(t)&&(pe(n)||(n=t),t=void 0);let i=v(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,l=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];a!==void 0&&l>=a?s++:(o[e]=this._truncateToSize(t),l++)}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&c.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=v(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];n!==void 0&&o>=n?a++:(i[e]=this._truncateToSize(t),o++)}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===u.UNSET||this.status.code===u.OK)return this;let t={code:e.code};return e.code===u.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&c.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?c.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(e),this._duration=ae(this.startTime,this.endTime),this._duration[0]<0&&(c.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&c.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&c.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(e){if(typeof e==`number`&&e<=f.now())return de(e+this._performanceOffset);if(typeof e==`number`)return g(e);if(e instanceof Date)return g(e.getTime());if(fe(e))return e;if(this._startTimeProvided)return g(Date.now());let t=f.now()-this._performanceStartTime;return le(this.startTime,g(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Se]=e:e&&(e.code?n[he]=e.code.toString():e.name&&(n[he]=e.name),e.message&&(n[Se]=e.message),e.stack&&(n[ve]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Xe,n,t):c.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);c.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(c.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[Ze](e,t,n){return $e(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:Qe(this.resource)}},e,t,n)}},P;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(P||={});var tt=`otel.component.name`,nt=`otel.component.type`,rt=`otel.span.parent.origin`,it=`otel.span.sampling_result`,at=`otel.sdk.processor.span.processed`,ot=`otel.sdk.processor.span.queue.capacity`,st=`otel.sdk.processor.span.queue.size`,ct=`otel.sdk.span.live`,lt=`otel.sdk.span.started`,ut=`batching_span_processor`,dt=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(lt,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ct,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=pt(t);if(this.startedSpans.add(1,{[rt]:ft(e),[it]:n}),t===P.NOT_RECORD)return()=>{};let r={[it]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function ft(e){return e?e.isRemote?`remote`:`local`:`none`}function pt(e){switch(e){case P.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case P.RECORD:return`RECORD_ONLY`;case P.NOT_RECORD:return`DROP`}}var mt=`2.11.0`;l(),h();var ht=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor;let n=t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,mt);this._tracerMetrics=new dt(n)}startSpan(e,t={},i=a.active()){t.root&&(i=s.deleteSpan(i));let l=s.getSpan(i);if(_e(i))return c.debug(`Instrumentation suppressed, returning Noop Span`),s.wrapSpanContext(n);let u=l?.spanContext(),ee=this._idGenerator.generateSpanId(),te,f,p;!u||!s.isSpanContextValid(u)?f=this._idGenerator.generateTraceId():(f=u.traceId,p=u.traceState,te=u);let ne=t.kind??o.INTERNAL,re=(t.links??[]).map(e=>({context:e.context,attributes:v(e.attributes)})),ie=v(t.attributes),m=this._sampler.shouldSample(i,f,e,ne,ie,re),h=this._tracerMetrics.startSpan(u,m.decision);p=m.traceState??p;let ae=m.decision===r.RECORD_AND_SAMPLED?d.SAMPLED:d.NONE,oe={traceId:f,spanId:ee,traceFlags:ae,traceState:p};if(m.decision===r.NOT_RECORD)return c.debug(`Recording is off, propagating context in a non-recording span`),s.wrapSpanContext(oe);let se=v(Object.assign(ie,m.attributes));return new et({resource:this._resource,scope:this.instrumentationScope,context:i,spanContext:oe,name:e,kind:ne,links:re,parentSpanContext:te,attributes:se,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:h})}startActiveSpan(e,t,n,r){let i,o,c;if(arguments.length<2)return;arguments.length===2?c=t:arguments.length===3?(i=t,c=n):(i=t,o=n,c=r);let l=o??a.active(),u=this.startSpan(e,i,l),d=s.setSpan(l,u);return a.with(d,c,void 0,u)}[Ze](e,t,n){return $e(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:Qe(this._resource)},spanLimits:this._spanLimits},e,t,n)}};h();var gt=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{b(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},F=class{shouldSample(){return{decision:P.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},I=class{shouldSample(){return{decision:P.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};l(),h();var L=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(b(Error(`ParentBasedSampler must have a root sampler configured`)),new I),this._remoteParentSampled=e.remoteParentSampled??new I,this._remoteParentNotSampled=e.remoteParentNotSampled??new F,this._localParentSampled=e.localParentSampled??new I,this._localParentNotSampled=e.localParentNotSampled??new F}shouldSample(e,t,n,r,a,o){let c=s.getSpanContext(e);return!c||!i(c)?this._root.shouldSample(e,t,n,r,a,o):c.isRemote?c.traceFlags&d.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,a,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,a,o):c.traceFlags&d.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,a,o):this._localParentNotSampled.shouldSample(e,t,n,r,a,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};we();var _t=new Map,vt=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=_t.get(e)??0;if(_t.set(e,r+1),this.standardAttrs={[nt]:e,[tt]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[be]:`queue_full`},this.processedSpans=t.createCounter(at,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(ot,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(st,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[be]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}};l(),h();var yt=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new oe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(c.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize);let n=e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):t();this._metrics=new vt(ut,n,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&d.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){this._finishedSpans.length>=this._maxQueueSize?(this._droppedSpansCount===0&&c.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1)):(this._droppedSpansCount>0&&(c.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);a.with(me(a.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===ue.SUCCESS?e():t(i.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{b(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,b(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},bt=class extends yt{onShutdown(){}},xt=8,St=16,Ct=class{generateTraceId=wt(St);generateSpanId=wt(xt)},R=Buffer.allocUnsafe(St);function wt(e){return function(){for(let t=0;t<e/4;t++)R.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<e&&!(R[t]>0);t++)t===e-1&&(R[e-1]=1);return R.toString(`hex`,0,e)}}l();var z;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(z||={});var Tt=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??ye();let n=e.spanProcessors??[];this._activeSpanProcessor=new gt(n),this._tracerOptions={resource:this._resource,sampler:e.sampler??new L({root:new I}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Ct,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return t()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new ht({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(e){let t=e?.timeoutMillis??this._forceFlushTimeoutMillis,n=this._activeSpanProcessor._spanProcessors.map(e=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${t} ms`)),r=z.timeout},t);e.forceFlush().then(()=>{clearTimeout(i),r!==z.timeout&&(r=z.resolved,n(r))}).catch(e=>{clearTimeout(i),r=z.error,n(e)})}));return new Promise((e,t)=>{Promise.all(n).then(n=>{let r=n.filter(e=>e!==z.resolved);r.length>0?t(r):e()}).catch(e=>t([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[Ze](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return $e(`TracerProvider`,{resource:{attributes:Qe(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}};l();var Et=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=this._ratio===1?4294967296:Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:ee(t)&&this._accumulate(t)<this._upperBound?P.RECORD_AND_SAMPLED:P.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}};l(),h();var B;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(B||={});var V=1;function Dt(){return{sampler:Ot(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:y(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:y(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:y(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:y(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:y(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:y(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:y(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:y(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}function Ot(){let e=ge(`OTEL_TRACES_SAMPLER`)??B.ParentBasedAlwaysOn;switch(e){case B.AlwaysOn:return new I;case B.AlwaysOff:return new F;case B.ParentBasedAlwaysOn:return new L({root:new I});case B.ParentBasedAlwaysOff:return new L({root:new F});case B.TraceIdRatio:return new Et(kt());case B.ParentBasedTraceIdRatio:return new L({root:new Et(kt())});default:return c.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${B.ParentBasedAlwaysOn}".`),new L({root:new I})}}function kt(){let e=y(`OTEL_TRACES_SAMPLER_ARG`);return e==null?(c.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${V}.`),V):e<0||e>1?(c.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${V}.`),V):e}h();function At(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??y(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??y(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??y(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??y(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,Object.assign({},e,{spanLimits:t})}h();var jt=class extends Tt{constructor(e={}){let t=ne({},Dt(),At(e));delete t.generalLimits,super(t)}};h();var Mt=class extends bt{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])if(t[e]===void 0){let r=y(n);r!==void 0&&(t[e]=r)}super({exporter:e,...t})}};l(),p();var Nt=`aventure-mcp-server`,Pt=`aventure=mcp`,Ft=`langfuse.session.id`,It=`/api/public/otel/v1/traces`,Lt=5e3,Rt=new Set([`langfuse.observation.input`,`langfuse.observation.output`,`langfuse.observation.status_message`]),zt=[`OTEL_EXPORTER_OTLP_HEADERS`,`OTEL_EXPORTER_OTLP_TRACES_HEADERS`],H,U;function W(e){return e?.trim()||void 0}function Bt(){return W(process.env.GIT_SHA)??W(process.env.SENTRY_RELEASE)??Oe().version}function Vt(){let e=W(process.env.LANGFUSE_BASE_URL),t=W(process.env.LANGFUSE_PUBLIC_KEY),n=W(process.env.LANGFUSE_SECRET_KEY);if(e!==void 0&&t!==void 0&&n!==void 0){for(let e of zt){let t=(process.env[e]??``).split(`,`).map(e=>e.split(`=`,1)[0]?.trim().toLowerCase()??``).filter(e=>e!==``&&e!==`authorization`);if(t.length>0)throw Error(`${e} sets ${t.join(`, `)}, which the Langfuse trace exporter would forward`)}return new Ye({url:new URL(It,e).href,headers:{Authorization:`Basic ${Buffer.from(`${t}:${n}`).toString(`base64`)}`,"x-langfuse-ingestion-version":`4`},timeoutMillis:Lt})}}function Ht(e){let t={};for(let[n,r]of Object.entries(e.attributes))Rt.has(n)||(t[n]=r);return{name:e.name,kind:e.kind,spanContext:()=>e.spanContext(),...e.parentSpanContext===void 0?{}:{parentSpanContext:e.parentSpanContext},startTime:e.startTime,endTime:e.endTime,status:e.status,attributes:t,links:e.links,events:e.events,duration:e.duration,ended:e.ended,resource:e.resource,instrumentationScope:e.instrumentationScope,droppedAttributesCount:e.droppedAttributesCount,droppedEventsCount:e.droppedEventsCount,droppedLinksCount:e.droppedLinksCount}}function Ut(e){return{export:(t,n)=>e.export(t.map(Ht),n),shutdown:()=>e.shutdown(),forceFlush:()=>e.forceFlush?.()??Promise.resolve()}}function Wt(){if(H!==void 0)return U;let e=W(process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT),t=[...e===void 0?[]:[Ut(new Ye({url:e,timeoutMillis:Lt}))],...[Vt()].filter(e=>e!==void 0)];return H=new jt({sampler:new I,resource:se({...Ce(),"service.version":Bt()}),spanProcessors:t.map(e=>new Mt(e,{exportTimeoutMillis:Lt}))}),U=t.length===0?void 0:H.getTracer(Nt),U}function Gt(){Wt()}var Kt=/^00-(?<traceId>[0-9a-f]{32})-(?<spanId>[0-9a-f]{16})-(?<flags>[0-9a-f]{2})$/u,qt=/[13579bdf]$/u;function Jt(t,n,r){let i=Wt();if(i===void 0)return;let a=Kt.exec(r??``)?.groups,c=a?.traceId===void 0||a.spanId===void 0?e:s.setSpanContext(e,{traceId:a.traceId,spanId:a.spanId,traceFlags:qt.test(a.flags??``)?d.SAMPLED:d.NONE,isRemote:!0});return i.startSpan(t,{kind:o.SERVER,attributes:{"langfuse.trace.name":t,...n,"langfuse.environment":Ce()[`deployment.environment.name`],"langfuse.release":Bt()}},c)}function Yt(e){let{traceId:t,spanId:n,traceFlags:r}=e.spanContext();return`00-${t}-${n}-${(r&d.SAMPLED)===0?`00`:`01`}`}function Xt(e,t,n){e.setAttributes(t),e.setStatus({code:n?u.ERROR:u.OK}),e.end()}async function Zt(){let e=H;H=void 0,U=void 0,await e?.shutdown()}var G=new je,Qt=()=>G.getStore()?.requestId,$t=()=>G.getStore()?.userBearerToken;function en(){let e=G.getStore(),t=[...e?.sessionId===void 0?[]:[`${Ft}=${encodeURIComponent(e.sessionId)}`],...e?.traceName===void 0?[]:[`langfuse.trace.name=${encodeURIComponent(e.traceName)}`],...e?.traceTag===void 0?[]:[`langfuse.trace.tags=${encodeURIComponent(e.traceTag.map(encodeURIComponent).join(`,`))}`]].join(`,`);return{...e?.requestId===void 0?{}:{"X-Client-Request-Id":e.requestId},...e?.traceparent===void 0?{}:{traceparent:e.traceparent,tracestate:Pt,...t.length===0?{}:{baggage:t}}}}function tn(e,t){return G.run({...G.getStore(),requestId:e},t)}function nn(e,t){return G.run({...G.getStore(),userBearerToken:e},t)}function rn(e,t){return G.run({...G.getStore(),...e},t)}A({bodyPath:k(),valueField:T(A({path:T(k().nullable()).readonly(),type:E([`object`,`array`,`string`,`number`,`integer`,`boolean`]),nullable:D()})).readonly()});var K=C([w(``),k().regex(/^(?:\/(?:[^~/]|~[01])*)+$/)]),an=x({readOperationId:k().min(1),writePointer:K,readPointer:K,readParameter:k().min(1).optional(),submittedMap:T(x({bodyPointer:K,readPointer:K,identityPointer:K})).min(1).optional()}),q=[`get`,`post`,`put`,`patch`,`delete`],on={get:`GET`,post:`POST`,put:`PUT`,patch:`PATCH`,delete:`DELETE`},sn=e=>on[e];function cn(e){let t=e.toLowerCase(),n=q.find(e=>e===t);if(n===void 0)throw Error(`Unsupported OpenAPI method: ${e}`);return n}var ln=[`oauth`,`start`,`poll`,`acknowledge`,`revoke`],un=x({name:k().regex(/^[A-Z][A-Z0-9_]*$/u)}),J=C([w(`private`),A({scope:k().optional(),value:k().optional()})]),Y=De(()=>A({$ref:k().optional(),description:k().optional(),type:C([k(),T(k())]).optional(),format:k().optional(),default:M.optional(),enum:T(M).optional(),"x-extensible-enum":T(M).optional(),"x-aventure-parsed-enum":D().optional(),readOnly:D().optional(),items:Y.optional(),minItems:O().int().nonnegative().optional(),maxItems:O().int().nonnegative().optional(),properties:S(k(),Y).optional(),required:T(k()).optional(),oneOf:T(Y).optional(),anyOf:T(Y).optional(),allOf:T(Y).optional(),propertyNames:Y.optional(),additionalProperties:C([Y,D()]).optional(),"x-aventure-visibility":J.optional(),"x-aventure-cli-conflicts":T(T(k().min(1)).min(2)).min(1).optional(),"x-aventure-env":un.optional(),"x-aventure-detail":w(!0).optional(),"x-aventure-operation-only":T(k().min(1)).min(1).optional()})),dn=A({in:k(),name:k(),required:D().optional(),description:k().optional(),schema:Y.optional(),"x-aventure-visibility":J.optional(),"x-aventure-legacy-name":x({name:k().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`}))}),fn=S(k(),A({schema:Y.optional()})),pn=A({description:k().optional(),content:fn.optional(),"x-aventure-standard-response":D().optional()}),mn=A({description:k().optional(),required:D().optional(),content:fn.optional()}),hn=x({auth:E([`none`,`read`]).optional(),mutates:D().optional()}).optional(),gn=k().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)* [a-z0-9]+(?:-[a-z0-9]+)*$/u),_n=k().regex(/^[a-z][A-Za-z0-9]*$/u),vn=k().regex(/^--(?:no-)?[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u),yn=x({command:gn,role:E(ln),summary:k().trim().min(1).optional(),description:k().trim().min(1).optional(),bodyOption:T(_n).min(1).optional(),localOption:T(x({optionKey:_n,flag:vn,description:k().trim().min(1)})).min(1).optional()}).superRefine((e,t)=>{let n=[e.bodyOption??[],(e.localOption??[]).map(e=>e.optionKey),(e.localOption??[]).map(e=>e.flag)].some(e=>new Set(e).size!==e.length),r=(e.localOption??[]).some(e=>new te(e.flag).attributeName()!==e.optionKey);(n||r)&&t.addIssue({code:`custom`,message:`Composite CLI options must be unique and match their local flags`})}).optional(),bn=A({operationId:k(),summary:k().optional(),description:k().optional(),tags:T(k()).optional(),deprecated:D().optional(),hidden:D().optional(),security:T(S(k(),T(k()))).optional(),parameters:T(dn).optional(),requestBody:mn.optional(),responses:S(k(),pn),"x-aventure-visibility":J.optional(),"x-aventure-tool":hn,"x-aventure-mutation-readback":an.optional(),"x-aventure-cli-composite":yn}).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`})}}),xn=A(Object.fromEntries(q.map(e=>[e,bn.optional()]))),Sn=A({$ref:k().optional(),description:k().optional(),type:C([k(),T(k())]).optional(),format:k().optional(),default:M.optional(),enum:T(M).optional(),"x-extensible-enum":T(M).optional(),"x-aventure-parsed-enum":D().optional(),readOnly:D().optional(),items:Y.optional(),minItems:O().int().nonnegative().optional(),maxItems:O().int().nonnegative().optional(),oneOf:T(Y).optional(),anyOf:T(Y).optional(),allOf:T(Y).optional(),propertyNames:Y.optional(),additionalProperties:C([Y,D()]).optional(),properties:S(k(),Y).optional(),required:T(k()).optional(),"x-aventure-visibility":J.optional(),"x-aventure-cli-conflicts":T(T(k().min(1)).min(2)).min(1).optional(),"x-aventure-env":un.optional(),"x-aventure-detail":w(!0).optional(),"x-aventure-noun":x({one:k().trim().min(1),other:k().trim().min(1)}).optional()});A({info:A({description:k().optional()}).optional(),tags:T(A({name:k(),description:k().optional(),"x-aventure-cli":x({section:E([`researchData`,`account`,`administration`,`cli`])}).optional()})).optional(),paths:S(k(),xn),webhooks:S(k(),A({post:A({description:k(),requestBody:mn})})).optional(),components:A({schemas:S(k(),Sn)})}).superRefine((e,t)=>{for(let[n,r]of Object.entries(e.paths))for(let i of q){let a=r[i]?.[`x-aventure-mutation-readback`];a!==void 0&&wn(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 Cn=new Set([`page`,`size`,`sort`]);function X(e){return e?.$ref?.startsWith(`#/components/schemas/`)===!0?e.$ref.slice(21):void 0}function wn(e,t){for(let[n,r]of Object.entries(e))for(let e of q){let i=r[e];if(i?.operationId===t)return{method:e,template:n,operation:i}}return null}function Tn(e,t,n){let r=We(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&&Ge(n,r))return{method:t,template:n,operation:e}}return null}function En(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 Dn(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 On(e,t){let n={};for(let r of e.parameters??[]){if(r.in!==`query`||Cn.has(r.name))continue;let e=t?.[r.name]??kn(r.schema?.default);e!==void 0&&(n[r.name]=e)}return Object.keys(n).length===0?void 0:n}function kn(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 An=3e4;async function jn(e,t,n,r){let i=In(Z(e.requestBody?.content),n);if(!i.ok||i.data===null)return N(i.summary,i.warnings);let a=i.data;if(e.requestBody?.required===!0&&t===void 0&&a?.kind!==`multipart`)return N(`Request body is required.`);if(a?.kind===`multipart`)return await Rn(e.requestBody?.required===!0,a.schema,t);let o=a?.contentType??r;return j(`Request body prepared`,{...t===void 0?{}:{body:t},...o===void 0?{}:{contentType:o}})}function Mn(e){if(typeof e!=`string`)return j(`Request body unchanged`,e);let t=e.trimStart().slice(0,1);if(t!==`{`&&t!==`[`)return j(`Request body unchanged`,e);try{let t=M.safeParse(JSON.parse(e));if(!t.success)throw t.error;return j(`Request body parsed`,t.data)}catch(e){return N(`Request body string must be valid JSON: ${e instanceof Error?e.message:String(e)}`)}}function Nn(e,t){let n=e?.schema;if(n===void 0)return!1;let r=X(n),i=n.type??(r===void 0?void 0:t[r]?.type);return Array.isArray(i)?i.includes(`array`):i===`array`}function Pn(e){return Z(e)[0]?.kind??`json`}function Fn(e){return e===void 0||Object.keys(e).length===0||Z(e).length>0}function Z(e){let t=Object.entries(e??{});return[...t.flatMap(e=>Xn(e[0])?[Ln(e,`json`)]:[]),...t.flatMap(e=>Zn(e[0])?[Ln(e,`multipart`)]:[])]}function In(e,t){if(t===void 0)return j(`Default request content selected`,e[0]);let n=Q(t),r=e.find(e=>Q(e.contentType)===n);return r===void 0?N(`Request Content-Type '${t}' is not supported. Supported choices: ${e.map(({contentType:e})=>e).join(`, `)||`none`}.`):j(`Explicit request content selected`,r)}function Ln(e,t){let n=e[1].schema;return{contentType:e[0],kind:t,...n===void 0?{}:{schema:n}}}async function Rn(e,t,n){if(!e&&n==null)return j(`Optional multipart body omitted`,{});let r=zn(n);if(!r.ok||r.data===null)return N(r.summary,r.warnings);let i=new FormData;for(let e of Bn(t)){let t=r.data[e.name];if(t==null){if(e.required)return N(`Multipart body requires '${e.name}'.`)}else{if(Array.isArray(t)&&t.length<(e.schema.minItems??0))return N(`Multipart part '${e.name}' requires more entries.`);if(Array.isArray(t)&&t.length>(e.schema.maxItems??2**53-1))return N(`Multipart part '${e.name}' has too many entries.`);if(Vn(e.schema)||Hn(e.schema)){let n=Hn(e.schema)?t:[t];if(!Array.isArray(n)||n.some(e=>typeof e!=`string`))return N(`Multipart part '${e.name}' must contain file paths or URLs.`);for(let t of n){if(typeof t!=`string`)continue;let n=await Gn(t);if(!n.ok||n.data===null)return N(n.summary,n.warnings);i.append(e.name,n.data.blob,n.data.filename)}}else if(Un(e.schema,t)){let n=JSON.stringify(t);i.append(e.name,new Blob([n],{type:`application/json`}),`${e.name}.json`)}else{let n=Wn(i,e.name,t);if(!n.ok)return n}}}return j(`Multipart body prepared`,{body:i})}function zn(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=Object.fromEntries(Object.entries(e));return j(`Multipart input parsed`,t)}return N(`Multipart request body must be a JSON object keyed by form part name.`)}function Bn(e){let t=new Set(e?.required??[]);return Object.entries(e?.properties??{}).map(([e,n])=>({name:e,schema:n,required:t.has(e)}))}function Vn(e){return e.type===`string`&&e.format===`binary`}function Hn(e){return e.type===`array`&&e.items!==void 0&&Vn(e.items)}function Un(e,t){return typeof t!=`object`||!t||Array.isArray(t)?!1:e.type===`object`||typeof e.$ref==`string`&&e.$ref.length>0}function Wn(e,t,n){if(Array.isArray(n)){for(let r of n){let n=Wn(e,t,r);if(!n.ok)return n}return j(`Multipart scalar array appended`,null)}return typeof n==`object`?N(`Multipart part '${t}' must be scalar.`):(e.append(t,String(n)),j(`Multipart scalar appended`,null))}async function Gn(e){return Jn(e)?Qt()===void 0?await Kn(e):N(`MCP media URL fetching is disabled. Pass the page as sourceUrl in the JSON body instead.`):Qt()===void 0?await qn(e):N(`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 Kn(e){let t=new AbortController,n=setTimeout(()=>t.abort(),An);try{let n=new URL(e),r=await fetch(e,{signal:t.signal});if(!r.ok)return N(`Failed to fetch media URL: ${r.status} ${r.statusText}`);let i=r.headers.get(`content-type`)?.split(`;`)[0]?.trim()??Yn(n.pathname)??``,a=new Blob([await r.arrayBuffer()],{type:i});return j(`URL media fetched`,{blob:a,filename:ke(n.pathname)||`upload`})}catch(e){return t.signal.aborted?N(`Failed to fetch media URL: timed out after ${An}ms.`):N(`Failed to fetch media URL: ${e instanceof Error?e.message:String(e)}`)}finally{clearTimeout(n)}}async function qn(e){try{let t=Yn(e)??``,n=await Me(e);return j(`File media read`,{blob:new Blob([n],{type:t}),filename:ke(e)})}catch(t){return N(`Failed to read media file '${e}': ${t instanceof Error?t.message:String(t)}`)}}function Jn(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}function Yn(e){return Qn[Ae(e).toLowerCase()]}function Xn(e){let t=Q(e);return t===`*/*`||t===`application/json`||t.endsWith(`+json`)}function Zn(e){return Q(e)===`multipart/form-data`}var Q=e=>e.split(`;`)[0]?.trim().toLowerCase()??``,Qn={".gif":`image/gif`,".heic":`image/heic`,".heif":`image/heif`,".jpeg":`image/jpeg`,".jpg":`image/jpeg`,".png":`image/png`,".webp":`image/webp`};function $n(e,t,n){let r=new Map,i=(t,a,o)=>{let s=X(t);if(a>n||s!==void 0&&o.includes(s))return;let c=s===void 0?o:[...o,s],l=tr(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(er(n.content),0,[]);return r}function er(e){return e?.[`application/json`]?.schema??Object.values(e??{}).find(e=>e.schema!==void 0)?.schema}function tr(e,t){let n=X(t);return{...n===void 0?void 0:e.components.schemas[n],...t}}function nr(e){if(e===`private`||typeof e==`object`&&(e.scope===`private`||e.value===`private`))return`private`}function rr(e){return e===`write`||e===`delete`}function ir(e){return rr(e)||e===`job`}function ar(e,t){return e===`DELETE`||t===`delete`}var or=`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 sr(e,t){let n=e===`array`?t:e;return n===void 0||n===`string`}function cr(e){let t=e.operation[`x-aventure-tool`];if(!mr(e.path,e.operation,e.method===`GET`&&t?.auth===`none`,e.includeBinary===!0))return null;let n=pr(e.operation.operationId),r=Tr(e.path,n),i=fr(r,n,e.method),a=lr(e.method,e.operation);if(a===null)return null;let o=t?.auth===`read`&&i===`write`?`lookup`:i,s=e.method===`GET`||a===`read`||a===`none`;return{resource:Er(e.path),intent:o,cliPath:r,scope:s&&!rr(o)?`read`:`write`,auth:a,visibility:nr(e.operation[`x-aventure-visibility`]),mutates:t?.mutates===!0||void 0,stdinBody:e.operation.requestBody!==void 0&&Pn(e.operation.requestBody.content)===`json`,destructive:ar(e.method,o)}}function lr(e,t){let n=t[`x-aventure-tool`]?.auth;if(n===`none`)return`none`;if(n===`read`)return`read`;if(e===`GET`&&(t.security?.length??0)===0)return`none`;let r=!1,i=!1,a=!1;for(let e of t.security??[]){let t=Object.keys(e);t.includes(`clientSecretAuth`)&&(r=!0),t.includes(`adminApiKeyAuth`)&&(a=!0),(t.includes(`bearerAuth`)||t.includes(`clerkApiKeyAuth`))&&(i=!0)}return e===`GET`&&r||r&&!a&&!i?`read`:a?`write`:i?`bearer`:e===`GET`?`read`:null}var ur={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`},dr=`status`;function fr(e,t,n){if(e.length===1&&e[0]===dr)return`status`;let r=Object.hasOwn(ur,t)?ur[t]:void 0;return r===void 0?n===`GET`?`read`:n===`DELETE`?`delete`:`write`:r}function pr(e){let t=/^[a-z]+/u.exec(e)?.[0];if(t===void 0)throw Error(`operationId '${e}' has no verb`);return t}function mr(e,t,n,r){return hr(e)&&t.hidden!==!0&&(n||!gr.some(t=>t.test(e)))&&Fn(t.requestBody?.content)&&(xr(t.responses)||r&&br(t))}function hr(e){return e.startsWith(`/v1/`)||e.startsWith(`/v2/`)}var gr=[/^\/v1\/auth\/(?:session|login|ui|registrations|password-resets|cli-authorizations)(?:\/|$)/u,/^\/v1\/addresses\/locations(?:\/|$)/u,/^\/v1\/entities\/\{entityId\}\/sites$/u,/^\/v1\/(?:chat\/completions|embeddings)$/u,/^\/v1\/observability(?:\/|$)/u,/^\/v1\/media\/identicons(?:\/|$)/u];function _r(e){return e!==`/v1/auth/api-key`&&!/^\/v1\/sitemap(?:\/|$)/u.test(e)}var vr=/(?:^|-)(?:runs|jobs)$/u;function yr(e){switch(e.intent){case`read`:case`lookup`:case`search`:case`status`:case`job`:return e.intent;case`write`:{let t=pr(e.operationId);return t===`enrich`||t===`create`&&vr.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 br(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=>wr(e.schema)))}function xr(e){return Object.entries(e).filter(([e])=>e.startsWith(`2`)).every(([,e])=>Sr(e.content))}function Sr(e){if(e===void 0)return!0;let t=Object.entries(e);return t.length===0||t.some(([e,t])=>Cr(e)&&!wr(t.schema))}function Cr(e){return e===`*/*`||e===`application/json`||e.endsWith(`+json`)}function wr(e){return e?.format===`byte`||e?.format===`binary`}function Tr(e,t){let n=kr(e).map($),r=n.length===1&&t===`get`&&!e.includes(`{`),i=n.some(e=>e.split(`-`).includes(t));return r||i?n:[...n,t]}function Er(e){return $(kr(e).at(0)??`system`)}function Dr(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 Or=e=>`--${$(e)}`;function kr(e){return Ar(e).filter(e=>!jr(e)&&!Mr(e))}function Ar(e){return e.split(`/`).filter(e=>e.length>0)}function jr(e){return/^v\d+$/u.test(e)}function Mr(e){return e.startsWith(`{`)&&e.endsWith(`}`)}export{en as A,Yt as B,Dn as C,Tn as D,On as E,Ft as F,Xt as I,Zt as L,tn as M,rn as N,X as O,nn as P,Jt as R,En as S,cn as T,We as V,Z as _,sr as a,q as b,rr as c,$ as d,yr as f,jn as g,Mn as h,ir as i,$t as j,Qt as k,Dr as l,$n as m,ur as n,Or as o,cr as p,br as r,ar as s,or as t,_r as u,Nn as v,wn as w,sn as x,In as y,Gt as z};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aventurevc/aventure-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.234",
|
|
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": "7fcb138bbbaa3ccad314f65776d6888c5e66f312",
|
|
37
37
|
"openapiPath": "openapi/openapi.json",
|
|
38
|
-
"openapiSha256": "
|
|
38
|
+
"openapiSha256": "c3a7326f9ac1b0d8984f74bff5b25098b39a3fa6ed0554a90410d7c2287f93b4"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {}
|
|
41
41
|
}
|