@aventurevc/aventure-cli 0.8.531 → 0.8.533
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/{agent-help-text-BkAN4M9o.js → agent-help-text-DRuk0A-w.js} +1 -1
- package/dist/chunks/{api-key-credential-verification-WaLW2yqt.js → api-key-credential-verification-BcNzbMPb.js} +1 -1
- package/dist/chunks/{api-key-credential-verification-D-E27i22.js → api-key-credential-verification-Cg9cwCrB.js} +1 -1
- package/dist/chunks/{api-key-login-DFemEvRB.js → api-key-login-BDiH7JA3.js} +1 -1
- package/dist/chunks/{auth-status-check-BhY4xNjL.js → auth-status-check-DqarLsts.js} +1 -1
- package/dist/chunks/{auth-status-check-BftjEZ3u.js → auth-status-check-DtxPBiOm.js} +1 -1
- package/dist/chunks/{auth-status-render-DIVGaJj3.js → auth-status-render-Cb1KYPLG.js} +1 -1
- package/dist/chunks/{aventure-cli-Cf2eOVFv.js → aventure-cli-DgqhT6JE.js} +5 -5
- package/dist/chunks/{batch-io-D3x-Xn3F.js → batch-io-DMBP5izn.js} +1 -1
- package/dist/chunks/{builtin-auth-DLAH1wpm.js → builtin-auth--rkmP0Cj.js} +4 -4
- package/dist/chunks/{builtin-run-wait-CvKtSOr8.js → builtin-run-wait-Sr5UWSN_.js} +1 -1
- package/dist/chunks/{builtin-update-0JHbXm0K.js → builtin-update-C4JXKQVi.js} +1 -1
- package/dist/chunks/{completion-B-eCcy0a.js → completion-BIhulkci.js} +1 -1
- package/dist/chunks/{contract-CbON6Uz8.js → contract-nURcinLo.js} +1 -1
- package/dist/chunks/detail-5ECrsBKB.js +1 -0
- package/dist/chunks/detail-C7sfTADC.js +1 -0
- package/dist/chunks/{generated-body-ChoBBL3I.js → generated-body-Bc_kLSrA.js} +1 -1
- package/dist/chunks/{help-catalog-Bjhn-ewU.js → help-catalog-Cp4yosag.js} +1 -1
- package/dist/chunks/{help-intent-BrXOSWlJ.js → help-intent-B4qM6cF8.js} +1 -1
- package/dist/chunks/logout-BO2n_PKZ.js +1 -0
- package/dist/chunks/{logout-CkueWLsD.js → logout-Dhgju6ME.js} +1 -1
- package/dist/chunks/mcp-generation-contract-CEIC_dUC.js +1 -0
- package/dist/chunks/mcp-generation-contract-eAQpFVc2.js +1 -0
- package/dist/chunks/{oauth-bearer-credential-DjhdVFy2.js → oauth-bearer-credential-C1Bhz2Ty.js} +1 -1
- package/dist/chunks/oauth-bearer-credential-CNZy4qr7.js +1 -0
- package/dist/chunks/{oauth-login-487XxoqZ.js → oauth-login-CPIh0SlO.js} +1 -1
- package/dist/chunks/{oauth-login-Cvt-vFMW.js → oauth-login-DuFobNwd.js} +1 -1
- package/dist/chunks/{openapi-call-DEEv5X3e.js → openapi-call-C2iRcDJX.js} +1 -1
- package/dist/chunks/{openapi-call-BjVDqxH4.js → openapi-call-CeTrV9YM.js} +1 -1
- package/dist/chunks/openapi-commands-BGv_TGt5.js +1 -0
- package/dist/chunks/{openapi-commands-B1Gg1yBU.js → openapi-commands-JYhjulKS.js} +1 -1
- package/dist/chunks/openapi-snapshot.json +1 -1
- package/dist/chunks/operations-catalog-D2CPgNTH.js +1 -0
- package/dist/chunks/{operations-catalog-CnDkFi3B.js → operations-catalog-DnBk2q83.js} +1 -1
- package/dist/chunks/{operations-metadata-C6L8ZK09.js → operations-metadata-CisfJTAN.js} +1 -1
- package/dist/chunks/{operations-Ca6U4SVN.js → operations-o-uJnYaE.js} +2 -2
- package/dist/chunks/{output-DxNDDd6t.js → output-DZD-Tc5G.js} +1 -1
- package/dist/chunks/{output-KfYPQWEV.js → output-Nc8E1CiO.js} +1 -1
- package/dist/chunks/{parse-error-hint-Cdf6pCPe.js → parse-error-hint-BibaKsT5.js} +1 -1
- package/dist/chunks/{search-narrowing-DnAEvwer.js → search-narrowing-CUnWZhqq.js} +1 -1
- package/dist/chunks/{startup-auth-B8_sryp0.js → startup-auth-DPpalnlP.js} +1 -1
- package/dist/chunks/{startup-auth-D62TfEIJ.js → startup-auth-DnVfIPEy.js} +1 -1
- package/dist/chunks/{text-response-BWs1H4F7.js → text-response-CgJwnvms.js} +2 -2
- package/package.json +3 -3
- package/dist/chunks/detail-BHRxGu7O.js +0 -1
- package/dist/chunks/detail-Dj2UjONb.js +0 -1
- package/dist/chunks/logout-HfADNdh-.js +0 -1
- package/dist/chunks/mcp-generation-contract-Bh7RArna.js +0 -1
- package/dist/chunks/mcp-generation-contract-CR5XkRxd.js +0 -1
- package/dist/chunks/oauth-bearer-credential-DTPR6s9N.js +0 -1
- package/dist/chunks/openapi-commands-Zk9q7Wbr.js +0 -1
- package/dist/chunks/operations-catalog-CJc8y5jI.js +0 -1
|
@@ -13,5 +13,5 @@ import{a as e}from"./package-DEeHDoOT.js";import{C as t,S as n,_ as r,c as i,d a
|
|
|
13
13
|
`),120-n.length,_-g.byteLength(n.map(e=>`${e}\n`).join(``),`utf8`),t).join(`
|
|
14
14
|
`)}${e.endsWith(`
|
|
15
15
|
`)?`
|
|
16
|
-
`:``}`,n,t),re=new Set([`core`,`nameFull`,`nameBrand`,`name`,`title`,`fundingDetail`,`round`,`dateAnnounced`,`amountRaised`,`person`,`fundraiseRound`]),ie=5,S=(e,t=``,n)=>e===`mcp`?`see structuredContent.data.response${t}`:n??`read it whole with --data --to-file <path>`,ae=(e,t)=>e===`mcp`?`inspect structuredContent.data, or call aventure_help with q set to your intent for a narrower read and its query arguments.`:t??`read it whole with --data --to-file <path> or the section's sub-resource operation.`;function oe(e,t,n=_,{transport:r=`cli`,...i}={}){let a=e=>e.length<=t&&v(e,n);if(a(e))return e;i.onOmission?.();let o=se(e),s=e=>[...ce(o,e-1,S(r,``,i.exactRecovery)),`... output folded to fit 120 lines and ${_} UTF-8 bytes; "(+N lines)" and "N more" mark hidden content in the named section; ${ae(r,i.exactRecovery)}`],c=2,l=t,u=s(c);for(;c<=l;){let e=Math.floor((c+l)/2),t=s(e);a(t)?(u=t,c=e+1):l=e-1}return u}function se(e){let t={line:``,child:[]},n=[{node:t,indent:-1}];for(let t of e){let e=T(t);for(;n.length>1&&(n.at(-1)?.indent??-1)>=e;)n.pop();let r={line:t,child:[]};n.at(-1)?.node.child.push(r),n.push({node:r,indent:e})}return t.child}var C=new WeakMap,w=e=>{let t=C.get(e);if(t!==void 0)return t;let n=e.child.reduce((e,t)=>e+w(t),1);return C.set(e,n),n},T=e=>e.length-e.trimStart().length,E=/^(?:- ?|\d+\.(?: |$))/u,D=e=>(e.line.trimStart().replace(E,``).split(/[:= ]/u)[0]??``).split(`.`).at(-1)?.replace(/\[\d+\]$/u,``)??``,O=e=>re.has(D(e)),k=e=>O(e)||!j(e)&&e.child.some(k),A=e=>O(e)?w(e):k(e)?e.child.reduce((e,t)=>e+A(t),1):1,j=e=>E.test(e.line.trimStart()),M=e=>e.line.trimStart().startsWith(`... `),N=e=>[e.line,...e.child.flatMap(N)];function ce(e,t,n){if(e.reduce((e,t)=>e+w(t),0)<=t)return e.flatMap(N);if(!e.some(j)||!e.every(e=>j(e)||M(e)))return de(e,t,n);let r=e.filter(M).map(({line:e})=>e);return[...ue(e.filter(j),t-r.length,n),...r]}function le(e,t,n){if(t>=w(e))return N(e);if(t<=1){let t=e.child.map(D).filter(Boolean).join(`, `)||`nested content`;return[`${e.line} (+${w(e)-1} lines) omitted: ${t}; ${n}`]}return[e.line,...ce(e.child,t-1,n)]}function ue(e,t,n){let r=Math.max(1,Math.floor((t-1)/Math.min(e.length,ie))),i=[],a=0;for(let o of e){let e=Math.min(r,w(o));if(i.length+e>t-1)break;i.push(...le(o,e,n)),a+=1}let o=` `.repeat(T(e[0]?.line??``));return a===e.length?i:[...i,`${o}... ${e.length-a} more items omitted; ${n}`]}function de(e,t,n){let r=e=>e.reduce((e,t)=>e+A(t),0);if(e.length>t||r(e)>t&&e.some(e=>A(e)===1)){let i=e.toSorted((e,t)=>Number(k(t))-Number(k(e))||w(e)-w(t)).slice(0,Math.max(0,t-1));for(;i.length>1&&A(i.at(-1)??e[0]??{line:``,child:[]})===1&&r(i)>t-1;)i.pop();let a=` `.repeat(T(e[0]?.line??``)),o=de(e.filter(e=>i.includes(e)),t-1,n),s=e.filter(e=>!i.includes(e)).map(D),c=s.slice(0,10).join(`, `),l=s.length>10?`, ...`:``;return[...o,`${a}... ${s.length} more fields: ${c}${l}`]}let i=e.map(e=>({node:e,allotted:1})),a=t-e.length,o=(e,t)=>e.forEach((n,r)=>{let i=Math.min(t(n.node)-n.allotted,Math.floor(a/(e.length-r)));n.allotted+=i,a-=i});return o(i.filter(({node:e})=>A(e)>1).toSorted((e,t)=>A(e.node)-A(t.node)),A),o(i.toSorted((e,t)=>w(e.node)-e.allotted-(w(t.node)-t.allotted)),w),i.flatMap(({node:e,allotted:t})=>le(e,t,n))}var fe=s([`PAID_PLAN`,`DAILY_ALLOWANCE`]),pe=s([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),me=Object.assign(t([pe,n()]),{enum:pe.enum}),he=r({billingAccess:fe.nullish(),excerpt:n(),sourceId:n(),sourceType:me,sourceVersion:n().nullish()}),ge=r({instruction:n(),operationId:n(),planTaskKey:c(n()).optional(),publishesAnalysis:i().optional(),stepKey:n().optional(),title:n().nullish()}),_e=r({body:n(),expectation:n(),method:c(n()),override:n(),reject:c(n()),typeCatalog:n()}),ve=r({cliCommand:n(),mcpTool:n().nullish(),step:ge,title:n().nullish(),writeGuidance:_e.nullish()}),ye=s([`ENTITY`,`NEWS`,`TEXT`,`FACT`,`WRITER_BRIEF`]),be=Object.assign(t([ye,n()]),{enum:ye.enum}),xe=r({allowedValue:n().nullish(),description:n(),key:n(),required:i().default(!0).optional(),type:be}),P=r({catalogRevision:a().optional(),gateId:c(n()).optional(),input:c(xe),noWriteCompletion:i().optional(),noWriteOutcome:c(l).optional(),step:c(ve),taskKey:n().optional()}),F=s([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),Se=r({candidate:c(he),operationId:n().nullish(),outcome:F,probability:o().nullish(),taskKey:n().nullish(),taskPlan:P.nullish()}),Ce=r({answer:n(),citation:c(he),confidence:u,resolution:Se.nullish()}),I=2,we=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 L(e,t){let n=V(t);if(n.length!==0){e.add(n),(n===`individual`||n===`individuals`)&&L(e,`person`);for(let t of Te(n))R(e,t,n);R(e,Ee(n),n)}}function Te(e){if(e===`people`)return[`person`];let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=I&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return[`${t}y`];let n=e.endsWith(`es`)?e.slice(0,-2):``;return n.length>=I&&n!==`us`&&/(?:s|ss|sh|ch|x|z)$/u.test(n)?[n,`${n}e`]:e.length>I&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`?[e.slice(0,-1)]:[]}function Ee(e){if(e===`person`)return`people`;if(e!==`new`&&e!==`news`&&e!==`status`&&e!==`us`){if(e.length>=I&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e))return`${e.slice(0,-1)}ies`;if(!(e.length>=I&&e.endsWith(`es`)))return e.length>=I&&/(?:s|ss|sh|ch|x|z)$/u.test(e)?`${e}es`:e.endsWith(`s`)?void 0:`${e}s`}}function R(e,t,n){t!==void 0&&t!==n&&t.length>=I&&/^[a-z]+$/u.test(t)&&e.add(t)}function z(e){let t=new Set(B(e)),n=Array.from(t);for(let e of n)L(t,e);return t}function De(e){return B(e).map(z)}function Oe(e,t){if(e.length===0)return!1;let n=z(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function B(e){return V(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!we.has(e))}function V(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 H(e,t){return e.map(e=>{let n=e.requestBody??[],r=[...e.parameters.map(e=>U(e)),...n.flatMap(e=>e.parameter.map(t=>U(t,n.length>1?e.contentType:void 0))),...ke(n)],i=[t,...e.cliPath].join(` `),a=e.mutates===!0||m(e.intent),o=n[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:a,destructive:ee(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse?null:f(e,`public`),body:{hasBody:o!==void 0,kind:o?.kind??null,...o!==void 0&&n.length>1?{contentType:o.contentType}:{},required:o?.required??!1,description:o?.description??``,requiredPath:o?.requiredPath??[]},flags:r,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},...e.header===void 0||e.header.length===0?{}:{header:e.header},summary:e.summary,description:e.description,...e.deprecated===void 0?{}:{deprecated:e.deprecated}}})}function U(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 ke(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 W(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var Ae=[`-id`,`-slug`,`-url`],je=[`--id`,`--slug`,`--url`],Me=`--from-file "<path>"`;function Ne(t,n,r=e().bin[0]){let i=H(n,r),a=i.find(e=>e.operationId===t);return a===void 0?[]:Fe(a,i)}function G(t,n,r=e().bin[0]){let i=n.find(e=>e.operationId===t),[a]=i===void 0?[]:H([i],r);return a&&K(a,Re(a,!1))}function Pe(t,n,r,i=e().bin[0]){let a=e=>{let t=e.findIndex((e,t)=>r[t]!==e);return t===-1?e.length:t},o=`${r[0]} get`,[s,c]=n.filter(({method:e,path:n,parameters:r,cliPath:i})=>{let s=r.filter(({location:e})=>e===`path`),[c]=s;return e===`GET`&&s.length===1&&c?.flag.split(/\s+/u)[0]===t&&n.endsWith(`/{${c.name}}`)&&(a(i)>1||i.join(` `)===o)}).toSorted((e,t)=>a(t.cliPath)-a(e.cliPath));if(s!==void 0&&(c===void 0||a(c.cliPath)!==a(s.cliPath)))return G(s.operationId,n,i)}function K(e,t){return[e.cli.command,...t,`--data`].join(` `)}function Fe(e,t){return[`example: ${K(e,Re(e))}`,...Ie(e,t)]}function Ie(e,t){return W(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} ${Be(i)} --data`;return[`lookup: ${e.name} from a slug: ${a}`]})}var Le=/(?:^|\.)text$/u;function Re(e,t=!0){let n=W(e),r=n.filter(e=>e.required),i=e.body.kind===`json`&&n.some(e=>e.location===`body`&&Le.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(Be);return i||(e.body.required||e.body.requiredPath.length>0)&&!a.some(e=>e.location===`body`)?[...o,Me]:o}function ze(e){let t=new Set;L(t,e.resource);for(let n of Ae)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 je){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function Be(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}function q(e,t,n=t.inputName){if(t.in===`body`)return n;let r=Xe.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?Ye(Y(n!==`id`&&n!==`slug`?n:`${Ue(e.path)}${Ke(n)}`),t):r.inputName}function J(e,t,n=Ge(e)){return Ve(We(e,t),new Set(n))}function Ve(e,t){if(!t.has(e)&&!/^no[A-Z]/u.test(e))return e;let n=`body${Ke(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function He(e,t,n){return`${e}[${t}].${n}`}function Ue(e){return Ze.find(([,t])=>t.test(e))?.[0]??`record`}function We(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=qe(t);return Ye(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?Y(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function Ge(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>q(e,t)))}function Ke(e){return e.replace(/^./u,e=>e.toUpperCase())}function Y(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 qe(e){let t=Y(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?Je(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function Je(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function Ye(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var Xe=[{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`}],Ze=[[`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 Qe(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>$e(t,q(e,t))),r=(t?.parameter??[]).map(t=>$e(t,J(e,t)));return{selector:n.filter(e=>e.location===`path`||et(e)),pagination:n.filter(tt),filter:[...n.filter(X),...r.filter(X)],body:r.filter(e=>!X(e))}}function $e(e,t){let{in:n,inputName:r,nullable:i,...a}=e;return{...a,flag:d(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function et(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function tt(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function X(e){return e.location!==`path`&&!et(e)&&!tt(e)}function Z(e){let t=st(e);return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,tool:p(e),scope:e.projection.scope,requiredInput:at(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))],...t===void 0?{}:{paidPlan:t}}}function nt(e,t){let n=e.requestBody?.[0];return t?{...Z(e),description:e.description,resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:Qe(e)}:{...Z(e),optionalInput:ot(e),arrayInput:ct(e)}}function rt(e){let t=Qe(e),n=e=>e.filter(e=>e.required);return{...nt(e,!1),description:e.description,arrayInput:void 0,optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function it(e){let{cli:t,scope:n,...r}=Z(e);return{...r,optionalDetailOmitted:!0}}function at(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function ot(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 st(e){return e.response.find(({status:e})=>e===`402`)?.description}function ct(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var lt=160,Q=`Operation catalog matches`,ut=[`whole`,`described`,`requiredDescribed`,`optionalNamed`,`optionalGrouped`],dt=e=>`${[Q,...e].join(`
|
|
16
|
+
`:``}`,n,t),re=new Set([`core`,`nameFull`,`nameBrand`,`name`,`title`,`fundingDetail`,`round`,`dateAnnounced`,`amountRaised`,`person`,`fundraiseRound`]),ie=5,S=(e,t=``,n)=>e===`mcp`?`see structuredContent.data.response${t}`:n??`read it whole with --data --to-file <path>`,ae=(e,t)=>e===`mcp`?`inspect structuredContent.data, or call aventure_help with q set to your intent for a narrower read and its query arguments.`:t??`read it whole with --data --to-file <path> or the section's sub-resource operation.`;function oe(e,t,n=_,{transport:r=`cli`,...i}={}){let a=e=>e.length<=t&&v(e,n);if(a(e))return e;i.onOmission?.();let o=se(e),s=e=>[...ce(o,e-1,S(r,``,i.exactRecovery)),`... output folded to fit 120 lines and ${_} UTF-8 bytes; "(+N lines)" and "N more" mark hidden content in the named section; ${ae(r,i.exactRecovery)}`],c=2,l=t,u=s(c);for(;c<=l;){let e=Math.floor((c+l)/2),t=s(e);a(t)?(u=t,c=e+1):l=e-1}return u}function se(e){let t={line:``,child:[]},n=[{node:t,indent:-1}];for(let t of e){let e=T(t);for(;n.length>1&&(n.at(-1)?.indent??-1)>=e;)n.pop();let r={line:t,child:[]};n.at(-1)?.node.child.push(r),n.push({node:r,indent:e})}return t.child}var C=new WeakMap,w=e=>{let t=C.get(e);if(t!==void 0)return t;let n=e.child.reduce((e,t)=>e+w(t),1);return C.set(e,n),n},T=e=>e.length-e.trimStart().length,E=/^(?:- ?|\d+\.(?: |$))/u,D=e=>(e.line.trimStart().replace(E,``).split(/[:= ]/u)[0]??``).split(`.`).at(-1)?.replace(/\[\d+\]$/u,``)??``,O=e=>re.has(D(e)),k=e=>O(e)||!j(e)&&e.child.some(k),A=e=>O(e)?w(e):k(e)?e.child.reduce((e,t)=>e+A(t),1):1,j=e=>E.test(e.line.trimStart()),M=e=>e.line.trimStart().startsWith(`... `),N=e=>[e.line,...e.child.flatMap(N)];function ce(e,t,n){if(e.reduce((e,t)=>e+w(t),0)<=t)return e.flatMap(N);if(!e.some(j)||!e.every(e=>j(e)||M(e)))return de(e,t,n);let r=e.filter(M).map(({line:e})=>e);return[...ue(e.filter(j),t-r.length,n),...r]}function le(e,t,n){if(t>=w(e))return N(e);if(t<=1){let t=e.child.map(D).filter(Boolean).join(`, `)||`nested content`;return[`${e.line} (+${w(e)-1} lines) omitted: ${t}; ${n}`]}return[e.line,...ce(e.child,t-1,n)]}function ue(e,t,n){let r=Math.max(1,Math.floor((t-1)/Math.min(e.length,ie))),i=[],a=0;for(let o of e){let e=Math.min(r,w(o));if(i.length+e>t-1)break;i.push(...le(o,e,n)),a+=1}let o=` `.repeat(T(e[0]?.line??``));return a===e.length?i:[...i,`${o}... ${e.length-a} more items omitted; ${n}`]}function de(e,t,n){let r=e=>e.reduce((e,t)=>e+A(t),0);if(e.length>t||r(e)>t&&e.some(e=>A(e)===1)){let i=e.toSorted((e,t)=>Number(k(t))-Number(k(e))||w(e)-w(t)).slice(0,Math.max(0,t-1));for(;i.length>1&&A(i.at(-1)??e[0]??{line:``,child:[]})===1&&r(i)>t-1;)i.pop();let a=` `.repeat(T(e[0]?.line??``)),o=de(e.filter(e=>i.includes(e)),t-1,n),s=e.filter(e=>!i.includes(e)).map(D),c=s.slice(0,10).join(`, `),l=s.length>10?`, ...`:``;return[...o,`${a}... ${s.length} more fields: ${c}${l}`]}let i=e.map(e=>({node:e,allotted:1})),a=t-e.length,o=(e,t)=>e.forEach((n,r)=>{let i=Math.min(t(n.node)-n.allotted,Math.floor(a/(e.length-r)));n.allotted+=i,a-=i});return o(i.filter(({node:e})=>A(e)>1).toSorted((e,t)=>A(e.node)-A(t.node)),A),o(i.toSorted((e,t)=>w(e.node)-e.allotted-(w(t.node)-t.allotted)),w),i.flatMap(({node:e,allotted:t})=>le(e,t,n))}var fe=s([`PAID_PLAN`,`DAILY_ALLOWANCE`]),pe=s([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),me=Object.assign(t([pe,n()]),{enum:pe.enum}),he=r({billingAccess:fe.nullish(),excerpt:n(),sourceId:n(),sourceType:me,sourceVersion:n().nullish()}),ge=r({childOrder:s([`IN_ORDER`,`SIDE_BY_SIDE`,`CHOOSE_ONE`]).nullish(),condition:n().nullish(),instruction:n(),operationId:n(),parentStepKey:n().nullish(),planTaskKey:c(n()).optional(),publishesAnalysis:i().optional(),requiresStepKey:c(n()).optional(),stepKey:n().optional(),title:n().nullish()}),_e=r({body:n(),expectation:n(),method:c(n()),override:n(),reject:c(n()),typeCatalog:n()}),ve=r({cliCommand:n(),mcpTool:n().nullish(),step:ge,title:n().nullish(),writeGuidance:_e.nullish()}),ye=s([`ENTITY`,`NEWS`,`TEXT`,`FACT`,`WRITER_BRIEF`]),be=Object.assign(t([ye,n()]),{enum:ye.enum}),xe=r({allowedValue:n().nullish(),description:n(),key:n(),required:i().default(!0).optional(),type:be}),P=r({catalogRevision:a().optional(),gateId:c(n()).optional(),input:c(xe),noWriteCompletion:i().optional(),noWriteOutcome:c(l).optional(),step:c(ve),taskKey:n().optional()}),F=s([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),Se=r({candidate:c(he),operationId:n().nullish(),outcome:F,probability:o().nullish(),taskKey:n().nullish(),taskPlan:P.nullish()}),Ce=r({answer:n(),citation:c(he),confidence:u,resolution:Se.nullish()}),I=2,we=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 L(e,t){let n=V(t);if(n.length!==0){e.add(n),(n===`individual`||n===`individuals`)&&L(e,`person`);for(let t of Te(n))R(e,t,n);R(e,Ee(n),n)}}function Te(e){if(e===`people`)return[`person`];let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=I&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return[`${t}y`];let n=e.endsWith(`es`)?e.slice(0,-2):``;return n.length>=I&&n!==`us`&&/(?:s|ss|sh|ch|x|z)$/u.test(n)?[n,`${n}e`]:e.length>I&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`?[e.slice(0,-1)]:[]}function Ee(e){if(e===`person`)return`people`;if(e!==`new`&&e!==`news`&&e!==`status`&&e!==`us`){if(e.length>=I&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e))return`${e.slice(0,-1)}ies`;if(!(e.length>=I&&e.endsWith(`es`)))return e.length>=I&&/(?:s|ss|sh|ch|x|z)$/u.test(e)?`${e}es`:e.endsWith(`s`)?void 0:`${e}s`}}function R(e,t,n){t!==void 0&&t!==n&&t.length>=I&&/^[a-z]+$/u.test(t)&&e.add(t)}function z(e){let t=new Set(B(e)),n=Array.from(t);for(let e of n)L(t,e);return t}function De(e){return B(e).map(z)}function Oe(e,t){if(e.length===0)return!1;let n=z(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function B(e){return V(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!we.has(e))}function V(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 H(e,t){return e.map(e=>{let n=e.requestBody??[],r=[...e.parameters.map(e=>U(e)),...n.flatMap(e=>e.parameter.map(t=>U(t,n.length>1?e.contentType:void 0))),...ke(n)],i=[t,...e.cliPath].join(` `),a=e.mutates===!0||m(e.intent),o=n[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:a,destructive:ee(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse?null:f(e,`public`),body:{hasBody:o!==void 0,kind:o?.kind??null,...o!==void 0&&n.length>1?{contentType:o.contentType}:{},required:o?.required??!1,description:o?.description??``,requiredPath:o?.requiredPath??[]},flags:r,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},...e.header===void 0||e.header.length===0?{}:{header:e.header},summary:e.summary,description:e.description,...e.deprecated===void 0?{}:{deprecated:e.deprecated}}})}function U(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 ke(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 W(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var Ae=[`-id`,`-slug`,`-url`],je=[`--id`,`--slug`,`--url`],Me=`--from-file "<path>"`;function Ne(t,n,r=e().bin[0]){let i=H(n,r),a=i.find(e=>e.operationId===t);return a===void 0?[]:Fe(a,i)}function G(t,n,r=e().bin[0]){let i=n.find(e=>e.operationId===t),[a]=i===void 0?[]:H([i],r);return a&&K(a,Re(a,!1))}function Pe(t,n,r,i=e().bin[0]){let a=e=>{let t=e.findIndex((e,t)=>r[t]!==e);return t===-1?e.length:t},o=`${r[0]} get`,[s,c]=n.filter(({method:e,path:n,parameters:r,cliPath:i})=>{let s=r.filter(({location:e})=>e===`path`),[c]=s;return e===`GET`&&s.length===1&&c?.flag.split(/\s+/u)[0]===t&&n.endsWith(`/{${c.name}}`)&&(a(i)>1||i.join(` `)===o)}).toSorted((e,t)=>a(t.cliPath)-a(e.cliPath));if(s!==void 0&&(c===void 0||a(c.cliPath)!==a(s.cliPath)))return G(s.operationId,n,i)}function K(e,t){return[e.cli.command,...t,`--data`].join(` `)}function Fe(e,t){return[`example: ${K(e,Re(e))}`,...Ie(e,t)]}function Ie(e,t){return W(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} ${Be(i)} --data`;return[`lookup: ${e.name} from a slug: ${a}`]})}var Le=/(?:^|\.)text$/u;function Re(e,t=!0){let n=W(e),r=n.filter(e=>e.required),i=e.body.kind===`json`&&n.some(e=>e.location===`body`&&Le.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(Be);return i||(e.body.required||e.body.requiredPath.length>0)&&!a.some(e=>e.location===`body`)?[...o,Me]:o}function ze(e){let t=new Set;L(t,e.resource);for(let n of Ae)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 je){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function Be(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}function q(e,t,n=t.inputName){if(t.in===`body`)return n;let r=Xe.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?Ye(Y(n!==`id`&&n!==`slug`?n:`${Ue(e.path)}${Ke(n)}`),t):r.inputName}function J(e,t,n=Ge(e)){return Ve(We(e,t),new Set(n))}function Ve(e,t){if(!t.has(e)&&!/^no[A-Z]/u.test(e))return e;let n=`body${Ke(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function He(e,t,n){return`${e}[${t}].${n}`}function Ue(e){return Ze.find(([,t])=>t.test(e))?.[0]??`record`}function We(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=qe(t);return Ye(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?Y(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function Ge(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>q(e,t)))}function Ke(e){return e.replace(/^./u,e=>e.toUpperCase())}function Y(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 qe(e){let t=Y(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?Je(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function Je(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function Ye(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var Xe=[{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`}],Ze=[[`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 Qe(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>$e(t,q(e,t))),r=(t?.parameter??[]).map(t=>$e(t,J(e,t)));return{selector:n.filter(e=>e.location===`path`||et(e)),pagination:n.filter(tt),filter:[...n.filter(X),...r.filter(X)],body:r.filter(e=>!X(e))}}function $e(e,t){let{in:n,inputName:r,nullable:i,...a}=e;return{...a,flag:d(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function et(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function tt(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function X(e){return e.location!==`path`&&!et(e)&&!tt(e)}function Z(e){let t=st(e);return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,tool:p(e),scope:e.projection.scope,requiredInput:at(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))],...t===void 0?{}:{paidPlan:t}}}function nt(e,t){let n=e.requestBody?.[0];return t?{...Z(e),description:e.description,resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:Qe(e)}:{...Z(e),optionalInput:ot(e),arrayInput:ct(e)}}function rt(e){let t=Qe(e),n=e=>e.filter(e=>e.required);return{...nt(e,!1),description:e.description,arrayInput:void 0,optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function it(e){let{cli:t,scope:n,...r}=Z(e);return{...r,optionalDetailOmitted:!0}}function at(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function ot(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 st(e){return e.response.find(({status:e})=>e===`402`)?.description}function ct(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var lt=160,Q=`Operation catalog matches`,ut=[`whole`,`described`,`requiredDescribed`,`optionalNamed`,`optionalGrouped`],dt=e=>`${[Q,...e].join(`
|
|
17
17
|
`)}\n`;function ft(e,t=[],n=`mcp`){if(!Array.isArray(e)||e.length===0||!e.every(vt))return null;let r=e,i=n===`mcp`?`structuredContent.data`:`the --data --to-file <path> output`,a=e=>v([Q,...e,...t]);for(let e of ut){let t=[...r.flatMap(t=>$(t,e)),...mt(r,e,i)];if(a(t))return dt(t)}let o=(e,t=r.length-e)=>{let n=r.slice(e),a=n.length-t;return[...r.slice(0,e).flatMap(e=>$(e,`optionalGrouped`)),...mt(r.slice(0,e),`optionalGrouped`,i),...n.length===0?[]:[`... ${n.length} more operations omitted to fit ${_} UTF-8 bytes: ${[...n.slice(0,t).map(({operationId:e})=>e),...a>0?[`and ${a} more in ${i}`]:[]].join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`]]},s=[...r.keys()].findLast(e=>a(o(e)));return dt(s===void 0?o(0,[...r.keys()].findLast(e=>a(o(0,e)))??0):o(s))}var pt=e=>`call aventure_help with q=<operationId> and limit=1; inspect argument and optionalInput in ${e} for the retained inputs`;function mt(e,t,n){let r=t===`optionalGrouped`&&e.some(e=>$(e,t).some(e=>e.includes(`.{`)))?[`... optional input names sharing a prefix are grouped: a.{b, c} names a.b and a.c.`]:[];return[...ht(e,t,n),...r]}function ht(e,t,n){let r=e.flatMap(e=>`argument`in e?Object.values(e.argument).flat():[]),i=t===`whole`?0:r.filter(e=>e.description.length>lt&&(t===`described`||e.required)).length,a=i===0?[]:[`... ${i} argument descriptions shortened; inspect each row's argument in ${n} for full descriptions.`];if(e.some(e=>`optionalDetailOmitted`in e))return[...a,e.some(e=>`argument`in e)?`... optional argument details omitted: the full list exceeds the result cap; ${pt(n)}.`:`... 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 a;let o=t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`,s=r.filter(({required:e})=>!e).length;return[...a,`... ${s} ${o} omitted to fit ${_} UTF-8 bytes; ${n} carries them, and ${pt(n)}.`]}function $(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} (${e.tool})`,` ${e.summary}`,...`description`in e&&e.description?[` ${e.description}`]:[],` 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,n])=>` optional ${e}: ${gt(n,t)}`):[],...`arrayInput`in e&&e.arrayInput?.length?[` JSON array inputs: ${e.arrayInput.join(`, `)}`]:[],...`paidPlan`in e&&e.paidPlan!==void 0?[` paid plan: ${e.paidPlan}`]:[],...n.filter(({required:e})=>e||t!==`optionalNamed`&&t!==`optionalGrouped`).map(e=>_t(e,e.required||t!==`requiredDescribed`,t)),...(t===`optionalNamed`||t===`optionalGrouped`)&&r.length>0?[` optional inputs: ${gt(r,t)}`]:[]]}function gt(e,t){if(t!==`optionalGrouped`)return e.join(`, `);let n=new Map;for(let t of e){let e=n,r=t.split(`.`);r.forEach((t,n)=>{let i=e.get(t)??{end:!1,child:new Map};e.set(t,i),n===r.length-1&&(i.end=!0),e=i.child})}let r=(e,t)=>{let n=[...t.child].flatMap(([n,i])=>t.child.size===1?r(`${e}.${n}`,i):r(n,i));return[...t.end?[e]:[],...t.child.size>1?[`${e}.{${n.join(`, `)}}`]:n]};return[...n].flatMap(([e,t])=>r(e,t)).join(`, `)}function _t(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<=lt?e.description:`${e.description.slice(0,157)}...`}`:i}function vt(e){return typeof e==`object`&&!!e&&`operationId`in e&&typeof e.operationId==`string`&&`requiredInput`in e&&Array.isArray(e.requiredInput)&&`intent`in e&&`summary`in e}function yt(e){let t=t=>{let n=(`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)},n=t(`path`),r=t(`query`);return{tool:p(e),arguments:{operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:xt(e)}}}}var bt=4;function xt(e){let t=e.requestBody?.[0];if(t===void 0)return{};if(t.requiredPath.length>0||e.intent!==`lookup`||t.schemaType===`array`)return St(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>bt?[]:[[t,`<${i.join(`|`)}>`]]}))}function St(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(Ct,t);r[n.at(-1)??e]=`<${e}>`}return t}function Ct(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 wt(e){let t=st(e);return{mcpCall:yt(e),...t===void 0?{}:{paidPlan:t}}}function Tt(e){let t=Et(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function Et(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()??``}}export{_ as A,B as C,F as D,Ce as E,S as F,b as I,te as L,x as M,oe as N,P as O,ne as P,z as S,De as T,Fe as _,ft as a,L as b,it as c,q as d,He as f,Pe as g,Ne as h,wt as i,y as j,me as k,rt as l,W as m,Et as n,yt as o,Le as p,Tt as r,nt as s,Q as t,J as u,H as v,V as w,Oe as x,G as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,i as t,r as n}from"./result-envelope-vZPeiIKr.js";import{U as r,m as i,n as a,u as o}from"./tool-policy-Dv9EGGWT.js";import{n as s}from"./openapi-snapshot-DvEOY1RS.js";import{C as c,E as l,S as u,T as d,b as f,c as p,i as m,l as h,n as g,o as _,r as v,s as y,t as b,w as x,x as S}from"./help-catalog-
|
|
1
|
+
import{c as e,i as t,r as n}from"./result-envelope-vZPeiIKr.js";import{U as r,m as i,n as a,u as o}from"./tool-policy-Dv9EGGWT.js";import{n as s}from"./openapi-snapshot-DvEOY1RS.js";import{C as c,E as l,S as u,T as d,b as f,c as p,i as m,l as h,n as g,o as _,r as v,s as y,t as b,w as x,x as S}from"./help-catalog-Cp4yosag.js";var C=/\b(?:https?:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:\/\S*)?/giu,w=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/giu,T=/^[a-z0-9]+(?:-[a-z0-9]+)+$/u,E=250,D=40,O=100;function k(e,t){let n=new Set,r=[],i=/\bslugs?\b/iu.test(e),a=e.replace(w,()=>(n.add(`uuid`),` `)).replace(C,e=>{n.add(`url`);let t=e.replace(/^(?:https?:\/\/)?[^/]+/iu,``).replace(/[?#].*$/su,``).split(`/`).filter(e=>e.length>0).map(e=>e.toLowerCase()),i=t.at(-1);return i!==void 0&&T.test(i)&&(n.add(`slug`),t.pop()),r.push(...t.flatMap(e=>e.split(/[^a-z0-9]+/u))),` `}).split(/\s+/u).filter(e=>{let r=e.replace(/^[^a-z0-9]+|[^a-z0-9]+$/giu,``).toLowerCase(),a=T.test(r)&&!t.has(r)&&(i||/\d/u.test(r));return a&&n.add(`slug`),!a}).join(` `).trim(),o=/^(.+?)\s+at\s+\S/iu.exec(a)?.[1]?.toLowerCase();return{text:a,kind:n,urlPathWord:r.filter(e=>e.length>0),...o&&{affiliation:o}}}function A(e,t,n){return e===`uuid`?/(?:^id|Id)$/u.test(t)&&n.includes(`{${t}}`):t===e}function j(e,t){let n=new Set;for(let r of e){let e=new Set;f(e,r);let i=t.filter(({cliPath:t})=>e.has(t[0]??``)),a=i.length>0?i:t.filter(({cliPath:t})=>t.some(t=>e.has(t)));for(let{resource:e}of a)n.add(e)}return n}function M(e,t,n){if(n.intent!==`read`&&n.intent!==`lookup`)return 0;let r=e.affiliation,i=r&&n.directParameterName.includes(`entityId`)&&n.description.toLowerCase().includes(r)&&/\bat a company\b/iu.test(`${n.summary} ${n.description}`),a=new Set(c(n.summary)),o=i?O:0;for(let t of e.kind)n.directParameterName.some(e=>A(t,e,n.path))&&(o+=E,a.has(t)&&(o+=D));if(o===0)return 0;let s=new Set(c(`${n.summary} ${n.description}`));return(t.size>0?t.has(n.resource):e.urlPathWord.some(e=>{let t=new Set;return f(t,e),[...t].some(e=>s.has(e))}))&&(o+=O),o}var ee=40,te=4,N=3,P=1,F=new Map,I=new WeakMap;function L(e){let t=F.get(e);if(t!==void 0)return t;let n=s(),a=r(n.paths,e),o=a===null?new Map:i(n,a.operation.responses,N);return F.set(e,o),o}function R(e,t,n){let r=0,i=z(n);for(let[e,i]of n)t.has(e.toLowerCase())&&(r+=ee*(4-i)/4);for(let t of e){let e=Math.min(...[...t].map(e=>i.get(e)??1/0));e<=P&&(r+=te*(2-e))}return r}function z(e){let t=I.get(e);if(t!==void 0)return t;let n=new Map;for(let[t,r]of e){if(r>P)continue;let e=new Set;for(let n of c(t))f(e,n);for(let t of e)n.set(t,Math.min(n.get(t)??r,r))}return I.set(e,n),n}var B=5,V=.5,H=15,U=30,W=2,G=100,K=.5;function q(e,t,n){if(e.trim().length===0)return t.map(e=>({item:e,score:1}));let r=t.map(e=>({item:e,fields:n(e)})),i=k(e,new Set(r.flatMap(({fields:e})=>e.cliPath))),a=j(i.urlPathWord,r.map(({fields:e})=>e)),o=x(i.text);if(o.length===0&&i.kind.size===0)return t.map(e=>({item:e,score:1}));let s=u(o),c=d(o),l=new Set(i.text.toLowerCase().split(/[^a-z0-9]+/u));return r.map(({item:e,fields:t})=>({item:e,fields:t,score:(o.length===0?0:ne({normalizedQuery:o,tokens:s,termForm:c,queryWord:l},t))+M(i,a,t)})).filter(({score:e})=>e>0).toSorted((e,t)=>Number(e.fields.deprecated===!0)-Number(t.fields.deprecated===!0)||t.score-e.score||e.fields.cliPath.length-t.fields.cliPath.length||e.fields.cliPath.join(` `).localeCompare(t.fields.cliPath.join(` `))||e.fields.operationId.localeCompare(t.fields.operationId)).map(({item:e,score:t})=>({item:e,score:t}))}var J=new WeakMap;function Y(e){let t=J.get(e);if(t!==void 0)return t;let n=e.requestBody??[],r=[...e.parameter,...n.flatMap(e=>e.parameter)],i=!o(e.intent)||`written`,a={...e,cliPath:e.projection.cliPath,enumParameter:r.map(e=>({values:e.itemSchemaEnum??e.schemaEnum??[],direct:e.name===e.inputName&&(e.in!==`body`||i)})),parameterName:r.flatMap(e=>[e.name,e.inputName]),directParameterName:e.parameter.map(e=>e.name),parameterDescription:[...r,...n].map(({description:e})=>e),responseFieldLevel:L(e.operationId)};return J.set(e,a),a}function X(n,r){let i=n.q?.trim()??``,a=q(i,r.filter(e=>Z(n,e)&&(i.length>0||e.deprecated!==!0)),Y),o=(a[0]?.score??0)*V,s=a.filter(({score:e})=>e>=o),c=n.limit===void 0||!Number.isFinite(n.limit)?B:n.limit,l=Math.min(s.length,Math.max(0,Math.trunc(c))),u=s.slice(0,l).map(({item:e})=>e),d={totalOperations:r.length,matched:s.length,returned:u.length},f=u.length===1,m=u.map(e=>y(e,f)),g=e(b,m,{counts:d}),_=t(g),v=f?u.map(h):u.map(p);return{summary:b,data:_?m:v,counts:d}}function Z(e,t){let{root:n}=e;return!(e.method!==void 0&&t.method!==e.method||e.scope!==void 0&&t.projection.scope!==e.scope||n&&t.resource!==n&&t.projection.cliPath[0]!==n)}function ne({normalizedQuery:e,tokens:t,termForm:n,queryWord:r},i){let a=oe(i),s=ie(i),l=0;a.some(t=>t===e)&&(l+=100),a.some(t=>t.includes(e))&&(l+=40),l+=ae(e,a);let u=new Set(a.flatMap(c)),d=new Set(s.flatMap(c));for(let e of t)a.some(t=>t===e)?l+=20:d.has(e)?l+=8:u.has(e)&&(l+=W);for(let e of i.cliPath){let n=new Set;for(let t of e.split(`-`))f(n,t);[...n].some(e=>t.has(e))&&(l+=H)}S(n,s)&&(l+=200),n.length>1&&s.some(t=>t.includes(e))&&(l+=G),i.parameterName.some(t=>x(t)===e)&&(l+=U);let p=new Set(i.parameterDescription.flatMap(c));for(let e of t)p.has(e)&&(l+=W);return l+=ce(t,i.enumParameter,$(r)),[`list`,`search`,`find`,`browse`].some(e=>t.has(e))&&/^(?:list|search)[A-Z]/u.test(i.operationId)&&(l+=30),l+=R(n,r,i.responseFieldLevel),l-=se(e,t,i.description),o(i.intent)&&!$(r)?l*K:l}var re=`edit change set fix rename link unlink mark publish correct`.split(` `),Q=new Set([...Object.entries(a).filter(([,e])=>o(e)).map(([e])=>e),...re]);function $(e){return[...e].some(e=>Q.has(e))}function ie(e){return[e.operationId,e.cliPath.join(` `),e.summary].map(x).filter(e=>e.length>0)}function ae(e,t){let n=c(e),r=0;for(let e=0;e<n.length-1;e+=1){let i=n.slice(e,e+2).join(` `);t.some(e=>e.includes(i))&&(r+=24)}return r}function oe(e){return[...new Set([e.operationId,e.method,e.path,e.resource,e.intent,e.cliPath.join(` `),e.summary,(g(e.description).useFor||e.description).slice(0,240)].map(x).filter(e=>e.length>0))]}function se(e,t,n){let r=x(g(n).notFor);if(r.length===0)return 0;let i=r.includes(e)?40:0,a=new Set(c(r));for(let e of t)r===e?i+=20:a.has(e)&&(i+=8);return i}function ce(e,t,n){let r=0;for(let{values:i,direct:a}of t)i.some(t=>le(e,t))&&(r+=a===!0||a===`written`&&n?40:10);return r}function le(e,t){let n=c(t);return n.length>0&&n.every(t=>e.has(t))}function ue(e){return typeof e.data==`object`&&e.data!==null&&`response`in e.data?e.data.response:void 0}async function de(t,r,i,a){let o=t.q?.trim()??``;if(o.length===0)return n(`Provide q to resolve a request to one operation.`);let s=i.find(({resource:e,intent:t,deprecated:n})=>e===`help`&&t===`search`&&n!==!0);if(s===void 0)return n(`This build ships no help resolve operation.`);let c=await a(s,{body:{question:o,resolve:!0,...t.scope===void 0?{}:{scope:t.scope===`read`?`READ`:`WRITE`}}});if(!c.ok)return{...c,data:null};let u=l.safeParse(ue(c));if(!u.success||u.data.resolution==null)return n(`The help resolve operation returned no resolution.`,c.warnings,{httpStatus:c.httpStatus});let{answer:d,resolution:f}=u.data,p=e=>r.find(t=>t.operationId===e),h=p(f.operationId),g=f.taskPlan??void 0,y=(g?.step??[]).map(({step:e})=>({step:e,contract:p(e.operationId)})),b=[...new Set([...f.operationId!=null&&h===void 0?[f.operationId]:[],...y.filter(({contract:e})=>e===void 0).map(({step:e})=>e.operationId)])];return b.some(e=>!i.some(t=>t.operationId===e))?n(`No operation on this connection answers that request.`):e(b.length===0?`Help resolution`:`Help resolution this connection cannot finish: it cannot run ${b.join(`, `)}.`,{outcome:f.outcome,probability:f.probability,answer:d,candidate:f.candidate.filter(({sourceId:e})=>i.some(({operationId:t})=>t===e)).map(({sourceId:e})=>{let t=p(e);return t===void 0?{sourceId:e}:Object.assign({sourceId:e},m(t))}),...h===void 0?{}:{operation:{operationId:h.operationId,apiRoute:`${h.method} ${h.path}`,...v(h),...m(h)}},...(f.taskKey,{}),...g===void 0?{}:{taskPlan:{input:g.input,step:y.map(({contract:e,step:{stepKey:t,instruction:n,operationId:r}})=>Object.assign({instruction:n},e===void 0?{operationId:r}:{mcpCall:_(e)}))}}},{warnings:b.map(e=>i.some(t=>t.operationId===e)?`Operation ${e} is in this server's catalog, but your grant does not allow it.`:`Operation ${e} is outside this server's catalog, so no credential runs it here.`)})}export{L as a,de as i,q as n,X as r,Y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as logoutCliCredentials}from"./logout-Dhgju6ME.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,p as t,t as n}from"./env-BJt0rU1S.js";import{c as r,r as i}from"./result-envelope-vZPeiIKr.js";import{V as a}from"./tool-policy-Dv9EGGWT.js";import{o}from"./openapi-call-
|
|
1
|
+
import{o as e,p as t,t as n}from"./env-BJt0rU1S.js";import{c as r,r as i}from"./result-envelope-vZPeiIKr.js";import{V as a}from"./tool-policy-Dv9EGGWT.js";import{o}from"./openapi-call-CeTrV9YM.js";import{a as s,r as c}from"./api-target-vxev2RKl.js";import{i as l,n as u,s as d,t as f}from"./api-key-credential-CghLPNnh.js";import{n as p,t as m}from"./credential-redaction-CB8ReX08.js";import{n as h}from"./contract-nURcinLo.js";import{t as g}from"./openapi-composites-IdxI7cAF.js";import{c as _,f as v,m as y,n as b,r as x}from"./oauth-credential-uoAAuAGx.js";import{t as S}from"./oauth-login-DuFobNwd.js";var C=h(g,`revoke`);async function w(r){let a;try{a=c(t().host)}catch(e){return i(`auth logout: invalid API host — ${m(e)}`)}let o=await j(a),s=await E(a),l=await k(a,r),u=T(a,s,l);if(o===void 0)return u;let d={...u.data??{host:a,revoked:!1,forgotten:!1},presented:o};switch(o.state){case`revoked`:return{...u,summary:`${u.summary} The API key in ${n.authToken} is revoked; unset it in this shell.`,data:d,ids:[...u.ids,o.apiKeyId]};case`unconfirmed`:return{...i(`auth logout: revocation of the API key in ${n.authToken} was not confirmed — ${o.summary}`,[`Retry when the API is available, or revoke the key at ${e}/settings/api-keys.`]),data:d};case`notApiKey`:case`rejected`:return{...u,data:d,warnings:[...u.warnings,`${n.authToken} was not revoked — ${o.summary}; unset it in this shell.`]};default:throw Error(`Unsupported AUTH_TOKEN logout state`)}}function T(e,t,n){let a=t.state===`failed`?[`OAuth credential could not be removed — ${t.summary}`]:t.state===`forgotten`&&!t.revoked?[`OAuth refresh token was not revoked remotely — ${t.summary??`no revocation endpoint`}`]:[],o={host:e,revoked:!1,forgotten:!1,oauth:t};return n===null?t.state===`missing`?r(`No CLI credential is stored for this API host.`,o):t.state===`failed`?{...i(`auth logout: ${a[0]}`),data:o}:r(t.revoked?`OAuth credential revoked remotely and removed locally.`:`OAuth credential removed locally.`,o,{warnings:a}):{...n,data:{...n.data??o,oauth:t},warnings:[...n.warnings,...a]}}async function E(e){let t=await x(e);if(t.state===`missing`)return{state:`missing`};let n=t.state===`found`?await O(t.stored):{revoked:!1};try{await b(e)}catch(e){return{state:`failed`,summary:m(e)}}return{state:`forgotten`,...n}}async function D(e){let t=Reflect.get(await S(e),`revocation_endpoint`);return typeof t==`string`?y(t,`revocation endpoint`,!0):void 0}async function O(e){let{client:t,tokens:n}=e.credential,r=n.refresh_token??n.access_token;try{let e=await D(t);if(e===void 0)return{revoked:!1};let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:r,client_id:_(t)})});return n.ok?{revoked:!0}:{revoked:!1,summary:`revocation endpoint answered ${n.status}`}}catch(e){return{revoked:!1,summary:m(e,v(n))}}}async function k(e,t){let n;try{n=await l(e)}catch(e){return i(`auth logout: stored credential could not be read — ${m(e)}`)}if(n.state===`unavailable`)return{...i(`auth logout: ${n.summary}`),data:{host:e,revoked:!1,forgotten:!1}};if(n.state===`missing`)return null;let a=n.stored,o=await A(a),s=o.outcome===`revoked`,c=a.activation!==`active`&&o.outcome===`rejected`;if(!s&&!c&&!t.forgetLocal)return{...i(`auth logout: remote revocation was not confirmed; local credential preserved — ${o.summary}`,[`Retry when the API is available. If an earlier response was lost after revocation, the retry can be unauthorized because revoked keys cannot authenticate.`,"Use `--forget-local` only to remove local bytes while accepting that the remote key may remain active."]),data:N(a,!1,!1)};try{if((await u(a)).state===`changed`)return{...i(`auth logout: local credential changed during logout; current credential preserved, logout incomplete`,[o.summary]),data:N(a,s,!1)}}catch(e){return{...i(`auth logout: local credential removal failed — ${m(e,[a.credential.secret])}`,[s?"The remote key is revoked. Re-run with `--forget-local` to retry local cleanup.":`Remote revocation was not confirmed; inspect auth status before retrying.`]),data:N(a,s,!1)}}return r(s?`API key revoked remotely and removed locally.`:c?`Stale pending CLI credential removed; its remote key can no longer authenticate and unacknowledged keys expire at the authorization deadline.`:`API key removed locally without confirmed remote revocation.`,N(a,s,!0),{ids:[a.credential.apiKey.id],warnings:s||c?[]:[`Remote revocation was not confirmed; the API key may remain active.`]})}async function A(e){let t=await M(e.credential.secret);return t.apiKey===null?t:t.apiKey.id!==e.credential.apiKey.id||t.apiKey.subject!==e.credential.apiKey.subject?{outcome:`unconfirmed`,summary:`remote response did not match the stored API key identity`}:t}async function j(e){let n=t().userBearerToken?.trim();if(n===void 0||n.length===0)return;let r=await l(e);if(r.state===`found`&&r.stored.credential.secret===n)return;let i=await M(n);return i.outcome===`revoked`&&i.apiKey!==null?{state:`revoked`,apiKeyId:i.apiKey.id}:i.refused?{state:`notApiKey`,summary:i.summary}:{state:i.outcome===`rejected`?`rejected`:`unconfirmed`,summary:i.summary}}async function M(e){let n={apiKey:null,refused:!1},r=s(t());try{let t=await o(r,{method:C.method,path:a(C.path,{},C.operationId),headers:{Authorization:`Bearer ${e}`}},d);if(t.ok&&t.redirect)return{...n,outcome:`unconfirmed`,summary:`remote key revocation returned unexpected redirect ${t.status}`};if(!t.ok){let r=t.problem.type!==`about:blank`,i=r&&t.problem.status===401;return{...n,outcome:i?`rejected`:`unconfirmed`,refused:r&&t.problem.status===403,summary:p(t.problem,[e])}}let i={id:t.data.id,subject:t.data.subject};return t.data.status===`REVOKED`?{apiKey:i,refused:!1,outcome:`revoked`,summary:`remote key revocation confirmed`}:{apiKey:i,refused:!1,outcome:`unconfirmed`,summary:`remote response did not confirm REVOKED status`}}catch(t){return{...n,outcome:`unconfirmed`,summary:m(t,[e])}}}function N(e,t,n){return{host:e.host,apiKeyId:e.credential.apiKey.id,activation:f(e.activation),revoked:t,forgotten:n}}export{A as n,w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{r as MCP_GENERATION_CONTRACT}from"./mcp-generation-contract-eAQpFVc2.js";
|