@aventurevc/aventure-cli 0.8.534 → 0.8.535

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 (83) hide show
  1. package/dist/aventure-cli/command-catalog.compact.txt +1 -1
  2. package/dist/aventure-cli/index.js +1 -1
  3. package/dist/aventure-cli/unified-operations.json +1 -1
  4. package/dist/chunks/{agent-help-text-DRuk0A-w.js → agent-help-text-C2U8FRh8.js} +1 -1
  5. package/dist/chunks/{api-key-bearer-credential-BSEMnkpE.js → api-key-bearer-credential-BB3YX-ft.js} +1 -1
  6. package/dist/chunks/{api-key-bearer-credential-ecEvnz6R.js → api-key-bearer-credential-D86St6ov.js} +1 -1
  7. package/dist/chunks/{api-key-credential-DcHd9NrV.js → api-key-credential-m2xVtZ-Y.js} +1 -1
  8. package/dist/chunks/{api-key-credential-CghLPNnh.js → api-key-credential-vRNsPuIS.js} +1 -1
  9. package/dist/chunks/{api-key-credential-verification-BcNzbMPb.js → api-key-credential-verification-D4H19VQz.js} +1 -1
  10. package/dist/chunks/{api-key-credential-verification-Cg9cwCrB.js → api-key-credential-verification-DQcpTsNb.js} +1 -1
  11. package/dist/chunks/{api-key-login-BDiH7JA3.js → api-key-login-BDGGTRdw.js} +1 -1
  12. package/dist/chunks/{auth-resolver-BXKR4Kx8.js → auth-resolver-D-dCACU-.js} +1 -1
  13. package/dist/chunks/auth-resolver-nb9959nx.js +1 -0
  14. package/dist/chunks/{auth-status-check-C5ia2k3X.js → auth-status-check-Dg0vrLL1.js} +1 -1
  15. package/dist/chunks/{auth-status-check-Ddc9IpSB.js → auth-status-check-DjxflxRM.js} +1 -1
  16. package/dist/chunks/{auth-status-render-Cb1KYPLG.js → auth-status-render-BpDwBo2Y.js} +1 -1
  17. package/dist/chunks/{aventure-cli-BWjpD6tK.js → aventure-cli-C2BKECJd.js} +5 -5
  18. package/dist/chunks/{batch-io-DMBP5izn.js → batch-io-D_4uxPoB.js} +1 -1
  19. package/dist/chunks/{builtin-auth-DNtpr8sj.js → builtin-auth-BiNilwhy.js} +4 -4
  20. package/dist/chunks/{builtin-run-wait-Dj3wjz5b.js → builtin-run-wait-yYhGP5Nf.js} +1 -1
  21. package/dist/chunks/{builtin-update-CcwAcU7J.js → builtin-update-nSzYDyjx.js} +1 -1
  22. package/dist/chunks/{cli-help-policy-BhJrJ8ED.js → cli-help-policy-7Y2p5jV8.js} +1 -1
  23. package/dist/chunks/{completion-CyTiZ2Gj.js → completion-ChGesGcY.js} +1 -1
  24. package/dist/chunks/{contract-nURcinLo.js → contract-CVNZPJQS.js} +1 -1
  25. package/dist/chunks/{credential-redaction-CB8ReX08.js → credential-redaction-NUR1Ke-w.js} +1 -1
  26. package/dist/chunks/{credential-store-C_HTpQcV.js → credential-store-CY4hvokq.js} +1 -1
  27. package/dist/chunks/{env-BJt0rU1S.js → env-Cvbjjmpl.js} +1 -1
  28. package/dist/chunks/{generated-body-Bc_kLSrA.js → generated-body-BMKRzNyy.js} +1 -1
  29. package/dist/chunks/{generated-dispatch-TK5zH-R8.js → generated-dispatch-CgJdt_el.js} +1 -1
  30. package/dist/chunks/{generated-option-order-calf17Im.js → generated-option-order-CfC1yASW.js} +1 -1
  31. package/dist/chunks/{help-catalog-Cp4yosag.js → help-catalog-RnwrGvvU.js} +1 -1
  32. package/dist/chunks/{help-intent-B4qM6cF8.js → help-intent-NaE8q_Je.js} +1 -1
  33. package/dist/chunks/{logging-DsAr5H7d.js → logging-BMhtWW2E.js} +1 -1
  34. package/dist/chunks/{logging-mtFV7E-2.js → logging-CD5QGdx4.js} +1 -1
  35. package/dist/chunks/{logout-Dhgju6ME.js → logout-B3xOJW2A.js} +1 -1
  36. package/dist/chunks/logout-CvEFYt4D.js +1 -0
  37. package/dist/chunks/mcp-generation-contract-B0HN8kTm.js +1 -0
  38. package/dist/chunks/{mcp-generation-contract-CEIC_dUC.js → mcp-generation-contract-CsS06nOt.js} +1 -1
  39. package/dist/chunks/oauth-bearer-credential-C0ncRHEv.js +1 -0
  40. package/dist/chunks/{oauth-bearer-credential-C1Bhz2Ty.js → oauth-bearer-credential-D3GysLcP.js} +1 -1
  41. package/dist/chunks/{oauth-credential-uoAAuAGx.js → oauth-credential-DIJSRFu5.js} +1 -1
  42. package/dist/chunks/{oauth-credential-DfMxzAHc.js → oauth-credential-em3q7tX_.js} +1 -1
  43. package/dist/chunks/{oauth-login-CPIh0SlO.js → oauth-login-BBv-fRTV.js} +1 -1
  44. package/dist/chunks/{oauth-login-DuFobNwd.js → oauth-login-C7MkvmEt.js} +1 -1
  45. package/dist/chunks/{openapi-call-CeTrV9YM.js → openapi-call-D9zgXqbw.js} +8 -8
  46. package/dist/chunks/{openapi-call-C2iRcDJX.js → openapi-call-DhVHADrB.js} +1 -1
  47. package/dist/chunks/{openapi-commands-Cxu0MCsz.js → openapi-commands-DR9MKBXG.js} +1 -1
  48. package/dist/chunks/openapi-commands-Db-aRML4.js +1 -0
  49. package/dist/chunks/openapi-snapshot.json +1 -1
  50. package/dist/chunks/{operations-DMXKh_6j.js → operations-CaFAj0CH.js} +2 -2
  51. package/dist/chunks/operations-catalog-0e5jlRjP.js +1 -0
  52. package/dist/chunks/{operations-catalog-CZyMQ4Gj.js → operations-catalog-BTtdnWeX.js} +1 -1
  53. package/dist/chunks/{operations-metadata-CisfJTAN.js → operations-metadata-DcxTwcL5.js} +1 -1
  54. package/dist/chunks/{output-CRQWVbxR.js → output-DbmjGIkA.js} +1 -1
  55. package/dist/chunks/{output-CdjAIcSd.js → output-akHXNIFu.js} +1 -1
  56. package/dist/chunks/output-mode-2cLaEnPU.js +1 -0
  57. package/dist/chunks/{output-mode-vRG-oR5h.js → output-mode-CA8910tY.js} +1 -1
  58. package/dist/chunks/{output-spill-WwNcv7rc.js → output-spill-BPq8nR4M.js} +1 -1
  59. package/dist/chunks/{parse-error-hint-CpoO_70Z.js → parse-error-hint-BMeakdjD.js} +1 -1
  60. package/dist/chunks/{payload-operand-guard-0dVd-G7W.js → payload-operand-guard-C_D3hCvU.js} +1 -1
  61. package/dist/chunks/{private-readback-CVqzR2TK.js → private-readback-BDrHngQO.js} +1 -1
  62. package/dist/chunks/{request-replay-BaF95kl0.js → request-replay-BVzVEecw.js} +1 -1
  63. package/dist/chunks/request-replay-CHVFuAL7.js +1 -0
  64. package/dist/chunks/{response-problem-DLlyFL0O.js → response-problem-B21PnnID.js} +1 -1
  65. package/dist/chunks/response-problem-DNYv8kvS.js +1 -0
  66. package/dist/chunks/result-envelope-CgEtEqXZ.js +1 -0
  67. package/dist/chunks/{search-narrowing-CSG5QWe9.js → search-narrowing-D6_JS2EO.js} +1 -1
  68. package/dist/chunks/{startup-auth-DPpalnlP.js → startup-auth-BEady9gE.js} +1 -1
  69. package/dist/chunks/startup-auth-CfwZGvWI.js +1 -0
  70. package/dist/chunks/{text-response-CgJwnvms.js → text-response-Cs20xvE2.js} +1 -1
  71. package/dist/chunks/{tool-policy-Dv9EGGWT.js → tool-policy-BqvObQio.js} +1 -1
  72. package/package.json +3 -3
  73. package/dist/chunks/auth-resolver-CCOxNbuq.js +0 -1
  74. package/dist/chunks/logout-BO2n_PKZ.js +0 -1
  75. package/dist/chunks/mcp-generation-contract-eAQpFVc2.js +0 -1
  76. package/dist/chunks/oauth-bearer-credential-CNZy4qr7.js +0 -1
  77. package/dist/chunks/openapi-commands-DWJX_nHR.js +0 -1
  78. package/dist/chunks/operations-catalog-CkjChaye.js +0 -1
  79. package/dist/chunks/output-mode-l8oZddQR.js +0 -1
  80. package/dist/chunks/request-replay-C2rHlI83.js +0 -1
  81. package/dist/chunks/response-problem-BahgA5Ja.js +0 -1
  82. package/dist/chunks/result-envelope-vZPeiIKr.js +0 -1
  83. package/dist/chunks/startup-auth-DnVfIPEy.js +0 -1
