@aventurevc/aventure-cli 0.8.186 → 0.8.188

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 (43) hide show
  1. package/dist/aventure-cli/command-catalog.compact.txt +1 -0
  2. package/dist/aventure-cli/index.js +1 -1
  3. package/dist/aventure-cli/unified-operations.json +22 -2
  4. package/dist/chunks/api-key-bearer-credential-DIELOZAr.js +1 -0
  5. package/dist/chunks/{api-key-bearer-credential-BYpoThef.js → api-key-bearer-credential-auXuInf6.js} +1 -1
  6. package/dist/chunks/{aventure-cli-CkS2Nrdy.js → aventure-cli-B7uBrRXc.js} +10 -10
  7. package/dist/chunks/{cli-help-policy-RGOSoZ1Z.js → cli-help-policy-CuiFrmX2.js} +1 -1
  8. package/dist/chunks/contract-51x33o36.js +27 -0
  9. package/dist/chunks/{dist-CXpQ87Pz.js → dist-axdCszgo.js} +2 -2
  10. package/dist/chunks/{env-YDNggcP1.js → env-DPGP9jZR.js} +1 -1
  11. package/dist/chunks/{logging-CDCaRpiW.js → logging-CkWwAnww.js} +1 -1
  12. package/dist/chunks/logging-lT5vID0k.js +1 -0
  13. package/dist/chunks/mcp-generation-contract-CSoZkn3E.js +1 -0
  14. package/dist/chunks/{mcp-generation-contract-B6pMxUtz.js → mcp-generation-contract-CkT_WyFS.js} +1 -1
  15. package/dist/chunks/{oauth-bearer-credential-DU8FTqw7.js → oauth-bearer-credential-BjkmIecw.js} +2 -2
  16. package/dist/chunks/oauth-bearer-credential-w-C8_ira.js +1 -0
  17. package/dist/chunks/oauth-login-C_8ieKkJ.js +1 -0
  18. package/dist/chunks/{oauth-login-BvM3PU4d.js → oauth-login-wfbfdu7f.js} +1 -1
  19. package/dist/chunks/openapi-commands-C9XNQlI0.js +1 -0
  20. package/dist/chunks/openapi-commands-M-pZ7Kvh.js +1 -0
  21. package/dist/chunks/{output-mode-vMKFzwSx.js → output-mode-Doaex9bB.js} +1 -1
  22. package/dist/chunks/output-mode-PwV0q-uN.js +1 -0
  23. package/dist/chunks/{output-spill-DNpXqseL.js → output-spill-NbFsMmQ4.js} +1 -1
  24. package/dist/chunks/provider-catalog-CI4nnqXT.js +1 -0
  25. package/dist/chunks/{response-problem-DEZ2kyCp.js → response-problem-BWkiz0cI.js} +1 -1
  26. package/dist/chunks/result-envelope-CMkMWwDI.js +1 -0
  27. package/dist/chunks/startup-auth-Cdvg6ORp.js +1 -0
  28. package/dist/chunks/startup-auth-DR9tpZZR.js +1 -0
  29. package/dist/chunks/{tool-policy-D7R8FUUe.js → tool-policy-Cu9R-Sz2.js} +1 -1
  30. package/package.json +3 -3
  31. package/dist/chunks/api-key-bearer-credential-B-1UINE8.js +0 -1
  32. package/dist/chunks/contract-BGHL_lBv.js +0 -27
  33. package/dist/chunks/logging-C5C6Bsga.js +0 -1
  34. package/dist/chunks/mcp-generation-contract-Ch56aEHy.js +0 -1
  35. package/dist/chunks/oauth-bearer-credential-Cwn03TGq.js +0 -1
  36. package/dist/chunks/oauth-login-c3frMYua.js +0 -1
  37. package/dist/chunks/openapi-commands-C0WAjaN3.js +0 -1
  38. package/dist/chunks/openapi-commands-K3hFzG4D.js +0 -1
  39. package/dist/chunks/output-mode-BlKnxa9F.js +0 -1
  40. package/dist/chunks/provider-catalog-B7G8OXYn.js +0 -1
  41. package/dist/chunks/result-envelope-D5wNfKzB.js +0 -1
  42. package/dist/chunks/startup-auth-BCJtMtHx.js +0 -1
  43. package/dist/chunks/startup-auth-BJ3mNNZp.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./openapi-commands-C9XNQlI0.js";export{e as GENERATED_OPENAPI_COMMAND_SPECS};
