@aventurevc/aventure-cli 0.8.418 → 0.8.419
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-CvosKpYR.js → api-key-bearer-credential-D5Hbqfm3.js} +1 -1
- package/dist/chunks/{api-key-bearer-credential-BLyU60pX.js → api-key-bearer-credential-YJPeAheU.js} +1 -1
- package/dist/chunks/{api-key-credential-DE3-BIyE.js → api-key-credential-BzzmM-P-.js} +1 -1
- package/dist/chunks/{api-key-credential--8Qb-Iop.js → api-key-credential-Cr1aPyGV.js} +1 -1
- package/dist/chunks/{api-key-credential-verification-De3fRVwG.js → api-key-credential-verification-DmEkfVgj.js} +1 -1
- package/dist/chunks/{api-key-credential-verification-BpKqBkTM.js → api-key-credential-verification-g1VutBly.js} +1 -1
- package/dist/chunks/{api-key-login-RxgCv_D4.js → api-key-login-HZafralu.js} +1 -1
- package/dist/chunks/{auth-resolver-D3QFIxSW.js → auth-resolver-BnK4x1vt.js} +1 -1
- package/dist/chunks/auth-resolver-Csx2wedp.js +1 -0
- package/dist/chunks/{auth-status-check-BwNe9s5w.js → auth-status-check-Ba_7IER7.js} +1 -1
- package/dist/chunks/{auth-status-check-DDm_5wC2.js → auth-status-check-DRSwi9--.js} +1 -1
- package/dist/chunks/{auth-status-render-Dsvm7cou.js → auth-status-render-CWL-L_9x.js} +1 -1
- package/dist/chunks/{aventure-cli-CHDG04NJ.js → aventure-cli-BRx20tbl.js} +5 -5
- package/dist/chunks/{batch-io-Cvo7FfIs.js → batch-io-DgwZwRpQ.js} +1 -1
- package/dist/chunks/{builtin-auth-Q3OA4QDu.js → builtin-auth-QiC-7MKe.js} +4 -4
- package/dist/chunks/{builtin-run-wait-CZusd_gq.js → builtin-run-wait-B4fwnFYI.js} +1 -1
- package/dist/chunks/{builtin-update-BcierYdb.js → builtin-update-qeIeNPzz.js} +1 -1
- package/dist/chunks/{cli-help-policy-DIcX8OWu.js → cli-help-policy-BX-whN-w.js} +1 -1
- package/dist/chunks/{completion-5xuOtoKf.js → completion-DLIhx1yG.js} +1 -1
- package/dist/chunks/{contract-DLzXMUjF.js → contract-B2oibXOn.js} +1 -1
- package/dist/chunks/{contract-parameter-BUraclSS.js → contract-parameter-BsYdHniz.js} +1 -1
- package/dist/chunks/{credential-store-Cc301MYX.js → credential-store-C_2xvL4d.js} +1 -1
- package/dist/chunks/env-CC1-vnc-.js +1 -0
- package/dist/chunks/{generated-option-order-B7LYhMhj.js → generated-option-order-BNFSLEDZ.js} +1 -1
- package/dist/chunks/help-catalog-CvpHuIkW.js +2 -0
- package/dist/chunks/{help-intent-k07ioxjq.js → help-intent-CJL4NGOD.js} +1 -1
- package/dist/chunks/{logging-B8Ld27N8.js → logging-D7Z7a3sv.js} +1 -1
- package/dist/chunks/{logging-CsxFMnjR.js → logging-DqIIwQLm.js} +1 -1
- package/dist/chunks/{logout-Desb3ggn.js → logout-D9e2tc3f.js} +1 -1
- package/dist/chunks/logout-aSSPrw35.js +1 -0
- package/dist/chunks/{mcp-generation-contract-DEkLNl1V.js → mcp-generation-contract-Euuk5_0h.js} +1 -1
- package/dist/chunks/mcp-generation-contract-WwcIl8lu.js +1 -0
- package/dist/chunks/{oauth-bearer-credential-cVmD0MtO.js → oauth-bearer-credential-D0hek5Sr.js} +1 -1
- package/dist/chunks/oauth-bearer-credential-Df6NPV5V.js +1 -0
- package/dist/chunks/{oauth-credential-cg5twgQv.js → oauth-credential-D3dnMZRE.js} +1 -1
- package/dist/chunks/{oauth-credential-CfLdSioQ.js → oauth-credential-DADCv54U.js} +1 -1
- package/dist/chunks/{oauth-login-C_MkUv0M.js → oauth-login-BCU7sziS.js} +1 -1
- package/dist/chunks/{oauth-login-BTFb9GBz.js → oauth-login-BZl9R9lD.js} +1 -1
- package/dist/chunks/{openapi-call-BYFpOz0o.js → openapi-call-Bd2wUhXk.js} +1 -1
- package/dist/chunks/{openapi-call-DxJMoulQ.js → openapi-call-BiKamLmB.js} +1 -1
- package/dist/chunks/{openapi-commands-D1jAgAjr.js → openapi-commands-Cr4BN7jf.js} +1 -1
- package/dist/chunks/openapi-commands-LRER_hsQ.js +1 -0
- package/dist/chunks/openapi-snapshot.json +1 -1
- package/dist/chunks/{operations-CvCUVMg7.js → operations-Do8gJz5Y.js} +2 -2
- package/dist/chunks/{operations-catalog-Clf1COPT.js → operations-catalog-BP-bJlI2.js} +1 -1
- package/dist/chunks/operations-catalog-CtnrukD6.js +1 -0
- package/dist/chunks/{operations-metadata-B2wBuzO-.js → operations-metadata-DVXRDkYa.js} +1 -1
- package/dist/chunks/{output-Cage0cak.js → output-B8HawMKY.js} +1 -1
- package/dist/chunks/{output-CW4MMcMX.js → output-GMp6qpse.js} +1 -1
- package/dist/chunks/{parse-error-hint-gfByaVez.js → parse-error-hint-v1E3Qm0v.js} +1 -1
- package/dist/chunks/{payload-operand-guard-CsaTfY9Q.js → payload-operand-guard-BAEsdwL6.js} +1 -1
- package/dist/chunks/{private-readback-et6dKd1Z.js → private-readback-O02uf2R4.js} +1 -1
- package/dist/chunks/{startup-auth-T1fCSqHx.js → startup-auth-B_NvVcRd.js} +1 -1
- package/dist/chunks/{startup-auth-C9mdYUSd.js → startup-auth-DyRGV3vF.js} +1 -1
- package/dist/chunks/{text-response-CCGjoGEl.js → text-response-CgPFdlkn.js} +1 -1
- package/dist/chunks/{tool-policy-B-ydHkhx.js → tool-policy-BmDEaARa.js} +1 -1
- package/package.json +3 -3
- package/dist/chunks/auth-resolver-J4llJftd.js +0 -1
- package/dist/chunks/env-DtsCE2J8.js +0 -1
- package/dist/chunks/help-catalog-CKhHZ7VD.js +0 -2
- package/dist/chunks/logout-CK6Ok_if.js +0 -1
- package/dist/chunks/mcp-generation-contract-BpJGXyll.js +0 -1
- package/dist/chunks/oauth-bearer-credential-B0BWV1b5.js +0 -1
- package/dist/chunks/openapi-commands-Bfl6_8wk.js +0 -1
- package/dist/chunks/operations-catalog-DsLdU5it.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{C as t,S as n,_ as r,c as i,d as a,g as o,i as s,s as c}from"./iso-DzqMxtky.js";import{t as l}from"./confidence-CjeYTBnf.js";import{c as u,d as ee,l as te,s as d,u as ne}from"./tool-policy-B-ydHkhx.js";import{i as re,t as f}from"./human-text-cap-dR2SJQJC.js";import{n as ie,t as ae}from"./contract-parameter-BUraclSS.js";var p=2,oe=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 m(e,t){let n=v(t);if(n.length!==0){e.add(n),(n===`individual`||n===`individuals`)&&m(e,`person`);for(let t of se(n))h(e,t,n);h(e,ce(n),n)}}function se(e){if(e===`people`)return[`person`];let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=p&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return[`${t}y`];let n=e.endsWith(`es`)?e.slice(0,-2):``;return n.length>=p&&n!==`us`&&/(?:s|ss|sh|ch|x|z)$/u.test(n)?[n,`${n}e`]:e.length>p&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`?[e.slice(0,-1)]:[]}function ce(e){if(e===`person`)return`people`;if(e!==`new`&&e!==`news`&&e!==`status`&&e!==`us`){if(e.length>=p&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e))return`${e.slice(0,-1)}ies`;if(!(e.length>=p&&e.endsWith(`es`)))return e.length>=p&&/(?:s|ss|sh|ch|x|z)$/u.test(e)?`${e}es`:e.endsWith(`s`)?void 0:`${e}s`}}function h(e,t,n){t!==void 0&&t!==n&&t.length>=p&&/^[a-z]+$/u.test(t)&&e.add(t)}function g(e){let t=new Set(_(e)),n=Array.from(t);for(let e of n)m(t,e);return t}function le(e){return _(e).map(g)}function ue(e,t){if(e.length===0)return!1;let n=g(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function _(e){return v(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!oe.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 y(e,t){return e.map(e=>{let n=e.requestBody??[],r=[...e.parameters.map(e=>b(e)),...n.flatMap(e=>e.parameter.map(t=>b(t,n.length>1?e.contentType:void 0))),...de(n)],i=[t,...e.cliPath].join(` `),a=e.mutates===!0||ne(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:te(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse?null:ee(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 b(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 de(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 x(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var fe=[`-id`,`-slug`,`-url`],pe=[`--id`,`--slug`,`--url`],me=`/v1/lookup`,he=`--from-file "<path>"`;function ge(t,n,r=e().bin[0]){let i=y(n,r),a=i.find(e=>e.operationId===t);return a===void 0?[]:w(a,i)}function S(t,n,r=e().bin[0]){let i=n.find(e=>e.operationId===t),[a]=i===void 0?[]:y([i],r);return a&&C(a,E(a,!1))}function _e(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 S(s.operationId,n,i)}function C(e,t){return[e.cli.command,...t,`--data`].join(` `)}function w(e,t){return[`example: ${C(e,E(e))}`,...ve(e,t)]}function ve(e,t){return x(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} ${D(i)} --data`,o=t.find(e=>e.method===`POST`&&e.path===me),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} ${D(s)} --data, then match.owner.${e.optionKey} when status is MATCHED`]})}var T=/(?:^|\.)text$/u;function E(e,t=!0){let n=x(e),r=n.filter(e=>e.required),i=e.body.kind===`json`&&n.some(e=>e.location===`body`&&T.test(e.wireName)&&(e.required||!e.wireName.includes(`.`))),a=i?r.filter(e=>e.location!==`body`):r,o=(r.length>0||!t?a:ye(e)).map(D);return i||(e.body.required||e.body.requiredPath.length>0)&&!a.some(e=>e.location===`body`)?[...o,he]:o}function ye(e){let t=new Set;m(t,e.resource);for(let n of fe)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 pe){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function D(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}var be=s([`PAID_PLAN`,`DAILY_ALLOWANCE`]),O=s([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),k=Object.assign(t([O,n()]),{enum:O.enum}),A=r({billingAccess:be.nullish(),excerpt:n(),sourceId:n(),sourceType:k,sourceVersion:n().nullish()}),xe=r({instruction:n(),operationId:n(),planTaskKey:c(n()).optional(),publishesAnalysis:i().optional(),stepKey:n().optional(),title:n().nullish()}),j=r({body:n(),expectation:n(),method:c(n()),override:n(),reject:c(n()),typeCatalog:n()}),M=r({cliCommand:n(),mcpTool:n().nullish(),step:xe,title:n().nullish(),writeGuidance:j.nullish()}),N=s([`ENTITY`,`NEWS`,`TEXT`,`FACT`,`WRITER_BRIEF`]),Se=Object.assign(t([N,n()]),{enum:N.enum}),Ce=r({allowedValue:n().nullish(),description:n(),key:n(),required:i().default(!0).optional(),type:Se}),P=r({catalogRevision:a().optional(),gateId:c(n()).optional(),input:c(Ce),step:c(M),taskKey:n().optional()}),F=s([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),we=r({candidate:c(A),operationId:n().nullish(),outcome:F,probability:o().nullish(),taskKey:n().nullish(),taskPlan:P.nullish()}),Te=r({answer:n(),citation:c(A),confidence:l,resolution:we.nullish()});function I(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>L(t,ie(e,t))),r=(t?.parameter??[]).map(t=>L(t,ae(e,t)));return{selector:n.filter(e=>e.location===`path`||R(e)),pagination:n.filter(z),filter:[...n.filter(B),...r.filter(B)],body:r.filter(e=>!B(e))}}function L(e,t){let{in:n,inputName:r,nullable:i,...a}=e;return{...a,flag:u(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function R(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function z(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function B(e){return e.location!==`path`&&!R(e)&&!z(e)}function V(e){return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,tool:d(e),scope:e.projection.scope,requiredInput:U(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]}}function H(e,t){let n=e.requestBody?.[0],r=V(e),i=W(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:I(e)}:{...r,optionalInput:Oe(e),arrayInput:ke(e),...i===void 0?{}:{paidPlan:i}}}function Ee(e){let t=I(e),n=e=>e.filter(e=>e.required);return{...H(e,!1),arrayInput:void 0,optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function De(e){let{cli:t,scope:n,...r}=V(e),i=W(e);return{...r,...i===void 0?{}:{paidPlan:i},optionalDetailOmitted:!0}}function U(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function Oe(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 W(e){return e.response.find(({status:e})=>e===`402`)?.description}function ke(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var G=160,K=`Operation catalog matches`,Ae=[`whole`,`described`,`requiredDescribed`,`optionalNamed`,`optionalGrouped`],q=e=>`${[K,...e].join(`
|
|
2
|
-
`)}\n`;function je(e,t=[],n=`mcp`){if(!Array.isArray(e)||e.length===0||!e.every(Pe))return null;let r=e,i=n===`mcp`?`structuredContent.data`:`the --data --to-file <path> output`,a=e=>re([K,...e,...t]);for(let e of Ae){let t=[...r.flatMap(t=>X(t,e)),...Y(r,e,i)];if(a(t))return q(t)}let o=(e,t=r.length-e)=>{let n=r.slice(e),a=n.length-t;return[...r.slice(0,e).flatMap(e=>X(e,`optionalGrouped`)),...Y(r.slice(0,e),`optionalGrouped`,i),...n.length===0?[]:[`... ${n.length} more operations omitted to fit ${f} 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 q(s===void 0?o(0,[...r.keys()].findLast(e=>a(o(0,e)))??0):o(s))}var J=e=>`call aventure_help with q=<operationId> and limit=1; inspect argument and optionalInput in ${e} for the retained inputs`;function Y(e,t,n){let r=t===`optionalGrouped`&&e.some(e=>X(e,t).some(e=>e.includes(`.{`)))?[`... optional input names sharing a prefix are grouped: a.{b, c} names a.b and a.c.`]:[];return[...Me(e,t,n),...r]}function Me(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>G&&(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; ${J(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 ${f} UTF-8 bytes; ${n} carries them, and ${J(n)}.`]}function X(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}`,` 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}: ${Z(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=>Ne(e,e.required||t!==`requiredDescribed`,t)),...(t===`optionalNamed`||t===`optionalGrouped`)&&r.length>0?[` optional inputs: ${Z(r,t)}`]:[]]}function Z(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 Ne(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<=G?e.description:`${e.description.slice(0,157)}...`}`:i}function Pe(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 Q(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:d(e),arguments:{operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:Ie(e)}}}}var Fe=4;function Ie(e){let t=e.requestBody?.[0];if(t===void 0)return{};if(t.requiredPath.length>0||e.intent!==`lookup`||t.schemaType===`array`)return Le(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>Fe?[]:[[t,`<${i.join(`|`)}>`]]}))}function Le(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(Re,t);r[n.at(-1)??e]=`<${e}>`}return t}function Re(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 ze(e){let t=W(e);return{mcpCall:Q(e),...t===void 0?{}:{paidPlan:t}}}function Be(e){let t=$(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function $(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{g as C,le as E,ue as S,v as T,_e as _,je as a,S as b,De as c,F as d,P as f,ge as g,x as h,ze as i,Ee as l,T as m,$ as n,Q as o,k as p,Be as r,H as s,K as t,Te as u,w as v,_ as w,m as x,y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{t as logoutCliCredentials}from"./logout-Desb3ggn.js";
|