@@ -1 +1 @@
1
- import{c as e,r as t}from"./result-envelope-vZPeiIKr.js";function n(e,t){return e.parameters.filter(e=>e.required&&t[e.optionKey]===void 0).map(e=>e.flag)}function r(e,t){return(e.requestBody?.length??0)>1&&typeof t.contentType==`string`?t.contentType:void 0}var i=e=>typeof e==`string`&&e.trim()===``;function a(e,t){let n=new Set([...t.parameters,...(t.requestBody??[]).flatMap(({parameter:e})=>e)].filter(e=>e.required).map(e=>e.optionKey));for(let t of e.options){let r=t.attributeName(),a=e.getOptionValue(r);if(!(Array.isArray(a)?a.some(i):i(a)))continue;let o=Array.isArray(a)?a.filter(e=>!i(e)):[];o.length>0?e.setOptionValue(r,o):(n.has(r)&&e.error(`error: option '${t.flags}' requires a value`),e.setOptionValue(r,void 0))}}function o(e){return e.split(` `)[0]??e}function s(e){if(e.requestBody===void 0||e.requestBody.length===0){let[t,n]=e.parameters.filter(e=>e.required);return n===void 0&&t?.schemaType===`string`?t:void 0}if(e.requestBody.length!==1||e.parameters.some(e=>e.required))return;let t=e.requestBody[0]?.parameter??[],n=t.filter(e=>e.required);if(n.length===1&&n[0]?.schemaType===`string`)return n[0];if(n.length!==0||e.intent!==`search`)return;let r=t.filter(e=>{let t=e.name.split(`.`).at(-1);return e.schemaType===`string`&&(t===`query`||t===`search`)});return r.length===1?r[0]:void 0}function c(n,r,i){let a=r.join(` `).trim();return a.length===0?e(`No positional text`,i):i[n.optionKey]===void 0?e(`Positional text parsed`,{...i,[n.optionKey]:a}):t(`Unexpected argument "${a}": ${o(n.flag)} already sets this value, and this command has no subcommand by that name. Drop "${a}".`)}export{s as a,a as i,o as n,c as o,n as r,r as t};
1
+ import{c as e,r as t}from"./result-envelope-CgEtEqXZ.js";function n(e,t){return e.parameters.filter(e=>e.required&&t[e.optionKey]===void 0).map(e=>e.flag)}function r(e,t){return(e.requestBody?.length??0)>1&&typeof t.contentType==`string`?t.contentType:void 0}var i=e=>typeof e==`string`&&e.trim()===``;function a(e,t){let n=new Set([...t.parameters,...(t.requestBody??[]).flatMap(({parameter:e})=>e)].filter(e=>e.required).map(e=>e.optionKey));for(let t of e.options){let r=t.attributeName(),a=e.getOptionValue(r);if(!(Array.isArray(a)?a.some(i):i(a)))continue;let o=Array.isArray(a)?a.filter(e=>!i(e)):[];o.length>0?e.setOptionValue(r,o):(n.has(r)&&e.error(`error: option '${t.flags}' requires a value`),e.setOptionValue(r,void 0))}}function o(e){return e.split(` `)[0]??e}function s(e){if(e.requestBody===void 0||e.requestBody.length===0){let[t,n]=e.parameters.filter(e=>e.required);return n===void 0&&t?.schemaType===`string`?t:void 0}if(e.requestBody.length!==1||e.parameters.some(e=>e.required))return;let t=e.requestBody[0]?.parameter??[],n=t.filter(e=>e.required);if(n.length===1&&n[0]?.schemaType===`string`)return n[0];if(n.length!==0||e.intent!==`search`)return;let r=t.filter(e=>{let t=e.name.split(`.`).at(-1);return e.schemaType===`string`&&(t===`query`||t===`search`)});return r.length===1?r[0]:void 0}function c(n,r,i){let a=r.join(` `).trim();return a.length===0?e(`No positional text`,i):i[n.optionKey]===void 0?e(`Positional text parsed`,{...i,[n.optionKey]:a}):t(`Unexpected argument "${a}": ${o(n.flag)} already sets this value, and this command has no subcommand by that name. Drop "${a}".`)}export{s as a,a as i,o as n,c as o,n as r,r as t};
@@ -1 +1 @@
1
- import{c as e,r as t}from"./result-envelope-vZPeiIKr.js";import{t as n}from"./private-readback-CVqzR2TK.js";import{c as r,i,o as a,s as o}from"./cli-help-policy-BhJrJ8ED.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-CgEtEqXZ.js";import{t as n}from"./private-readback-BDrHngQO.js";import{c as r,i,o as a,s as o}from"./cli-help-policy-7Y2p5jV8.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,4 +1,4 @@
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"./task-no-write-outcome-BDqB8HQA.js";import{t as u}from"./confidence-CjeYTBnf.js";import{c as d,d as f,l as ee,s as p,u as m}from"./tool-policy-Dv9EGGWT.js";import{i as h}from"./text-field-jFKOGMzr.js";import{Buffer as g}from"node:buffer";var _=16e3,v=(e,t=_)=>e.length<=120&&g.byteLength(`${e.join(`
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"./task-no-write-outcome-BDqB8HQA.js";import{t as u}from"./confidence-CjeYTBnf.js";import{c as d,d as f,l as ee,s as p,u as m}from"./tool-policy-BqvObQio.js";import{i as h}from"./text-field-jFKOGMzr.js";import{Buffer as g}from"node:buffer";var _=16e3,v=(e,t=_)=>e.length<=120&&g.byteLength(`${e.join(`
2
2
  `)}\n`,`utf8`)<=t,y=(e,{appendNewline:t=!1,preservedTrailerLines:n,transport:r=`cli`,...i}={})=>{let a=h(e),o=t||a.endsWith(`
3
3
  `),s=a.endsWith(`
4
4
  `)?a.slice(0,-1):a,c=s.length===0?[]:s.split(`
@@ -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-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};
1
+ import{c as e,i as t,r as n}from"./result-envelope-CgEtEqXZ.js";import{U as r,m as i,n as a,u as o}from"./tool-policy-BqvObQio.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-RnwrGvvU.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};
@@ -1 +1 @@
1
- export{t as describeError,n as errorCauseFields,r as logDebug,i as logError,a as logInfo,o as logWarn,s as otelResourceAttributes,c as setStderrLogging,l as shutdownLogging,u as useServerProcessLogging}from"./logging-mtFV7E-2.js";
1
+ export{t as describeError,n as errorCauseFields,r as logDebug,i as logError,a as logInfo,o as logWarn,s as otelResourceAttributes,c as setStderrLogging,l as shutdownLogging,u as useServerProcessLogging}from"./logging-CD5QGdx4.js";