@@ -1 +1 @@
1
- import{n as e}from"./commander-BB7CDPLs.js";import{t}from"./result-envelope-D5wNfKzB.js";import{t as n}from"./output-spill-DNpXqseL.js";var r=`${t/1e3}KB`,i=[{flags:`--text`,description:`Print text (terminal default).`,conflicts:[`data`,`dataFull`,`json`]},{flags:`--data`,description:`Print data JSON (piped default); over ${r} prints a truncated envelope, not the payload; use --to-file.`,conflicts:[`text`,`dataFull`,`json`]},{flags:`--data-full`,description:`Print uncapped JSON for bounded programs; never LLM agents.`,conflicts:[`text`,`data`,`json`,`toFile`]},{flags:`--to-file <path>`,description:`Write the response to <path> and print only a receipt: {spilledTo, byteLength} for an API read, else a 'spilled <bytes> bytes to <path>' line; a failure still prints inline.`,conflicts:[`dataFull`]},{flags:`--json`,description:`Print the stable JSON envelope (capped at ${r}).`,conflicts:[`text`,`data`,`dataFull`]},{flags:`--all-fields`,description:`Print text including the detail fields --text hides; --data and --json already carry every field.`,conflicts:[]}],a=new Intl.ListFormat(`en`,{type:`disjunction`});function o(t){let n=i.map(t=>({spec:t,option:new e(t.flags)}));for(let{spec:e,option:r}of n){let i=n.filter(({option:t})=>e.conflicts.some(e=>e===t.attributeName())).flatMap(({option:e})=>e.long??[]);r.description=i.length===0?e.description:`${e.description} Cannot combine with ${a.format(i)}.`,t.addOption(r.conflicts([...e.conflicts]))}return t}function s(e,t=`auto`){return d(e.toFile)&&n(e.toFile),e.json===!0?`json`:e.dataFull===!0?`data-full`:e.data===!0?`data`:e.text===!0||e.allFields===!0?`text`:u(e)||t===`auto`&&!process.stdout.isTTY?`data`:`text`}function c(e){if(e.includes(`--text`))return!1;let t=e.includes(`--json`)||e.includes(`--data`)||e.includes(`--data-full`);return e.includes(`--all-fields`)&&!t?!1:t||e.includes(`--agent-chassis`)&&e.includes(`--agent-model`)||!process.stdout.isTTY}function l(e){return e===`data`||e===`data-full`||e===`json`}function u(e){return d(e.agentChassis)&&d(e.agentModel)}function d(e){return typeof e==`string`&&e.trim().length>0}export{s as i,c as n,l as r,o as t};
1
+ import{n as e}from"./commander-BB7CDPLs.js";import{t}from"./result-envelope-CMkMWwDI.js";import{t as n}from"./output-spill-NbFsMmQ4.js";var r=`${t/1e3}KB`,i=[{flags:`--text`,description:`Print text (terminal default).`,conflicts:[`data`,`dataFull`,`json`]},{flags:`--data`,description:`Print data JSON (piped default); over ${r} prints a truncated envelope, not the payload; use --to-file.`,conflicts:[`text`,`dataFull`,`json`]},{flags:`--data-full`,description:`Print uncapped JSON for bounded programs; never LLM agents.`,conflicts:[`text`,`data`,`json`,`toFile`]},{flags:`--to-file <path>`,description:`Write the response to <path> and print only a receipt: {spilledTo, byteLength} for an API read, else a 'spilled <bytes> bytes to <path>' line; a failure still prints inline.`,conflicts:[`dataFull`]},{flags:`--json`,description:`Print the stable JSON envelope (capped at ${r}).`,conflicts:[`text`,`data`,`dataFull`]},{flags:`--all-fields`,description:`Print text including the detail fields --text hides; --data and --json already carry every field.`,conflicts:[]}],a=new Intl.ListFormat(`en`,{type:`disjunction`});function o(t){let n=i.map(t=>({spec:t,option:new e(t.flags)}));for(let{spec:e,option:r}of n){let i=n.filter(({option:t})=>e.conflicts.some(e=>e===t.attributeName())).flatMap(({option:e})=>e.long??[]);r.description=i.length===0?e.description:`${e.description} Cannot combine with ${a.format(i)}.`,t.addOption(r.conflicts([...e.conflicts]))}return t}function s(e,t=`auto`){return d(e.toFile)&&n(e.toFile),e.json===!0?`json`:e.dataFull===!0?`data-full`:e.data===!0?`data`:e.text===!0||e.allFields===!0?`text`:u(e)||t===`auto`&&!process.stdout.isTTY?`data`:`text`}function c(e){if(e.includes(`--text`))return!1;let t=e.includes(`--json`)||e.includes(`--data`)||e.includes(`--data-full`);return e.includes(`--all-fields`)&&!t?!1:t||e.includes(`--agent-chassis`)&&e.includes(`--agent-model`)||!process.stdout.isTTY}function l(e){return e===`data`||e===`data-full`||e===`json`}function u(e){return d(e.agentChassis)&&d(e.agentModel)}function d(e){return typeof e==`string`&&e.trim().length>0}export{s as i,c as n,l as r,o as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./output-mode-Doaex9bB.js";export{e as cliMachineOutputSelected};
@@ -1 +1 @@
1
- import{i as e}from"./result-envelope-D5wNfKzB.js";import{dirname as t}from"node:path";import{mkdirSync as n,writeFileSync as r}from"node:fs";import{Buffer as i}from"node:buffer";var a;function o(e){a=e}function s(e){return typeof e!=`object`||!e||Array.isArray(e)||!Reflect.has(e,`method`)||!Reflect.has(e,`endpoint`)||!(`response`in e)||e.response===void 0?e:e.response}function c(o){let c=a;if(c===void 0)return o;a=void 0;let u=o.data,d=o.ok?u instanceof Uint8Array?u:typeof u==`string`?i.from(u,`utf8`):l(s(u)):l(o);try{n(t(c),{recursive:!0}),r(c,d)}catch(t){return e(`could not spill output to '${c}'`,[String(t)])}if(!o.ok)return o;if(typeof u!=`object`||!u||u instanceof Uint8Array||s(u)===u)return{...o,data:`spilled ${d.byteLength} bytes to '${c}'`};let f=s(u),p,m=!1;if(typeof f==`object`&&f&&!Array.isArray(f)&&!(`content`in f)&&!(`score`in f)&&!(`id`in f&&`core`in f)){m=`core`in f;let e=`core`in f?Object.hasOwn(f,`core`)?f.core:void 0:f;typeof e==`object`&&e&&!Array.isArray(e)&&`id`in e&&Object.hasOwn(e,`id`)&&(typeof e.id==`string`||typeof e.id==`number`&&Number.isSafeInteger(e.id))&&(p=e.id)}return{...o,data:{...u,response:{spilledTo:c,byteLength:d.byteLength,...p===void 0?{}:m?{core:{id:p}}:{id:p}}}}}function l(e){return i.from(JSON.stringify(e,null,2),`utf8`)}export{s as n,c as r,o as t};
1
+ import{i as e}from"./result-envelope-CMkMWwDI.js";import{dirname as t}from"node:path";import{mkdirSync as n,writeFileSync as r}from"node:fs";import{Buffer as i}from"node:buffer";var a;function o(e){a=e}function s(e){return typeof e!=`object`||!e||Array.isArray(e)||!Reflect.has(e,`method`)||!Reflect.has(e,`endpoint`)||!(`response`in e)||e.response===void 0?e:e.response}function c(o){let c=a;if(c===void 0)return o;a=void 0;let u=o.data,d=o.ok?u instanceof Uint8Array?u:typeof u==`string`?i.from(u,`utf8`):l(s(u)):l(o);try{n(t(c),{recursive:!0}),r(c,d)}catch(t){return e(`could not spill output to '${c}'`,[String(t)])}if(!o.ok)return o;if(typeof u!=`object`||!u||u instanceof Uint8Array||s(u)===u)return{...o,data:`spilled ${d.byteLength} bytes to '${c}'`};let f=s(u),p,m=!1;if(typeof f==`object`&&f&&!Array.isArray(f)&&!(`content`in f&&Array.isArray(f.content))&&!(`score`in f)&&!(`id`in f&&`core`in f)){m=`core`in f;let e=`core`in f?Object.hasOwn(f,`core`)?f.core:void 0:f;typeof e==`object`&&e&&!Array.isArray(e)&&`id`in e&&Object.hasOwn(e,`id`)&&(typeof e.id==`string`||typeof e.id==`number`&&Number.isSafeInteger(e.id))&&(p=e.id)}return{...o,data:{...u,response:{spilledTo:c,byteLength:d.byteLength,...p===void 0?{}:m?{core:{id:p}}:{id:p}}}}}function l(e){return i.from(JSON.stringify(e,null,2),`utf8`)}export{s as n,c as r,o as t};
@@ -0,0 +1 @@
1
+ import{w as e,y as t}from"./person-owner-BJgNYLKX.js";import{Vr as n}from"./dist-axdCszgo.js";var r=t({clerkPublishableKey:e().nullish(),oauthClient:n.nullish()});export{r as t};
@@ -1 +1 @@
1
- import{S as e,w as t}from"./person-owner-BJgNYLKX.js";import{d as n,u as r}from"./result-envelope-D5wNfKzB.js";var i=/(?:authorization|api-key|secret|token)/iu,a=/^x-cli-[a-z0-9-]*secret$/iu;function o(r,i,a={}){let o=d(a);o.length>0&&(i=s(i,o));let l=e(t(),n).safeParse(i);if(!l.success)return{status:r,title:`HTTP ${r}`,type:`about:blank`,code:void 0,detail:typeof i==`string`?i:void 0};let u=c(l.data),f=typeof u.status==`number`?u.status:r;return{...u,status:f,title:typeof u.title==`string`?u.title:`HTTP ${f}`,type:typeof u.type==`string`?u.type:`about:blank`,detail:typeof u.detail==`string`?u.detail:void 0}}function s(e,t){return typeof e==`string`?f(e,t):typeof e!=`object`||!e?e:Array.isArray(e)?e.map(e=>s(e,t)):Object.fromEntries(Object.entries(e).map(([e,n])=>[f(e,t),s(n,t)]))}function c(e){let t=r.safeParse(e);if(t.success)return e;let n=new Set(t.error.issues.map(e=>String(e.path[0])));return Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))}function l(e,t){if(u(t))return{status:e.status,title:`CLI authorization broker request failed`};let n=d(t),r={};for(let[t,i]of Object.entries(e))i!=null&&(r[t]=typeof i==`object`?JSON.stringify(s(i,n)):typeof i==`string`?f(i,n):i);return r}function u(e){return Object.keys(e).some(e=>a.test(e))}function d(e){let t=[];for(let[n,r]of Object.entries(e)){if(!i.test(n))continue;let e=r.trim();if(e.length===0)continue;t.push(e);let a=e.indexOf(` `);if(a>0){let n=e.slice(a+1).trim();n.length>0&&t.push(n)}}return t}function f(e,t){let n=e;for(let e of t)e!=null&&e.length>0&&(n=n.replaceAll(e,`<redacted>`));return n}function p(e,t){if(u(t))return{status:e.status,title:`CLI authorization broker request failed`,type:`about:blank`,detail:`Broker diagnostic text was suppressed at the CLI credential boundary.`,...h(e)};let n=d(t);if(n.length===0)return e;let r=t=>{let r=e[t];return typeof r==`string`?{[t]:f(r,n)}:{}},i=t=>{let r=e[t];return r==null?{}:{[t]:Object.fromEntries(Object.entries(r).map(([e,t])=>[f(e,n),f(t,n)]))}},a=t=>{let r=e[t];return Array.isArray(r)?{[t]:r.map(e=>f(e,n))}:{}};return{status:e.status,title:f(e.title,n),type:f(e.type,n),...r(`detail`),...r(`hint`),...r(`field`),...r(`suggestion`),...r(`requiredRole`),...r(`existingRecordId`),...i(`suggestions`),...i(`error`),...a(`unknownParameters`),...a(`validParameters`),...e.details===void 0?{}:{details:e.details},...e.resolution===void 0?{}:{resolution:e.resolution},...e.code===void 0?{}:{code:e.code},...e.disposition==null?{}:{disposition:e.disposition},...Array.isArray(e.proseViolation)?{proseViolation:e.proseViolation.map(e=>({...e,passage:f(e.passage,n),reason:f(e.reason,n)}))}:{},...r(`traceId`),...r(`spanId`),...e.limitType===void 0?{}:{limitType:e.limitType},...e.allowanceType===void 0?{}:{allowanceType:e.allowanceType},...e.limit===void 0?{}:{limit:e.limit},...e.used===void 0?{}:{used:e.used},...e.remaining===void 0?{}:{remaining:e.remaining},...e.resetAt===void 0?{}:{resetAt:e.resetAt},...e.windowSeconds===void 0?{}:{windowSeconds:e.windowSeconds},...e.filedRunId?{filedRunId:e.filedRunId}:{},...h(e)}}function m(e,t){if(_(e.retryAfterSeconds)!==void 0)return e;let n=g(t.get(`retry-after`));return n===void 0?e:{...e,retryAfterSeconds:n}}function h(e){let t=_(e.retryAfterSeconds);return t===void 0?{}:{retryAfterSeconds:t}}function g(e){let t=e?.trim()??``;if(/^\d+$/u.test(t))return _(Number(t));let n=/[a-z]/iu.test(t)?new Date(t).getTime():NaN;return Number.isNaN(n)?void 0:_(Math.ceil((n-Date.now())/1e3))}function _(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:void 0}export{p as a,m as c,d as i,o as n,g as o,f as r,_ as s,l as t};
1
+ import{S as e,w as t}from"./person-owner-BJgNYLKX.js";import{d as n,u as r}from"./result-envelope-CMkMWwDI.js";var i=/(?:authorization|api-key|secret|token)/iu,a=/^x-cli-[a-z0-9-]*secret$/iu;function o(r,i,a={}){let o=d(a);o.length>0&&(i=s(i,o));let l=e(t(),n).safeParse(i);if(!l.success)return{status:r,title:`HTTP ${r}`,type:`about:blank`,code:void 0,detail:typeof i==`string`?i:void 0};let u=c(l.data),f=typeof u.status==`number`?u.status:r;return{...u,status:f,title:typeof u.title==`string`?u.title:`HTTP ${f}`,type:typeof u.type==`string`?u.type:`about:blank`,detail:typeof u.detail==`string`?u.detail:void 0}}function s(e,t){return typeof e==`string`?f(e,t):typeof e!=`object`||!e?e:Array.isArray(e)?e.map(e=>s(e,t)):Object.fromEntries(Object.entries(e).map(([e,n])=>[f(e,t),s(n,t)]))}function c(e){let t=r.safeParse(e);if(t.success)return e;let n=new Set(t.error.issues.map(e=>String(e.path[0])));return Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))}function l(e,t){if(u(t))return{status:e.status,title:`CLI authorization broker request failed`};let n=d(t),r={};for(let[t,i]of Object.entries(e))i!=null&&(r[t]=typeof i==`object`?JSON.stringify(s(i,n)):typeof i==`string`?f(i,n):i);return r}function u(e){return Object.keys(e).some(e=>a.test(e))}function d(e){let t=[];for(let[n,r]of Object.entries(e)){if(!i.test(n))continue;let e=r.trim();if(e.length===0)continue;t.push(e);let a=e.indexOf(` `);if(a>0){let n=e.slice(a+1).trim();n.length>0&&t.push(n)}}return t}function f(e,t){let n=e;for(let e of t)e!=null&&e.length>0&&(n=n.replaceAll(e,`<redacted>`));return n}function p(e,t){if(u(t))return{status:e.status,title:`CLI authorization broker request failed`,type:`about:blank`,detail:`Broker diagnostic text was suppressed at the CLI credential boundary.`,...h(e)};let n=d(t);if(n.length===0)return e;let r=t=>{let r=e[t];return typeof r==`string`?{[t]:f(r,n)}:{}},i=t=>{let r=e[t];return r==null?{}:{[t]:Object.fromEntries(Object.entries(r).map(([e,t])=>[f(e,n),f(t,n)]))}},a=t=>{let r=e[t];return Array.isArray(r)?{[t]:r.map(e=>f(e,n))}:{}};return{status:e.status,title:f(e.title,n),type:f(e.type,n),...r(`detail`),...r(`hint`),...r(`field`),...r(`suggestion`),...r(`requiredRole`),...r(`existingRecordId`),...i(`suggestions`),...i(`error`),...a(`unknownParameters`),...a(`validParameters`),...e.details===void 0?{}:{details:e.details},...e.resolution===void 0?{}:{resolution:e.resolution},...e.code===void 0?{}:{code:e.code},...e.disposition==null?{}:{disposition:e.disposition},...Array.isArray(e.proseViolation)?{proseViolation:e.proseViolation.map(e=>({...e,passage:f(e.passage,n),reason:f(e.reason,n)}))}:{},...r(`traceId`),...r(`spanId`),...e.limitType===void 0?{}:{limitType:e.limitType},...e.allowanceType===void 0?{}:{allowanceType:e.allowanceType},...e.limit===void 0?{}:{limit:e.limit},...e.used===void 0?{}:{used:e.used},...e.remaining===void 0?{}:{remaining:e.remaining},...e.resetAt===void 0?{}:{resetAt:e.resetAt},...e.windowSeconds===void 0?{}:{windowSeconds:e.windowSeconds},...e.filedRunId?{filedRunId:e.filedRunId}:{},...h(e)}}function m(e,t){if(_(e.retryAfterSeconds)!==void 0)return e;let n=g(t.get(`retry-after`));return n===void 0?e:{...e,retryAfterSeconds:n}}function h(e){let t=_(e.retryAfterSeconds);return t===void 0?{}:{retryAfterSeconds:t}}function g(e){let t=e?.trim()??``;if(/^\d+$/u.test(t))return _(Number(t));let n=/[a-z]/iu.test(t)?new Date(t).getTime():NaN;return Number.isNaN(n)?void 0:_(Math.ceil((n-Date.now())/1e3))}function _(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:void 0}export{p as a,m as c,d as i,o as n,g as o,f as r,_ as s,l as t};
@@ -0,0 +1 @@
1
+ import{E as e,O as t,S as n,T as r,h as i,i as a,l as o,n as s,o as c,p as l,s as u,t as d,u as f,v as p,w as m,y as h}from"./person-owner-BJgNYLKX.js";import{Buffer as g}from"node:buffer";var _=i(()=>r([m(),p(),f(),u(),o(_),n(m(),_)])),v=c([`URL_DUPLICATE`,`STRICT_URL_LOOKUP`,`DUPLICATE_CREATE_REVIEW`,`CLASSIFICATION_INACTIVE_TAG`,`NEWS_SOURCE_URL`]),y=Object.assign(r([v,m()]),{enum:v.enum}),ee=c([`REACTIVATE`,`ATTACH_INACTIVE`]),te=h({availableOverrides:o(ee),conflictType:y,slug:m(),tagId:l()}),b=h({externalId:m().nullish(),id:l(),reason:o(m()),score:l(),slug:m().regex(/^[a-z0-9_-]+$/).max(255).nullish()}),x=h({externalId:m().nullish(),id:t(),name:m().nullish(),operatingStatus:m().nullish(),publicPath:m().nullish(),reason:o(m()),score:l().optional(),slug:m().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:s.nullish()}),S=h({candidate:o(x).nullish(),conflictType:y,newsCandidate:o(b).nullish(),overridePath:m().nullish(),threshold:l()}),ne=h({conflictingArticleId:l(),conflictingArticleSlug:m(),conflictingArticleTitle:m(),conflictType:y}),re=h({candidateEntityId:o(t()),candidatePersonId:o(t()),conflictType:y,hint:m(),normalizedUrl:m().nullish(),url:m(),urlType:m().nullish()}),ie=h({owner:d,urlId:l()}),ae=h({conflictType:y,existingJoin:o(ie),fragmentIgnored:f(),guidance:m(),normalizedUrl:m().nullish(),requestedOwner:d,url:m(),urlType:m()}),C=r([ae,re,S,te,ne]),w=h({acceptedValue:o(m()).nullish(),action:c([`setField`,`setParameter`,`removeParameter`,`useEndpoint`,`reviewCandidates`,`authenticate`]),endpoint:m().nullish(),fieldPath:m().nullish(),parameter:m().nullish(),retryable:f().nullish()}),T=c([`source`,`record`,`disclaimer`,`voice`,`marketing`,`chained`,`structured`,`tense`,`temporal`,`factList`,`mojibake`,`unsupported`,`legalSource`,`textContract`]),E=Object.assign(r([T,m()]),{enum:T.enum}),oe=h({overridable:f(),passage:m(),problem:E,reason:m()}),D=c([`entity`,`person`,`news`,`blog`,`content`]),se=h({deletedAt:a({offset:!0}).nullish(),id:m(),isHidden:f(),nameBrand:m().nullish(),resourceType:D,showOnSitemap:f(),slug:m()}),ce=h({newUrl:m().nullish(),oldUrl:m(),targetCurrentSlug:m().nullish(),targetId:m().nullish(),targetResourceType:D.nullish()}),O=c([`COMPANY`,`PERSON`,`ENTITY_VIEW`,`ENTITY_BRAND`,`PERSON_VIEW`,`WEB_SEARCH`]),le=Object.assign(r([O,m()]),{enum:O.enum}),k=h({allowanceType:le.nullish(),circuitBreaker:m().nullish(),code:r([c(`not_authorized.rateLimited.rate_limited.subscription_required.subscription_canceled.subscription_past_due.subscription_paused.billing_allowance_exhausted.billing_additional_usage_cap_reached.billing_credit_checkout_closed.account_exists.origin_detail_capacity.origin_detail_shutdown.suspectedShellStrip.suspected_shell_strip.prose_rejected.url_surface_misclassification.JOBRUNR_DISABLED.jobrunr_disabled.task_plan_operation_unserved.JOBRUNR_STORAGE_UNAVAILABLE.jobrunr_storage_unavailable.rbac_lookup_unavailable.GEOCODE_PROVIDER_ERROR.geocode_provider_error.sentry_api_error.frontend_cache_epoch_mode_not_targeted.image_blocklist_match.image_monochrome.image_too_small.image_wrong_aspect.image_monogram.image_unreadable.image_processing_error.image_brand_mismatch.image_photographic.web_crawl_fetch_failed.source_document_fetch_busy.primary_website_missing.news_rss_feed_fetch_failed.news_rss_article_fetch_failed.callback_connection_refused.callback_timeout.callback_tls_error.callback_http_4xx.callback_http_5xx.callback_challenge_failed.news_subscription_limit.r2_fetch_failed.r2_delete_failed.r2_upload_failed.source_document_body_unavailable.source_document_capture_limit_exceeded.news_similarity_embedding_unavailable.search_provider_not_configured.search_provider_error.search_still_running.lookup_still_running.sec_edgar_fetch_failed.github_fetch_failed.INFERENCE_PROVIDER_ERROR.inference_provider_error.INFERENCE_PROVIDER_RESPONSE_EMPTY.inference_provider_response_empty.INFERENCE_PROVIDER_INVALID_JSON.inference_provider_invalid_json.INFERENCE_PROFILES_MISSING.inference_profiles_missing.INFERENCE_PROFILE_API_KEY_MISSING.inference_profile_api_key_missing`.split(`.`)),m().max(128)]).nullish(),conflictingRecord:se.nullish(),detail:m().optional(),details:C.nullish(),disposition:c([`TRANSIENT`,`TERMINAL`]).nullish(),error:n(m(),m()).nullish(),existingRecordId:m().nullish(),existingRedirect:ce.nullish(),feId:m().nullish(),field:m().nullish(),filedRunId:o(t()).nullish(),hammingDistance:p().int().nullish(),hint:m().nullish(),instance:m().optional(),limit:p().int().nullish(),limitType:r([c([`FORM`,`GLOBAL`,`SUBNET`,`IP`,`UNKNOWN`,`RESILIENCE4J`,`WEB_SEARCH`,`AGENT_HELP`,`NATURAL_SEARCH`,`BILLING_ALLOWANCE`,`BILLING_ADDITIONAL_USAGE`,`CLERK_PUBLIC_ADMISSION`,`CLERK_SCRIPT_LOAD`,`ORIGIN_DETAIL`,`INFERENCE_PROVIDER`]),m()]).nullish(),matchedBlocklistKey:m().nullish(),mediaType:m().nullish(),moderationReason:m().nullish(),parseError:m().nullish(),path:m().nullish(),properties:n(m(),_).optional(),proseViolation:o(oe).nullish(),remaining:p().int().nullish(),requiredRole:m().nullish(),resetAt:a({offset:!0}).nullish(),resolution:w.nullish(),retryAfterSeconds:p().int().nullish(),spanId:m().nullish(),status:l().optional(),suggestion:m().nullish(),suggestions:n(m(),m()).nullish(),suspectedFragment:m().nullish(),title:m().optional(),traceId:m().nullish(),type:m().optional(),unknownParameters:o(m()).nullish(),used:p().int().nullish(),validParameters:o(m()).nullish(),value:m().nullish(),windowSeconds:p().int().nullish()}),ue=e=>e>=500&&e<600,A=r([m(),p(),f()]),j=h({number:p().optional(),size:p().optional(),numberOfElements:p().optional(),totalElements:p().optional(),totalPages:p().optional(),first:f().optional(),last:f().optional(),empty:f().optional()}),M=h({byteLength:p(),maxBytes:p(),omitted:o(m()),recovery:m()}),N=h({status:p(),title:m(),type:m()}).catchall(_.optional()).and(k);h({ok:f(),summary:m(),httpStatus:p().optional(),operationId:m().optional(),method:m().optional(),endpoint:m().optional(),format:c([`json`,`text`]).optional(),count:p().optional(),page:j.optional(),filters:n(m(),r([A,o(A)])).optional(),truncated:f().optional(),truncation:M.optional(),omitted:o(m()).default([]),ids:o(m()).default([]),counts:n(m(),p()).default({}),references:o(m()).default([]),warnings:o(m()).default([]),problem:N.optional(),data:e()});var P=5e4,F=[50,25,10,5,1],I=320,L=[{arrayLimit:1/0,rowLimit:1/0,stringLimit:24e3},{arrayLimit:1/0,rowLimit:1/0,stringLimit:1e4},...F.map(e=>({arrayLimit:e,rowLimit:1/0}))],R=1e3,z=/^(?:bio|biography|body|content|description|evidence|fulltext|notes|snippet|summary|text)$/u,B=/(?:description|snippet|summary|text)$/u;function V(e){let t=j.safeParse(e);return t.success&&Object.values(t.data).some(e=>e!==void 0)?t.data:void 0}function H(e,t){if(t?.numberOfElements!==void 0)return t.numberOfElements;if(Array.isArray(e))return e.length;let n=$(e)?e.content:void 0;return Array.isArray(n)?n.length:void 0}function U(e,t,n={}){return{ok:!0,summary:e,...n,omitted:n.omitted??[],ids:n.ids??[],counts:n.counts??{},references:n.references??[],warnings:n.warnings??[],data:t}}function de(e,t=[],n={}){return{...U(e,null,{...n,warnings:t}),ok:!1}}function fe(e,t={}){let n={byteLength:g.byteLength(JSON.stringify(e),`utf8`),maxBytes:t.maxBytes??5e4};if(n.byteLength<=n.maxBytes)return e;let r=e.httpStatus??0;if(t.write===!0&&e.ok&&r>=200&&r<300)return pe(e,n,t.exactRecovery);let i=t.exactRecovery??`Refetch a narrower result: use ids/references, a more specific list read (e.g. entities relationships list, entities people list, or news list --owner-entity-id), filters, or smaller pages with page and size.`,a=_.safeParse(JSON.parse(JSON.stringify(e.data))),o=t=>{let r=a.success?Y(a.data,`data`,n,t):{value:Z(n),omitted:[`data`]};return{...e,truncated:!0,truncation:X(n,r.omitted,i),warnings:[...e.warnings,...t.rowLimit===1/0?[]:[_e(t.rowLimit)],`response truncated (>${n.maxBytes/1e3}KB); read the section through its sub-resource operation, or request a smaller page, a compact projection where the operation offers one, or a narrower server-side filter`],data:r.value}},s=e;for(let e of L)if(s=o(e),K(s,n.maxBytes))return s;let c=0;for(let t=2**Math.floor(Math.log2(J(e.data)));t>=1;t/=2)K(o({arrayLimit:1,rowLimit:c+t}),n.maxBytes)&&(c+=t);return c>0?o({arrayLimit:1,rowLimit:c}):W({...s,truncation:X(n,[`data`],i),data:Z(n)},n,i,`response truncated (>${n.maxBytes/1e3}KB); metadata named in truncation.omitted was removed; read the section through its sub-resource operation, or request a smaller page, a compact projection where the operation offers one, or a narrower server-side filter`)}function pe(e,t,n=`Read the full result through the GET operation on ${e.endpoint??`this route`}.`){let r={...e.counts},i=(e,n)=>{let a={};for(let[o,s]of Object.entries($(e)?e:{}))Array.isArray(s)?r[`${n}${o}`]=s.length:typeof s==`string`?a[o]=q(s,t,I):typeof s!=`object`||!s?a[o]=s:n===``&&o===`response`&&(a[o]=i(s,`response.`));return a},a={...e,summary:`${e.method} succeeded (HTTP ${e.httpStatus}); response body omitted (${t.byteLength} bytes, over the ${t.maxBytes/1e3}KB cap); do not retry the write`,truncated:!0,truncation:X(t,[`data`],n),counts:r,data:i(e.data,``)},o=a,s=[`data`],c={};for(let r of[`references`,`ids`,`warnings`]){if(K(o,t.maxBytes))return o;s.push(r),c[r]=[],o={...a,...c,omitted:[...e.omitted,...s.slice(1)],truncation:X(t,s,n)}}return K(o,t.maxBytes)?o:W({...o,data:Z(t),warnings:[`response truncated (>${t.maxBytes/1e3}KB); do not retry the write`]},t,n,`response truncated (>${t.maxBytes/1e3}KB); metadata named in truncation.omitted was removed; do not retry the write`)}function W(e,t,n,r){if(K(e,t.maxBytes))return e;let i=e.warnings.slice(0,-1),a=[`data`],o=e;if(o.problem!==void 0){let e=G(o.problem);if(JSON.stringify(e).length<JSON.stringify(o.problem).length&&(a.push(`problem`),o={...o,problem:e,truncation:X(t,a,n)},K(o,t.maxBytes)))return o}let s=[];if(e.filters!==void 0&&s.push(`filters`),e.omitted.length>0&&s.push(`omitted`),e.ids.length>0&&s.push(`ids`),Object.keys(e.counts).length>0&&s.push(`counts`),e.references.length>0&&s.push(`references`),a.push(...s),o={...o,filters:void 0,truncation:X(t,a,n),omitted:[],ids:[],counts:{},references:[],warnings:s.length===0?e.warnings:[...i,r]},K(o,t.maxBytes))return o;let c=e=>e===void 0?void 0:q(e,t),l={summary:q(o.summary,t),operationId:c(o.operationId),method:c(o.method),endpoint:c(o.endpoint),warnings:o.warnings.map(e=>q(e,t)),problem:o.problem&&G(o.problem,t)},u=new Map(Object.entries(o));for(let[e,t]of Object.entries(l))JSON.stringify(t)!==JSON.stringify(u.get(e))&&a.push(e);if(o={...o,...l,truncation:X(t,a,n)},K(o,t.maxBytes))return o;a.push(`warnings`),o.page!==void 0&&a.push(`page`);let d=q(o.summary,t,I);return d!==o.summary&&a.push(`summary`),{...o,summary:d,page:void 0,truncation:X(t,a,n),warnings:[r]}}function G(e,t){let n=e=>t===void 0?e:q(e,t);return{status:e.status,title:n(e.title),type:n(e.type),...e.detail===void 0?{}:{detail:n(e.detail)},...e.instance===void 0?{}:{instance:n(e.instance)},...e.code===void 0?{}:{code:typeof e.code==`string`?n(e.code):e.code},...e.retryAfterSeconds===void 0?{}:{retryAfterSeconds:e.retryAfterSeconds}}}function K(e,t=P){return g.byteLength(JSON.stringify(e),`utf8`)<=t}function q(e,t,n=R){if(g.byteLength(JSON.stringify(e),`utf8`)<=n)return e;let r=Q(t),i=``,a=g.byteLength(JSON.stringify(r),`utf8`);for(let t of e){let e=g.byteLength(JSON.stringify(t),`utf8`)-2;if(a+e>n)break;i+=t,a+=e}return`${i.trimEnd()}${r}`}function J(e){return Array.isArray(e)?e.length:$(e)?Math.max(0,...Object.values(e).map(J)):0}function Y(e,t,n,r){if(typeof e==`string`){let i=he(ve(t))||e.length>R,a=r.stringLimit??I;return!i||e.length<=a?{value:e,omitted:[]}:{value:`${e.slice(0,a).trimEnd()}${Q(n)}`,omitted:[t]}}if(typeof e!=`object`||!e)return{value:e,omitted:[]};if(Array.isArray(e))return me(e,t,n,r);if(t===`data.response.entity.answer`||t===`data.response.answer`)return{value:e,omitted:[]};let i={},a=[];for(let[o,s]of Object.entries(e)){if(s===void 0)continue;let e=Y(s,`${t}.${o}`,n,r);i[o]=e.value,a.push(...e.omitted)}return{value:i,omitted:a}}function me(e,t,n,r){let i=e.slice(0,r.rowLimit),a={...r,rowLimit:r.arrayLimit},o=i.map((e,r)=>Y(e,`${t}[${r}]`,n,a)),s=o.flatMap(e=>e.omitted),c=`${t}[${i.length}..] (kept ${i.length} of ${e.length})`;return{value:o.map(e=>e.value),omitted:e.length>i.length?[...s,c]:s}}function he(e){let t=e.toLowerCase();return z.test(t)||B.test(t)}var ge=`Refetch a narrower result: use ids/references, a more specific list read (e.g. entities relationships list, entities people list, or news list --owner-entity-id), filters, or smaller pages with page and size.`;function X(e,t,n){return{...e,omitted:t.length===0?[`data`]:[...new Set(t)],recovery:q(n,e)}}function Z(e){return{truncated:!0,...e}}function Q(e){return`\n[truncated byteLength=${e.byteLength} maxBytes=${e.maxBytes}]`}var _e=e=>`kept the first ${e} whole rows of each list; read the rest ${e} at a time: rerun a paged read with --size ${e} and --page 1, 2, … (MCP: size, page), or a batch read with at most ${e} ids per call`;function ve(e){return(e.split(`.`).at(-1)??e).replace(/\[\d+\]$/,``)}var $=e=>typeof e==`object`&&!!e&&!Array.isArray(e);export{K as a,U as c,_ as d,de as i,ue as l,ge as n,V as o,fe as r,H as s,P as t,k as u};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./commander-BB7CDPLs.js";import{o as r,u as i}from"./env-DPGP9jZR.js";import{c as a,i as o}from"./result-envelope-CMkMWwDI.js";import{_ as s}from"./tool-policy-Cu9R-Sz2.js";import{r as c}from"./cli-help-policy-CuiFrmX2.js";function l(e,t){return e.parameters.filter(e=>e.required&&t[e.optionKey]===void 0).map(e=>e.flag)}function u(e,t){return(e.requestBody?.length??0)>1&&typeof t.contentType==`string`?t.contentType:void 0}var d=e=>typeof e==`string`&&e.trim()===``;function f(e,t){let n=new Set([...t.parameters,...(t.requestBody??[]).flatMap(({parameter:e})=>e)].filter(e=>e.required).map(e=>e.optionKey));for(let t of e.options){let r=t.attributeName(),i=e.getOptionValue(r);if(!(Array.isArray(i)?i.some(d):d(i)))continue;let a=Array.isArray(i)?i.filter(e=>!d(e)):[];if(a.length>0){e.setOptionValue(r,a);continue}n.has(r)&&e.error(`error: option '${t.flags}' requires a value`),e.setOptionValue(r,void 0)}}function p(e){return e.split(` `)[0]??e}function m(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 h(e,t,n){let r=t.join(` `).trim();return r.length===0?a(`No positional text`,n):n[e.optionKey]===void 0?a(`Positional text parsed`,{...n,[e.optionKey]:r}):o(`Unexpected argument "${r}": ${p(e.flag)} already sets this value, and this command has no subcommand by that name. Drop "${r}".`)}var g={addresses:{summary:`List Address Links`,section:`administration`},"addresses links":{summary:`Returns entity and person association ids, owner ids, and nullable roles for a physical address, including historical associations`},agents:{summary:`Deprecated: Answer a Natural-Language Platform Help Question`,section:`cli`},"agents help":{summary:`Deprecated: use help ask (POST /v1/help) with the same body`},auth:{summary:`Sign-in, session, API key, and CLI authorization endpoints`,section:`account`},"auth api-key":{summary:`Get Current API Key`},"auth me":{summary:`Current User Permissions`},"auth me permissions":{summary:`Returns the current caller's resolved roles and permissions`},"auth providers":{summary:`Get the Sign-In Options`},billing:{summary:`Plans, prices, subscription, usage, and upgrades`,section:`account`},"billing additional-usage":{summary:`Update Additional Usage Settings`},"billing ai-credits":{summary:`Read the Current AI Credit Allowance`},"billing checkout-sessions":{summary:`Create or Recover a Checkout Session`},"billing credit-purchases":{summary:`Read a Prepaid Credit Purchase Confirmation`},"billing plan-change-previews":{summary:`Preview a Subscription Plan Change`},"billing plan-changes":{summary:`Change the Subscription Plan`},"billing plans":{summary:`List Subscription Tiers and Plans`},"billing portal-sessions":{summary:`Create a Hosted Billing Portal Session`},"billing subscription":{summary:`Read the Current Billing Subscription`},"billing subscription next-charge":{summary:`Preview the Next Subscription Charge`},"billing subscription payment-profile":{summary:`Read Your Card on File and Introductory Offer`},directory:{summary:`List Shared Directory Views`,section:`researchData`},"directory shared":{summary:`Share a Directory View`},"directory shared slug":{summary:`Read a Shared Directory View by Slug`},enrichments:{summary:`Enrich Many Companies and People`,section:`researchData`},entities:{summary:`Companies and funds: people, funding, and news`,section:`researchData`},"entities acquisitions":{summary:`Acquisitions a company made or was part of`},"entities addresses":{summary:`A company's recorded office and headquarters addresses`},"entities blog-posts":{summary:`External blog and article links for entities and people`},"entities brand":{summary:`Get a Company's Names, Logos, Links, and Tags`},"entities classifications":{summary:`Classification tags on a company, and suggested tags`},"entities classifications catalog":{summary:`Get the Company Classification Taxonomy`},"entities classifications suggestions":{summary:`Suggest Classifications for a Company`},"entities classifications tags":{summary:`List Classification Tags`},"entities content":{summary:`Publications about one company or person, and platform-wide publication search`},"entities content facets":{summary:`Count a Company's Publications`},"entities employee-counts":{summary:`List a Company's Headcount Over Time`},"entities enrichments":{summary:`Enrich One Company, Product, or Service`},"entities filters":{summary:`Filter options for company listings: available values, refinement, and option search`},"entities fundraise-investor-joins":{summary:`List the Investors in a Funding Round`},"entities fundraise-rounds":{summary:`List a Company's Funding Rounds`},"entities investments":{summary:`List the Investments a Company Made`},"entities investor-activity":{summary:`Get Investor Activity`},"entities investors":{summary:`List a Company's Investors`},"entities logo":{summary:`Get a Company Logo`},"entities lookup-exact":{summary:`Read Full Entity Detail by aVenture Profile URL, Slug, Website, or Domain`},"entities people":{summary:`People linked to companies, and the role each one holds`},"entities person-investors":{summary:`List Person Investors`},"entities relationships":{summary:`Relationships between companies, investors, and other organizations`},"entities relationships types":{summary:`List Entity Relationship Types`},"entities repositories":{summary:`List a Company's GitHub Repositories`},"entities research":{summary:`Get the Research Gathered About a Company`},"entities research-details":{summary:`List Research Details`},"entities research-details types":{summary:`List the Accepted Research Detail Types`},"entities research-snippets":{summary:`List Research Snippets`},"entities research-snippets types":{summary:`List the Accepted Research Snippet Types`},"entities search":{summary:`Search Companies, Products, and Services`},"entities search jobs":{summary:`Get an Async Semantic Entity Search`},"entities sec":{summary:`Get SEC EDGAR Facts for a Public Company`},"entities similar":{summary:`Similar companies and lean similar-company summaries by id`},"entities similar summary":{summary:`Get Similar Company Summaries by ID`},"entities slug":{summary:`Get a Company's Slug`},"entities texts":{summary:`Descriptions and other written text for companies and people`},"entities texts types":{summary:`List the Accepted Company Text Types`},"entities trending-news":{summary:`List Trending News About a Company`},"entities types":{summary:`List the Accepted typeRecord Values`},"entities unique-ids":{summary:`External identifiers and the records they name`},"entities urls":{summary:`Websites, social profiles, and other URLs for companies and people`},"entities valuations":{summary:`List a Company's Valuation Over Time`},help:{summary:`Answer a Natural-Language Platform Help Question`,section:`cli`},lookup:{summary:`Read a Company, Product, Service, or Person Identity`,section:`researchData`},"lookup-from-file":{summary:`Identify a Company, Product, Service, or Person by Name, URL, or ID`,section:`researchData`},"lookup-jobs":{summary:`Async article and bulk name identification`,section:`researchData`},"lookup-mentions":{summary:`Identify Every Company and Person a Page or Screenshot Names`,section:`researchData`},metrics:{summary:`Get Platform Totals for Companies, Funding, and People`,section:`cli`},news:{summary:`News linked to the companies and people in it`,section:`researchData`},"news feedback":{summary:`Submit News Feedback`},"news related-entities":{summary:`List the Entities a News Article Is About`},"news subscriptions":{summary:`List Entity News Subscriptions`},"news subscriptions test-events":{summary:`Send a Test News Event`},"news thumbnail":{summary:`Get News Thumbnail`},people:{summary:`Founders and investors, and what they back`,section:`researchData`},"people addresses":{summary:`A person's recorded addresses`},"people blog-posts":{summary:`External blog and article links for entities and people`},"people content":{summary:`Publications about one company or person, and platform-wide publication search`},"people content facets":{summary:`Count a Person's Publications`},"people enrichments":{summary:`Enrich One Person`},"people entities":{summary:`People linked to companies, and the role each one holds`},"people filters":{summary:`Filter options for people listings and option search`},"people graph":{summary:`Get Person Graph`},"people investments":{summary:`List a Person's Investments`},"people investor-activity":{summary:`Get Person Investor Activity`},"people lookup-exact":{summary:`Read One Person's Full Detail by aVenture Profile URL, Slug, or URL`},"people photo":{summary:`Get Person Photo`},"people repositories":{summary:`List a Person's GitHub Repositories`},"people similar":{summary:`List People Similar to One Person`},"people texts":{summary:`Descriptions and other written text for companies and people`},"people texts types":{summary:`List the Accepted Person Text Types`},"people unique-ids":{summary:`External identifiers and the records they name`},"people urls":{summary:`Websites, social profiles, and other URLs for companies and people`},"research-runs":{summary:`Research requests you file for a company, Product, Service, or person, and their progress`,section:`researchData`},"research-runs presets":{summary:`List Research Presets`},resolve:{summary:`Deprecated: Resolve an Entity or Person by Identifier Token`,section:`researchData`},search:{summary:`Search Companies, People, and News Together`,section:`researchData`},"search link":{summary:`Search From a Page URL`},"search link jobs":{summary:`Get a Link Search Job`},"search natural":{summary:`Find companies and people in natural language`},"search shared":{summary:`Search companies, people, and news, or by URL`},"search shared slug":{summary:`Read a Shared Search by Slug`},"unique-ids":{summary:`External identifiers and the records they name`,section:`researchData`},"unique-ids types":{summary:`List the Accepted Unique Identifier Types`},"url-types":{summary:`List URL Types`,section:`researchData`},web:{summary:`Search the Live Web`,section:`researchData`},"web searches":{summary:`Get an Async Web Search Job`},"web searches jobs":{summary:"Reads the web-search job a `Prefer: respond-async` search accepted"}};function _(e){return b(e,v())}function v(){return!!i().userBearerToken?.trim()}function y(e){return v()||!c(e,g)}function b(e,t){return t?e:e.filter(e=>!c(e.cliPath[0],g)||e.visibility!==`private`).map(x)}function x(e){let t=e.parameters.filter(S),n=e.requestBody?.map(e=>{let t=e.parameter.filter(S);return t.length===e.parameter.length?e:{...e,parameter:t}}),r=n?.every((t,n)=>t===e.requestBody?.[n]);return t.length===e.parameters.length&&r!==!1?e:{...e,parameters:t,requestBody:n}}var S=e=>e.visibility!==`private`;function C(i,a){let o=i.indexOf(`--`),l=i.slice(0,o===-1?i.length:o);if(l.some(e=>e===`--version`||e===`-V`))return`none`;let d=new n().exitOverride().configureOutput({writeErr:()=>void 0}).addOption(new e(`--environment <environment>`,`route all API calls to a mapped API environment`).choices([...r()])).addOption(new e(`--content-type <media-type>`)).addOption(new e(`--ask <question>`)),f=d.parseOptions([...i]).operands,p=d.opts().environment;p!==void 0&&(process.env.API_ENV=p);let m=a.find(e=>w(f,e.cliPath)),h=m===void 0?void 0:u(m,d.opts());if(m!==void 0&&h!==void 0){let e=s(m.requestBody??[],h);if(!e.ok)throw new t(e.summary)}let _=f.at(0);if(_===void 0)return`stored`;if(_===`update`||_===`auth`&&m===void 0)return`none`;let v=d.opts().ask;return l.some(e=>e===`--help`||e===`-h`)?(m??(_===`help`&&v===void 0?a.find(e=>w(f.slice(1),e.cliPath)):void 0))!==void 0||c(_,g)?`stored`:`none`:c(_,g)?`required`:_===`help`?m===void 0?v===void 0?`stored`:f.length===1?`required`:`none`:`required`:_===`agents`&&f[1]===`setup`?`required`:[`command-catalog`,`completion`].includes(_)?`optional`:_===`batch`?`required`:m===void 0?`optional`:`required`}function w(e,t){return t.every((t,n)=>e[n]===t)}export{g as a,l as c,h as d,_ as i,f as l,C as n,u as o,b as r,p as s,y as t,m as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./startup-auth-Cdvg6ORp.js";export{e as commandAuthMaterializationMode};
@@ -1 +1 @@
1
- import{n as e}from"./commander-BB7CDPLs.js";import{C as t,S as n,T as r,g as i,h as a,l as o,o as s,u as c,v as l,w as u,y as d}from"./person-owner-BJgNYLKX.js";import{c as f,d as p,i as m}from"./result-envelope-D5wNfKzB.js";import{basename as h,extname as ee}from"node:path";import{AsyncLocalStorage as te}from"node:async_hooks";import{readFile as ne}from"node:fs/promises";function g(e){return new URL(e,`https://placeholder.invalid`).pathname}function _(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean);return n.length!==r.length||r.some(re)?!1:n.every((e,t)=>v(e)||e===r[t])}function v(e){let t=e.slice(1,-1);return e.startsWith(`{`)&&e.endsWith(`}`)&&t.length>0&&!t.includes(`/`)&&!t.includes(`{`)&&!t.includes(`}`)}function re(e){if(v(e))return!0;let t=e.toLowerCase(),n=e.slice(3,-3);return t.startsWith(`%7b`)&&t.endsWith(`%7d`)&&n.length>0&&!n.includes(`/`)&&!n.includes(`%`)&&!n.includes(`{`)&&!n.includes(`}`)}var y=new te,b=()=>y.getStore()?.requestId,ie=()=>y.getStore()?.userBearerToken;function ae(e,t){return y.run({...y.getStore(),requestId:e},t)}function x(e,t){return y.run({...y.getStore(),userBearerToken:e},t)}var S=[`get`,`post`,`put`,`patch`,`delete`],C={get:`GET`,post:`POST`,put:`PUT`,patch:`PATCH`,delete:`DELETE`},oe=e=>C[e];function se(e){let t=e.toLowerCase(),n=S.find(e=>e===t);if(n===void 0)throw Error(`Unsupported OpenAPI method: ${e}`);return n}var ce=[`oauth`,`start`,`poll`,`acknowledge`,`revoke`],w=t({name:u().regex(/^[A-Z][A-Z0-9_]*$/u)}),T=r([i(`private`),d({scope:u().optional(),value:u().optional()})]),E=a(()=>d({$ref:u().optional(),description:u().optional(),type:r([u(),o(u())]).optional(),format:u().optional(),default:p.optional(),enum:o(p).optional(),"x-extensible-enum":o(p).optional(),"x-aventure-parsed-enum":c().optional(),readOnly:c().optional(),items:E.optional(),minItems:l().int().nonnegative().optional(),maxItems:l().int().nonnegative().optional(),properties:n(u(),E).optional(),required:o(u()).optional(),oneOf:o(E).optional(),anyOf:o(E).optional(),allOf:o(E).optional(),propertyNames:E.optional(),additionalProperties:r([E,c()]).optional(),"x-aventure-visibility":T.optional(),"x-aventure-cli-conflicts":o(o(u().min(1)).min(2)).min(1).optional(),"x-aventure-env":w.optional(),"x-aventure-detail":i(!0).optional(),"x-aventure-operation-only":o(u().min(1)).min(1).optional()})),le=d({in:u(),name:u(),required:c().optional(),description:u().optional(),schema:E.optional(),"x-aventure-visibility":T.optional(),"x-aventure-legacy-name":t({name:u().trim().min(1)}).optional()}).superRefine((e,t)=>{let n=e[`x-aventure-legacy-name`]?.name;n!==void 0&&(e.in!==`path`&&t.addIssue({code:`custom`,path:[`x-aventure-legacy-name`],message:`x-aventure-legacy-name is valid only for path parameters`}),n===e.name&&t.addIssue({code:`custom`,path:[`x-aventure-legacy-name`,`name`],message:`Legacy path parameter name must differ from its canonical name`}))}),D=n(u(),d({schema:E.optional()})),ue=d({description:u().optional(),content:D.optional(),"x-aventure-standard-response":c().optional()}),O=d({description:u().optional(),required:c().optional(),content:D.optional()}),de=t({auth:s([`none`,`read`]).optional()}).optional(),k=r([i(``),u().regex(/^(?:\/(?:[^~/]|~[01])*)+$/)]),A=t({readOperationId:u().min(1),writePointer:k,readPointer:k}),j=u().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)* [a-z0-9]+(?:-[a-z0-9]+)*$/u),M=u().regex(/^[a-z][A-Za-z0-9]*$/u),N=u().regex(/^--(?:no-)?[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u),P=t({command:j,role:s(ce),summary:u().trim().min(1).optional(),description:u().trim().min(1).optional(),bodyOption:o(M).min(1).optional(),localOption:o(t({optionKey:M,flag:N,description:u().trim().min(1)})).min(1).optional()}).superRefine((t,n)=>{let r=[t.bodyOption??[],(t.localOption??[]).map(e=>e.optionKey),(t.localOption??[]).map(e=>e.flag)].some(e=>new Set(e).size!==e.length),i=(t.localOption??[]).some(t=>new e(t.flag).attributeName()!==t.optionKey);(r||i)&&n.addIssue({code:`custom`,message:`Composite CLI options must be unique and match their local flags`})}).optional(),F=d({operationId:u(),summary:u().optional(),description:u().optional(),tags:o(u()).optional(),deprecated:c().optional(),hidden:c().optional(),security:o(n(u(),o(u()))).optional(),parameters:o(le).optional(),requestBody:O.optional(),responses:n(u(),ue),"x-aventure-visibility":T.optional(),"x-aventure-tool":de,"x-aventure-mutation-readback":A.optional(),"x-aventure-cli-composite":P}).superRefine((e,t)=>{let n=e.parameters??[];for(let[e,r]of n.entries()){let i=r[`x-aventure-legacy-name`]?.name;r.in===`path`&&i!==void 0&&n.some((t,n)=>n!==e&&t.in===`path`&&(t.name===i||t[`x-aventure-legacy-name`]?.name===i))&&t.addIssue({code:`custom`,path:[`parameters`,e,`x-aventure-legacy-name`,`name`],message:`Legacy path parameter name '${i}' collides with another declared path parameter`})}}),I=d(Object.fromEntries(S.map(e=>[e,F.optional()]))),L=d({$ref:u().optional(),description:u().optional(),type:r([u(),o(u())]).optional(),format:u().optional(),default:p.optional(),enum:o(p).optional(),"x-extensible-enum":o(p).optional(),"x-aventure-parsed-enum":c().optional(),readOnly:c().optional(),items:E.optional(),minItems:l().int().nonnegative().optional(),maxItems:l().int().nonnegative().optional(),oneOf:o(E).optional(),anyOf:o(E).optional(),allOf:o(E).optional(),propertyNames:E.optional(),additionalProperties:r([E,c()]).optional(),properties:n(u(),E).optional(),required:o(u()).optional(),"x-aventure-visibility":T.optional(),"x-aventure-cli-conflicts":o(o(u().min(1)).min(2)).min(1).optional(),"x-aventure-env":w.optional(),"x-aventure-detail":i(!0).optional(),"x-aventure-noun":t({one:u().trim().min(1),other:u().trim().min(1)}).optional()});d({info:d({description:u().optional()}).optional(),tags:o(d({name:u(),description:u().optional(),"x-aventure-cli":t({section:s([`researchData`,`account`,`administration`,`cli`])}).optional()})).optional(),paths:n(u(),I),webhooks:n(u(),d({post:d({description:u(),requestBody:O})})).optional(),components:d({schemas:n(u(),L)})}).superRefine((e,t)=>{for(let[n,r]of Object.entries(e.paths))for(let i of S){let a=r[i]?.[`x-aventure-mutation-readback`];a!==void 0&&B(e.paths,a.readOperationId)===null&&t.addIssue({code:`custom`,path:[`paths`,n,i,`x-aventure-mutation-readback`,`readOperationId`],message:`mutation readback names '${a.readOperationId}', which no operation in this document emits`})}});var R=new Set([`page`,`size`,`sort`]);function z(e){return e?.$ref?.startsWith(`#/components/schemas/`)===!0?e.$ref.slice(21):void 0}function B(e,t){for(let[n,r]of Object.entries(e))for(let e of S){let i=r[e];if(i?.operationId===t)return{method:e,template:n,operation:i}}return null}function V(e,t,n){let r=g(n),i=e[r]?.[t];if(i)return{method:t,template:r,operation:i};for(let[n,i]of Object.entries(e)){let e=i[t];if(e&&_(n,r))return{method:t,template:n,operation:e}}return null}function H(e,t,n=e){return e.replace(/\{([^}]+)}/g,(...e)=>{let r=e[1],i=t[r];if(i==null)throw Error(`Missing path parameter '${r}' for ${n}`);return encodeURIComponent(String(i))})}function fe(e,t,n){let r=t;for(let i of e.parameters??[]){let e=i[`x-aventure-legacy-name`]?.name;if(i.in!==`path`||e===void 0)continue;let a=t[e];if(Object.hasOwn(t,e)&&a!==void 0){if(Object.hasOwn(t,i.name))throw Error(`Path parameters '${i.name}' and legacy alias '${e}' were both supplied for ${n}`);r===t&&(r={...t}),r[i.name]=a,delete r[e]}}return r}function pe(e,t){let n={};for(let r of e.parameters??[]){if(r.in!==`query`||R.has(r.name))continue;let e=t?.[r.name]??me(r.schema?.default);e!==void 0&&(n[r.name]=e)}return Object.keys(n).length===0?void 0:n}function me(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`||Array.isArray(e)&&e.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return e}var U=3e4;async function he(e,t,n,r){let i=G(W(e.requestBody?.content),n);if(!i.ok||i.data===null)return m(i.summary,i.warnings);let a=i.data;if(e.requestBody?.required===!0&&t===void 0&&a?.kind!==`multipart`)return m(`Request body is required.`);if(a?.kind===`multipart`)return await ve(e.requestBody?.required===!0,a.schema,t);let o=a?.contentType??r;return f(`Request body prepared`,{...t===void 0?{}:{body:t},...o===void 0?{}:{contentType:o}})}function ge(e){if(typeof e!=`string`)return f(`Request body unchanged`,e);let t=e.trimStart().slice(0,1);if(t!==`{`&&t!==`[`)return f(`Request body unchanged`,e);try{let t=p.safeParse(JSON.parse(e));if(!t.success)throw t.error;return f(`Request body parsed`,t.data)}catch(e){return m(`Request body string must be valid JSON: ${e instanceof Error?e.message:String(e)}`)}}function _e(e,t){let n=e?.schema;if(n===void 0)return!1;let r=z(n),i=n.type??(r===void 0?void 0:t[r]?.type);return Array.isArray(i)?i.includes(`array`):i===`array`}function W(e){let t=Object.entries(e??{});return[...t.flatMap(e=>Ee(e[0])?[K(e,`json`)]:[]),...t.flatMap(e=>De(e[0])?[K(e,`multipart`)]:[])]}function G(e,t){if(t===void 0)return f(`Default request content selected`,e[0]);let n=Z(t),r=e.find(e=>Z(e.contentType)===n);return r===void 0?m(`Request Content-Type '${t}' is not supported. Supported choices: ${e.map(({contentType:e})=>e).join(`, `)||`none`}.`):f(`Explicit request content selected`,r)}function K(e,t){let n=e[1].schema;return{contentType:e[0],kind:t,...n===void 0?{}:{schema:n}}}async function ve(e,t,n){if(!e&&n==null)return f(`Optional multipart body omitted`,{});let r=ye(n);if(!r.ok||r.data===null)return m(r.summary,r.warnings);let i=new FormData;for(let e of be(t)){let t=r.data[e.name];if(t==null){if(e.required)return m(`Multipart body requires '${e.name}'.`);continue}if(Array.isArray(t)&&t.length<(e.schema.minItems??0))return m(`Multipart part '${e.name}' requires more entries.`);if(Array.isArray(t)&&t.length>(e.schema.maxItems??2**53-1))return m(`Multipart part '${e.name}' has too many entries.`);if(q(e.schema)||J(e.schema)){let n=J(e.schema)?t:[t];if(!Array.isArray(n)||n.some(e=>typeof e!=`string`))return m(`Multipart part '${e.name}' must contain file paths or URLs.`);for(let t of n){if(typeof t!=`string`)continue;let n=await Se(t);if(!n.ok||n.data===null)return m(n.summary,n.warnings);i.append(e.name,n.data.blob,n.data.filename)}}else if(xe(e.schema,t)){let n=JSON.stringify(t);i.append(e.name,new Blob([n],{type:`application/json`}),`${e.name}.json`)}else{let n=Y(i,e.name,t);if(!n.ok)return n}}return f(`Multipart body prepared`,{body:i})}function ye(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=Object.fromEntries(Object.entries(e));return f(`Multipart input parsed`,t)}return m(`Multipart request body must be a JSON object keyed by form part name.`)}function be(e){let t=new Set(e?.required??[]);return Object.entries(e?.properties??{}).map(([e,n])=>({name:e,schema:n,required:t.has(e)}))}function q(e){return e.type===`string`&&e.format===`binary`}function J(e){return e.type===`array`&&e.items!==void 0&&q(e.items)}function xe(e,t){return typeof t!=`object`||!t||Array.isArray(t)?!1:e.type===`object`||typeof e.$ref==`string`&&e.$ref.length>0}function Y(e,t,n){if(Array.isArray(n)){for(let r of n){let n=Y(e,t,r);if(!n.ok)return n}return f(`Multipart scalar array appended`,null)}return typeof n==`object`?m(`Multipart part '${t}' must be scalar.`):(e.append(t,String(n)),f(`Multipart scalar appended`,null))}async function Se(e){return Te(e)?await Ce(e):b()===void 0?await we(e):m(`MCP callers cannot upload local files: pass an http(s) URL as the multipart part, or send media by sourceUrl in a JSON body. Local file paths are CLI-only.`)}async function Ce(e){let t=new AbortController,n=setTimeout(()=>t.abort(),U);try{let n=new URL(e),r=await fetch(e,{signal:t.signal});if(!r.ok)return m(`Failed to fetch media URL: ${r.status} ${r.statusText}`);let i=r.headers.get(`content-type`)?.split(`;`)[0]?.trim()??X(n.pathname)??``,a=new Blob([await r.arrayBuffer()],{type:i});return f(`URL media fetched`,{blob:a,filename:h(n.pathname)||`upload`})}catch(e){return t.signal.aborted?m(`Failed to fetch media URL: timed out after ${U}ms.`):m(`Failed to fetch media URL: ${e instanceof Error?e.message:String(e)}`)}finally{clearTimeout(n)}}async function we(e){try{let t=X(e)??``,n=await ne(e);return f(`File media read`,{blob:new Blob([n],{type:t}),filename:h(e)})}catch(t){return m(`Failed to read media file '${e}': ${t instanceof Error?t.message:String(t)}`)}}function Te(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}function X(e){return Oe[ee(e).toLowerCase()]}function Ee(e){let t=Z(e);return t===`*/*`||t===`application/json`||t.endsWith(`+json`)}function De(e){return Z(e)===`multipart/form-data`}var Z=e=>e.split(`;`)[0]?.trim().toLowerCase()??``,Oe={".gif":`image/gif`,".heic":`image/heic`,".heif":`image/heif`,".jpeg":`image/jpeg`,".jpg":`image/jpeg`,".png":`image/png`,".webp":`image/webp`};function ke(e,t,n){let r=new Map,i=(t,a,o)=>{let s=z(t);if(a>n||s!==void 0&&o.includes(s))return;let c=s===void 0?o:[...o,s],l=je(e,t);for(let e of[...l.items===void 0?[]:[l.items],...l.oneOf??[],...l.anyOf??[],...l.allOf??[]])i(e,a,c);for(let[e,t]of Object.entries(l.properties??{}))r.set(e,Math.min(r.get(e)??a,a)),i(t,a+1,c)};for(let[e,n]of Object.entries(t))e.startsWith(`2`)&&i(Ae(n.content),0,[]);return r}function Ae(e){return e?.[`application/json`]?.schema??Object.values(e??{}).find(e=>e.schema!==void 0)?.schema}function je(e,t){let n=z(t);return{...n===void 0?void 0:e.components.schemas[n],...t}}function Me(e){return e===`write`||e===`delete`}function Ne(e,t){return e===`DELETE`||t===`delete`}var Pe=`Shell-safe input: single-quote string flag values that contain $; use --from-file or stdin for JSON bodies, multiline text, and free text with currency amounts.`;function Fe(e,t){let n=e===`array`?t:e;return n===void 0||n===`string`}var Q={add:`write`,answer:`search`,ask:`search`,attach:`write`,audit:`read`,batch:`lookup`,convert:`write`,create:`write`,delete:`delete`,enrich:`write`,filter:`search`,get:`read`,import:`write`,join:`write`,list:`read`,lookup:`lookup`,merge:`write`,preview:`lookup`,reconcile:`write`,remove:`delete`,replace:`write`,resolve:`lookup`,search:`search`,status:`read`,suggest:`read`,update:`write`,upload:`write`};function Ie(e){let t=/^[a-z]+/u.exec(e)?.[0];if(t===void 0)throw Error(`operationId '${e}' has no verb`);return t}function Le(e){return e!==`/v1/auth/api-key`&&!/^\/v1\/sitemap(?:\/|$)/u.test(e)}var Re=/(?:^|-)(?:runs|jobs)$/u;function ze(e){switch(e.intent){case`read`:case`lookup`:case`search`:case`status`:case`job`:return e.intent;case`write`:{let t=Ie(e.operationId);return t===`enrich`||t===`create`&&Re.test(e.cliPath.at(-2)??``)?`job`:null}case`delete`:return null;default:{let t=e.intent;throw Error(`No public MCP intent for ${String(t)}`)}}}function Be(e){let t=Object.entries(e.responses).filter(([e])=>e.startsWith(`2`));return t.length>0&&t.every(([,e])=>Object.values(e.content??{}).some(e=>Ve(e.schema)))}function Ve(e){return e?.format===`byte`||e?.format===`binary`}function He(e){return`aventure_${e}`}function $(e){return e.replace(/([a-z0-9])([A-Z])/gu,`$1-$2`).replace(/[^A-Za-z0-9]+/gu,`-`).replace(/^-+|-+$/gu,``).toLowerCase()}var Ue=e=>`--${$(e)}`;export{x as A,se as C,b as D,z as E,ie as O,B as S,V as T,G as _,Ue as a,H as b,He as c,ze as d,ke as f,_e as g,W as h,Fe as i,g as j,ae as k,Le as l,he as m,Q as n,Ne as o,ge as p,Be as r,Me as s,Pe as t,$ as u,S as v,pe as w,fe as x,oe as y};
1
+ import{n as e}from"./commander-BB7CDPLs.js";import{C as t,S as n,T as r,g as i,h as a,l as o,o as s,u as c,v as l,w as u,y as d}from"./person-owner-BJgNYLKX.js";import{c as f,d as p,i as m}from"./result-envelope-CMkMWwDI.js";import{basename as h,extname as ee}from"node:path";import{AsyncLocalStorage as te}from"node:async_hooks";import{readFile as ne}from"node:fs/promises";function g(e){return new URL(e,`https://placeholder.invalid`).pathname}function _(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean);return n.length!==r.length||r.some(re)?!1:n.every((e,t)=>v(e)||e===r[t])}function v(e){let t=e.slice(1,-1);return e.startsWith(`{`)&&e.endsWith(`}`)&&t.length>0&&!t.includes(`/`)&&!t.includes(`{`)&&!t.includes(`}`)}function re(e){if(v(e))return!0;let t=e.toLowerCase(),n=e.slice(3,-3);return t.startsWith(`%7b`)&&t.endsWith(`%7d`)&&n.length>0&&!n.includes(`/`)&&!n.includes(`%`)&&!n.includes(`{`)&&!n.includes(`}`)}var y=new te,b=()=>y.getStore()?.requestId,ie=()=>y.getStore()?.userBearerToken;function ae(e,t){return y.run({...y.getStore(),requestId:e},t)}function x(e,t){return y.run({...y.getStore(),userBearerToken:e},t)}var S=[`get`,`post`,`put`,`patch`,`delete`],C={get:`GET`,post:`POST`,put:`PUT`,patch:`PATCH`,delete:`DELETE`},oe=e=>C[e];function se(e){let t=e.toLowerCase(),n=S.find(e=>e===t);if(n===void 0)throw Error(`Unsupported OpenAPI method: ${e}`);return n}var ce=[`oauth`,`start`,`poll`,`acknowledge`,`revoke`],w=t({name:u().regex(/^[A-Z][A-Z0-9_]*$/u)}),T=r([i(`private`),d({scope:u().optional(),value:u().optional()})]),E=a(()=>d({$ref:u().optional(),description:u().optional(),type:r([u(),o(u())]).optional(),format:u().optional(),default:p.optional(),enum:o(p).optional(),"x-extensible-enum":o(p).optional(),"x-aventure-parsed-enum":c().optional(),readOnly:c().optional(),items:E.optional(),minItems:l().int().nonnegative().optional(),maxItems:l().int().nonnegative().optional(),properties:n(u(),E).optional(),required:o(u()).optional(),oneOf:o(E).optional(),anyOf:o(E).optional(),allOf:o(E).optional(),propertyNames:E.optional(),additionalProperties:r([E,c()]).optional(),"x-aventure-visibility":T.optional(),"x-aventure-cli-conflicts":o(o(u().min(1)).min(2)).min(1).optional(),"x-aventure-env":w.optional(),"x-aventure-detail":i(!0).optional(),"x-aventure-operation-only":o(u().min(1)).min(1).optional()})),le=d({in:u(),name:u(),required:c().optional(),description:u().optional(),schema:E.optional(),"x-aventure-visibility":T.optional(),"x-aventure-legacy-name":t({name:u().trim().min(1)}).optional()}).superRefine((e,t)=>{let n=e[`x-aventure-legacy-name`]?.name;n!==void 0&&(e.in!==`path`&&t.addIssue({code:`custom`,path:[`x-aventure-legacy-name`],message:`x-aventure-legacy-name is valid only for path parameters`}),n===e.name&&t.addIssue({code:`custom`,path:[`x-aventure-legacy-name`,`name`],message:`Legacy path parameter name must differ from its canonical name`}))}),D=n(u(),d({schema:E.optional()})),ue=d({description:u().optional(),content:D.optional(),"x-aventure-standard-response":c().optional()}),O=d({description:u().optional(),required:c().optional(),content:D.optional()}),de=t({auth:s([`none`,`read`]).optional()}).optional(),k=r([i(``),u().regex(/^(?:\/(?:[^~/]|~[01])*)+$/)]),A=t({readOperationId:u().min(1),writePointer:k,readPointer:k}),j=u().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)* [a-z0-9]+(?:-[a-z0-9]+)*$/u),M=u().regex(/^[a-z][A-Za-z0-9]*$/u),N=u().regex(/^--(?:no-)?[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u),P=t({command:j,role:s(ce),summary:u().trim().min(1).optional(),description:u().trim().min(1).optional(),bodyOption:o(M).min(1).optional(),localOption:o(t({optionKey:M,flag:N,description:u().trim().min(1)})).min(1).optional()}).superRefine((t,n)=>{let r=[t.bodyOption??[],(t.localOption??[]).map(e=>e.optionKey),(t.localOption??[]).map(e=>e.flag)].some(e=>new Set(e).size!==e.length),i=(t.localOption??[]).some(t=>new e(t.flag).attributeName()!==t.optionKey);(r||i)&&n.addIssue({code:`custom`,message:`Composite CLI options must be unique and match their local flags`})}).optional(),F=d({operationId:u(),summary:u().optional(),description:u().optional(),tags:o(u()).optional(),deprecated:c().optional(),hidden:c().optional(),security:o(n(u(),o(u()))).optional(),parameters:o(le).optional(),requestBody:O.optional(),responses:n(u(),ue),"x-aventure-visibility":T.optional(),"x-aventure-tool":de,"x-aventure-mutation-readback":A.optional(),"x-aventure-cli-composite":P}).superRefine((e,t)=>{let n=e.parameters??[];for(let[e,r]of n.entries()){let i=r[`x-aventure-legacy-name`]?.name;r.in===`path`&&i!==void 0&&n.some((t,n)=>n!==e&&t.in===`path`&&(t.name===i||t[`x-aventure-legacy-name`]?.name===i))&&t.addIssue({code:`custom`,path:[`parameters`,e,`x-aventure-legacy-name`,`name`],message:`Legacy path parameter name '${i}' collides with another declared path parameter`})}}),I=d(Object.fromEntries(S.map(e=>[e,F.optional()]))),L=d({$ref:u().optional(),description:u().optional(),type:r([u(),o(u())]).optional(),format:u().optional(),default:p.optional(),enum:o(p).optional(),"x-extensible-enum":o(p).optional(),"x-aventure-parsed-enum":c().optional(),readOnly:c().optional(),items:E.optional(),minItems:l().int().nonnegative().optional(),maxItems:l().int().nonnegative().optional(),oneOf:o(E).optional(),anyOf:o(E).optional(),allOf:o(E).optional(),propertyNames:E.optional(),additionalProperties:r([E,c()]).optional(),properties:n(u(),E).optional(),required:o(u()).optional(),"x-aventure-visibility":T.optional(),"x-aventure-cli-conflicts":o(o(u().min(1)).min(2)).min(1).optional(),"x-aventure-env":w.optional(),"x-aventure-detail":i(!0).optional(),"x-aventure-noun":t({one:u().trim().min(1),other:u().trim().min(1)}).optional()});d({info:d({description:u().optional()}).optional(),tags:o(d({name:u(),description:u().optional(),"x-aventure-cli":t({section:s([`researchData`,`account`,`administration`,`cli`])}).optional()})).optional(),paths:n(u(),I),webhooks:n(u(),d({post:d({description:u(),requestBody:O})})).optional(),components:d({schemas:n(u(),L)})}).superRefine((e,t)=>{for(let[n,r]of Object.entries(e.paths))for(let i of S){let a=r[i]?.[`x-aventure-mutation-readback`];a!==void 0&&B(e.paths,a.readOperationId)===null&&t.addIssue({code:`custom`,path:[`paths`,n,i,`x-aventure-mutation-readback`,`readOperationId`],message:`mutation readback names '${a.readOperationId}', which no operation in this document emits`})}});var R=new Set([`page`,`size`,`sort`]);function z(e){return e?.$ref?.startsWith(`#/components/schemas/`)===!0?e.$ref.slice(21):void 0}function B(e,t){for(let[n,r]of Object.entries(e))for(let e of S){let i=r[e];if(i?.operationId===t)return{method:e,template:n,operation:i}}return null}function V(e,t,n){let r=g(n),i=e[r]?.[t];if(i)return{method:t,template:r,operation:i};for(let[n,i]of Object.entries(e)){let e=i[t];if(e&&_(n,r))return{method:t,template:n,operation:e}}return null}function H(e,t,n=e){return e.replace(/\{([^}]+)}/g,(...e)=>{let r=e[1],i=t[r];if(i==null)throw Error(`Missing path parameter '${r}' for ${n}`);return encodeURIComponent(String(i))})}function fe(e,t,n){let r=t;for(let i of e.parameters??[]){let e=i[`x-aventure-legacy-name`]?.name;if(i.in!==`path`||e===void 0)continue;let a=t[e];if(Object.hasOwn(t,e)&&a!==void 0){if(Object.hasOwn(t,i.name))throw Error(`Path parameters '${i.name}' and legacy alias '${e}' were both supplied for ${n}`);r===t&&(r={...t}),r[i.name]=a,delete r[e]}}return r}function pe(e,t){let n={};for(let r of e.parameters??[]){if(r.in!==`query`||R.has(r.name))continue;let e=t?.[r.name]??me(r.schema?.default);e!==void 0&&(n[r.name]=e)}return Object.keys(n).length===0?void 0:n}function me(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`||Array.isArray(e)&&e.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return e}var U=3e4;async function he(e,t,n,r){let i=G(W(e.requestBody?.content),n);if(!i.ok||i.data===null)return m(i.summary,i.warnings);let a=i.data;if(e.requestBody?.required===!0&&t===void 0&&a?.kind!==`multipart`)return m(`Request body is required.`);if(a?.kind===`multipart`)return await ve(e.requestBody?.required===!0,a.schema,t);let o=a?.contentType??r;return f(`Request body prepared`,{...t===void 0?{}:{body:t},...o===void 0?{}:{contentType:o}})}function ge(e){if(typeof e!=`string`)return f(`Request body unchanged`,e);let t=e.trimStart().slice(0,1);if(t!==`{`&&t!==`[`)return f(`Request body unchanged`,e);try{let t=p.safeParse(JSON.parse(e));if(!t.success)throw t.error;return f(`Request body parsed`,t.data)}catch(e){return m(`Request body string must be valid JSON: ${e instanceof Error?e.message:String(e)}`)}}function _e(e,t){let n=e?.schema;if(n===void 0)return!1;let r=z(n),i=n.type??(r===void 0?void 0:t[r]?.type);return Array.isArray(i)?i.includes(`array`):i===`array`}function W(e){let t=Object.entries(e??{});return[...t.flatMap(e=>Ee(e[0])?[K(e,`json`)]:[]),...t.flatMap(e=>De(e[0])?[K(e,`multipart`)]:[])]}function G(e,t){if(t===void 0)return f(`Default request content selected`,e[0]);let n=Z(t),r=e.find(e=>Z(e.contentType)===n);return r===void 0?m(`Request Content-Type '${t}' is not supported. Supported choices: ${e.map(({contentType:e})=>e).join(`, `)||`none`}.`):f(`Explicit request content selected`,r)}function K(e,t){let n=e[1].schema;return{contentType:e[0],kind:t,...n===void 0?{}:{schema:n}}}async function ve(e,t,n){if(!e&&n==null)return f(`Optional multipart body omitted`,{});let r=ye(n);if(!r.ok||r.data===null)return m(r.summary,r.warnings);let i=new FormData;for(let e of be(t)){let t=r.data[e.name];if(t==null){if(e.required)return m(`Multipart body requires '${e.name}'.`);continue}if(Array.isArray(t)&&t.length<(e.schema.minItems??0))return m(`Multipart part '${e.name}' requires more entries.`);if(Array.isArray(t)&&t.length>(e.schema.maxItems??2**53-1))return m(`Multipart part '${e.name}' has too many entries.`);if(q(e.schema)||J(e.schema)){let n=J(e.schema)?t:[t];if(!Array.isArray(n)||n.some(e=>typeof e!=`string`))return m(`Multipart part '${e.name}' must contain file paths or URLs.`);for(let t of n){if(typeof t!=`string`)continue;let n=await Se(t);if(!n.ok||n.data===null)return m(n.summary,n.warnings);i.append(e.name,n.data.blob,n.data.filename)}}else if(xe(e.schema,t)){let n=JSON.stringify(t);i.append(e.name,new Blob([n],{type:`application/json`}),`${e.name}.json`)}else{let n=Y(i,e.name,t);if(!n.ok)return n}}return f(`Multipart body prepared`,{body:i})}function ye(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=Object.fromEntries(Object.entries(e));return f(`Multipart input parsed`,t)}return m(`Multipart request body must be a JSON object keyed by form part name.`)}function be(e){let t=new Set(e?.required??[]);return Object.entries(e?.properties??{}).map(([e,n])=>({name:e,schema:n,required:t.has(e)}))}function q(e){return e.type===`string`&&e.format===`binary`}function J(e){return e.type===`array`&&e.items!==void 0&&q(e.items)}function xe(e,t){return typeof t!=`object`||!t||Array.isArray(t)?!1:e.type===`object`||typeof e.$ref==`string`&&e.$ref.length>0}function Y(e,t,n){if(Array.isArray(n)){for(let r of n){let n=Y(e,t,r);if(!n.ok)return n}return f(`Multipart scalar array appended`,null)}return typeof n==`object`?m(`Multipart part '${t}' must be scalar.`):(e.append(t,String(n)),f(`Multipart scalar appended`,null))}async function Se(e){return Te(e)?await Ce(e):b()===void 0?await we(e):m(`MCP callers cannot upload local files: pass an http(s) URL as the multipart part, or send media by sourceUrl in a JSON body. Local file paths are CLI-only.`)}async function Ce(e){let t=new AbortController,n=setTimeout(()=>t.abort(),U);try{let n=new URL(e),r=await fetch(e,{signal:t.signal});if(!r.ok)return m(`Failed to fetch media URL: ${r.status} ${r.statusText}`);let i=r.headers.get(`content-type`)?.split(`;`)[0]?.trim()??X(n.pathname)??``,a=new Blob([await r.arrayBuffer()],{type:i});return f(`URL media fetched`,{blob:a,filename:h(n.pathname)||`upload`})}catch(e){return t.signal.aborted?m(`Failed to fetch media URL: timed out after ${U}ms.`):m(`Failed to fetch media URL: ${e instanceof Error?e.message:String(e)}`)}finally{clearTimeout(n)}}async function we(e){try{let t=X(e)??``,n=await ne(e);return f(`File media read`,{blob:new Blob([n],{type:t}),filename:h(e)})}catch(t){return m(`Failed to read media file '${e}': ${t instanceof Error?t.message:String(t)}`)}}function Te(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}function X(e){return Oe[ee(e).toLowerCase()]}function Ee(e){let t=Z(e);return t===`*/*`||t===`application/json`||t.endsWith(`+json`)}function De(e){return Z(e)===`multipart/form-data`}var Z=e=>e.split(`;`)[0]?.trim().toLowerCase()??``,Oe={".gif":`image/gif`,".heic":`image/heic`,".heif":`image/heif`,".jpeg":`image/jpeg`,".jpg":`image/jpeg`,".png":`image/png`,".webp":`image/webp`};function ke(e,t,n){let r=new Map,i=(t,a,o)=>{let s=z(t);if(a>n||s!==void 0&&o.includes(s))return;let c=s===void 0?o:[...o,s],l=je(e,t);for(let e of[...l.items===void 0?[]:[l.items],...l.oneOf??[],...l.anyOf??[],...l.allOf??[]])i(e,a,c);for(let[e,t]of Object.entries(l.properties??{}))r.set(e,Math.min(r.get(e)??a,a)),i(t,a+1,c)};for(let[e,n]of Object.entries(t))e.startsWith(`2`)&&i(Ae(n.content),0,[]);return r}function Ae(e){return e?.[`application/json`]?.schema??Object.values(e??{}).find(e=>e.schema!==void 0)?.schema}function je(e,t){let n=z(t);return{...n===void 0?void 0:e.components.schemas[n],...t}}function Me(e){return e===`write`||e===`delete`}function Ne(e,t){return e===`DELETE`||t===`delete`}var Pe=`Shell-safe input: single-quote string flag values that contain $; use --from-file or stdin for JSON bodies, multiline text, and free text with currency amounts.`;function Fe(e,t){let n=e===`array`?t:e;return n===void 0||n===`string`}var Q={add:`write`,answer:`search`,ask:`search`,attach:`write`,audit:`read`,batch:`lookup`,convert:`write`,create:`write`,delete:`delete`,enrich:`write`,filter:`search`,get:`read`,import:`write`,join:`write`,list:`read`,lookup:`lookup`,merge:`write`,preview:`lookup`,reconcile:`write`,remove:`delete`,replace:`write`,resolve:`lookup`,search:`search`,status:`read`,suggest:`read`,update:`write`,upload:`write`};function Ie(e){let t=/^[a-z]+/u.exec(e)?.[0];if(t===void 0)throw Error(`operationId '${e}' has no verb`);return t}function Le(e){return e!==`/v1/auth/api-key`&&!/^\/v1\/sitemap(?:\/|$)/u.test(e)}var Re=/(?:^|-)(?:runs|jobs)$/u;function ze(e){switch(e.intent){case`read`:case`lookup`:case`search`:case`status`:case`job`:return e.intent;case`write`:{let t=Ie(e.operationId);return t===`enrich`||t===`create`&&Re.test(e.cliPath.at(-2)??``)?`job`:null}case`delete`:return null;default:{let t=e.intent;throw Error(`No public MCP intent for ${String(t)}`)}}}function Be(e){let t=Object.entries(e.responses).filter(([e])=>e.startsWith(`2`));return t.length>0&&t.every(([,e])=>Object.values(e.content??{}).some(e=>Ve(e.schema)))}function Ve(e){return e?.format===`byte`||e?.format===`binary`}function He(e){return`aventure_${e}`}function $(e){return e.replace(/([a-z0-9])([A-Z])/gu,`$1-$2`).replace(/[^A-Za-z0-9]+/gu,`-`).replace(/^-+|-+$/gu,``).toLowerCase()}var Ue=e=>`--${$(e)}`;export{x as A,se as C,b as D,z as E,ie as O,B as S,V as T,G as _,Ue as a,H as b,He as c,ze as d,ke as f,_e as g,W as h,Fe as i,g as j,ae as k,Le as l,he as m,Q as n,Ne as o,ge as p,Be as r,Me as s,Pe as t,$ as u,S as v,pe as w,fe as x,oe as y};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aventurevc/aventure-cli",
3
- "version": "0.8.186",
3
+ "version": "0.8.188",
4
4
  "private": false,
5
5
  "description": "Command-line access to aVenture research data on companies, people, funding, and news.",
6
6
  "homepage": "https://docs.aventure.vc/cli",
@@ -33,9 +33,9 @@
33
33
  },
34
34
  "aventurePublicApi": {
35
35
  "repository": "aventurevc/aventure-docs",
36
- "commit": "0032631718a19dd1595caf7c8d3a6571cdfcfa1e",
36
+ "commit": "7e69d5754ad27d1f40e14fb124dadbabc46af93c",
37
37
  "openapiPath": "openapi/openapi.json",
38
- "openapiSha256": "9d0ef34dbfe43bf625a3b6a50b0e8b1e8068e95f7262e4d14f6a19fc0ec47fdb"
38
+ "openapiSha256": "36c6533685faa59fd78e12f78683909f10d3cd52352af98ff3eefaedbe871ce2"
39
39
  },
40
40
  "scripts": {}
41
41
  }
@@ -1 +0,0 @@
1
- import{t as e}from"./api-key-bearer-credential-BYpoThef.js";export{e as materializeCliApiKeyBearerCredential};
@@ -1,27 +0,0 @@
1
- import{n as e}from"./commander-BB7CDPLs.js";import{C as t,O as n,T as r,i,l as a,n as o,o as s,p as c,t as l,u,v as d,w as f,y as p}from"./person-owner-BJgNYLKX.js";import{Fr as m}from"./dist-CXpQ87Pz.js";import{a as ee,c as h,d as g,i as _}from"./result-envelope-D5wNfKzB.js";import{a as te}from"./package-DPDX5zmx.js";import{S as ne,a as re,c as ie,d as ae,f as oe,l as se,n as ce,o as le,s as v}from"./tool-policy-D7R8FUUe.js";import{a as ue,n as de,r as y,t as fe}from"./text-field-BoNdbrtA.js";import{C as b,D as pe,E as me,O as he,S as ge,T as _e,_ as ve,a as ye,b as be,c as xe,d as Se,f as Ce,g as we,h as Te,i as Ee,k as De,l as Oe,m as ke,n as Ae,o as je,p as Me,r as Ne,s as Pe,t as Fe,u as Ie,v as Le,w as Re,x as ze,y as Be}from"./detail-DIjiKrvq.js";import{a as Ve,o as He}from"./cli-help-policy-RGOSoZ1Z.js";import{Buffer as x}from"node:buffer";var S=s([`HIGH`,`MEDIUM`,`LOW`]),Ue=s([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),We=Object.assign(r([Ue,f()]),{enum:Ue.enum}),Ge=p({excerpt:f(),sourceId:f(),sourceType:We,sourceVersion:f().nullish()}),Ke=p({instruction:f(),operationId:f(),stepKey:f().optional()}),qe=p({body:f(),expectation:f(),method:a(f()),override:f(),reject:a(f()),typeCatalog:f()}),Je=p({cliCommand:f(),mcpTool:f().nullish(),step:Ke,writeGuidance:qe.nullish()}),Ye=s([`ENTITY`,`TEXT`,`WRITER_BRIEF`]),Xe=Object.assign(r([Ye,f()]),{enum:Ye.enum}),Ze=p({allowedValue:f().nullish(),description:f(),key:f(),type:Xe}),Qe=p({catalogRevision:c().optional(),gateId:a(f()).optional(),input:a(Ze),step:a(Je),taskKey:f().optional()}),C=s([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),$e=p({candidate:a(Ge),operationId:f().nullish(),outcome:C,probability:d().nullish(),taskKey:f().nullish(),taskPlan:Qe.nullish()}),et=p({answer:f(),citation:a(Ge),confidence:S,resolution:$e.nullish()});function w(e,t,n=t.inputName){if(t.in===`body`)return n;let r=ft.find(t=>n===t.name&&e.path.includes(t.path));return r===void 0?dt(ct(n!==`id`&&n!==`slug`?n:`${it(e.path)}${st(n)}`),t):r.inputName}function tt(e,t,n=ot(e)){return nt(at(e,t),new Set(n))}function nt(e,t){if(!t.has(e))return e;let n=`body${st(e)}`,r=n;for(let e=2;t.has(r);e+=1)r=`${n}${e}`;return r}function rt(e,t,n){return`${e}[${t}].${n}`}function it(e){return pt.find(([,t])=>t.test(e))?.[0]??`record`}function at(e,t){if(t.name===`id`&&e.path===`/v1/app/url-slug-redirects`)return`recordId`;let n=lt(t);return dt(e.intent===`search`&&(t.name.startsWith(`filter.`)||t.name.startsWith(`search.`))?ct(n.replace(/^(?:filter|search)/u,``).replace(/^./u,e=>e.toLowerCase())):n,t)}function ot(e){return new Set(e.parameter.filter(e=>e.in===`path`||e.in===`query`||e.in===`header`).map(t=>w(e,t)))}function st(e){return e.replace(/^./u,e=>e.toUpperCase())}function ct(e){return e.replace(/^addressAddress/u,`address`).replace(/^arrayFilterAmountInvestedRange/u,`fundraiseAmountInvestedRange`).replace(/^arrayFilterAmountRaisedRange/u,`fundraiseAmountRaisedRange`).replace(/^arrayFilterEntityName$/u,`entityName`).replace(/^arrayFilterInvestedCompany$/u,`fundraiseInvestedCompanyName`).replace(/^arrayFilterPersonTitle$/u,`personTitle`).replace(/^arrayFilterRound$/u,`fundraiseRound`).replace(/^arrayFilterTotalInvestmentCount/u,`totalInvestmentCount`).replace(/^arrayFilterTypeRecord$/u,`typeRecord`).replace(/^createEntity/u,`entity`).replace(/^createUrlLink/u,`urlLink`).replace(/^fundraiseActivity/u,`fundraise`).replace(/FundraiseActivity/gu,`Fundraise`).replace(/^logoOption/u,`logo`).replace(/LogoOption/gu,`Logo`).replace(/^researchDetailTypeResearchDetail$/u,`researchDetailType`).replace(/^researchDetailValueResearchDetail$/u,`researchDetailValue`).replace(/^textText$/u,`text`).replace(/^textTextName$/u,`textName`).replace(/^textTextType$/u,`textType`)}function lt(e){let t=ct(e.inputName);return/(?:^|\.)nameAlias\[\]\./u.test(e.name)?t.replace(/^entityNameAlias/u,`alias`):/(?:^|\.)urlLink\[\]\./u.test(e.name)?ut(t):/(?:^|\.)manualLogo\./u.test(e.name)?t.replace(/^manualLogo/u,`logo`):t}function ut(e){return e===`urlLinkUrl`?`url`:e===`urlLinkUrlType`?`urlType`:e.replace(/^urlLink/u,`url`)}function dt(e,t){return e===`text`?/(?:^|\.)text(?:\[\])?\.text$/u.test(t.name)?`textBody`:`inputText`:e}var ft=[{name:`detailId`,path:`/research-details/{detailId}`,inputName:`researchDetailId`},{name:`version`,path:`/instructions/`,inputName:`instructionVersion`},{name:`detailId`,path:`/financial/valuation/{detailId}`,inputName:`valuationDetailId`},{name:`joinId`,path:`/fundraise-investor-joins`,inputName:`fundraiseInvestorJoinId`}],pt=[[`entity`,/^\/v1\/entities(?:$|\/detail|\/lookup|\/summary|\/duplicate-check)/u],[`person`,/^\/v1\/people(?:\/detail|\/lookup|\/duplicate-check|\/\{slug\})/u],[`news`,/^\/v1\/(?:news\/|jobs\/news\/)/u],[`screenshot`,/^\/v1\/media\/screenshots\//u],[`media`,/^\/v1\/media/u],[`article`,/^\/v1\/app\/blog\/articles/u],[`page`,/^\/v1\/app\/pages/u],[`contact`,/^\/v1\/contacts\//u],[`provenance`,/^\/v1\/provenance\//u],[`location`,/^\/v1\/addresses\/locations\//u]];function mt(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>ht(t,w(e,t))),r=(t?.parameter??[]).map(t=>ht(t,tt(e,t)));return{selector:n.filter(e=>e.location===`path`||gt(e)),pagination:n.filter(_t),filter:[...n.filter(vt),...r.filter(vt)],body:r.filter(e=>!vt(e))}}function ht(e,t){let{in:n,inputName:r,...i}=e;return{...i,name:e.in===`body`?t:e.name,flag:re(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function gt(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function _t(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function vt(e){return e.location!==`path`&&!gt(e)&&!_t(e)}var T=16e3,yt=(e,t=T)=>e.length<=120&&x.byteLength(`${e.join(`
2
- `)}\n`,`utf8`)<=t,E=(e,t=!1,n=!1,r=1)=>{let i=de(e),a=t||i.endsWith(`
3
- `),o=i.endsWith(`
4
- `)?i.slice(0,-1):i,s=o.length===0?[]:o.split(`
5
- `),c=x.byteLength(`${s.join(`
6
- `)}\n`,`utf8`);if(s.length<=120&&c<=16e3)return`${s.join(`
7
- `)}${a?`
8
- `:``}`;let l=n?Math.min(Math.max(1,r),118):0,u=l>0?s.slice(-l):[],d=u.length===0?s:s.slice(0,-u.length),f=[s.length>120?`120 physical lines`:``,c>16e3?`${T} UTF-8 bytes`:``].filter(Boolean).join(` and `),p=e=>de(`... output truncated: ${e} more lines omitted to stay within ${f}; recover omitted response content with narrower server-side filters, the relevant sub-resource operation (aventure_help names it), or responseFormat json.`),m=(e,t)=>[...e,...u,t].join(`
9
- `),ee=120-u.length-1,h=d.slice(0,ee),g=p(s.length-h.length-u.length);for(;x.byteLength(`${m(h,g)}\n`,`utf8`)>T;){if(h.length>0)h=h.slice(0,-1);else if(u.length>0)u=u.slice(1);else break;g=p(s.length-h.length-u.length)}return`${m(h,g)}${a?`
10
- `:``}`},bt=e=>E(Ct(e.trimEnd().split(`
11
- `),120).join(`
12
- `),e.endsWith(`
13
- `)),xt=new Set([`core`,`nameFull`,`nameBrand`,`name`,`title`,`fundingDetail`,`round`,`dateAnnounced`,`amountRaised`,`person`,`fundraiseRound`]),St=5;function Ct(e,t,n=T){let r=e=>e.length<=t&&yt(e,n);if(r(e))return e;let i=wt(e),a=e=>[...Mt(i,e-1),`... output folded to fit 120 lines and ${T} UTF-8 bytes; "(+N lines)" and "N more" mark hidden content; read it whole with responseFormat json, --data --to-file <path>, or the section's sub-resource operation.`],o=2,s=t,c=a(o);for(;o<=s;){let e=Math.floor((o+s)/2),t=a(e);r(t)?(c=t,o=e+1):s=e-1}return c}function wt(e){let t={line:``,child:[]},n=[{node:t,indent:-1}];for(let t of e){let e=Et(t);for(;n.length>1&&(n.at(-1)?.indent??-1)>=e;)n.pop();let r={line:t,child:[]};n.at(-1)?.node.child.push(r),n.push({node:r,indent:e})}return t.child}var Tt=new WeakMap,D=e=>{let t=Tt.get(e);if(t!==void 0)return t;let n=e.child.reduce((e,t)=>e+D(t),1);return Tt.set(e,n),n},Et=e=>e.length-e.trimStart().length,Dt=/^(?:- ?|\d+\.(?: |$))/u,Ot=e=>(e.line.trimStart().replace(Dt,``).split(/[:= ]/u)[0]??``).split(`.`).at(-1)?.replace(/\[\d+\]$/u,``)??``,kt=e=>xt.has(Ot(e)),O=e=>kt(e)||!A(e)&&e.child.some(O),k=e=>kt(e)?D(e):O(e)?e.child.reduce((e,t)=>e+k(t),1):1,A=e=>Dt.test(e.line.trimStart()),At=e=>e.line.trimStart().startsWith(`... `),jt=e=>[e.line,...e.child.flatMap(jt)];function Mt(e,t){if(e.reduce((e,t)=>e+D(t),0)<=t)return e.flatMap(jt);if(!e.some(A)||!e.every(e=>A(e)||At(e)))return Ft(e,t);let n=e.filter(At).map(({line:e})=>e);return[...Pt(e.filter(A),t-n.length),...n]}function Nt(e,t){return t>=D(e)?jt(e):t<=1?[`${e.line} (+${D(e)-1} lines)`]:[e.line,...Mt(e.child,t-1)]}function Pt(e,t){let n=Math.max(1,Math.floor((t-1)/Math.min(e.length,St))),r=[],i=0;for(let a of e){let e=Math.min(n,D(a));if(r.length+e>t-1)break;r.push(...Nt(a,e)),i+=1}let a=` `.repeat(Et(e[0]?.line??``));return i===e.length?r:[...r,`${a}... ${e.length-i} more`]}function Ft(e,t){let n=e=>e.reduce((e,t)=>e+k(t),0);if(e.length>t||n(e)>t&&e.some(e=>k(e)===1)){let r=e.toSorted((e,t)=>Number(O(t))-Number(O(e))||D(e)-D(t)).slice(0,Math.max(0,t-1));for(;r.length>1&&k(r.at(-1)??e[0]??{line:``,child:[]})===1&&n(r)>t-1;)r.pop();let i=` `.repeat(Et(e[0]?.line??``)),a=Ft(e.filter(e=>r.includes(e)),t-1),o=e.filter(e=>!r.includes(e)).map(Ot),s=o.slice(0,10).join(`, `),c=o.length>10?`, ...`:``;return[...a,`${i}... ${o.length} more fields: ${s}${c}`]}let r=e.map(e=>({node:e,allotted:1})),i=t-e.length,a=(e,t)=>e.forEach((n,r)=>{let a=Math.min(t(n.node)-n.allotted,Math.floor(i/(e.length-r)));n.allotted+=a,i-=a});return a(r.filter(({node:e})=>k(e)>1).toSorted((e,t)=>k(e.node)-k(t.node)),k),a(r.toSorted((e,t)=>D(e.node)-e.allotted-(D(t.node)-t.allotted)),D),r.flatMap(({node:e,allotted:t})=>Nt(e,t))}function It(e,t){let n=e.requestBody?.[0],r={operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,scope:e.projection.scope,requiredInput:Rt(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]},i=Bt(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:mt(e)}:{...r,optionalInput:zt(e),arrayInput:Vt(e),...i===void 0?{}:{paidPlan:i}}}function Lt(e){let t=mt(e),n=e=>e.filter(e=>e.required);return{...It(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function Rt(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function zt(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 Bt(e){return e.response.find(({status:e})=>e===`402`)?.description}function Vt(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var Ht=160,j=`Operation catalog matches`,Ut=[`whole`,`described`,`requiredDescribed`,`optionalNamed`],Wt=e=>`${[j,...e].join(`
14
- `)}\n`,Gt=e=>yt([j,...e]);function Kt(e){if(!Array.isArray(e)||e.length===0||!e.every(Zt))return null;let t=e;for(let e of Ut){let n=[...t.flatMap(t=>Yt(t,e)),...Jt(t,e)];if(Gt(n))return Wt(n)}let n=e=>[...t.slice(0,e).flatMap(e=>Yt(e,`optionalNamed`)),...Jt(t.slice(0,e),`optionalNamed`),`... ${t.length-e} more operations omitted to fit ${T} UTF-8 bytes: ${t.slice(e).map(({operationId:e})=>e).join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`];return Wt(n([...t.keys()].findLast(e=>e>0&&Gt(n(e)))??1))}var qt="the CLI's `aventure help <operationId> --data` prints every input";function Jt(e,t){return e.some(e=>`optionalDetailOmitted`in e)?[`... optional argument details omitted: the full list exceeds the result cap; ${qt}.`]:t===`whole`||t===`described`||!e.some(e=>`argument`in e)?[]:[`... ${t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`} omitted to fit ${T} UTF-8 bytes; structuredContent carries them, and ${qt}.`]}function Yt(e,t){let n=`argument`in e?Object.values(e.argument).flat():[],r=n.filter(({required:e})=>!e).map(({name:e})=>e);return[`${e.operationId} ${e.method} ${e.path} (aventure_${e.intent})`,` ${e.summary}`,` required: ${e.requiredInput.length===0?`none`:e.requiredInput.join(`, `)}`,` responseContentType: ${e.responseContentType.length===0?`none`:e.responseContentType.join(`, `)}`,...`optionalInput`in e?Object.entries(e.optionalInput).filter(([,e])=>e.length>0).map(([e,t])=>` optional ${e}: ${t.join(`, `)}`):[],...`arrayInput`in e&&e.arrayInput.length>0?[` JSON array inputs: ${e.arrayInput.join(`, `)}`]:[],...`paidPlan`in e&&e.paidPlan!==void 0?[` paid plan: ${e.paidPlan}`]:[],...n.filter(({required:e})=>e||t!==`optionalNamed`).map(e=>Xt(e,e.required||t!==`requiredDescribed`,t)),...t===`optionalNamed`&&r.length>0?[` optional inputs: ${r.join(`, `)}`]:[]]}function Xt(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<=Ht?e.description:`${e.description.slice(0,157)}...`}`:i}function Zt(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 Qt(e){let t=t=>{let n=e.parameter.filter(e=>e.in===t&&e.required&&e.schemaDefault===void 0).map($t);return n.length===0?void 0:Object.fromEntries(n)},n=t(`path`),r=t(`query`),i=[...new Set((e.requestBody?.[0]?.requiredPath??[]).map(e=>e.replace(/[.[].*$/su,``)))];return{tool:ie(e.intent),operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:Object.fromEntries(i.map(e=>[e,`<${e}>`]))}}}function $t(e){return[e.name,`<${e.name}>`]}function en(e){let t=tn(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function tn(e){let t=e.match(/USE FOR:\s*([\s\S]*?)(?:NOT FOR:|$)/iu),n=e.match(/NOT FOR:\s*([\s\S]*?)$/iu);return{useFor:t?.[1]?.trim()??``,notFor:n?.[1]?.trim()??``}}var M=2,nn=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 N(e,t){let n=I(t);n.length!==0&&(e.add(n),(n===`individual`||n===`individuals`)&&N(e,`person`),on(e,rn(n),n),on(e,an(n),n))}function rn(e){if(e===`people`)return`person`;let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=M&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return`${e.slice(0,-3)}y`;if(e.length>M&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`)return e.slice(0,-1)}function an(e){if(e===`person`)return`people`;if(e!==`new`)return e.length>=M&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e)?`${e.slice(0,-1)}ies`:e.endsWith(`s`)?void 0:`${e}s`}function on(e,t,n){t!==void 0&&t!==n&&t.length>=M&&/^[a-z]+$/u.test(t)&&e.add(t)}function P(e){let t=new Set(F(e)),n=Array.from(t);for(let e of n)N(t,e);return t}function sn(e){return F(e).map(P)}function cn(e,t){if(e.length===0)return!1;let n=P(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function F(e){return I(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!nn.has(e))}function I(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`)}var ln=/\b(?:https?:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:\/\S*)?/giu,un=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/giu,dn=/^[a-z0-9]+(?:-[a-z0-9]+)+$/u,fn=250,pn=40,mn=100;function hn(e,t){let n=new Set,r=[],i=/\bslugs?\b/iu.test(e);return{text:e.replace(un,()=>(n.add(`uuid`),` `)).replace(ln,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&&dn.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=dn.test(r)&&!t.has(r)&&(i||/\d/u.test(r));return a&&n.add(`slug`),!a}).join(` `).trim(),kind:n,urlPathWord:r.filter(e=>e.length>0)}}function gn(e,t,n){return e===`uuid`?/(?:^id|Id)$/u.test(t)&&n.includes(`{${t}}`):t===e}function _n(e,t){let n=new Set;for(let r of e){let e=new Set;N(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 vn(e,t,n){if(n.intent!==`read`&&n.intent!==`lookup`)return 0;let r=new Set(F(n.summary)),i=0;for(let t of e.kind)n.directParameterName.some(e=>gn(t,e,n.path))&&(i+=fn,r.has(t)&&(i+=pn));if(i===0)return 0;let a=new Set(F(`${n.summary} ${n.description}`));return(t.size>0?t.has(n.resource):e.urlPathWord.some(e=>{let t=new Set;return N(t,e),[...t].some(e=>a.has(e))}))&&(i+=mn),i}var yn=40,bn=4,xn=3,Sn=1,Cn=new Map;function wn(e){let t=Cn.get(e);if(t!==void 0)return t;let n=m(),r=ne(n.paths,e),i=r===null?new Map:oe(n,r.operation.responses,xn);return Cn.set(e,i),i}function Tn(e,t,n){let r=0,i=new Map;for(let[e,a]of n){if(t.has(e.toLowerCase())&&(r+=yn*(4-a)/4),a>Sn)continue;let n=new Set;for(let t of F(e))N(n,t);for(let e of n)i.set(e,Math.min(i.get(e)??a,a))}for(let t of e){let e=Math.min(...[...t].map(e=>i.get(e)??1/0));e<=Sn&&(r+=bn*(2-e))}return r}var En=5,Dn=.5,On=15,kn=30,An=2,jn=.5;function Mn(e,t,n){let r=t.map(e=>({item:e,fields:n(e)})),i=hn(e,new Set(r.flatMap(({fields:e})=>e.cliPath))),a=_n(i.urlPathWord,r.map(({fields:e})=>e)),o=I(i.text);if(o.length===0&&i.kind.size===0)return t.map(e=>({item:e,score:1}));let s=P(o),c=sn(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:In({normalizedQuery:o,tokens:s,termForm:c,queryWord:l},t))+vn(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}))}function Nn(e){let t=[...e.parameter,...(e.requestBody??[]).flatMap(e=>e.parameter)];return{...e,cliPath:e.projection.cliPath,enumParameter:t.map(e=>({values:e.itemSchemaEnum??e.schemaEnum??[],direct:e.name===e.inputName})),parameterName:t.flatMap(e=>[e.name,e.inputName]),directParameterName:e.parameter.map(e=>e.name),parameterDescription:[...e.parameter,...e.requestBody??[],...(e.requestBody??[]).flatMap(e=>e.parameter)].map(({description:e})=>e),responseFieldLevel:wn(e.operationId)}}function Pn(e,t){let n=e.q?.trim()??``,r=Mn(n,t.filter(t=>Fn(e,t)&&(n.length>0||t.deprecated!==!0)),Nn),i=(r[0]?.score??0)*Dn,a=r.filter(({score:e})=>e>=i),o=e.limit===void 0||!Number.isFinite(e.limit)?En:e.limit,s=Math.min(a.length,Math.max(0,Math.trunc(o))),c=a.slice(0,s).map(({item:e})=>e),l={totalOperations:t.length,matched:a.length,returned:c.length},u=c.map(e=>It(e,c.length===1));return{summary:j,data:ee(h(j,u,{counts:l}))?u:c.map(Lt),counts:l}}function Fn(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 In({normalizedQuery:e,tokens:t,termForm:n,queryWord:r},i){let a=Hn(i),o=Bn(i),s=0;a.some(t=>t===e)&&(s+=100),a.some(t=>t.includes(e))&&(s+=40),s+=Vn(e,a);let c=new Set(a.flatMap(F));for(let e of t)a.some(t=>t===e)?s+=20:c.has(e)&&(s+=8);for(let e of i.cliPath){let n=new Set;N(n,e),[...n].some(e=>t.has(e))&&(s+=On)}cn(n,o)&&(s+=200),i.parameterName.some(t=>I(t)===e)&&(s+=kn);let l=new Set(i.parameterDescription.flatMap(F));for(let e of t)l.has(e)&&(s+=An);return s+=Wn(t,i.enumParameter),[`list`,`search`,`find`,`browse`].some(e=>t.has(e))&&/^(?:list|search)[A-Z]/u.test(i.operationId)&&(s+=30),s+=Tn(n,r,i.responseFieldLevel),s-=Un(e,t,i.description),v(i.intent)&&!zn(r)?s*jn:s}var Ln=`edit change set fix rename link unlink mark publish correct`.split(` `),Rn=new Set([...Object.entries(ce).filter(([,e])=>v(e)).map(([e])=>e),...Ln]);function zn(e){return[...e].some(e=>Rn.has(e))}function Bn(e){return[e.operationId,e.cliPath.join(` `),e.summary].map(I).filter(e=>e.length>0)}function Vn(e,t){let n=F(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 Hn(e){return[...new Set([e.operationId,e.method,e.path,e.resource,e.intent,e.cliPath.join(` `),e.summary,tn(e.description).useFor||e.description].map(I).filter(e=>e.length>0))]}function Un(e,t,n){let r=I(tn(n).notFor);if(r.length===0)return 0;let i=r.includes(e)?40:0,a=new Set(F(r));for(let e of t)r===e?i+=20:a.has(e)&&(i+=8);return i}function Wn(e,t){let n=0;for(let{values:r,direct:i}of t)r.some(t=>Gn(e,t))&&(n+=i?40:10);return n}function Gn(e,t){let n=F(t);return n.length>0&&n.every(t=>e.has(t))}function Kn(e){return typeof e.data==`object`&&e.data!==null&&`response`in e.data?e.data.response:void 0}async function qn(e,t,n,r){let i=e.q?.trim()??``;if(i.length===0)return _(`Provide q to resolve a request to one operation.`);let a=n.find(({resource:e,intent:t,deprecated:n})=>e===`help`&&t===`search`&&n!==!0);if(a===void 0)return _(`This build ships no help resolve operation.`);let o=await r(a,{body:{question:i,resolve:!0,...e.scope===void 0?{}:{scope:e.scope===`read`?`READ`:`WRITE`}}});if(!o.ok)return{...o,data:null};let s=et.safeParse(Kn(o));if(!s.success||s.data.resolution==null)return _(`The help resolve operation returned no resolution.`);let{answer:c,resolution:l}=s.data,u=e=>t.find(t=>t.operationId===e),d=u(l.operationId),f=l.taskPlan??void 0,p=(f?.step??[]).map(({step:e})=>({step:e,contract:u(e.operationId)})),m=[...new Set([...l.operationId!=null&&d===void 0?[l.operationId]:[],...p.filter(({contract:e})=>e===void 0).map(({step:e})=>e.operationId)])];return m.some(e=>!n.some(t=>t.operationId===e))?_(`No operation on this connection answers that request.`):h(m.length===0?`Help resolution`:`Help resolution this connection cannot finish: it cannot run ${m.join(`, `)}.`,{outcome:l.outcome,probability:l.probability,answer:c,candidate:l.candidate.map(({sourceId:e})=>e).filter(e=>n.some(({operationId:t})=>t===e)),...d===void 0?{}:{operation:{operationId:d.operationId,apiRoute:`${d.method} ${d.path}`,...en(d),mcpCall:Qt(d)}},...(l.taskKey,{}),...f===void 0?{}:{taskPlan:{input:f.input,step:p.map(({contract:e,step:{stepKey:t,instruction:n,operationId:r}})=>e===void 0?{instruction:n,operationId:r}:{instruction:n,mcpCall:Qt(e)})}}},{warnings:m.map(e=>n.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.`)})}var Jn=p({detail:f(),field:f().nullish(),scope:s([`entity`,`person`,`news`])}),Yn=s([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),Xn=Object.assign(r([Yn,f()]),{enum:Yn.enum}),L=p({modeRequested:Xn,modeUsed:Xn}),Zn=p({answerUnavailable:u(),entity:L,news:L,person:L,rejection:a(Jn),unavailable:a(s([`entity`,`person`,`news`]))}),Qn=p({acceleratorParticipation:a(we),detail:a(Te)}),R=p({core:b,enrichment:Re,fundraiseRound:a(Le),research:Qn,semanticMatch:je.nullish()}),$n=s([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),er=p({compositeScore:d().nullish(),cosineScore:d().nullish(),curatedAsOf:f().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),curatedRelationshipType:f().nullish(),curatedSource:f().nullish(),derivedFromEntityId:n().nullish(),matchedSectionWeight:d().nullish(),origin:$n,rank:c(),sharedSectionCount:c().nullish()}),tr=p({entity:R,similarity:er}),nr=p({fundraiseInvestorJoin:u(),fundraiseTransaction:u(),operatingStatus:u(),relationship:u()}),rr=s([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),ir=s([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),ar=p({acquiredEntity:b,acquirerEntity:b,amount:d().int().nullish(),announcedAt:f().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),asOf:f().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),completedAt:f().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),createdAt:i({offset:!0}).nullish(),currency:f().nullish(),dataConfidence:ze.nullish(),evidence:nr,fundraiseTransactionId:n().nullish(),investorJoinId:n().nullish(),isCurrent:u().nullish(),publicSource:ge.nullish(),relationshipId:c(),status:rr,transactionStatus:ir.nullish(),updatedAt:i({offset:!0}).nullish()}),or=s([`SAFE`,`Convertible Note`,`Preferred Stock`,`Common Stock`,`Other Equity`,`Bond`,`Loan`,`Other Debt`,`Grant`,`Token`]),sr=p({amountInvested:d().nullish(),createdAt:i({offset:!0}),financialInstrumentType:or.nullish(),id:n(),investor:l,leadInvestor:u(),transactionId:n(),updatedAt:i({offset:!0})}),cr=p({entity:Fe,investorAttribution:a(Be),round:a(be),roundCount:c()}),lr=p({core:b,fundingDetail:pe.nullish(),similarity:er,urlLink:a(_e)}),ur=p({compliance:ke.nullish(),createdAt:i({offset:!0}).nullish(),id:c(),isCurrent:u().nullish(),isPrimary:u().nullish(),language:f().nullish(),owner:l,text:f(),textName:f().nullish(),textType:f(),updatedAt:i({offset:!0}).nullish()}),dr=s([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),fr=s([`fundraiseRound`,`researchDetail`]),pr=s([`preMoney`,`postMoney`,`reported`]),mr=p({amountRaised:d().int().nullish(),asOfDate:f().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),confidence:Oe,currency:f(),declaredBasis:pr,derivation:dr,detailId:c().nullish(),label:f().nullish(),source:fr,sourceRef:f(),valuationPostMoney:d().int().nullish(),valuationPreMoney:d().int().nullish()}),hr=p({createdAt:i({offset:!0}).nullish(),description:f().nullish(),forkCount:c(),githubId:d().int(),homepageUrl:f().nullish(),id:d().int(),isArchived:u(),isFork:u(),language:f().nullish(),license:f().nullish(),name:f(),ownerLogin:f(),repoCreatedAt:i({offset:!0}).nullish(),repoPushedAt:i({offset:!0}).nullish(),stargazerCount:c(),topic:a(f()),updatedAt:i({offset:!0}).nullish(),url:f()}),z=p({empty:u().optional(),sorted:u().optional(),unsorted:u().optional()}),B=p({offset:d().int().optional(),paged:u().optional(),pageNumber:c().optional(),pageSize:c().optional(),sort:z.optional(),unpaged:u().optional()}),gr=p({investorAttribution:a(Be),person:Ne,round:a(be),roundCount:c()}),_r=s([`by`,`about`]),vr=s([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),yr=p({canonicalUrl:f().nullish(),contentId:f(),contentType:vr,createdAt:i({offset:!0}).nullish(),publishedAt:i({offset:!0}).nullish(),relation:_r.nullish(),sourceDomain:f().nullish(),sourceName:f().nullish(),summary:f().nullish(),title:f(),topic:f().nullish(),updatedAt:i({offset:!0}).nullish(),url:f().nullish(),year:c().nullish()});p({content:a(Se).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(r([De,he])).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(xe).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(b).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(ar).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Fe).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(sr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Le).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(cr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(R).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Ie).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(ve).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Te).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Me).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(tr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(lr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(ur).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(_e).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(mr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(hr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Ce).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(ye).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Ne).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Pe).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(gr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(Ee).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()}),p({content:a(yr).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()});var br=p({content:a(R),number:c(),size:c(),totalElements:d().int(),totalPages:c()}),xr=p({content:a(Ce),number:c(),size:c(),totalElements:d().int(),totalPages:c()}),Sr=p({content:a(ye),number:c(),size:c(),totalElements:d().int(),totalPages:c()});p({content:a(Ae).optional(),empty:u().optional(),first:u().optional(),last:u().optional(),number:c().optional(),numberOfElements:c().optional(),pageable:B.optional(),size:c().optional(),sort:z.optional(),totalElements:d().int().optional(),totalPages:c().optional()});var Cr=s([`entityRecord`,`researchSnippet`,`newsArticle`,`personRecord`,`fundraiseTransaction`]),wr=Object.assign(r([Cr,f()]),{enum:Cr.enum}),Tr=p({entityId:n(),source:wr,sourceId:f()}),Er=p({citation:a(Tr),text:f(),topic:f().nullish()}),Dr=p({citation:a(Tr),confidence:S,description:f().nullish(),heading:f().nullish(),paragraph:a(Er),relatedQuery:a(f()),shareable:u(),text:f(),title:f().nullish()}),Or=p({enrichmentRunId:n().nullish(),entityId:n()}),kr=p({sortPriority:s([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),Ar=p({max:i({offset:!0}).nullish(),min:i({offset:!0}).nullish()}),V=p({max:d().nullish(),min:d().nullish()}),H=p({max:c().nullish(),min:c().nullish()}),jr=p({averageAmountInvestedUsdRange:a(V).optional(),largestAmountInvestedUsdRange:a(V).optional(),smallestAmountInvestedUsdRange:a(V).optional(),totalAmountInvestedUsdRange:a(V).optional(),totalInvestmentRange:a(H).optional()}),Mr=p({amountInvestedRange:a(V).optional(),amountRaisedRange:a(V).optional(),dateAnnouncedRange:Ar.nullish(),investedCompanyName:a(f()).optional(),investedCountry:a(f()).optional(),investedIndustry:a(f()).optional(),investedRound:a(f()).optional(),investorActivity:jr.optional(),investorName:a(f()).optional(),lastRoundYearRange:a(H).optional(),rankByInvestmentActivity:u().nullish(),round:a(f()).optional(),totalRaisedRange:a(V).optional(),valuationRange:a(V).optional()}),Nr=s([`NONE`,`COMPANY_LISTING_READY`]),Pr=s([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),Fr=s([`hostPath`,`domain`]),Ir=t({acceleratorBrand:a(f()).optional(),acceleratorCohort:a(f()).optional(),acceleratorName:a(f()).optional(),acceleratorStatus:a(f()).optional(),affinity:a(f()).optional(),closedLast:u().optional(),employeeCountRange:a(H).optional(),entityId:a(n()).optional(),entityName:a(f()).optional(),featured:u().nullish(),fundraiseActivity:Mr.optional(),hasFundraising:u().nullish(),headquartersCity:a(f()).optional(),headquartersCountry:a(f()).optional(),headquartersState:a(f()).optional(),industry:a(f()).optional(),letter:f().nullish(),location:a(f()).optional(),logoOption:kr.optional(),mainProduct:a(f()).optional(),operatingStatus:a(Pr).optional(),originCountry:a(f()).optional(),person:a(f()).optional(),portfolioHeadquartersCity:a(f()).optional(),portfolioHeadquartersCountry:a(f()).optional(),portfolioHeadquartersState:a(f()).optional(),qualityGate:Nr.optional(),rankByProminence:u().nullish(),semanticQuery:f().nullish(),slug:a(f().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:a(f()).optional(),suppressLateStage:u().nullish(),suppressNonOperating:u().nullish(),suppressZeroTotalRaised:u().nullish(),tag:a(f()).optional(),textSearch:f().nullish(),typeCustomer:a(f()).optional(),typeModel:a(f()).optional(),typeOwnership:a(f()).optional(),typeRecord:a(o).optional(),typeRevenue:a(f()).optional(),typeTechnologyUsed:a(f()).optional(),url:f().nullish(),urlDomain:f().nullish(),urlMatchMode:Fr.nullish(),urlType:me.nullish(),yearFoundedRange:a(H).optional()}),Lr=s([`discovery`,`profile`,`peer`,`comparison`]),Rr=s([`keyword`,`semantic`]),zr=s([`ID`,`NAME_BRAND`,`YEAR_FOUNDED`,`STATUS_OPERATING`,`UPDATED_AT`,`CREATED_AT`,`NEXT_DUE_AT`,`DATA_COMPLETION_COVERAGE`,`TOTAL_RAISED`,`AMOUNT_INVESTED`,`RECENT_INVESTMENT_AT`,`STAGE`,`MOST_RECENT_AMOUNT`,`LATEST_VALUATION`,`MOST_RECENT_DATE`,`ACCELERATOR_BRAND`,`ACCELERATOR_COHORT`,`HEADQUARTERS_COUNTRY`,`EMPLOYEE_COUNT`]),Br=Object.assign(r([zr,f()]),{enum:zr.enum}),Vr=p({descending:u(),field:Br,sortKey:f().nullish()}),Hr=p({order:a(Vr),relevance:Rr.nullish()}),Ur=p({confidence:S,execution:L,fallbackUsed:u(),filter:Ir,intent:Lr,interpretation:f(),sort:Hr,subjectEntityName:a(f()),unsupported:f().nullish()}),Wr=p({changedAt:i({offset:!0}).nullish(),dataSourceUpdatedAt:i({offset:!0}).nullish(),pendingApproval:c().nullish(),sourceId:f().nullish(),status:f().nullish()}),Gr=p({fundManagerRelationshipSource:Wr.nullish(),fundraiseTransaction:Le,fundraiseTransactionSource:Wr.nullish(),investorJoinSource:Wr.nullish()}),Kr=p({evidence:Gr,investor:l,semanticMatch:je.nullish()}),qr=p({entityId:n(),matchedOffering:b.nullish(),probability:d(),webUrl:a(f())}),Jr=p({entityId:n(),label:f(),publishedAt:i({offset:!0}).nullish(),score:d(),source:wr,sourceId:f(),text:f(),url:f().nullish()}),Yr=p({answer:Dr.nullish(),filing:a(Or).nullish(),interpretation:Ur,investment:a(Kr),judgment:a(qr),passage:a(Jr),peer:a(tr),pendingWebQuery:a(f()),result:br,searchRequestId:n().nullish(),subject:a(R)}),Xr=s([`auto-match`,`needs-review`,`approved`,`rejected`]),Zr=p({createdAt:i({offset:!0}),entityId:n(),href:f().nullish(),internal:u(),matchStatus:Xr.nullish(),mention:f().nullish(),slug:f().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:o.nullish(),updatedAt:i({offset:!0})}),Qr=p({entity:a(Zr),newsId:c()}),$r=t({acceleratorBrand:a(f()).optional(),acceleratorCohort:a(f()).optional(),acceleratorName:a(f()).optional(),acceleratorStatus:a(f()).optional(),affinity:a(f()).optional(),closedLast:u().optional(),employeeCountRange:a(H).optional(),entityId:a(n()).optional(),entityName:a(f()).optional(),featured:u().nullish(),fundraiseActivity:Mr.optional(),hasFundraising:u().nullish(),headquartersCity:a(f()).optional(),headquartersCountry:a(f()).optional(),headquartersState:a(f()).optional(),industry:a(f()).optional(),letter:f().nullish(),location:a(f()).optional(),logoOption:kr.optional(),mainProduct:a(f()).optional(),operatingStatus:a(Pr).optional(),originCountry:a(f()).optional(),person:a(f()).optional(),portfolioHeadquartersCity:a(f()).optional(),portfolioHeadquartersCountry:a(f()).optional(),portfolioHeadquartersState:a(f()).optional(),qualityGate:Nr.optional(),rankByProminence:u().nullish(),slug:a(f().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:a(f()).optional(),suppressLateStage:u().nullish(),suppressNonOperating:u().nullish(),suppressZeroTotalRaised:u().nullish(),tag:a(f()).optional(),textSearch:f().nullish(),typeCustomer:a(f()).optional(),typeModel:a(f()).optional(),typeOwnership:a(f()).optional(),typeRecord:a(o).optional(),typeRevenue:a(f()).optional(),typeTechnologyUsed:a(f()).optional(),url:f().nullish(),urlDomain:f().nullish(),urlMatchMode:Fr.nullish(),urlType:me.nullish(),yearFoundedRange:a(H).optional()}),ei=p({amountInvestedRange:a(V).nullish(),amountRaisedRange:a(V).nullish(),entityName:a(f()).nullish(),investedCompany:a(f()).nullish(),personTitle:a(f()).nullish(),round:a(f()).nullish(),totalInvestmentCount:a(H).nullish(),typeRecord:a(o).nullish()}),ti=p({arrayFilter:ei.optional(),entityFilter:$r.optional(),entityId:n().nullish(),entitySlug:f().nullish(),firstName:f().nullish(),includeAddress:u().nullish(),includeUrl:u().nullish(),investorActivity:jr.optional(),isCurrent:u().nullish(),lastName:f().nullish(),letter:f().nullish(),personId:a(n()).max(200).optional(),personName:a(f()).optional(),role:f().nullish(),search:f().nullish(),semanticQuery:f().nullish(),status:f().nullish()}),ni=p({descending:u(),field:s([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`]),sortKey:f().nullish()}),ri=p({order:a(ni),relevance:Rr.nullish()}),ii=p({confidence:S,execution:L,fallbackUsed:u(),filter:ti,interpretation:f(),sort:ri,unsupported:f().nullish()}),ai=p({interpretation:ii,investment:a(Kr),result:Sr,searchRequestId:n().nullish()}),oi=p({label:f(),query:f()}),si=p({key:f(),option:a(oi),prompt:f()}),ci=p({entity:Yr,entityDetail:a(Fe),news:xr,newsEntityMention:a(Qr),person:ai,personDetail:a(Ne),provenance:Zn,qualifier:si.nullish()});function li(e,t){return e.map(e=>{let n=e.requestBody??[],r=[...e.parameters.map(e=>ui(e)),...n.flatMap(e=>e.parameter.map(t=>ui(t,n.length>1?e.contentType:void 0))),...di(n)],i=[t,...e.cliPath].join(` `),a=v(e.intent),o=ae(e),s=n[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:a,destructive:le(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse||!se(e.path)||o===null?null:ie(o),body:{hasBody:s!==void 0,kind:s?.kind??null,...s!==void 0&&n.length>1?{contentType:s.contentType}:{},required:s?.required??!1,description:s?.description??``,requiredPath:s?.requiredPath??[]},flags:r,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},summary:e.summary,description:e.description,...e.deprecated===void 0?{}:{deprecated:e.deprecated}}})}function ui(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 di(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 fi(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var pi=[`-id`,`-slug`,`-url`],mi=[`--id`,`--slug`,`--url`],hi=`/v1/lookup`,gi=`--from-file "<path>"`;function _i(e,t,n=te().bin[0]){let r=li(t,n),i=r.find(t=>t.operationId===e);return i===void 0?[]:xi(i,r)}function vi(e,t,n=te().bin[0]){let r=t.find(t=>t.operationId===e),[i]=r===void 0?[]:li([r],n);return i&&bi(i,wi(i,!1))}function yi(e,t,n,r=te().bin[0]){let i=e=>{let t=e.findIndex((e,t)=>n[t]!==e);return t===-1?e.length:t},a=`${n[0]} get`,[o,s]=t.filter(({method:t,path:n,parameters:r,cliPath:o})=>{let s=r.filter(({location:e})=>e===`path`),[c]=s;return t===`GET`&&s.length===1&&c?.flag.split(/\s+/u)[0]===e&&n.endsWith(`/{${c.name}}`)&&(i(o)>1||o.join(` `)===a)}).toSorted((e,t)=>i(t.cliPath)-i(e.cliPath));if(o!==void 0&&(s===void 0||i(s.cliPath)!==i(o.cliPath)))return vi(o.operationId,t,r)}function bi(e,t){return[e.cli.command,...t,`--data`].join(` `)}function xi(e,t){return[`example: ${bi(e,wi(e))}`,...Si(e,t)]}function Si(e,t){return fi(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} ${Ei(i)} --data`,o=t.find(e=>e.method===`POST`&&e.path===hi),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} ${Ei(s)} --data, then match.owner.${e.optionKey} when status is MATCHED`]})}var Ci=/(?:^|\.)text$/u;function wi(e,t=!0){let n=fi(e).filter(e=>e.required),r=e.body.kind===`json`&&n.some(e=>e.location===`body`&&Ci.test(e.wireName))?n.filter(e=>e.location!==`body`):n,i=(n.length>0||!t?r:Ti(e)).map(Ei);return(e.body.required||e.body.requiredPath.length>0)&&!r.some(e=>e.location===`body`)?[...i,gi]:i}function Ti(e){let t=new Set;N(t,e.resource);for(let n of pi)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 mi){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function Ei(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}var Di=`aventure`;function Oi(e,t){let n=t.find(t=>t.operationId===e)?.cliPath;return n===void 0?void 0:`${Di} ${n.join(` `)}`}function ki(e,t,n=e){return vi(e,t,`aventure`)??n}function Ai(e,t){let n=et.safeParse(e);if(!n.success)return null;let{answer:r,citation:i,confidence:a,resolution:o}=n.data;if(o!=null)return ji(r,o,t);let s=r.trimEnd().split(`
15
- `),c=new Set(i.flatMap(({sourceType:e,sourceId:n})=>{if(e!==We.options[0].enum.OPERATION)return[];let r=Oi(n,t);return r===void 0?[]:[r]}));return c.size>0&&s.push(``,`Commands:`,...[...c].map(e=>` ${e}`)),s.push(``,`Confidence: ${a}`),i.length===0?s:(s.push(`Sources (${i.length}):`),s.push(...i.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`})),s)}function ji(e,t,n){let{outcome:r,operationId:i,probability:a,candidate:o,taskKey:s,taskPlan:c}=t,l=[c==null?e.trimEnd():Ni(c)],u=[``,`Outcome: ${r}${a==null?``:` (probability ${a.toFixed(2)})`}`];switch(r){case C.enum.TASK_PLAN:return[...l,...c==null?[]:Pi(c,n),...u];case C.enum.OPERATION_ADVICE:{let e=o.filter(({sourceId:e})=>e!==i);return[...l,...i==null?[]:[``,`Command:`,` ${ki(i,n)}`],...u,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case C.enum.CLARIFY:return[...l,...s==null?[]:[``,`Leading catalog task: ${s}`],...Ii(`Candidates:`,o,n),...u];case C.enum.ABSTAIN:return[...l,...Ii(`Nearest operations:`,o,n),...u];default:throw Error(`Unhandled help resolution outcome ${String(r)}`)}}function Mi(e,t){let n=Qe.safeParse(e);return n.success?[Ni(n.data),...Pi(n.data,t)]:null}var Ni=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function Pi(e,t){return e.step.length===0?[``,`This catalog task has no planned steps yet.`]:[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n})=>` ${e} (${t}): ${n}`)],``,`Steps:`,...e.step.flatMap(({step:n,cliCommand:r,writeGuidance:i},a)=>[` ${a+1}. ${n.stepKey===void 0?``:`${n.stepKey}: `}${ki(n.operationId,t,r)}`,` ${n.instruction}`,...Fi(e,a,i)]),...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function Fi(e,t,n){if(n==null)return[];let r=JSON.stringify(n),i=e.step.findIndex(({writeGuidance:e})=>JSON.stringify(e)===r);return i===t?[` Write guidance:`,` - Expectation: ${n.expectation}`,` - Body: ${n.body}`,` - Read first: ${n.typeCatalog}`,` - Rejected when:`,...n.reject.map(e=>` - ${e}`),` - Override: ${n.override}`,` - Method: ${n.method.join(`; `)}`]:[` Write guidance: as step ${i+1}.`]}function Ii(e,t,n){if(t.length===0)return[];let r=t.map(({sourceId:e,excerpt:t})=>({command:Oi(e,n)??e,excerpt:t})),i=Math.max(...r.map(({command:e})=>e.length));return[``,e,...r.map(({command:e,excerpt:t})=>` ${e.padEnd(i)} # ${t}`)]}var U=30,Li=8,W=10,Ri=2,zi=[`id`,`association.associationId`,`slug`,`name`,`nameBrand`,`nameFull`,`core.nameBrand`,`core.nameFull`,`core.slug`,`core.typeRecord`,`entity.core.nameBrand`,`entity.core.slug`,`title`,`sourceName`,`publishedAt`,`round`,`dateAnnounced`,`amountRaised`,`investorAttribution.amountInvested`,`stage`,`updatedAt`,`createdAt`],Bi=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]),Vi=[`interpretation`,`confidence`,`unsupported`,`execution`,`fallbackUsed`];function Hi(e,t,n){if(typeof t==`string`)return bt(t);let r=Kt(t);if(r!==null)return E(r);let i=$i(t);if(i===null)return null;let a=e.find(({operationId:e})=>e===i.operationId),{response:o,hiddenNote:s}=ue(a?.detailField,i.response),c={...i,response:o,parameters:a?.parameters??[]},l=Ai(c.response,e)??Mi(c.response,e);if(l!==null)return E(l.join(`
16
- `),!0);let u=Ui(c);if(u!==null)return E([...u,...s].join(`
17
- `),!0,s.length>0);let d=[c.summary??n??c.operationId??`OpenAPI call succeeded`,`${c.method} ${c.endpoint}`],f=Ct(qi(c),117-s.length,T-x.byteLength(`${[...d,...s].join(`
18
- `)}\n`,`utf8`));return E([...[...d,...f].filter(Boolean),...s].join(`
19
- `),!0,s.length>0)}function Ui({response:e,...t}){if(e===void 0||!Y(e)||!(`entity`in e&&`person`in e&&`news`in e))return null;let n=ci.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o}=n.data;return[...r.answer?Wi(r.answer):[],...o.unavailable.map(e=>`${e} unavailable: retry this scope later`),...o.answerUnavailable?[`answer unavailable: retry this search later`]:[],...o.rejection.map(({scope:e,detail:t})=>y(`${e} rejected: ${t}`)),[`entities:`,...G(r.result,t)].join(`
20
- `),[`people:`,...G(i.result,t)].join(`
21
- `),[`news:`,...G(a,t)].join(`
22
- `)]}function Wi(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${y(e)}`).join(`
23
- `)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>y(` - ${e}:${t} entity=${n}`)).join(`
24
- `)}`;return[`answer:\n ${de(e.text).replaceAll(`
25
- `,`
26
- `)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function Gi(e){let t=$i(e)?.response,n=Y(t)?t.interpretation:void 0;if(!Y(n))return null;let r=L.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=q(n.filter),{unsupported:s,fallbackUsed:c}=n;return E([`strategy: requested=${i} used=${a}`,...Y(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${Ki(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``].filter(Boolean).join(`
27
- `),!0)}var Ki=e=>X(e)?y(e):Array.isArray(e)&&e.every(X)?e.map(e=>y(e)).join(`, `):JSON.stringify(e);function qi(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a}=e;if(t===void 0)return a!==void 0&&i!==void 0?[`status=${i} redirect=${a}`]:i===void 0?[]:[`status=${i} no response body`];let o=i===void 0||n===`GET`?``:`status=${i}`,s=Y(t)&&!na(t)?ra(t):null,c=s===null?void 0:Y(s.context.interpretation)?q(s.context):s.context,l=c!==void 0&&Y(c)?Object.entries(c):[],u=l.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(Y)),d=new Set(u.map(([e])=>e)),f=Object.fromEntries(l.filter(([e])=>!d.has(e)));return[o,...na(t)?G(t,e,r):s===null?aa(t)?Xi(t.filter,t.meta):oa(t)?Xi([...t.arrayFilterEntry,...t.rangeFilterEntry],t.filtersMeta):ca(t)?Zi(t):K(t,``):[...G(s.page,e,r),...Object.keys(f).length===0?[]:K(f,``),...u.flatMap(([e,t])=>[`${e}:`].concat(Ji(t)))]].filter(Boolean)}function G(e,t,n){let r=Qi(t),i=e.numberOfElements??e.content.length,a=(e.totalElements??0)-(e.number??0)*(e.size??0)-i,o=e.number===void 0?``:` page=${e.number}`,s=e.size===void 0?``:` size=${e.size}`,c=e.totalElements===void 0?``:` total=${e.totalElements}`,l=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,u=(e.number??0)+1,d=e.totalPages===void 0||u<e.totalPages,f=Z(`page`,t.parameters);return[`rows=${i}${o}${s}${c}${l}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${Q(n)}`,a<=0||n!==void 0?``:d&&i===e.size?`more: ${a} rows not shown; use ${f} or ${Z(`size`,t.parameters)} to see them`:`more: ${a} more matched but this response returns only these ${i}; narrow the query to reach them${d?` (${f} ${u} starts after this page)`:``}`,...Ji(e.content)].filter(Boolean)}function Ji(e){let t=e.filter(Y);if(t.length===0)return e.length===0?[`(empty)`]:ea(e,``);let n=Yi(t);if(n.length===0)return ea(e.slice(0,U),``);let r=t.slice(0,U).map(e=>{let t=J(e);return n.map(e=>t[e]??``)}),i=n.map(e=>e.split(`.`).at(-1)??e),a=i.map((e,t)=>{let n=r.map(e=>e[t]??``),i=Math.max(e.length,...n.map(e=>e.length));return e===`id`||e.endsWith(`Id`)?i:Math.min(32,i)}),o=e=>e.map((e,t)=>la(e,a[t]??12).padEnd(a[t]??12)).join(` `),s=[o(i),o(a.map(e=>`-`.repeat(e)))];return r.forEach(e=>s.push(o(e))),t.length>U&&s.push(`... ${t.length-U} more rows`),s}function Yi(e){let t=e.map(e=>J(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=zi.filter(e=>n.has(e)),i=new Set(r.map(ta)),a=[...n].filter(e=>{let n=t.every(t=>/^-?\d+(?:\.\d+)?$/u.test(t[e]??`0`));return!e.includes(`.`)||/id$/iu.test(e)||i.has(ta(e))?!1:(n&&i.add(ta(e)),n)}),o=[...n].filter(e=>/(?:^|\.)id$/u.test(e)).slice(0,1),s=[...new Set([...r,...o,...a])],c=[...n].filter(e=>!s.includes(e)).filter(e=>!e.toLowerCase().includes(`logo`)).slice(0,Li-s.length);return[...s,...c].slice(0,Li)}function Xi(e,t){let n=t!==void 0&&Y(t)?t:{},r=[`total`,`limit`].flatMap(e=>typeof n[e]==`number`?[` ${e}=${n[e]}`]:[]).join(``),i=[`filters=${e.length}${r}`];for(let t of e){let e=t.choiceOption.length,n=t.choiceOptionTotal===null?`unknown (degraded)`:t.choiceOptionTotal??e,r=t.choiceOptionTruncated===!0?` truncated`:``;i.push(`- ${t.filterKey} (${t.label}): choices ${e}/${n}${r}`),t.choiceOption.slice(0,W).forEach(e=>{i.push(` ${Z(t.filterKey)} ${Q(e.value)}`)}),e>W&&i.push(` ... ${e-W} more shown`)}return i}function Zi(e){let t=Z(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,W).map(e=>`${t} ${Q(e)}`),e.result.length>W?`... ${e.result.length-W} more matches`:``].filter(Boolean)}function Qi({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Bi.has(e)&&t.length>0).map(([e,n])=>`${Z(e,t)} ${Q(n)}`)}function $i(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:void 0},[n,r,i]=[t(`method`),t(`endpoint`),t(`nextCursor`)];if(n===void 0||r===void 0)return null;let a=Reflect.get(e,`httpStatus`),o=Reflect.get(e,`response`),s=o===void 0?void 0:g.safeParse(o);return s!==void 0&&!s.success?null:{method:n,endpoint:r,httpStatus:typeof a==`number`?a:void 0,location:t(`location`),operationId:t(`operationId`),summary:t(`summary`),nextCursor:i===``?void 0:i,response:s?.data}}function K(e,t,n){if(e===void 0)return[];if(X(e))return[`${t}${fe(e,n)}`];if(Array.isArray(e))return ea(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if(X(i)){r.push(`${t}${n}: ${fe(i,n)}`);continue}r.push(`${t}${n}:`);for(let e of K(i,`${t} `,n))r.push(e)}return r.length===0?[`${t}(empty)`]:r}function ea(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e){if(X(i)){r.push(`${t}- ${fe(i,n)}`);continue}r.push(`${t}-`);for(let e of K(i,`${t} `))r.push(e)}return r}function q(e){if(e===void 0||X(e))return e===null||typeof e==`string`&&e.trim().length===0?void 0:e;if(Array.isArray(e)){let t=e.flatMap(e=>{let t=q(e);return t===void 0?[]:[t]});return t.length===0?void 0:t}let t=Object.entries(e).flatMap(([e,t])=>{let n=q(t);return n===void 0?[]:[[e,n]]});if(t.length!==0)return Object.fromEntries([...Vi.flatMap(e=>t.filter(([t])=>t===e)),...t.filter(([e])=>!Vi.includes(e))])}function J(e,t=``,n=0){return X(e)?t.length===0?{}:{[t]:y(e,t)}:n>Ri?{}:Array.isArray(e)?e[0]===void 0?{}:J(e[0],t,n+1):Object.fromEntries(Object.entries(e).flatMap(([e,r])=>{if(r===void 0)return[];let i=t.length===0?e:`${t}.${e}`;return X(r)?[[i,y(r,i)]]:Object.entries(J(r,i,n+1))}))}var ta=e=>e.split(`.`,1)[0],na=e=>Y(e)&&Array.isArray(e.content);function ra(e){let[t,...n]=Object.entries(e).filter(e=>na(e[1])&&typeof e[1].totalElements==`number`);if(t===void 0||n.length>0)return null;let[r,i]=t;return{page:i,context:Object.fromEntries(Object.entries(e).filter(([e])=>e!==r))}}function ia(e){return Y(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var aa=e=>Y(e)&&sa(e.filter),oa=e=>Y(e)&&sa(e.arrayFilterEntry)&&sa(e.rangeFilterEntry),sa=e=>Array.isArray(e)&&e.every(ia),ca=e=>Y(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>typeof e!=`object`||!e,Z=(e,t=[])=>t.find(({name:t})=>t===e)?.flag.split(` `)[0]??`--${e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}`,Q=e=>/^[A-Za-z0-9._:/@-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`,la=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(0,t-3))}...`,ua=/\{([^}]+)\}/gu;function da(e,t){let n=t.filter(e=>e.method===`GET`),r=t=>e.endpoint!==void 0&&t.endsWith(e.endpoint),i=t.find(t=>t.operationId===e.operationId),a=e.ok&&i!==void 0&&v(i.intent),o=[...a&&e.endpoint!==void 0?pa(e.endpoint.split(`?`)[0]??``,n,!1).map(e=>`${e} --data --to-file <path>`):[],...e.references.filter(e=>!r(e)).flatMap(fa).flatMap(e=>pa(e.pathname,n,!0)),...e.references.filter(r).flatMap(fa).flatMap(e=>ma(e,n))];return o.length===0?{write:a}:{exactRecovery:`Read the full result ${o.join(`; `)}.`,write:a}}function fa(e){return URL.canParse(e)?[new URL(e)]:[]}function pa(e,t,n){return t.flatMap(t=>{let r=[...t.path.matchAll(ua)].map(([,e])=>e),i=RegExp(`^${t.path.replace(ua,`([^/]+)`)}$`,`u`),a=n&&r.length===0?null:i.exec(e);if(a===null)return[];let o=r.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[$(r),a[n+1]??``]});return[`${ha(t)}, ${ga(t,o)}`]})}function ma(e,t){let n=t.find(t=>t.path===e.pathname);return n===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${n.path}/`))return[];let r=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),i=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(r===void 0||i===void 0)return[];let a=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[$(t),_a(n)]}),o=[$(r),`<n>`,$(i),`<n>`];return[`${ha(t)}, in windows: ${ga(t,[...a,...o])}, advancing ${$(r)} until a window returns fewer than ${$(i)} units`]})}function ha(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function ga(e,t){return[Di,...e.cliPath,...t].join(` `)}function $(e){return e.flag.split(/\s+/u)[0]??e.flag}function _a(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function va(e){return e.toSorted((e,t)=>e.projection.cliPath.length-t.projection.cliPath.length||e.projection.cliPath.join(` `).localeCompare(t.projection.cliPath.join(` `))||e.operationId.localeCompare(t.operationId)).map(e=>{let t=e.parameter.flatMap(t=>{if(t.in!==`path`&&t.in!==`query`&&t.in!==`header`)return[];let n=t.in;return(t.in===`query`&&t.itemProperty!==void 0?t.itemProperty:[t]).map(t=>{let r=Ca(t,w(e,t),n);if(t.legacyName===void 0)return r;let i=Ca(t,w(e,t,t.legacyName),n).flag;return i===r.flag?r:Object.assign(r,{legacyFlag:i})})}),n=e.requestBody?.map(n=>{let r=xa(e,t,n),i=ba(n.cliConflicts,r),a=i.length===0?{}:{cliConflicts:i};return Object.assign({},n,{parameter:r},a)}),r=e.response.find(({status:e})=>e.startsWith(`2`)),i=r?.schemaName?.replace(/Schema$/,``);return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliPath:e.projection.cliPath,summary:e.summary,description:e.description,binaryResponse:e.binaryResponse?!0:void 0,explain:e.explain?!0:void 0,deprecated:e.deprecated?!0:void 0,requestBody:n,mutationReadback:e.mutationReadback,scope:e.projection.scope,auth:e.projection.auth,visibility:e.projection.visibility,errorResponse:e.errorResponse,successResponse:i,detailField:r?.detailField,parameters:t}})}function ya(e,t){let[n,r]=e.filter(e=>e.role===t);if(n===void 0||r!==void 0)throw Error(`Generated composite CLI role '${t}' is incomplete`);return n}function ba(e,t){let n=new Map(t.map(({name:e,optionKey:t})=>[e,t]));return(e??[]).map(e=>e.map(e=>{let t=n.get(e);if(t===void 0)throw Error(`x-aventure-cli-conflicts field '${e}' was removed from the generated CLI projection`);return t}))}function xa(e,t,n){let r=new Set(t.map(e=>e.optionKey));(e.requestBody?.length??0)>1&&r.add(`contentType`);let i=new Set(t.filter(e=>e.location===`path`).map(e=>e.name));return n.parameter.toSorted((e,t)=>Sa(e.name)-Sa(t.name)).flatMap(t=>{if(!t.required&&(r.has(t.inputName)||i.has(t.name)))return[];let n=tt(e,t,r);return r.add(n),[Ca(t,n,`body`)]})}function Sa(e){let t=e.split(`.`).at(-1);return t===`min`?0:t===`max`?1:2}function Ca(t,n,r){let i=t.itemSchemaEnum??t.schemaEnum,a=He(t.schemaType,t.itemSchemaType,t.schemaFormat,n),o=`${re(n)} ${t.schemaType===`boolean`?`[${a}]`:`<${a}>`}`;return{name:t.name,optionKey:new e(o).attributeName(),flag:o,required:t.required&&t.schemaDefault===void 0,description:Ve(t.description,i),schemaType:t.schemaType,schemaFormat:t.schemaFormat,itemSchemaType:t.itemSchemaType,defaultValue:wa(t.schemaDefault),choices:i,...t.envName===void 0?{}:{envName:t.envName},...t.visibility&&{visibility:t.visibility},location:r}}var wa=e=>Array.isArray(e)?e.map(String):typeof e==`number`?String(e):e;export{rt as S,P as _,Gi as a,It as b,_i as c,li as d,Nn as f,wn as g,qn as h,Hi as i,yi as l,Pn as m,ya as n,Ci as o,Mn as p,da as r,fi as s,va as t,xi as u,F as v,E as x,I as y};
@@ -1 +0,0 @@
1
- import{c as e,o as t}from"./logging-CDCaRpiW.js";export{t as logWarn,e as setStderrLogging};
@@ -1 +0,0 @@
1
- import{n as e}from"./mcp-generation-contract-B6pMxUtz.js";export{e as MCP_GENERATION_CONTRACT};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./oauth-bearer-credential-DU8FTqw7.js";export{t as materializeCliOAuthBearerCredential,e as materializeSavedCliOAuthBearerCredential};
@@ -1 +0,0 @@
1
- import{i as e}from"./oauth-login-BvM3PU4d.js";export{e as renewOAuthTokens};
@@ -1 +0,0 @@
1
- import{t as e}from"./openapi-commands-K3hFzG4D.js";export{e as GENERATED_OPENAPI_COMMAND_SPECS};