@aventurevc/aventure-cli 0.8.357 → 0.8.358

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.
Files changed (47) hide show
  1. package/dist/aventure-cli/command-catalog.compact.txt +2 -2
  2. package/dist/aventure-cli/index.js +1 -1
  3. package/dist/aventure-cli/unified-operations.json +1 -1
  4. package/dist/chunks/{api-key-credential-verification-Bctt_dVJ.js → api-key-credential-verification-CA1XyFD8.js} +1 -1
  5. package/dist/chunks/{api-key-credential-verification-Di4cXd3V.js → api-key-credential-verification-DcQoH0Up.js} +1 -1
  6. package/dist/chunks/{api-key-login-BsHmeKN2.js → api-key-login-tVrp9mSL.js} +1 -1
  7. package/dist/chunks/{auth-status-check-dWFj_aZ_.js → auth-status-check-9ptNc-4r.js} +1 -1
  8. package/dist/chunks/{auth-status-check-lfDaHxdh.js → auth-status-check-CjdguvHv.js} +1 -1
  9. package/dist/chunks/{auth-status-render-DFszvObT.js → auth-status-render-ksW7DEQR.js} +1 -1
  10. package/dist/chunks/{aventure-cli-BgTUScQA.js → aventure-cli-DxyvA1Mj.js} +5 -5
  11. package/dist/chunks/{builtin-auth-CVPHU4fk.js → builtin-auth-BtuxeIl6.js} +4 -4
  12. package/dist/chunks/{builtin-run-wait-Vu0bBVIJ.js → builtin-run-wait-CNlPdc6R.js} +1 -1
  13. package/dist/chunks/{builtin-update-C-mp18Nh.js → builtin-update-CLJ7R9-4.js} +1 -1
  14. package/dist/chunks/{completion-B5BVGf7q.js → completion-B5hTKY1K.js} +1 -1
  15. package/dist/chunks/detail-ChWLv1TT.js +1 -0
  16. package/dist/chunks/{detail-Bc47WSZN.js → detail-Dz22ab1I.js} +1 -1
  17. package/dist/chunks/{generated-option-order-Dz6KmtFN.js → generated-option-order-geGhlaMh.js} +1 -1
  18. package/dist/chunks/{logout-Cj1SHwv9.js → logout-BI8dZHcc.js} +1 -1
  19. package/dist/chunks/logout-BxWcZsIp.js +1 -0
  20. package/dist/chunks/{mcp-generation-contract-DF-DXfYV.js → mcp-generation-contract-Bt29Q6x_.js} +1 -1
  21. package/dist/chunks/{mcp-generation-contract-CWBSl1Bo.js → mcp-generation-contract-c6jm-LDq.js} +1 -1
  22. package/dist/chunks/oauth-bearer-credential-CMdM8lqD.js +1 -0
  23. package/dist/chunks/{oauth-bearer-credential-D6SvsZlr.js → oauth-bearer-credential-Dk720r-a.js} +1 -1
  24. package/dist/chunks/{oauth-login-DDPJxDeu.js → oauth-login-B1jQnNUS.js} +1 -1
  25. package/dist/chunks/{oauth-login-DrJwZyZt.js → oauth-login-B24pcjHq.js} +1 -1
  26. package/dist/chunks/{openapi-call-nDQnfSQ7.js → openapi-call-D_NLOwfn.js} +1 -1
  27. package/dist/chunks/{openapi-call-Jz01ShiX.js → openapi-call-Dd6xMaXC.js} +1 -1
  28. package/dist/chunks/{openapi-commands-BWQRYdCO.js → openapi-commands-Cp0Lib-9.js} +1 -1
  29. package/dist/chunks/openapi-commands-btFGumuX.js +1 -0
  30. package/dist/chunks/openapi-snapshot.json +1 -1
  31. package/dist/chunks/{operations-CLu97b05.js → operations-5kyZD17e.js} +2 -2
  32. package/dist/chunks/{operations-catalog-MCm_N5rL.js → operations-catalog-C1SuzWAW.js} +1 -1
  33. package/dist/chunks/operations-catalog-C3UvQ9fB.js +1 -0
  34. package/dist/chunks/{output-Bt68G8RP.js → output-CYNmRMGr.js} +1 -1
  35. package/dist/chunks/{output-DmE8mxgK.js → output-NqK3KVuh.js} +1 -1
  36. package/dist/chunks/{parse-error-hint-CYhhLKMj.js → parse-error-hint-BPDNnFEp.js} +1 -1
  37. package/dist/chunks/private-readback-7E7i5Pwk.js +1 -0
  38. package/dist/chunks/{startup-auth-Gmt4-LsU.js → startup-auth-DSoa-ISn.js} +1 -1
  39. package/dist/chunks/{startup-auth-BmBtrGgc.js → startup-auth-s-aDwbhR.js} +1 -1
  40. package/dist/chunks/{text-response-9gH00EmT.js → text-response-44YY4Fc6.js} +1 -1
  41. package/package.json +3 -3
  42. package/dist/chunks/detail-bzk9j-1_.js +0 -1
  43. package/dist/chunks/logout-BErkfOhl.js +0 -1
  44. package/dist/chunks/oauth-bearer-credential-BUzY55pZ.js +0 -1
  45. package/dist/chunks/openapi-commands-Dflk7Mo8.js +0 -1
  46. package/dist/chunks/operations-catalog-D_Syzb-F.js +0 -1
  47. package/dist/chunks/private-readback-BFTYnRsK.js +0 -1
@@ -1 +1 @@
1
- import{c as e,r as t}from"./result-envelope-DnsIr3gF.js";import{t as n}from"./private-readback-BFTYnRsK.js";import{c as r,i,o as a,s as o}from"./cli-help-policy-DTEXkYXH.js";function s(n,r,i){let a={...i};for(let e of r.parameter){let r=e.envName;if(r===void 0)continue;let i=process.env[r]?.trim();if(i===void 0||i.length===0)continue;let o=a[e.optionKey];if(o!==void 0&&(typeof o!=`string`||o!==i))return{...t(`${n} ${e.flag.split(` `)[0]??e.name} conflicts with ${r}; omit the flag or use ${i}.`),data:a};o===void 0&&(a[e.optionKey]=i)}return e(`Environment-bound options applied`,a)}function c(e,t,n){if(!k(n))return null;for(let r of t.parameter){let t=r.envName,i=t===void 0?void 0:process.env[t]?.trim();if(t===void 0||i===void 0||i.length===0||!w(n,r.name))continue;let a=C(n,r.name);if(typeof a!=`string`||a!==i)return`${e} ${r.name} in --from-file conflicts with ${t}; omit the field or use ${i}.`}return null}function l(e){let t=new Set(e.parameter.map(({name:e})=>e));return e.kind===`multipart`?e.requiredPath:e.requiredPath.filter(e=>!t.has(e))}function u(t,n,r,i=!1){if(i||!D(n)||!Array.isArray(r))return A(t,n,r);for(let[e,i]of r.entries()){let r=A(t,n,i,e);if(!r.ok)return r}return e(`Body value assigned`,null)}function d(e,t,n,r){return A(e,t,r,n)}function f(e){let t=[];for(let n of e.split(`.`)){let e=M(n);if(t.push(e.key),e.isArray)return t.join(`.`)}return null}function p(e,t){let n=f(t);if(n===null)return null;let r=S(e,n.split(`.`));return Array.isArray(r)?{path:n,rowCount:r.length,firstHole:x(r)}:null}function m(n,r){if(D(n.name)||n.schemaType===`array`)return e(`Repeated body option selected`,typeof r==`string`?[r]:r);if(!Array.isArray(r))return e(`Scalar body option selected`,r);let i=n.flag.split(` `)[0]??n.name;return r.length===1?e(`Scalar body option selected`,r[0]):t(`${i} was already given; pass it once.`)}var h=/^(?<row>\d+):(?<item>.*)$/su;function g(e,t,n){let r=_(n,t[n.optionKey]);return r===null||n.schemaType===`array`||e.parameter.filter(e=>e.schemaType!==`array`&&f(e.name)===r.container&&_(e,t[e.optionKey])?.plain.length===0).length>1?r:null}function _(e,t){let n=f(e.name);if(n===null||t===void 0||typeof t==`boolean`)return null;let r=new Map,i=[];for(let e of typeof t==`string`?[t]:t){let t=h.exec(e)?.groups,n=t?.row,a=t?.item;if(n===void 0||a===void 0){i.push(e);continue}let o=r.get(Number(n));o===void 0?r.set(Number(n),[a]):o.push(a)}return r.size===0?null:{container:n,rows:r,plain:i}}function v(e,t,n,{container:r,rows:i,plain:a}){let o=n.flag.split(` `)[0]??n.name;if(a.length>0)return`${o} mixes row-form values with plain value(s): ${a.join(`, `)} — prefix every value with its 0-based ${r}[] row index, as 0:value.`;let s=y(e,t,r);for(let[e,t]of i){if(e>=s)return`${o} names ${r}[] row ${e}, but these options build at most ${s} ${r}[] row(s) — number rows from 0, and name the row of a value that itself starts with digits and a colon, as 0:0:00 for the value 0:00.`;if(n.schemaType!==`array`&&t.length>1)return`${o} names ${r}[] row ${e} ${t.length} times — give each ${r}[] row one value.`}return null}function y(e,t,n){let r=0,i=0;for(let a of e.parameter){let o=t[a.optionKey];if(o===void 0||typeof o==`boolean`||f(a.name)!==n)continue;let s=typeof o==`string`?1:o.length;r=Math.max(r,s),a.schemaType!==`array`&&g(e,t,a)!==null&&(i+=s)}return Math.max(r,i)}function b(e,n,r,i){for(let a of n.parameter){if(r[a.optionKey]===void 0)continue;let o=p(i,a.name);if(o===null)continue;if(o.firstHole!==null)return t(`${e} has no ${o.path}[] row ${o.firstHole} — number ${o.path}[] rows from 0 with no gaps.`);if(a.schemaType!==`array`||o.rowCount<=1||g(n,r,a)!==null)continue;let s=a.flag.split(` `)[0]??a.name;return t(`${s} fills one ${o.path}[] row's list, so ${e} cannot also build ${o.rowCount} ${o.path}[] rows from direct options — prefix each value with its 0-based ${o.path}[] row index, as 0:value, or pass the rows with --from-file.`)}return null}function x(e){for(let t=0;t<e.length;t+=1)if(e[t]===void 0)return t;return null}function S(e,t){let n=e;for(let e of t){if(!k(n))return;n=n[e]??null}return n}function C(e,t){if(!D(t))return S(e,t.split(`.`))}function w(e,t){return E(e,t.split(`.`))}function T(e,t,n){if(!k(n))return null;let r=new Set(t.parameter.map(({name:e})=>e));for(let i of e)if(i!==t){for(let e of i.parameter)if(!r.has(e.name)&&w(n,e.name))return`${e.name} in --from-file requires --content-type ${i.contentType}.`}return null}function E(e,t){let[n,...r]=t;if(n===void 0)return!0;let i=M(n);if(!k(e)||!Object.hasOwn(e,i.key))return!1;let a=e[i.key]??null;return i.isArray?Array.isArray(a)&&a.every(e=>E(e,r)):E(a,r)}function D(e){return e.split(`.`).some(e=>M(e).isArray)}function O(e,t){return e.parameter.length===0||!k(t)?null:P(t,[],N(e.parameter))}function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(n,r,i,a=0){let o=r.split(`.`),s=n;for(let[n,c]of o.entries()){let l=M(c),u=n===o.length-1,d=j(s,l,r,u,i,a);if(!d.ok||d.data===null)return t(d.summary,d.warnings);if(u)return e(`Body value assigned`,null);s=d.data}return t(`${r} is not a valid body option path.`)}function j(n,r,i,a,o,s){let c=()=>t(`${i} cannot be combined with another body option at ${r.key}.`),l=n[r.key];if(r.isArray){if(l!==void 0&&!Array.isArray(l))return c();let t=l??[];if(l===void 0&&(n[r.key]=t),a)return t[s]===void 0?(t[s]=o,e(`Body value assigned`,n)):c();let i=t[s];if(i===void 0){let n={};return t[s]=n,e(`Body path created`,n)}return k(i)?e(`Body path stepped`,i):c()}if(a)return l===void 0?(n[r.key]=o,e(`Body value assigned`,n)):c();if(l===void 0){let t={};return n[r.key]=t,e(`Body path created`,t)}return k(l)?e(`Body path stepped`,l):c()}function M(e){let t=e.endsWith(`[]`);return{key:t?e.slice(0,-2):e,isArray:t}}function N(e){let t=new Set,n=new Set;for(let r of e){let e=`${r.name}${r.schemaType===`array`?`[]`:``}`;t.add(e);let i=e.split(`.`);for(let e=1;e<i.length;e+=1)n.add(i.slice(0,e).join(`.`))}return{leaf:t,prefix:n}}function P(e,t,n){if(Array.isArray(e)){if(e.length===0)return null;for(let r of e){let e=P(r,t,n);if(e!==null)return e}return null}if(!k(e))return null;for(let[r,i]of Object.entries(e)){let e=[...t,Array.isArray(i)?`${r}[]`:r],a=e.join(`.`);if(i===null&&F(`${a}[]`,n))continue;if(!F(a,n)){if(!I(e))continue;let r=[...new Set([...n.leaf,...n.prefix])].filter(e=>e.split(`.`).slice(0,-1).join(`.`)===t.join(`.`)),i=r.map(e=>e.split(`.`).at(-1)??``),o=R(e,r);return{path:a,message:`unknown JSON path ${a}. ${o===void 0?`Admitted keys: ${i.join(`, `)||`(none)`}.`:`Use ${o}.`}`}}let o=P(i,e,n);if(o!==null)return o}return null}function F(e,t){return t.prefix.has(e)||t.leaf.has(e)}function I(e){return e.slice(0,-1).some(e=>e.endsWith(`[]`))}var L=4;function R(e,t){let n=e.at(-1)?.replace(/\[\]$/u,``).toLowerCase()??``,r=t.map(e=>({path:e,score:z(n,e.split(`.`).at(-1)??``)})).filter(({score:e})=>e<1/0).toSorted((e,t)=>e.score-t.score||e.path.localeCompare(t.path));return r[0]?.score===r[1]?.score?void 0:r[0]?.path}function z(e,t){let n=t.replace(/\[\]$/u,``).toLowerCase();if(n===e)return 0;if(Math.min(e.length,n.length)<L)return 1/0;let r=e.length<=n.length?e:n,i=e.length<=n.length?n:e;if(i.length-r.length>1)return 1/0;let a=0;for(;a<r.length&&r[a]===i[a];)a+=1;return r.slice(a+ +(r.length===i.length))===i.slice(a+1)?1:1/0}var B=e=>Array.isArray(e)&&!Object.isFrozen(e);function V(e,t){let r=new Map;for(let e of t){let t=e.flag?.split(` `)[0];t!==void 0&&r.set(t,t===`--from-file`?{...e,inputType:`file`}:e)}for(let t of e){let e=t.long===void 0?void 0:r.get(t.long);e!==void 0&&(t.helpGroup(o(e)),t.description=n(t.description,{...e,hasParseDefault:t.defaultValue!==void 0}))}if(!B(e))throw Error(`Commander option list is frozen; generated option help cannot be ordered.`);e.sort((e,t)=>{let n=e.long===void 0?void 0:r.get(e.long),i=t.long===void 0?void 0:r.get(t.long);return n!==void 0&&i!==void 0?Y(n,i):n===void 0?i===void 0?0:1:-1})}function H(e){let t=new Map;for(let n of e)for(let e of n.parameter){let r=e.flag.split(` `)[0]??e.flag,i=t.get(r);i===void 0?t.set(r,{variant:[{descriptor:n,parameter:e}]}):t.set(r,{variant:[...i.variant,{descriptor:n,parameter:e}]})}return[...t.values()]}function U(e){let{flag:t}=e.variant[0].parameter;return e.variant.every(({parameter:e})=>e.flag===t)?t:`${t.split(` `)[0]??t} <value>`}function W(e){let t=e.variant.map(({descriptor:e,parameter:t})=>({contentType:e.contentType,text:q(e,t)})),n=t[0];return n===void 0?``:t.every(({text:e})=>e===n.text)?`${n.text===``?``:`${n.text} `}Request content: ${t.map(({contentType:e})=>e).join(`, `)}.`:t.map(({contentType:e,text:t})=>`${e}: ${t}`).join(` `)}function G(e,t){return[...new Set((e.cliConflicts??[]).filter(e=>e.includes(t)).flatMap(e=>e.filter(e=>e!==t)))]}function K(e,t){let n=e.kind===`multipart`?`Read a JSON object keyed by multipart part name from a file, or use - for stdin`:`Read the JSON request body from a file, or use - for stdin`,i=t.filter(e=>!t.some(t=>t.startsWith(`${e}.`)||t.startsWith(`${e}[].`)));return i.length===0?r(n):`${r(n)} Required JSON paths: ${i.join(`, `)}.`}function q(e,t){let n=i(t.description,void 0),r=e.kind!==`multipart`&&D(t.name),a=e.kind!==`multipart`&&t.optionKey!==t.name&&/^\w+$/u.test(t.name);return`${n}${r?` Repeat to add another value.`:``}${a?` --from-file JSON key: ${t.name}.`:``}${J(e,t)}`}function J(e,t){if(e.kind===`multipart`)return``;let n=f(t.name);if(n===null)return``;let[r,i]=t.schemaType===`array`?[``,``]:[` on two or more ${n}[] flags`,` then`];return` Prefix each value with its 0-based ${n}[] row index, as 0:value${r}, to fill more than one ${n}[] row. A leading digits-and-colon is${i} always read as that index, so name the row of a value that starts the same way, as 0:0:00 for the value 0:00.`}function Y(e,t){return a(e)-a(t)||Number(e.required!==!0)-Number(t.required!==!0)}export{O as S,w as _,K as a,l as b,q as c,b as d,u as f,c as g,T as h,U as i,g as l,s as m,Y as n,H as o,d as p,W as r,G as s,V as t,v as u,D as v,m as x,k as y};
1
+ import{c as e,r as t}from"./result-envelope-DnsIr3gF.js";import{t as n}from"./private-readback-7E7i5Pwk.js";import{c as r,i,o as a,s as o}from"./cli-help-policy-DTEXkYXH.js";function s(n,r,i){let a={...i};for(let e of r.parameter){let r=e.envName;if(r===void 0)continue;let i=process.env[r]?.trim();if(i===void 0||i.length===0)continue;let o=a[e.optionKey];if(o!==void 0&&(typeof o!=`string`||o!==i))return{...t(`${n} ${e.flag.split(` `)[0]??e.name} conflicts with ${r}; omit the flag or use ${i}.`),data:a};o===void 0&&(a[e.optionKey]=i)}return e(`Environment-bound options applied`,a)}function c(e,t,n){if(!k(n))return null;for(let r of t.parameter){let t=r.envName,i=t===void 0?void 0:process.env[t]?.trim();if(t===void 0||i===void 0||i.length===0||!w(n,r.name))continue;let a=C(n,r.name);if(typeof a!=`string`||a!==i)return`${e} ${r.name} in --from-file conflicts with ${t}; omit the field or use ${i}.`}return null}function l(e){let t=new Set(e.parameter.map(({name:e})=>e));return e.kind===`multipart`?e.requiredPath:e.requiredPath.filter(e=>!t.has(e))}function u(t,n,r,i=!1){if(i||!D(n)||!Array.isArray(r))return A(t,n,r);for(let[e,i]of r.entries()){let r=A(t,n,i,e);if(!r.ok)return r}return e(`Body value assigned`,null)}function d(e,t,n,r){return A(e,t,r,n)}function f(e){let t=[];for(let n of e.split(`.`)){let e=M(n);if(t.push(e.key),e.isArray)return t.join(`.`)}return null}function p(e,t){let n=f(t);if(n===null)return null;let r=S(e,n.split(`.`));return Array.isArray(r)?{path:n,rowCount:r.length,firstHole:x(r)}:null}function m(n,r){if(D(n.name)||n.schemaType===`array`)return e(`Repeated body option selected`,typeof r==`string`?[r]:r);if(!Array.isArray(r))return e(`Scalar body option selected`,r);let i=n.flag.split(` `)[0]??n.name;return r.length===1?e(`Scalar body option selected`,r[0]):t(`${i} was already given; pass it once.`)}var h=/^(?<row>\d+):(?<item>.*)$/su;function g(e,t,n){let r=_(n,t[n.optionKey]);return r===null||n.schemaType===`array`||e.parameter.filter(e=>e.schemaType!==`array`&&f(e.name)===r.container&&_(e,t[e.optionKey])?.plain.length===0).length>1?r:null}function _(e,t){let n=f(e.name);if(n===null||t===void 0||typeof t==`boolean`)return null;let r=new Map,i=[];for(let e of typeof t==`string`?[t]:t){let t=h.exec(e)?.groups,n=t?.row,a=t?.item;if(n===void 0||a===void 0){i.push(e);continue}let o=r.get(Number(n));o===void 0?r.set(Number(n),[a]):o.push(a)}return r.size===0?null:{container:n,rows:r,plain:i}}function v(e,t,n,{container:r,rows:i,plain:a}){let o=n.flag.split(` `)[0]??n.name;if(a.length>0)return`${o} mixes row-form values with plain value(s): ${a.join(`, `)} — prefix every value with its 0-based ${r}[] row index, as 0:value.`;let s=y(e,t,r);for(let[e,t]of i){if(e>=s)return`${o} names ${r}[] row ${e}, but these options build at most ${s} ${r}[] row(s) — number rows from 0, and name the row of a value that itself starts with digits and a colon, as 0:0:00 for the value 0:00.`;if(n.schemaType!==`array`&&t.length>1)return`${o} names ${r}[] row ${e} ${t.length} times — give each ${r}[] row one value.`}return null}function y(e,t,n){let r=0,i=0;for(let a of e.parameter){let o=t[a.optionKey];if(o===void 0||typeof o==`boolean`||f(a.name)!==n)continue;let s=typeof o==`string`?1:o.length;r=Math.max(r,s),a.schemaType!==`array`&&g(e,t,a)!==null&&(i+=s)}return Math.max(r,i)}function b(e,n,r,i){for(let a of n.parameter){if(r[a.optionKey]===void 0)continue;let o=p(i,a.name);if(o===null)continue;if(o.firstHole!==null)return t(`${e} has no ${o.path}[] row ${o.firstHole} — number ${o.path}[] rows from 0 with no gaps.`);if(a.schemaType!==`array`||o.rowCount<=1||g(n,r,a)!==null)continue;let s=a.flag.split(` `)[0]??a.name;return t(`${s} fills one ${o.path}[] row's list, so ${e} cannot also build ${o.rowCount} ${o.path}[] rows from direct options — prefix each value with its 0-based ${o.path}[] row index, as 0:value, or pass the rows with --from-file.`)}return null}function x(e){for(let t=0;t<e.length;t+=1)if(e[t]===void 0)return t;return null}function S(e,t){let n=e;for(let e of t){if(!k(n))return;n=n[e]??null}return n}function C(e,t){if(!D(t))return S(e,t.split(`.`))}function w(e,t){return E(e,t.split(`.`))}function T(e,t,n){if(!k(n))return null;let r=new Set(t.parameter.map(({name:e})=>e));for(let i of e)if(i!==t){for(let e of i.parameter)if(!r.has(e.name)&&w(n,e.name))return`${e.name} in --from-file requires --content-type ${i.contentType}.`}return null}function E(e,t){let[n,...r]=t;if(n===void 0)return!0;let i=M(n);if(!k(e)||!Object.hasOwn(e,i.key))return!1;let a=e[i.key]??null;return i.isArray?Array.isArray(a)&&a.every(e=>E(e,r)):E(a,r)}function D(e){return e.split(`.`).some(e=>M(e).isArray)}function O(e,t){return e.parameter.length===0||!k(t)?null:P(t,[],N(e.parameter))}function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(n,r,i,a=0){let o=r.split(`.`),s=n;for(let[n,c]of o.entries()){let l=M(c),u=n===o.length-1,d=j(s,l,r,u,i,a);if(!d.ok||d.data===null)return t(d.summary,d.warnings);if(u)return e(`Body value assigned`,null);s=d.data}return t(`${r} is not a valid body option path.`)}function j(n,r,i,a,o,s){let c=()=>t(`${i} cannot be combined with another body option at ${r.key}.`),l=n[r.key];if(r.isArray){if(l!==void 0&&!Array.isArray(l))return c();let t=l??[];if(l===void 0&&(n[r.key]=t),a)return t[s]===void 0?(t[s]=o,e(`Body value assigned`,n)):c();let i=t[s];if(i===void 0){let n={};return t[s]=n,e(`Body path created`,n)}return k(i)?e(`Body path stepped`,i):c()}if(a)return l===void 0?(n[r.key]=o,e(`Body value assigned`,n)):c();if(l===void 0){let t={};return n[r.key]=t,e(`Body path created`,t)}return k(l)?e(`Body path stepped`,l):c()}function M(e){let t=e.endsWith(`[]`);return{key:t?e.slice(0,-2):e,isArray:t}}function N(e){let t=new Set,n=new Set;for(let r of e){let e=`${r.name}${r.schemaType===`array`?`[]`:``}`;t.add(e);let i=e.split(`.`);for(let e=1;e<i.length;e+=1)n.add(i.slice(0,e).join(`.`))}return{leaf:t,prefix:n}}function P(e,t,n){if(Array.isArray(e)){if(e.length===0)return null;for(let r of e){let e=P(r,t,n);if(e!==null)return e}return null}if(!k(e))return null;for(let[r,i]of Object.entries(e)){let e=[...t,Array.isArray(i)?`${r}[]`:r],a=e.join(`.`);if(i===null&&F(`${a}[]`,n))continue;if(!F(a,n)){if(!I(e))continue;let r=[...new Set([...n.leaf,...n.prefix])].filter(e=>e.split(`.`).slice(0,-1).join(`.`)===t.join(`.`)),i=r.map(e=>e.split(`.`).at(-1)??``),o=R(e,r);return{path:a,message:`unknown JSON path ${a}. ${o===void 0?`Admitted keys: ${i.join(`, `)||`(none)`}.`:`Use ${o}.`}`}}let o=P(i,e,n);if(o!==null)return o}return null}function F(e,t){return t.prefix.has(e)||t.leaf.has(e)}function I(e){return e.slice(0,-1).some(e=>e.endsWith(`[]`))}var L=4;function R(e,t){let n=e.at(-1)?.replace(/\[\]$/u,``).toLowerCase()??``,r=t.map(e=>({path:e,score:z(n,e.split(`.`).at(-1)??``)})).filter(({score:e})=>e<1/0).toSorted((e,t)=>e.score-t.score||e.path.localeCompare(t.path));return r[0]?.score===r[1]?.score?void 0:r[0]?.path}function z(e,t){let n=t.replace(/\[\]$/u,``).toLowerCase();if(n===e)return 0;if(Math.min(e.length,n.length)<L)return 1/0;let r=e.length<=n.length?e:n,i=e.length<=n.length?n:e;if(i.length-r.length>1)return 1/0;let a=0;for(;a<r.length&&r[a]===i[a];)a+=1;return r.slice(a+ +(r.length===i.length))===i.slice(a+1)?1:1/0}var B=e=>Array.isArray(e)&&!Object.isFrozen(e);function V(e,t){let r=new Map;for(let e of t){let t=e.flag?.split(` `)[0];t!==void 0&&r.set(t,t===`--from-file`?{...e,inputType:`file`}:e)}for(let t of e){let e=t.long===void 0?void 0:r.get(t.long);e!==void 0&&(t.helpGroup(o(e)),t.description=n(t.description,{...e,hasParseDefault:t.defaultValue!==void 0}))}if(!B(e))throw Error(`Commander option list is frozen; generated option help cannot be ordered.`);e.sort((e,t)=>{let n=e.long===void 0?void 0:r.get(e.long),i=t.long===void 0?void 0:r.get(t.long);return n!==void 0&&i!==void 0?Y(n,i):n===void 0?i===void 0?0:1:-1})}function H(e){let t=new Map;for(let n of e)for(let e of n.parameter){let r=e.flag.split(` `)[0]??e.flag,i=t.get(r);i===void 0?t.set(r,{variant:[{descriptor:n,parameter:e}]}):t.set(r,{variant:[...i.variant,{descriptor:n,parameter:e}]})}return[...t.values()]}function U(e){let{flag:t}=e.variant[0].parameter;return e.variant.every(({parameter:e})=>e.flag===t)?t:`${t.split(` `)[0]??t} <value>`}function W(e){let t=e.variant.map(({descriptor:e,parameter:t})=>({contentType:e.contentType,text:q(e,t)})),n=t[0];return n===void 0?``:t.every(({text:e})=>e===n.text)?`${n.text===``?``:`${n.text} `}Request content: ${t.map(({contentType:e})=>e).join(`, `)}.`:t.map(({contentType:e,text:t})=>`${e}: ${t}`).join(` `)}function G(e,t){return[...new Set((e.cliConflicts??[]).filter(e=>e.includes(t)).flatMap(e=>e.filter(e=>e!==t)))]}function K(e,t){let n=e.kind===`multipart`?`Read a JSON object keyed by multipart part name from a file, or use - for stdin`:`Read the JSON request body from a file, or use - for stdin`,i=t.filter(e=>!t.some(t=>t.startsWith(`${e}.`)||t.startsWith(`${e}[].`)));return i.length===0?r(n):`${r(n)} Required JSON paths: ${i.join(`, `)}.`}function q(e,t){let n=i(t.description,void 0),r=e.kind!==`multipart`&&D(t.name),a=e.kind!==`multipart`&&t.optionKey!==t.name&&/^\w+$/u.test(t.name);return`${n}${r?` Repeat to add another value.`:``}${a?` --from-file JSON key: ${t.name}.`:``}${J(e,t)}`}function J(e,t){if(e.kind===`multipart`)return``;let n=f(t.name);if(n===null)return``;let[r,i]=t.schemaType===`array`?[``,``]:[` on two or more ${n}[] flags`,` then`];return` Prefix each value with its 0-based ${n}[] row index, as 0:value${r}, to fill more than one ${n}[] row. A leading digits-and-colon is${i} always read as that index, so name the row of a value that starts the same way, as 0:0:00 for the value 0:00.`}function Y(e,t){return a(e)-a(t)||Number(e.required!==!0)-Number(t.required!==!0)}export{O as S,w as _,K as a,l as b,q as c,b as d,u as f,c as g,T as h,U as i,g as l,s as m,Y as n,H as o,d as p,W as r,G as s,V as t,v as u,D as v,m as x,k as y};
@@ -1 +1 @@
1
- import{a as e,f as t,t as n}from"./env-CFzWAaru.js";import{c as r,r as i}from"./result-envelope-DnsIr3gF.js";import{z as a}from"./tool-policy-Bbmx_QTI.js";import{s as o}from"./openapi-call-nDQnfSQ7.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-LdCfwlmZ.js";import{n as p,t as m}from"./credential-redaction-BtlCCACb.js";import{n as h}from"./contract-V7AlMHKi.js";import{t as g}from"./openapi-composites-CO9Q6ihp.js";import{c as _,f as v,m as y,n as b,r as x}from"./oauth-credential-BI-8dUCp.js";import{t as S}from"./oauth-login-DrJwZyZt.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};
1
+ import{a as e,f as t,t as n}from"./env-CFzWAaru.js";import{c as r,r as i}from"./result-envelope-DnsIr3gF.js";import{z as a}from"./tool-policy-Bbmx_QTI.js";import{s as o}from"./openapi-call-D_NLOwfn.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-LdCfwlmZ.js";import{n as p,t as m}from"./credential-redaction-BtlCCACb.js";import{n as h}from"./contract-V7AlMHKi.js";import{t as g}from"./openapi-composites-CO9Q6ihp.js";import{c as _,f as v,m as y,n as b,r as x}from"./oauth-credential-BI-8dUCp.js";import{t as S}from"./oauth-login-B24pcjHq.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{t as logoutCliCredentials}from"./logout-BI8dZHcc.js";
@@ -1 +1 @@
1
- export{n as MCP_GENERATION_CONTRACT}from"./mcp-generation-contract-CWBSl1Bo.js";
1
+ export{n as MCP_GENERATION_CONTRACT}from"./mcp-generation-contract-c6jm-LDq.js";