@aventurevc/aventure-cli 0.8.507 → 0.8.509

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 (41) hide show
  1. package/dist/aventure-cli/command-catalog.compact.txt +2 -0
  2. package/dist/aventure-cli/index.js +1 -1
  3. package/dist/aventure-cli/unified-operations.json +1 -1
  4. package/dist/chunks/{api-key-login-CmM3BFbQ.js → api-key-login-DfO9m2mn.js} +1 -1
  5. package/dist/chunks/{auth-status-check-C0TLIzzV.js → auth-status-check-Csx3C7Sh.js} +1 -1
  6. package/dist/chunks/{auth-status-check-ECJ1ma5Y.js → auth-status-check-Dj4KXVZ7.js} +1 -1
  7. package/dist/chunks/{auth-status-render-BdQ2gpVo.js → auth-status-render-DPFpwyry.js} +1 -1
  8. package/dist/chunks/aventure-cli-cvGYyj7-.js +11 -0
  9. package/dist/chunks/{builtin-auth-CCSpEwe1.js → builtin-auth-OPVpJ_Jh.js} +4 -4
  10. package/dist/chunks/{builtin-run-wait-BCNt76cG.js → builtin-run-wait-D5hP41JN.js} +1 -1
  11. package/dist/chunks/{builtin-update-CA6jNqDJ.js → builtin-update-DmyUY7cK.js} +1 -1
  12. package/dist/chunks/{completion-LkPy50Y-.js → completion-BoOb1L3E.js} +1 -1
  13. package/dist/chunks/generated-body-BaGjgMKp.js +1 -0
  14. package/dist/chunks/generated-dispatch-C79846kK.js +1 -0
  15. package/dist/chunks/{logout-Ds94CRXY.js → logout-ZKjVMX3k.js} +1 -1
  16. package/dist/chunks/logout-yqWxz0ln.js +1 -0
  17. package/dist/chunks/{oauth-bearer-credential-CEb_TJb0.js → oauth-bearer-credential-BauMxnf1.js} +1 -1
  18. package/dist/chunks/oauth-bearer-credential-DAnAGKPx.js +1 -0
  19. package/dist/chunks/{oauth-login-385gwK94.js → oauth-login-CD0FydTx.js} +1 -1
  20. package/dist/chunks/{oauth-login-CH5QTomv.js → oauth-login-DYs41nu5.js} +1 -1
  21. package/dist/chunks/openapi-commands-BEyhfc6I.js +1 -0
  22. package/dist/chunks/{openapi-commands-COrqLHGQ.js → openapi-commands-C347qf0b.js} +1 -1
  23. package/dist/chunks/openapi-snapshot.json +1 -1
  24. package/dist/chunks/{operations-KPl8_NhR.js → operations-CCPlcB5L.js} +1 -1
  25. package/dist/chunks/operations-catalog-EwBZDr8Z.js +1 -0
  26. package/dist/chunks/{operations-catalog-CcBIdLCW.js → operations-catalog-fUC6msyN.js} +1 -1
  27. package/dist/chunks/{output-CgaHhOg3.js → output-B1si3d0c.js} +1 -1
  28. package/dist/chunks/{output-BTKY0bpt.js → output-BL3uMwJp.js} +2 -2
  29. package/dist/chunks/{parse-error-hint-CTKc2qdc.js → parse-error-hint-DTJsWd-D.js} +1 -1
  30. package/dist/chunks/search-narrowing-DQTfXVdT.js +2 -0
  31. package/dist/chunks/startup-auth-B0hdVmRP.js +1 -0
  32. package/dist/chunks/{startup-auth-CuJ9h74H.js → startup-auth-CSrJz2OG.js} +1 -1
  33. package/dist/chunks/text-response-BvrwYvKW.js +17 -0
  34. package/package.json +3 -3
  35. package/dist/chunks/aventure-cli-FQtYsQaa.js +0 -11
  36. package/dist/chunks/logout-B6m52rrW.js +0 -1
  37. package/dist/chunks/oauth-bearer-credential-BjcUE4gK.js +0 -1
  38. package/dist/chunks/openapi-commands-Cyvu5wdW.js +0 -1
  39. package/dist/chunks/operations-catalog-qerms2d4.js +0 -1
  40. package/dist/chunks/startup-auth-DGDPMIp_.js +0 -1
  41. package/dist/chunks/text-response-MUvhsfwc.js +0 -17
@@ -1,3 +1,3 @@
1
- import{n as e}from"./commander-DEj7N1b9.js";import{a as t}from"./package-DEeHDoOT.js";import{c as n}from"./result-envelope-DhuT_8lW.js";import{n as r}from"./output-BTKY0bpt.js";import{a as i,t as a}from"./output-mode-CE87SvLV.js";import{a as o,c as s,i as c,l,o as u,r as d,s as f,t as p,u as m}from"./operations-catalog-CcBIdLCW.js";var h=`Match only the first canonical or CLI-alias command segment`,g=[`text`,`lines`,`compact`,`json`,`ndjson`],_=`20`;function v(e,n,r=t().bin[0]){let a=y((e.commands.find(e=>e.name()===`help`)??e.command(`help`)).command(`catalog`).summary(`Search or list generated command metadata offline`).description([`Search or list generated ${r} command metadata without calling the API.`,`A query ranks the closest ${_} operations; no query lists every operation.`,`Run \`${r} help <command>\` for one operation's full documentation.`,`Use --format lines for rg/grep/ag/ack, ndjson|json for ast-grep/sg/parsers,`,"and compact for one `cli · summary · requiredFlags` row per operation."].join(`
1
+ import{n as e}from"./commander-DEj7N1b9.js";import{a as t}from"./package-DEeHDoOT.js";import{c as n}from"./result-envelope-DhuT_8lW.js";import{n as r}from"./output-BL3uMwJp.js";import{a as i,t as a}from"./output-mode-CE87SvLV.js";import{a as o,c as s,i as c,l,o as u,r as d,s as f,t as p,u as m}from"./operations-catalog-fUC6msyN.js";var h=`Match only the first canonical or CLI-alias command segment`,g=[`text`,`lines`,`compact`,`json`,`ndjson`],_=`20`;function v(e,n,r=t().bin[0]){let a=y((e.commands.find(e=>e.name()===`help`)??e.command(`help`)).command(`catalog`).summary(`Search or list generated command metadata offline`).description([`Search or list generated ${r} command metadata without calling the API.`,`A query ranks the closest ${_} operations; no query lists every operation.`,`Run \`${r} help <command>\` for one operation's full documentation.`,`Use --format lines for rg/grep/ag/ack, ndjson|json for ast-grep/sg/parsers,`,"and compact for one `cli · summary · requiredFlags` row per operation."].join(`
2
2
  `)).argument(`[query...]`,`Words to rank operations by; omit to list every operation`));a.addHelpText(`after`,()=>b(r)),a.action(function(e){let t=this.optsWithGlobals(),a=c(t,e),o=(a.q?.trim()??``)!==``;u(o&&t.limit===void 0?{...a,limit:_}:a,n,i(t,`text`),r)})}function y(t){return t.option(`--root <root>`,h).addOption(new e(`--scope <scope>`,`Filter by required auth scope`).choices([`read`,`write`,`all`]).default(`all`)).addOption(new e(`--mutates <mutates>`,`Filter mutating operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new e(`--destructive <destructive>`,`Filter destructive operations`).choices([`true`,`false`,`any`]).default(`any`)).addOption(new e(`--intent <intent>`,`Filter by operation intent`).choices([`read`,`lookup`,`search`,`write`,`delete`,`status`,`all`]).default(`all`)).addOption(new e(`--method <method>`,`Filter by HTTP method`).choices([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`all`]).default(`all`)).option(`--limit <count>`,`Maximum rows to return`).addOption(new e(`--format <format>`,`Text/file render format`).choices(g)).option(`--output <path>`,`Write rendered output to a file`),a(t),t}function b(e){return[``,`Shipped with this install, greppable without running this CLI:`,` ${p(e)} (operations callable without an admin grant)`,` ${d(e)} (every operation's CLI, API, and MCP forms as JSON)`,``].join(`
3
3
  `)}function x(e,n,r=t().bin[0]){let i=e.command(`command-catalog`,{hidden:!0}).summary(`Deprecated: run \`${r} help catalog\``).description(`Deprecated: run \`${r} help catalog\` to search or list operations, and \`${r} help <command>\` for one operation.`);C(i,n,r),w(i,n,r),T(i,n,r),E(i,r)}function S(e,t,n){return e.hook(`preAction`,()=>{process.stderr.write(`warning: Deprecated: \`${t} command-catalog ${e.name()}\` is replaced by \`${t} ${n}\`.\n`)})}function C(e,t,n){let r=y(e.command(`search`).summary("Deprecated: run `help catalog <query...>`").argument(`[query...]`,`Search query; same as --q.`).option(`--q <query>`,`Search generated command metadata`));S(r,n,`help catalog <query...>`),r.action(function(e){let r=this.optsWithGlobals(),a=c(r,e),o=(a.q?.trim()??``)===``?t.filter(({deprecated:e})=>e!==!0):t;u({...a,limit:r.limit??_},o,i(r,`text`),n)})}function w(t,n,r){let o=t.command(`show`).summary("Deprecated: run `help <command>`").option(`--command <command>`,`CLI command path, with or without ${r} prefix`).option(`--operation-id <operationId>`,`Generated OpenAPI operationId`).addOption(new e(`--format <format>`,`Text/file render format`).choices([`usage`,`lines`,`compact`,`json`,`ndjson`]).default(`usage`)).option(`--output <path>`,`Write rendered output to a file`);a(S(o,r,`help <command>`)),o.action(function(){let e=this.optsWithGlobals();f(e,n,i(e,`text`),r)})}function T(e,t,n){let r=y(e.command(`dump`).summary("Deprecated: run `help catalog`"));S(r,n,`help catalog`),r.action(function(){let e=this.optsWithGlobals();u(e,t,i(e,`text`),n)})}function E(e,t){let c=e.command(`unified`).summary(`Deprecated: read the shipped unified-operations.json`).option(`--output <path>`,`Write unified operations JSON to a file`);a(S(c,t,`help catalog --help`)),c.action(async function(){let e=this.optsWithGlobals(),t=i(e,`text`),{MCP_GENERATION_CONTRACT:a}=await import(`./mcp-generation-contract-Cn0k8qOJ.js`);if(t===`text`&&e.output===void 0&&(e.text===!0||e.allFields===!0)){r({mode:t},n(`Unified operations JSON`,`Use --output <path> to write the unified operations JSON.`,{counts:{totalOperations:a.length}}));return}let c=s(a);if(e.output!==void 0){let i=m(e.output,c);r({mode:t},n(`Unified operations JSON written`,{outputPath:i.target,byteLength:i.byteLength,schemaVersion:c.schemaVersion},{counts:{totalOperations:i.totalOperations}}))}else t===`text`?o(`Unified operations JSON`,l(c)):r({mode:t},n(`Unified operations JSON`,c,{counts:{totalOperations:c.totalOperations}}))})}export{v as registerHelpCatalogCommand,x as registerRetiredCommandCatalog};
@@ -0,0 +1 @@
1
+ export{s as writeShowResult}from"./operations-catalog-fUC6msyN.js";
@@ -1,4 +1,4 @@
1
- import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-DhuT_8lW.js";import{s as r}from"./tool-policy-DYjF2wFZ.js";import{a as i}from"./output-spill-Cdl7NULe.js";import"./startup-auth-DGDPMIp_.js";import{i as a,r as o}from"./operations-metadata-DnrouEku.js";import{n as s}from"./output-BTKY0bpt.js";import{fileURLToPath as c}from"node:url";import{dirname as l,resolve as u}from"node:path";import{existsSync as d,mkdirSync as f,writeFileSync as p}from"node:fs";var m=`unified-operations.json`;function h(e,t=new Date){let n=v(e);return{schemaVersion:1,generatedFrom:`MCP_GENERATION_CONTRACT`,generatedAt:t.toISOString(),totalOperations:n.length,note:`1:1 projection of MCP_GENERATION_CONTRACT written by the CLI build ([MCP1b.1-EXC1]).`,operations:n}}function g(e){return`${JSON.stringify(e,null,2)}\n`}function _(e,t){let n=u(e),r=g(t);return f(l(n),{recursive:!0}),p(n,r),{target:n,byteLength:Buffer.byteLength(r,`utf8`),totalOperations:t.totalOperations}}function v(e){return e.map(e=>({operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliCommand:e.projection.cliPath.join(` `),cliPath:e.projection.cliPath,mcpTool:r(e),bodySchemaName:e.requestBody?.[0]?.schemaName??null,bodySchemaImport:e.requestBody?.[0]?.schemaImport??null,auth:e.projection.auth,scope:e.projection.scope,destructive:e.projection.destructive})).toSorted((e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)||e.operationId.localeCompare(t.operationId))}var y=`command-catalog.compact.txt`,b=`dist/aventure-cli`,x=` · `,S=`-`;function C(t=e().bin[0]){return T(y,t)}function w(t=e().bin[0]){return T(m,t)}function T(e,t){return u(E(l(c(import.meta.url)),t),b,e)}function E(e,t){let n=e;for(;;){if(d(u(n,`package.json`)))return n;let r=l(n);if(r===n)throw Error(`No package.json above ${e}; ${t} is not in a package layout.`);n=r}}function D(e,t){let n=t.join(` `).trim();return n.length===0?e:{...e,q:e.q===void 0?n:`${e.q} ${n}`}}function O(t,n,r,i=e().bin[0]){let a=o(t,n,i);!a.ok||a.data===null?s({mode:r},a):A({opts:t,mode:r,data:a.data,defaultFormat:`lines`,rendered:N(a.data,M(t.format,`lines`)),summary:`Generated operation matches`})}function k(t,n,r,i=e().bin[0]){let o=a(t,n,i);!o.ok||o.data===null?s({mode:r},o):A({opts:t,mode:r,data:o.data,defaultFormat:`usage`,rendered:P(o.data,M(t.format,`usage`)),summary:`Generated operation detail`})}function A(e){let r=e.mode,i=M(e.opts.format,e.defaultFormat),a=e.opts.text===!0||e.opts.allFields===!0;if(e.opts.output===void 0&&a&&(i===`json`||i===`ndjson`)){s({mode:r},n(`--text or --all-fields cannot be combined with --format json or ndjson`,[`Omit the text flag for machine output, or use --format lines, compact, or text.`]));return}let o=e.opts.output===void 0&&r===`text`&&`count`in e.data&&e.data.count.matched===0&&(a||e.opts.format===void 0||i===`text`)?`No generated operations matched.`:e.rendered,c=o.endsWith(`
1
+ import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-DhuT_8lW.js";import{s as r}from"./tool-policy-DYjF2wFZ.js";import{a as i}from"./output-spill-Cdl7NULe.js";import"./startup-auth-B0hdVmRP.js";import{i as a,r as o}from"./operations-metadata-DnrouEku.js";import{n as s}from"./output-BL3uMwJp.js";import{fileURLToPath as c}from"node:url";import{dirname as l,resolve as u}from"node:path";import{existsSync as d,mkdirSync as f,writeFileSync as p}from"node:fs";var m=`unified-operations.json`;function h(e,t=new Date){let n=v(e);return{schemaVersion:1,generatedFrom:`MCP_GENERATION_CONTRACT`,generatedAt:t.toISOString(),totalOperations:n.length,note:`1:1 projection of MCP_GENERATION_CONTRACT written by the CLI build ([MCP1b.1-EXC1]).`,operations:n}}function g(e){return`${JSON.stringify(e,null,2)}\n`}function _(e,t){let n=u(e),r=g(t);return f(l(n),{recursive:!0}),p(n,r),{target:n,byteLength:Buffer.byteLength(r,`utf8`),totalOperations:t.totalOperations}}function v(e){return e.map(e=>({operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliCommand:e.projection.cliPath.join(` `),cliPath:e.projection.cliPath,mcpTool:r(e),bodySchemaName:e.requestBody?.[0]?.schemaName??null,bodySchemaImport:e.requestBody?.[0]?.schemaImport??null,auth:e.projection.auth,scope:e.projection.scope,destructive:e.projection.destructive})).toSorted((e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)||e.operationId.localeCompare(t.operationId))}var y=`command-catalog.compact.txt`,b=`dist/aventure-cli`,x=` · `,S=`-`;function C(t=e().bin[0]){return T(y,t)}function w(t=e().bin[0]){return T(m,t)}function T(e,t){return u(E(l(c(import.meta.url)),t),b,e)}function E(e,t){let n=e;for(;;){if(d(u(n,`package.json`)))return n;let r=l(n);if(r===n)throw Error(`No package.json above ${e}; ${t} is not in a package layout.`);n=r}}function D(e,t){let n=t.join(` `).trim();return n.length===0?e:{...e,q:e.q===void 0?n:`${e.q} ${n}`}}function O(t,n,r,i=e().bin[0]){let a=o(t,n,i);!a.ok||a.data===null?s({mode:r},a):A({opts:t,mode:r,data:a.data,defaultFormat:`lines`,rendered:N(a.data,M(t.format,`lines`)),summary:`Generated operation matches`})}function k(t,n,r,i=e().bin[0]){let o=a(t,n,i);!o.ok||o.data===null?s({mode:r},o):A({opts:t,mode:r,data:o.data,defaultFormat:`usage`,rendered:P(o.data,M(t.format,`usage`)),summary:`Generated operation detail`})}function A(e){let r=e.mode,i=M(e.opts.format,e.defaultFormat),a=e.opts.text===!0||e.opts.allFields===!0;if(e.opts.output===void 0&&a&&(i===`json`||i===`ndjson`)){s({mode:r},n(`--text or --all-fields cannot be combined with --format json or ndjson`,[`Omit the text flag for machine output, or use --format lines, compact, or text.`]));return}let o=e.opts.output===void 0&&r===`text`&&`count`in e.data&&e.data.count.matched===0&&(a||e.opts.format===void 0||i===`text`)?`No generated operations matched.`:e.rendered,c=o.endsWith(`
2
2
  `)?o:`${o}\n`;e.opts.output===void 0?r===`text`?j(e.summary,c):s({mode:r},t(e.summary,e.data,{counts:B(e.data)})):(p(e.opts.output,c),s({mode:r},t(e.summary,{outputPath:e.opts.output,byteLength:Buffer.byteLength(c,`utf8`),format:i},{counts:B(e.data)})))}function j(e,n){let r=i(t(e,n));!r.ok||r.data===null?s({mode:`text`},r):process.stdout.write(r.data.endsWith(`
3
3
  `)?r.data:`${r.data}\n`)}function M(e,t){return e??t}function N(e,t){return t===`json`?JSON.stringify(e,null,2):t===`ndjson`?e.operation.map(e=>JSON.stringify(e)).join(`
4
4
  `):t===`text`?L(e.operation):t===`compact`?e.operation.map(F).join(`
@@ -1 +1 @@
1
- export{n as emit,i as emitJson,a as emitSearchExplanation,o as pendingResult}from"./output-BTKY0bpt.js";
1
+ export{n as emit,i as emitJson,a as emitSearchExplanation,o as pendingResult}from"./output-BL3uMwJp.js";
@@ -1,4 +1,4 @@
1
- import{a as e}from"./package-DEeHDoOT.js";import{n as t,r as n}from"./result-envelope-DhuT_8lW.js";import{o as r}from"./logging-DqesyM4A.js";import{a as i,n as a,r as o,t as s}from"./output-spill-Cdl7NULe.js";import{j as c}from"./help-catalog-ByQFO96d.js";import{r as l}from"./response-problem-DaJm66IX.js";import{t as u}from"./openapi-commands-Cyvu5wdW.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./text-response-MUvhsfwc.js";import{resolve as _}from"node:path";import{tmpdir as v}from"node:os";import{randomUUID as y}from"node:crypto";var b=1e4;function x(e,t){let n=t.data,r=`jobId`,i=`statusUrl`,a=t.rolloverJob?.jobId??(typeof n==`object`&&n&&r in n&&typeof n[r]==`string`?n[r]:void 0),o=t.rolloverJob?.statusUrl??t.headers.location??(typeof n==`object`&&n&&i in n&&typeof n[i]==`string`?n[i]:void 0),s=t.headers[`retry-after`],c=o===void 0?void 0:d(o,u),l=`Pending, not a failure: ${e.operationId??`request`}${a===void 0?``:` job ${a}`} is still running, and its result is stored when it finishes.`+(s===void 0?``:` Retry-After: ${s}.`)+(c===void 0?o===void 0?``:` Poll GET ${o} for the result.`:` Read the result in a few minutes ${c}; do not resend the request.`);return{...e,summary:l,warnings:[...e.warnings,l],ids:a===void 0?e.ids:[...new Set([...e.ids,a])],references:o===void 0?e.references:[...new Set([...e.references,o])]}}function S(e){let t=E(e);return O(t),process.stdout.write(`${JSON.stringify(t)}\n`),t}function C(e){let t,n=E(e,{foldRows:!1,humanText:!0,onSpill:e=>{t=h(e)}});O(n);let r=g(u,n.data,n.summary,{heading:n.ok?void 0:`[FAIL] ${n.summary}`,trailer:[...n.ok||n.problem===void 0?[]:l(n.problem),...w(n)],exactRecovery:t}),i=[];if(r!==null)return process.stdout.write(r.endsWith(`
1
+ import{a as e}from"./package-DEeHDoOT.js";import{n as t,r as n}from"./result-envelope-DhuT_8lW.js";import{o as r}from"./logging-DqesyM4A.js";import{a as i,n as a,r as o,t as s}from"./output-spill-Cdl7NULe.js";import{j as c}from"./help-catalog-ByQFO96d.js";import{r as l}from"./response-problem-DaJm66IX.js";import{t as u}from"./openapi-commands-BEyhfc6I.js";import{d,f,m as p,n as m,p as h,t as g}from"./text-response-BvrwYvKW.js";import{resolve as _}from"node:path";import{tmpdir as v}from"node:os";import{randomUUID as y}from"node:crypto";var b=1e4;function x(e,t){let n=t.data,r=`jobId`,i=`statusUrl`,a=t.rolloverJob?.jobId??(typeof n==`object`&&n&&r in n&&typeof n[r]==`string`?n[r]:void 0),o=t.rolloverJob?.statusUrl??t.headers.location??(typeof n==`object`&&n&&i in n&&typeof n[i]==`string`?n[i]:void 0),s=t.headers[`retry-after`],c=o===void 0?void 0:h(o,u),l=`Pending, not a failure: ${e.operationId??`request`}${a===void 0?``:` job ${a}`} is still running, and its result is stored when it finishes.`+(s===void 0?``:` Retry-After: ${s}.`)+(c===void 0?o===void 0?``:` Poll GET ${o} for the result.`:` Read the result in a few minutes ${c}; do not resend the request.`);return{...e,summary:l,warnings:[...e.warnings,l],ids:a===void 0?e.ids:[...new Set([...e.ids,a])],references:o===void 0?e.references:[...new Set([...e.references,o])]}}function S(e){let t=E(e);return O(t),process.stdout.write(`${JSON.stringify(t)}\n`),t}function C(e){let t,n=E(e,{foldRows:!1,humanText:!0,onSpill:e=>{t=d(e)}});O(n);let r=g(u,n.data,n.summary,{heading:n.ok?void 0:`[FAIL] ${n.summary}`,trailer:[...n.ok||n.problem===void 0?[]:l(n.problem),...w(n)],exactRecovery:t}),i=[];if(r!==null)return process.stdout.write(r.endsWith(`
2
2
  `)?r:`${r}\n`),n;let a=n.ok?`OK`:`FAIL`;return i.push(`[${a}] ${n.summary}`),!n.ok&&n.problem!==void 0&&i.push(...l(n.problem)),i.push(...w(n)),process.stdout.write(c(i.join(`
3
- `),{appendNewline:!0})),n}function w(e){let t=[];e.ids.length>0&&t.push(` ids: ${e.ids.join(`, `)}`);for(let[n,r]of Object.entries(e.counts))t.push(` ${n}: ${r}`);for(let n of e.references)t.push(` ref: ${n}`);if(e.truncation!==void 0){let n=e.truncation.omitted.join(`, `);t.push(` truncated: byteLength=${e.truncation.byteLength} maxBytes=${e.truncation.maxBytes} omitted=${n}`,` recovery: ${e.truncation.recovery}`)}for(let n of e.warnings)t.push(` warn: ${n}`);return t}function T(e,t){if(e.mode===`csv`||e.mode===`xlsx`){if(!t.ok){T({mode:`json`},t);return}if(e.mode===`xlsx`&&!(t.data instanceof Uint8Array)){T({mode:`json`},n(`This operation does not offer XLSX; use --csv.`));return}let r=t.data instanceof Uint8Array?t.data:m(o(t.data));a()===void 0?(O(t),process.stdout.write(r)):T({mode:`data`},i({...t,data:r}));return}let r=a(),s=i(t);if(e.mode===`data`||e.mode===`data-full`){let t=e.mode===`data`?E(s,{allowSpill:r===void 0}):s;O(t),process.stdout.write(`${JSON.stringify(t.ok&&t.truncated!==!0?o(t.data):t)}\n`),t.ok||(process.exitCode=1)}else(e.mode===`json`?S(s):C(s)).ok||(process.exitCode=1)}function E(e,n={}){let r=Number(process.env.BASH_MAX_OUTPUT_LENGTH),a=Math.min(Number.isSafeInteger(r)&&r>0?r:1/0,e.ok?1/0:b),o={...f(e,u),...n,...Number.isSafeInteger(a)&&a>0?{maxBytes:Math.min(n.maxBytes??5e4,Math.floor(a/2))}:{}},c=t(e,o),l=!1;if(n.humanText===!0&&e.ok&&g(u,c.data,c.summary,{trailer:w(c),onOmission:()=>{l=!0}}),n.allowSpill===!1||o.write===!0&&n.humanText===!0||!l&&(c===e||c.truncated!==!0))return c;let d=process.env.AVENTURE_HARNESS_RUN_DATA_ROOT,p=_(d?_(d,`scratchpad`):v(),`aventure-output-${y()}.json`);s(p);let m,x=i(e,e=>{m=e});return m===void 0?x:(n.onSpill?.(p),t(e,{...o,exactRecovery:h(p),spill:m}))}function D(e,t){if(typeof t==`object`&&t&&`httpStatus`in t&&t.httpStatus===202)return;let n=p(t);n===null?(process.stderr.write(`explain: the response carried no search interpretation
3
+ `),{appendNewline:!0})),n}function w(e){let t=[];e.ids.length>0&&t.push(` ids: ${e.ids.join(`, `)}`);for(let[n,r]of Object.entries(e.counts))t.push(` ${n}: ${r}`);for(let n of e.references)t.push(` ref: ${n}`);if(e.truncation!==void 0){let n=e.truncation.omitted.join(`, `);t.push(` truncated: byteLength=${e.truncation.byteLength} maxBytes=${e.truncation.maxBytes} omitted=${n}`,` recovery: ${e.truncation.recovery}`)}for(let n of e.warnings)t.push(` warn: ${n}`);return t}function T(e,t){if(e.mode===`csv`||e.mode===`xlsx`){if(!t.ok){T({mode:`json`},t);return}if(e.mode===`xlsx`&&!(t.data instanceof Uint8Array)){T({mode:`json`},n(`This operation does not offer XLSX; use --csv.`));return}let r=t.data instanceof Uint8Array?t.data:p(o(t.data));a()===void 0?(O(t),process.stdout.write(r)):T({mode:`data`},i({...t,data:r}));return}let r=a(),s=i(t);if(e.mode===`data`||e.mode===`data-full`){let t=e.mode===`data`?E(s,{allowSpill:r===void 0}):s;O(t),process.stdout.write(`${JSON.stringify(t.ok&&t.truncated!==!0?o(t.data):t)}\n`),t.ok||(process.exitCode=1)}else(e.mode===`json`?S(s):C(s)).ok||(process.exitCode=1)}function E(e,n={}){let r=Number(process.env.BASH_MAX_OUTPUT_LENGTH),a=Math.min(Number.isSafeInteger(r)&&r>0?r:1/0,e.ok?1/0:b),o={...f(e,u),...n,...Number.isSafeInteger(a)&&a>0?{maxBytes:Math.min(n.maxBytes??5e4,Math.floor(a/2))}:{}},c=t(e,o),l=!1;if(n.humanText===!0&&e.ok&&g(u,c.data,c.summary,{trailer:w(c),onOmission:()=>{l=!0}}),n.allowSpill===!1||o.write===!0&&n.humanText===!0||!l&&(c===e||c.truncated!==!0))return c;let p=process.env.AVENTURE_HARNESS_RUN_DATA_ROOT,m=_(p?_(p,`scratchpad`):v(),`aventure-output-${y()}.json`);s(m);let h,x=i(e,e=>{h=e});return h===void 0?x:(n.onSpill?.(m),t(e,{...o,exactRecovery:d(m),spill:h}))}function D(e,t){if(typeof t==`object`&&t&&`httpStatus`in t&&t.httpStatus===202)return;let n=m(t);n===null?(process.stderr.write(`explain: the response carried no search interpretation
4
4
  `),process.exitCode=1):(e===`text`?process.stdout:process.stderr).write(n)}function O(t){if(t.ok&&t.warnings.length===0)return;let n=t.truncation===void 0?t.warnings:[...t.warnings,`omitted: ${t.truncation.omitted.join(`, `)}`,`recovery: ${t.truncation.recovery}`];r({component:e().bin[0],event:t.ok?`command_warning`:`command_failed`,message:n.length>0?n.join(` | `):t.summary,fields:{warningCount:t.warnings.length,summary:t.summary}})}export{D as a,S as i,T as n,x as o,C as r,b as t};
@@ -1,4 +1,4 @@
1
- import{u as e}from"./tool-policy-DYjF2wFZ.js";import{g as t,h as n}from"./help-catalog-ByQFO96d.js";import{c as r,s as i}from"./startup-auth-DGDPMIp_.js";import{t as a}from"./openapi-commands-Cyvu5wdW.js";import{r as o}from"./operations-metadata-DnrouEku.js";import{n as s}from"./operations-catalog-CcBIdLCW.js";import{a as c,t as l}from"./payload-operand-guard-C8eAl3-g.js";function u(e,t){return e.message.match(RegExp(`${t} '([^']+)'`,`iu`))?.[1]?.split(/\s+/u)[0]}function d(e){return e.flags.split(` `)[0]??e.flags}function f(e,t){let n=u(t,`required option`),r=e.options.findIndex(e=>d(e)===n);if(r<0)return;let i=new Set((M(c(e))?.parameters??[]).flatMap(e=>e.location===`path`?[e.optionKey]:[])),a=e.options.slice(r+1).find(t=>{let n=e.getOptionValue(t.attributeName());return i.has(t.attributeName())&&typeof n==`string`&&n!==``});if(a!==void 0)return`hint: ${n} is still required for this nested command; supplied child selector ${d(a)} does not replace the parent selector.`}var p=[[`--search`,`--query`,`--q`,`--term`,`--keyword`],[`--size`,`--limit`,`--page-size`,`--per-page`],[`--transaction-id`,`--fundraise-round-id`]];function m(e){let t=new Set(e.options.map(d)),n=process.argv.indexOf(`--`),r=new Set(n<0?process.argv:process.argv.slice(0,n));return e.args.filter(e=>r.has(e)&&/^--[^-=]/u.test(e)).map(e=>e.split(`=`)[0]??e).filter(e=>!t.has(e))}function h(e){let t=M(c(e))?.parameters??[],n=m(e).flatMap(n=>{let r=p.find(e=>e.includes(n))?.find(t=>e.options.some(e=>d(e)===t))??t.filter(({name:e})=>`--${e.replace(/[A-Z]/gu,`-$&`).toLowerCase()}`===n).map(e=>e.flag.split(` `)[0])[0];return r===void 0?[]:[`use ${r}, not ${n}`]});return n.length===0?void 0:`hint: ${n.join(`; `)}`}function g(e){return e.commands.length===0?[e]:e.commands.flatMap(g)}function _(e){return e.parent===null?e:_(e.parent)}function v(e,t){let n=t=>{let n=c(t).slice(c(e).length);return n.length*2+ +![`get`,`list`].includes(n.at(-1)??``)};return t.toSorted((e,t)=>n(e)-n(t))[0]}function y(e){return/^[A-Za-z0-9_./:=@+-]+$/u.test(e)?e:`'${e.replaceAll(`'`,`'"'"'`)}'`}function b(e,t){let n=[...e.options,...e.createHelp().visibleOptions(e)];for(let t=e.parent;t!==null;t=t.parent)n.push(...t.options);let r=t,i;for(let e=0;e<t.length;e++){let a=t[e];if(a===void 0||a===`--`)break;if(!a.startsWith(`-`)||a===`-`||i?.variadic&&Number.isFinite(Number(a)))continue;let o=a.indexOf(`=`),s=o<0?a:a.slice(0,o);if(i=n.find(e=>e.short===s||e.long===s),i===void 0||o>=0&&!i.required&&!i.optional){r=[`--help`];break}o<0&&(i.required||i.optional&&!t[e+1]?.startsWith(`-`))&&e++}return[_(e).name(),...c(e),...r].map(y).join(` `)}function x(e,t){let n=u(t,`unknown option`);if(n===void 0||e.commands.length===0)return;let r=v(e,g(e).filter(e=>e.options.some(e=>d(e)===n)));return r===void 0?void 0:`hint: run: ${b(r,process.argv.slice(2+c(e).length))}`}function S(e){return e!==void 0&&Object.hasOwn(r,e)}function C(e,t){return t.reduce((e,t)=>e?.commands.find(e=>e.name()===t),e)}function w(e,t){let n=c(e),r=[...n.slice(1),t];if(!S(n.at(0))||!S(r.at(0)))return;let i=C(_(e),r);if(i===void 0)return;let a=i;for(let e of process.argv.slice(2+n.length+1)){if(e.startsWith(`-`))break;let t=a.commands.find(t=>t.name()===e);if(t===void 0)break;r.push(e),a=t}return r}function T(e,t){let[n]=c(e);if(n===void 0||!S(n))return;let r=[n,t];return C(_(e),r)?.commands.length===0?r:void 0}function E(e){let[t,...n]=e.args;if(t===void 0)return[];let r=g(_(e)).map(c),i=n.findIndex((e,t)=>{let i=[...n.slice(0,t),e];return!r.some(e=>e.some((t,n)=>t===i[0]&&i.every((t,r)=>e[n+r]===t)))});return[t,...i<0?n:n.slice(0,i)]}function D(e,t,n=[]){let r=c(e),o=i(a).map(e=>e.cliPath).filter(e=>e[0]!==r[0]&&e.length>=t.length&&t.every((n,r)=>e[e.length-t.length+r]===n)),s=o.find(e=>e.length===t.length&&e.every((e,n)=>e===t[n]))??(o.length===1?o[0]:void 0);if(s===void 0)return;let l=C(_(e),s);return l===void 0?void 0:`hint: run: ${b(l,n)}`}function O(e,t,n){if(!A(t))return;let r=C(_(e),t);if(r===void 0)return;let i=e.args.slice(n.length),a=i.findIndex(e=>e.startsWith(`-`));return`hint: Did you mean: ${b(r,a<0?[]:i.slice(a))}`}function k(e){let t=c(e);if(t.at(1)!==void 0&&S(t.at(0)))return`hint: inspect generated command group: ${[_(e).name(),...t,`--help`].map(y).join(` `)}`}function A(t,n){let r=M(t)?.intent;return r!==void 0&&(n===void 0||e(r)===n)}var j=new Map(a.toReversed().map(e=>[e.cliPath.join(` `),e])),M=e=>j.get(e.join(` `));function N(e){let t=c(e).join(` `),r=i(a),o=r.find(e=>e.cliPath.join(` `)===t);return o===void 0?[]:n(o.operationId,r,_(e).name()).map(e=>`hint: ${e}`)}function P(e){let t=c(e);if(S(t.at(0))&&A(t))return`hint: inspect generated command: ${[_(e).name(),...t,`--help`].map(y).join(` `)}`}function F(t){let n=new Set,r=[];for(let i of a){let a=C(t,i.cliPath);if(a===void 0)continue;let o=a.options.map(d);if(e(i.intent))r.push(o);else for(let e of o)n.add(e)}let[i=[],...o]=r;return new Set(i.filter(e=>!n.has(e)&&o.every(t=>t.includes(e))))}function I(e,t){let n=c(e);if(A(n,!1)&&F(_(e)).has(t))return`hint: ${n.join(` `)} is a read operation; ${t} is a deprecated compatibility option only on mutation commands`}function L(e,t,n=!0){let r=_(e),l=r.commands.find(e=>e.name()===`help`),u=l?.commands.find(e=>e.name()===`catalog`);if(l===void 0||u===void 0)return;let f=[r.name(),l.name(),u.name(),t],p=c(e).at(0),m=u.options.find(e=>d(e)===`--root`),h=n&&m!==void 0&&S(p)?p:void 0;m!==void 0&&h!==void 0&&f.push(d(m),h);let g=i(a),v=o({q:t,root:h,limit:`3`},g,r.name()),b=v.ok&&v.data!==null?s(v.data,`compact`):``;return[`hint: search generated commands: ${f.map(y).join(` `)}`,...b===``?[]:[`hint: closest commands (command · summary · required flags):`],...b.split(`
1
+ import{u as e}from"./tool-policy-DYjF2wFZ.js";import{g as t,h as n}from"./help-catalog-ByQFO96d.js";import{c as r,s as i}from"./startup-auth-B0hdVmRP.js";import{t as a}from"./openapi-commands-BEyhfc6I.js";import{r as o}from"./operations-metadata-DnrouEku.js";import{n as s}from"./operations-catalog-fUC6msyN.js";import{a as c,t as l}from"./payload-operand-guard-C8eAl3-g.js";function u(e,t){return e.message.match(RegExp(`${t} '([^']+)'`,`iu`))?.[1]?.split(/\s+/u)[0]}function d(e){return e.flags.split(` `)[0]??e.flags}function f(e,t){let n=u(t,`required option`),r=e.options.findIndex(e=>d(e)===n);if(r<0)return;let i=new Set((M(c(e))?.parameters??[]).flatMap(e=>e.location===`path`?[e.optionKey]:[])),a=e.options.slice(r+1).find(t=>{let n=e.getOptionValue(t.attributeName());return i.has(t.attributeName())&&typeof n==`string`&&n!==``});if(a!==void 0)return`hint: ${n} is still required for this nested command; supplied child selector ${d(a)} does not replace the parent selector.`}var p=[[`--search`,`--query`,`--q`,`--term`,`--keyword`],[`--size`,`--limit`,`--page-size`,`--per-page`],[`--transaction-id`,`--fundraise-round-id`]];function m(e){let t=new Set(e.options.map(d)),n=process.argv.indexOf(`--`),r=new Set(n<0?process.argv:process.argv.slice(0,n));return e.args.filter(e=>r.has(e)&&/^--[^-=]/u.test(e)).map(e=>e.split(`=`)[0]??e).filter(e=>!t.has(e))}function h(e){let t=M(c(e))?.parameters??[],n=m(e).flatMap(n=>{let r=p.find(e=>e.includes(n))?.find(t=>e.options.some(e=>d(e)===t))??t.filter(({name:e})=>`--${e.replace(/[A-Z]/gu,`-$&`).toLowerCase()}`===n).map(e=>e.flag.split(` `)[0])[0];return r===void 0?[]:[`use ${r}, not ${n}`]});return n.length===0?void 0:`hint: ${n.join(`; `)}`}function g(e){return e.commands.length===0?[e]:e.commands.flatMap(g)}function _(e){return e.parent===null?e:_(e.parent)}function v(e,t){let n=t=>{let n=c(t).slice(c(e).length);return n.length*2+ +![`get`,`list`].includes(n.at(-1)??``)};return t.toSorted((e,t)=>n(e)-n(t))[0]}function y(e){return/^[A-Za-z0-9_./:=@+-]+$/u.test(e)?e:`'${e.replaceAll(`'`,`'"'"'`)}'`}function b(e,t){let n=[...e.options,...e.createHelp().visibleOptions(e)];for(let t=e.parent;t!==null;t=t.parent)n.push(...t.options);let r=t,i;for(let e=0;e<t.length;e++){let a=t[e];if(a===void 0||a===`--`)break;if(!a.startsWith(`-`)||a===`-`||i?.variadic&&Number.isFinite(Number(a)))continue;let o=a.indexOf(`=`),s=o<0?a:a.slice(0,o);if(i=n.find(e=>e.short===s||e.long===s),i===void 0||o>=0&&!i.required&&!i.optional){r=[`--help`];break}o<0&&(i.required||i.optional&&!t[e+1]?.startsWith(`-`))&&e++}return[_(e).name(),...c(e),...r].map(y).join(` `)}function x(e,t){let n=u(t,`unknown option`);if(n===void 0||e.commands.length===0)return;let r=v(e,g(e).filter(e=>e.options.some(e=>d(e)===n)));return r===void 0?void 0:`hint: run: ${b(r,process.argv.slice(2+c(e).length))}`}function S(e){return e!==void 0&&Object.hasOwn(r,e)}function C(e,t){return t.reduce((e,t)=>e?.commands.find(e=>e.name()===t),e)}function w(e,t){let n=c(e),r=[...n.slice(1),t];if(!S(n.at(0))||!S(r.at(0)))return;let i=C(_(e),r);if(i===void 0)return;let a=i;for(let e of process.argv.slice(2+n.length+1)){if(e.startsWith(`-`))break;let t=a.commands.find(t=>t.name()===e);if(t===void 0)break;r.push(e),a=t}return r}function T(e,t){let[n]=c(e);if(n===void 0||!S(n))return;let r=[n,t];return C(_(e),r)?.commands.length===0?r:void 0}function E(e){let[t,...n]=e.args;if(t===void 0)return[];let r=g(_(e)).map(c),i=n.findIndex((e,t)=>{let i=[...n.slice(0,t),e];return!r.some(e=>e.some((t,n)=>t===i[0]&&i.every((t,r)=>e[n+r]===t)))});return[t,...i<0?n:n.slice(0,i)]}function D(e,t,n=[]){let r=c(e),o=i(a).map(e=>e.cliPath).filter(e=>e[0]!==r[0]&&e.length>=t.length&&t.every((n,r)=>e[e.length-t.length+r]===n)),s=o.find(e=>e.length===t.length&&e.every((e,n)=>e===t[n]))??(o.length===1?o[0]:void 0);if(s===void 0)return;let l=C(_(e),s);return l===void 0?void 0:`hint: run: ${b(l,n)}`}function O(e,t,n){if(!A(t))return;let r=C(_(e),t);if(r===void 0)return;let i=e.args.slice(n.length),a=i.findIndex(e=>e.startsWith(`-`));return`hint: Did you mean: ${b(r,a<0?[]:i.slice(a))}`}function k(e){let t=c(e);if(t.at(1)!==void 0&&S(t.at(0)))return`hint: inspect generated command group: ${[_(e).name(),...t,`--help`].map(y).join(` `)}`}function A(t,n){let r=M(t)?.intent;return r!==void 0&&(n===void 0||e(r)===n)}var j=new Map(a.toReversed().map(e=>[e.cliPath.join(` `),e])),M=e=>j.get(e.join(` `));function N(e){let t=c(e).join(` `),r=i(a),o=r.find(e=>e.cliPath.join(` `)===t);return o===void 0?[]:n(o.operationId,r,_(e).name()).map(e=>`hint: ${e}`)}function P(e){let t=c(e);if(S(t.at(0))&&A(t))return`hint: inspect generated command: ${[_(e).name(),...t,`--help`].map(y).join(` `)}`}function F(t){let n=new Set,r=[];for(let i of a){let a=C(t,i.cliPath);if(a===void 0)continue;let o=a.options.map(d);if(e(i.intent))r.push(o);else for(let e of o)n.add(e)}let[i=[],...o]=r;return new Set(i.filter(e=>!n.has(e)&&o.every(t=>t.includes(e))))}function I(e,t){let n=c(e);if(A(n,!1)&&F(_(e)).has(t))return`hint: ${n.join(` `)} is a read operation; ${t} is a deprecated compatibility option only on mutation commands`}function L(e,t,n=!0){let r=_(e),l=r.commands.find(e=>e.name()===`help`),u=l?.commands.find(e=>e.name()===`catalog`);if(l===void 0||u===void 0)return;let f=[r.name(),l.name(),u.name(),t],p=c(e).at(0),m=u.options.find(e=>d(e)===`--root`),h=n&&m!==void 0&&S(p)?p:void 0;m!==void 0&&h!==void 0&&f.push(d(m),h);let g=i(a),v=o({q:t,root:h,limit:`3`},g,r.name()),b=v.ok&&v.data!==null?s(v.data,`compact`):``;return[`hint: search generated commands: ${f.map(y).join(` `)}`,...b===``?[]:[`hint: closest commands (command · summary · required flags):`],...b.split(`
2
2
  `).filter(Boolean).map(e=>` ${e}`)].join(`
3
3
  `)}function R(e,n=``){if(e.commands.length>0&&!A(c(e)))return;let r=e.options.flatMap(e=>e.hidden?[]:[d(e)]),o=i(a),s=t(n,o,c(e),_(e).name());return`${s===void 0?``:`hint: an id you already hold is read with: ${s}\n`}hint: ${c(e).join(` `)} accepts: ${r.join(` `)}`}function z(e,t){let n=u(t,`unknown command`);if(n===void 0||t.message.includes(`
4
4
  (Did you mean `))return;let r=E(e),i=process.argv.slice(2+c(e).length);if(r.length>0&&r.every((e,t)=>i[t]===e)){let t=D(e,r);if(t!==void 0)return t}let a=c(e),o=[...a.slice(0,-1),`${a.at(-1)}-${n}`,...r.slice(1)],s=(A(o)?o:void 0)??w(e,n)??T(e,n);if(s!==void 0)return O(e,s,r)??L(e,s.join(` `),!1);let l=r.join(` `)||n,d=k(e)??L(e,l),f=[...a,...r.slice(1)];return[d,r.length===a.length+a.length&&a.at(-1)===a.at(0)?O(e,f,r)?.replace(/^hint: Did you mean: /u,` `).concat(` · `):f.slice(1,-1).length>0?O(e,f,r):void 0].filter(e=>e!==void 0).join(`
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./package-DEeHDoOT.js";import{S as t,_ as n,s as r}from"./iso-DzqMxtky.js";import{r as i}from"./result-envelope-DhuT_8lW.js";import{i as a,n as o}from"./openapi-call-CUs1Yi5y.js";import{t as s}from"./openapi-commands-BEyhfc6I.js";import{a as c,c as l,i as u,l as d,o as f,r as p,s as m,u as h}from"./text-response-BvrwYvKW.js";import{n as g}from"./output-BL3uMwJp.js";import{n as _}from"./generated-body-BaGjgMKp.js";import{createInterface as v}from"node:readline/promises";var y=n({filterKey:t(),result:r(t())}),b=h.enum.size,x=`searchEntityFilters`,S=/^\s*(?<min>\d+)\s*[-–]\s*(?<max>\d+)\s*$/u,C=/^\s*\d+(?:[\s,]+\d+)*\s*$/u;async function w(e,t,n,r,i){await T({spec:e,opts:t,mode:n,payload:r,run:i,emit:e=>g({mode:n},e)})}async function T({spec:e,opts:t,mode:n,payload:r,run:i,emit:a,input:o=process.stdin,output:s=process.stdout,argv:c=process.argv.slice(2)}){if(n!==`text`||o.isTTY!==!0||s.isTTY!==!0||(N(r)?.narrowing?.question.length??0)===0)return;let l=v({input:o,output:s,terminal:!1}),u=new Promise(e=>l.once(`close`,()=>e(null))),d=e=>Promise.race([l.question(e).catch(()=>null),u]);try{await E({spec:e,opts:t,payload:r,run:i,emit:a,output:s,argv:c,ask:d})}finally{l.close()}}async function E(t){let{spec:n,output:r}=t,i=N(t.payload),a=i?.narrowing?.question[0];if(i===null||a===void 0)return;r.write(O(a));let o=await k(n,t.opts,i,a,t.ask,r);if(o===null)return;let s=D(n,t.opts,o),c=[...t.argv,...f(o)];r.write(`\n$ ${l([e().bin[0]??``,...c])}\n`);let u=await t.run(s);t.emit(u),u.ok&&await E({...t,opts:s,argv:c,payload:u.data})}function D(e,t,n){return{...t,...Object.fromEntries(u(e,n.field).map(({optionKey:e})=>[e,void 0])),...Object.fromEntries(n.option.map(({parameter:e,value:t})=>[e.optionKey,t]))}}function O({prompt:e,option:t}){let n=Math.max(...t.map(e=>m(e).length)),r=Math.max(...t.map(({count:e})=>String(e).length)),i=String(t.length).length;return[``,`${e}?`,...t.map((e,t)=>` ${String(t+1).padStart(i)} ${m(e).padEnd(n)} ${String(e.count).padStart(r)}`),``].join(`
2
+ `)}async function k(e,t,n,r,a,o){let s=(await a(`› `))?.trim()??``;if(s===``)return null;let l=C.test(s)?A(r,s):await M(e,t,n,r,s),u=typeof l==`string`?i(l):c(e,l);return u.ok&&u.data!==null?u.data:(o.write(`${u.summary}\n`),k(e,t,n,r,a,o))}function A(e,t){let n=t.split(/[\s,]+/u).map(Number);return n.filter(t=>t<1||t>e.option.length).length>0?`Pick 1 to ${e.option.length}, or type an answer.`:n.flatMap(t=>e.option[t-1]?.entityFilter??[])}function j({option:e}){return[...new Set(e.flatMap(({entityFilter:e})=>Object.keys(e)))]}async function M(e,t,n,r,i){let c=j(r),[l]=c;if(r.dimension===b&&l!==void 0){let e=S.exec(i)?.groups;return e?.min===void 0||e.max===void 0?`Type an employee range such as 10-50, or pick a number.`:[{[l]:[{min:Number(e.min),max:Number(e.max)}]}]}let u=s.find(({operationId:e})=>e===x);if(u===void 0||c.length===0)return`Pick one of the numbers.`;let d=await _(e,t),f=d.ok&&P(d.data)&&P(d.data.entityFilter)?d.data[p]:{},m=n.entity.interpretation.filter.typeRecord,h={...m===void 0?{}:{typeRecord:m},...f},g=await Promise.all(c.map(async e=>{let t={filterKey:e,query:i,scopeFilter:h},n=await a({method:u.method,path:o(u.operationId,{}),body:t,auth:u.auth,responseFormat:`json`}),r=y.safeParse(n.ok&&P(n.data)?n.data.response:void 0);return r.success?r.data.result.map(t=>({field:e,value:t})):`Could not look up “${i}”: ${n.summary}`})),v=g.find(e=>typeof e==`string`);if(v!==void 0)return v;let C=g.flatMap(e=>typeof e==`string`?[]:e),w=C.find(({value:e})=>e.toLowerCase()===i.toLowerCase())??(C.length===1?C[0]:void 0);return w===void 0?C.length===0?`Nothing matches “${i}”; pick a number or try another spelling.`:`Did you mean ${[...new Set(C.map(({value:e})=>e))].slice(0,8).join(`, `)}?`:[{[w.field]:[w.value]}]}function N(e){if(typeof e!=`object`||!e||!(`response`in e))return null;let t=d.safeParse(e.response);return t.success?t.data:null}function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{w as promptAfterResult};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./commander-DEj7N1b9.js";import{l as r,p as i,t as a}from"./env-CMJ0DtbB.js";import{y as o}from"./tool-policy-DYjF2wFZ.js";import{n as s}from"./cli-help-policy-BCuXaWdv.js";import{t as c}from"./generated-dispatch-C79846kK.js";var l={addresses:{summary:`List Address Links`,section:`administration`},"addresses links":{summary:`Returns every entity and person linked to this physical address, past and present, with each link's id, the linked record's id, and its role when one is recorded`},agent:{summary:`List Suggested Agent Questions`,section:`cli`,listed:!1},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`},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 Reuse 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 complimentary-continuation":{summary:`Undo Keeping the Complimentary Plan on Paid Billing`},"billing subscription next-charge":{summary:`Preview the Next Subscription Charge`},"billing subscription payment-profile":{summary:`Read Your Card on File and Introductory Offer`},content:{summary:`Publications about one company or person, and platform-wide publication search`,section:`researchData`},"content facets":{summary:`Count One Owner's Publications`},directory:{summary:`Views of the public directories: publish, list, and read shared views by slug, and export a view's rows as JSON, CSV, or XLSX`,section:`researchData`},"directory exports":{summary:`Export Directory Records`},"directory shared":{summary:`List Shared Directory Views`},"directory shared slug":{summary:`Read a Shared Directory View by Slug`},enrichments:{summary:`Enrich Companies, People, or a News Article's Mentions`,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 analysis-replay":{summary:`Get an Example Published Analysis Section`},"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:`List a Company's Classifications`},"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 contact-details":{summary:`List a Company's Contact Details`},"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 headcount-estimate":{summary:`Get an Entity's Headcount Estimate`},"entities investments":{summary:`List the Investments a Company Made`},"entities investor-activity":{summary:`Get Investor Portfolio Counts, Sectors and Recipients`},"entities investors":{summary:`List a Company's Investors`},"entities investors people":{summary:`List Person 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 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 revenue-estimate":{summary:`Get an Entity's Revenue Estimate`},"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 an SEC Registrant`},"entities similar":{summary:`Similar companies, as full records or short 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:`Identify a Company, Product, Service, or Person by Name, URL, or ID`,section:`researchData`},"lookup jobs":{summary:`Get a Lookup Job's State and the Records Its Article Names`},metrics:{summary:`Get Platform Totals for Companies, Funding, and People`,section:`cli`,listed:!1},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 contact-details":{summary:`List a Person's Contact Details`},"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 unique-ids":{summary:`External identifiers and the records they name`},"people urls":{summary:`Websites, social profiles, and other URLs for companies and people`},research:{summary:`Research requests and their progress`,section:`researchData`},"research runs":{summary:`List Your Research Runs`},"research runs draft":{summary:`Get a Research Run Draft`},"research runs draft sections":{summary:`Edit a Research Draft Section`},"research runs draft sections writes":{summary:`Get a Research Draft Section Write`},"research runs draft sources":{summary:`Get a Research Draft's Sources`},"research runs events":{summary:`Read a Research Run's Events`},"research runs presets":{summary:`List Research Presets`},"research runs turns":{summary:`Continue a Research Session`},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 companies, people, and news, or by URL`,section:`researchData`},"web searches":{summary:`Get an Async Web Search Job`},"web searches jobs":{summary:`Reads the web-search job a search accepted with a 202`}};function u(e){return p(e,d())}function d(){return!!i().userBearerToken?.trim()}function f(e){return d()||!s(e,l)}function p(e,t){return t?e:e.filter(e=>!s(e.cliPath[0],l)||e.visibility!==`private`).map(m)}function m(e){let t=e.parameters.filter(h),n=e.requestBody?.map(e=>{let t=e.parameter.filter(h);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 h=e=>e.visibility!==`private`;async function g(e){if(e===`none`||process.env[a.authToken]?.trim())return;let{materializeCliOAuthBearerCredential:t,materializeSavedCliOAuthBearerCredential:n}=await import(`./oauth-bearer-credential-DAnAGKPx.js`),{materializeCliApiKeyBearerCredential:r}=await import(`./api-key-bearer-credential-RIs8brrF.js`);await(e===`stored`?n():t()),await r()}function _(t){let r=t.findIndex(e=>e===`--version`||e===`-V`);if(r===-1)return!1;let i=new n().passThroughOptions().addOption(new e(`--environment <environment>`)).addOption(new e(`-h, --help`)).addOption(new e(`-V, --version`));return i.parseOptions(t.slice(0,r+1)),i.opts().version===!0}function v(t,i){let a=t.indexOf(`--`),o=t.slice(0,a===-1?t.length:a),s=new n().exitOverride().configureOutput({writeErr:()=>void 0}).addOption(new e(`--environment <environment>`)).parseOptions([...o]).operands,c=i.filter(e=>b(s,e.cliPath)).toSorted((e,t)=>t.cliPath.length-e.cliPath.length)[0],l=c!==void 0&&[...c.parameters,...c.requestBody?.flatMap(({parameter:e})=>e)??[]].some(e=>e.optionKey===`environment`),u=new n().exitOverride().configureOutput({writeErr:()=>void 0}).passThroughOptions(l).addOption(new e(`--environment <environment>`).choices([...r()])),{operands:d,unknown:f}=u.parseOptions([...o]);return{environment:u.opts().environment,commandArgv:[...d,...f,...a===-1?[]:t.slice(a)],positionalOptions:l}}function y(r,i){let a=r.indexOf(`--`),u=r.slice(0,a===-1?r.length:a);if(_(r))return`none`;let d=v(r,i),f=new n().exitOverride().configureOutput({writeErr:()=>void 0}).addOption(new e(`--content-type <media-type>`)),p=f.parseOptions([...d.commandArgv]).operands;d.environment!==void 0&&(process.env.API_ENV=d.environment);let m=i.find(e=>b(p,e.cliPath)),h=m===void 0?void 0:c(m,f.opts());if(m!==void 0&&h!==void 0){let e=o(m.requestBody??[],h);if(!e.ok)throw new t(e.summary)}let g=p.at(0);return g===void 0?`stored`:g===`update`||g===`auth`&&m===void 0?`none`:u.some(e=>e===`--help`||e===`-h`)?(m??(g===`help`?i.find(e=>b(p.slice(1),e.cliPath)):void 0))!==void 0||s(g,l)?`stored`:`none`:s(g,l)?`required`:g===`help`&&p[1]===`catalog`?`optional`:g===`help`?m===void 0?`stored`:`required`:g===`agents`&&p[1]===`setup`?`required`:[`command-catalog`,`completion`].includes(g)?`optional`:g===`batch`?`required`:m===void 0?`optional`:`required`}function b(e,t){return t.every((t,n)=>e[n]===t)}export{_ as a,l as c,v as i,y as n,p as o,g as r,u as s,f as t};
@@ -1 +1 @@
1
- export{n as commandAuthMaterializationMode,r as materializeCommandCredential}from"./startup-auth-DGDPMIp_.js";
1
+ export{n as commandAuthMaterializationMode,r as materializeCommandCredential}from"./startup-auth-B0hdVmRP.js";
@@ -0,0 +1,17 @@
1
+ import{A as e,C as t,E as n,S as r,_ as i,c as a,d as o,g as s,i as c,n as l,s as u,x as d}from"./iso-DzqMxtky.js";import{a as f,c as p,d as m,f as h,i as g,l as _,n as ee,o as v,p as y,r as te,s as ne,t as re,u as ie}from"./detail-BdF_5EBq.js";import{t as ae}from"./person-owner-BW4xz8uH.js";import{r as oe}from"./run-CSLAPf8G.js";import{n as b}from"./allowance-type-BVr12WiL.js";import{t as se}from"./confidence-CjeYTBnf.js";import{c as x,p as ce,r as S}from"./result-envelope-DhuT_8lW.js";import{a as le,s as ue}from"./tool-policy-DYjF2wFZ.js";import{i as de}from"./output-spill-Cdl7NULe.js";import{a as C,c as fe,i as pe,l as me,n as w,r as T,s as E,t as he}from"./text-field-jFKOGMzr.js";import{A as ge,F as D,M as _e,N as ve,P as ye,a as be,j as xe}from"./help-catalog-ByQFO96d.js";import{n as Se,r as Ce,t as we}from"./agent-help-text-ColO_FNC.js";import{existsSync as Te}from"node:fs";import{Buffer as Ee}from"node:buffer";function De(e){if(typeof e==`object`&&e&&!Array.isArray(e)&&Array.isArray(e.column)&&e.column.every(e=>typeof e==`string`)&&Array.isArray(e.row)&&e.row.every(e=>Array.isArray(e))){let t=e.column;return{column:t,record:e.row.map(e=>new Map(t.map((t,n)=>[t,O(e[n]??null)])))}}let t=Array.isArray(e)?e:typeof e==`object`&&e&&Array.isArray(e.content)?e.content:typeof e==`object`&&e&&Array.isArray(e.row)?e.row:[e],n=new Set,r=t.map(e=>{let t=new Map,r=(e,n)=>{if(Array.isArray(e))t.set(n,e.some(e=>typeof e==`object`&&!!e)?JSON.stringify(e):e.map(O).join(`; `));else if(typeof e==`object`&&e)for(let[t,i]of Object.entries(e))i!==void 0&&r(i,n===``?t:`${n}.${t}`);else t.set(n||`value`,e===null?``:String(e))};r(e,``);for(let e of t.keys())n.add(e);return t});return{column:[...n],record:r}}function O(e){return e===null?``:typeof e==`string`?e:JSON.stringify(e)}function k(e){return e.map(e=>{let t=/^[=+\-@\t\r]/u.test(e)?`'${e}`:e;return/[",\r\n]/u.test(t)?`"${t.replaceAll(`"`,`""`)}"`:t}).join(`,`)+`\r
2
+ `}function Oe(e){let{column:t,record:n}=De(e);return t.length===0?``:k(t)+n.map(e=>k(t.map(t=>e.get(t)??``))).join(``)}function ke(t){let n=ce.safeParse(JSON.parse(JSON.stringify(t??null)));if(!n.success)throw Error(`Response is not JSON, so it cannot be written as CSV: ${e(n.error)}`);return Oe(n.data)}var A=/\{([^}]+)\}/gu,Ae=/(?:^r|R)evision$/u;function je(e,t,n=`cli`){let r=t.filter(e=>e.method===`GET`&&(n===`cli`||e.binaryResponse!==!0)),i=t=>e.endpoint!==void 0&&t.endsWith(e.endpoint),a=t.find(t=>t.operationId===e.operationId),o=e.ok&&a!==void 0&&le(a.intent),s=[...o&&e.endpoint!==void 0?M(e.endpoint.split(`?`)[0]??``,r,!1,n,Pe(e.data)).map(e=>n===`mcp`?e:`${e} --data --to-file <path>`):[],...e.references.filter(e=>!i(e)).flatMap(j).flatMap(e=>M(e.pathname,r,!0,n)),...e.references.filter(i).flatMap(j).flatMap(e=>Ie(e,r,n))],c=n===`mcp`?Me:void 0,l=n===`cli`;return s.length===0?{write:o,narrowerRead:c,savesCappedPayload:l}:{exactRecovery:`Read the full result ${s.join(`; `)}.`,write:o,narrowerRead:c,savesCappedPayload:l}}var Me=`Refetch a narrower result: call aventure_help with q set to the read intent, then call aventure_read with its operationId and declared query or pathParams, using ids/references, filters, or smaller query.page/query.size windows.`;function Ne(e){let t=de(e);return`Inline output is truncated; full payload written to ${e}; read it with your file tool.`+(Te(t)?` For its long text fields, Grep ${t} or Read it with offset and limit: it holds them as short lines labeled with each field's JSON pointer and character range.`:``)}function Pe(e){let t=typeof e==`object`&&e&&`response`in e?e.response:null;return typeof t==`object`&&t?new Map(Object.entries(t).flatMap(([e,t])=>Number.isInteger(t)&&Ae.test(e)?[[e,String(t)]]:[])):new Map}function Fe(e,t){let n=t.filter(e=>e.method===`GET`);return M(new URL(e,`https://status.invalid`).pathname,n,!0,`cli`)[0]}function j(e){return URL.canParse(e)?[new URL(e)]:[]}function M(e,t,n,r,i=new Map){let a=t.filter(t=>t.path===e);return(a.length>0?a:t).flatMap(t=>{let a=[...t.path.matchAll(A)].map(([,e])=>e),o=RegExp(`^${t.path.replace(A,`([^/]+)`)}$`,`u`),s=n&&a.length===0?null:o.exec(e);if(s===null)return[];let c=t.parameters.flatMap(e=>{let t=e.location===`query`?i.get(e.name):void 0;return t===void 0?[]:[{parameter:e,pin:t}]});if(r===`mcp`)return[Le(t,{pathParams:Object.fromEntries(a.map((e,t)=>[e??``,decodeURIComponent(s[t+1]??``)])),...c.length===0?{}:{query:Object.fromEntries(c.map(({parameter:e,pin:t})=>[e.name,t]))}})];let l=a.flatMap((e,n)=>{let r=t.parameters.find(t=>t.name===e);return r===void 0?[]:[N(r),s[n+1]??``]}),u=c.flatMap(({parameter:e,pin:t})=>[N(e),t]);return[`${Re(t)}, ${ze(t,[...l,...u])}`]})}function Ie(e,t,n){let r=t.find(t=>t.path===e.pathname);return r===void 0?[]:t.flatMap(t=>{if(!t.path.startsWith(`${r.path}/`))return[];let i=t.parameters.find(({name:e})=>e.endsWith(`Offset`)),a=t.parameters.find(({name:e})=>e.endsWith(`Limit`));if(i===void 0||a===void 0)return[];if(n===`mcp`)return[`in windows: ${Le(t,{query:{...Object.fromEntries([...e.searchParams].filter(([e])=>t.parameters.some(t=>t.location===`query`&&t.name===e))),[i.name]:`<offset>`,[a.name]:`<limit>`}})}, advancing query.${i.name} until a window returns fewer than query.${a.name} units`];let o=t.parameters.flatMap(t=>{let n=e.searchParams.get(t.name);return t.location!==`query`||n===null?[]:[N(t),Be(n)]}),s=[N(i),`<n>`,N(a),`<n>`];return[`${Re(t)}, in windows: ${ze(t,[...o,...s])}, advancing ${N(i)} until a window returns fewer than ${N(a)} units`]})}function Le(e,t){return`${ue(e)} ${JSON.stringify({operationId:e.operationId,...t})}`}function Re(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function ze(e,t){return[we,...e.cliPath,...t].join(` `)}function N(e){return e.flag.split(/\s+/u)[0]??e.flag}function Be(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}var Ve=i({detail:r(),field:r().nullish(),scope:c([`entity`,`person`,`news`])}),He=c([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),Ue=Object.assign(t([He,r()]),{enum:He.enum}),P=i({modeRequested:Ue,modeUsed:Ue}),We=i({answerUnavailable:a(),entity:P,incompleteScope:u(c([`entity`,`person`,`news`])).optional(),narrowingUnavailable:a().optional(),news:P,person:P,rejection:u(Ve),unavailable:u(c([`entity`,`person`,`news`]))}),Ge=c([`person`,`company`,`productService`,`investor`,`operatingCompany`,`otherOrganization`,`investmentFirm`,`fund`]),Ke=Object.assign(t([Ge,r()]),{enum:Ge.enum}),qe=i({enrichmentRunId:n().nullish(),entityId:n()}),Je=i({batch:r().min(1),program:r().regex(/.*\S.*/).nullish()}),Ye=i({acceleratorEntityId:n(),detail:Je}),Xe=c([`numeric`,`overlap`,`containment`]),Ze=Object.assign(t([Xe,r()]),{enum:Xe.enum}),Qe=i({matchMode:Ze.nullish(),max:o().nullish(),min:o().nullish()}),F=i({sortPriority:c([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),$e=i({max:l({offset:!0}).nullish(),min:l({offset:!0}).nullish()}),I=i({max:s().nullish(),min:s().nullish()}),L=i({max:o().nullish(),min:o().nullish()}),et=i({averageAmountInvestedUsdRange:u(I).optional(),largestAmountInvestedUsdRange:u(I).optional(),smallestAmountInvestedUsdRange:u(I).optional(),totalAmountInvestedUsdRange:u(I).optional(),totalInvestmentRange:u(L).optional()}),tt=c([`any`,`every`]),nt=i({amountInvestedRange:u(I).optional(),amountRaisedRange:u(I).optional(),dateAnnouncedRange:$e.nullish(),dateFundingCompleteRange:$e.nullish(),investedAmountRaisedRange:u(I).optional(),investedCompanyName:u(r()).optional(),investedCountry:u(r()).optional(),investedIndustry:u(r()).optional(),investedRound:u(r()).optional(),investorActivity:et.optional(),investorEntityId:u(n()).optional(),investorFamilyEntityId:u(n()).optional(),investorName:u(r()).optional(),investorNameMatch:tt.nullish(),lastRoundYearRange:u(L).optional(),rankByInvestmentActivity:a().nullish(),round:u(r()).optional(),totalRaisedRange:u(I).optional(),valuationRange:u(I).optional()}),rt=c([`NONE`,`COMPANY_LISTING_READY`]),it=c([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),at=i({identifier:r().max(255).nullish(),idType:r()}),ot=i({category:r(),code:o().nullish(),codeText:r().max(255).nullish(),edition:r().max(128).nullish(),hasEdition:a().nullish()}),st=c([`hostPath`,`domain`]),ct=d({acceleratorBrand:u(r()).optional(),acceleratorCohort:u(r()).optional(),acceleratorName:u(r()).optional(),acceleratorParticipation:u(Ye).optional(),acceleratorStatus:u(r()).optional(),affinity:u(r()).optional(),closedLast:a().optional(),employeeCountRange:u(Qe).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:nt.optional(),hasFundraising:a().nullish(),headquartersCity:u(r()).optional(),headquartersCountry:u(r()).optional(),headquartersState:u(r()).optional(),industry:u(r()).optional(),investorPopulation:a().nullish(),letter:r().nullish(),location:u(r()).optional(),logoOption:F.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(it).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:rt.optional(),rankByProminence:a().nullish(),semanticQuery:r().nullish(),slug:u(r().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:u(r()).optional(),standardizedClassification:u(ot).max(20).optional(),suppressLateStage:a().nullish(),suppressNonOperating:a().nullish(),suppressZeroTotalRaised:a().nullish(),tag:u(r()).optional(),textSearch:r().nullish(),typeCustomer:u(r()).optional(),typeInvestor:u(r()).optional(),typeModel:u(r()).optional(),typeOwnership:u(r()).optional(),typeRecord:u(b).optional(),typeRegulatory:u(r()).optional(),typeRevenue:u(r()).optional(),typeTechnologyUsed:u(r()).optional(),uniqueId:u(at).max(20).optional(),url:r().nullish(),urlDomain:r().nullish(),urlMatchMode:st.nullish(),urlType:y.nullish(),yearFoundedRange:u(L).optional()}),R=d({acceleratorBrand:u(r()).optional(),acceleratorCohort:u(r()).optional(),acceleratorName:u(r()).optional(),acceleratorParticipation:u(Ye).optional(),acceleratorStatus:u(r()).optional(),affinity:u(r()).optional(),closedLast:a().optional(),employeeCountRange:u(Qe).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:nt.optional(),hasFundraising:a().nullish(),headquartersCity:u(r()).optional(),headquartersCountry:u(r()).optional(),headquartersState:u(r()).optional(),industry:u(r()).optional(),investorPopulation:a().nullish(),letter:r().nullish(),location:u(r()).optional(),logoOption:F.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(it).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:rt.optional(),rankByProminence:a().nullish(),slug:u(r().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:u(r()).optional(),standardizedClassification:u(ot).max(20).optional(),suppressLateStage:a().nullish(),suppressNonOperating:a().nullish(),suppressZeroTotalRaised:a().nullish(),tag:u(r()).optional(),textSearch:r().nullish(),typeCustomer:u(r()).optional(),typeInvestor:u(r()).optional(),typeModel:u(r()).optional(),typeOwnership:u(r()).optional(),typeRecord:u(b).optional(),typeRegulatory:u(r()).optional(),typeRevenue:u(r()).optional(),typeTechnologyUsed:u(r()).optional(),uniqueId:u(at).max(20).optional(),url:r().nullish(),urlDomain:r().nullish(),urlMatchMode:st.nullish(),urlType:y.nullish(),yearFoundedRange:u(L).optional()}),lt=i({entityFilter:R.nullish(),isCurrent:a().nullish(),personTitle:u(r()).optional()}),ut=c([`CURRENT`,`PAST`,`ANY`]),dt=i({amountInvestedRange:u(I).nullish(),amountRaisedRange:u(I).nullish(),entityName:u(r()).nullish(),investedCompany:u(r()).nullish(),personTitle:u(r()).nullish(),round:u(r()).nullish(),totalInvestmentCount:u(L).nullish(),typeRecord:u(b).nullish()}),ft=i({additionalAssociation:lt.nullish(),arrayFilter:dt.optional(),entityFilter:R.optional(),entityId:n().nullish(),entitySlug:r().nullish(),firstName:r().nullish(),hasRealPhoto:a().nullish(),includeAddress:a().nullish(),includeUrl:a().nullish(),investorActivity:et.optional(),isCurrent:a().nullish(),lastName:r().nullish(),letter:r().nullish(),nameQuery:r().nullish(),personId:u(n()).max(200).optional(),personName:u(r()).optional(),rankByEmployer:a().nullish(),role:r().nullish(),search:r().nullish(),semanticQuery:r().nullish(),status:r().nullish(),tenure:ut.nullish()}),pt=c([`discovery`,`profile`,`peer`,`comparison`]),mt=c([`keyword`,`semantic`]),ht=c([`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`,`NOTABLE_ACTIVITY_AT`,`ACCELERATOR_BRAND`,`ACCELERATOR_COHORT`,`HEADQUARTERS_COUNTRY`,`EMPLOYEE_COUNT`]),gt=Object.assign(t([ht,r()]),{enum:ht.enum}),_t=i({descending:a(),field:gt,sortKey:r().nullish()}),vt=i({order:u(_t),relevance:mt.nullish()}),yt=i({confidence:se,execution:P,fallbackUsed:a(),filter:ct,intent:pt,interpretation:r(),personAssociation:ft.nullish(),profileUnresolved:a().optional(),sort:vt,subjectEntityName:u(r()),unsupported:r().nullish()}),z=i({changedAt:l({offset:!0}).nullish(),dataSourceUpdatedAt:l({offset:!0}).nullish(),pendingApproval:o().nullish(),sourceId:r().nullish(),status:r().nullish()}),bt=i({fundManagerRelationshipSource:z.nullish(),fundraiseTransaction:h,fundraiseTransactionSource:z.nullish(),investorJoinSource:z.nullish()}),xt=i({evidence:bt,investor:ae,semanticMatch:ie.nullish()}),St=i({entityId:n(),matchedOffering:oe.nullish(),probability:s(),webUrl:u(r())}),Ct=i({entityId:n(),label:r(),publishedAt:l({offset:!0}).nullish(),score:s(),source:te,sourceId:r(),text:r(),url:r().nullish()}),wt=i({answer:ee.nullish(),filing:u(qe).nullish(),hiddenNonOperatingCount:s().int().nullish(),interpretation:yt,investment:u(xt),joinedEntityId:u(n()).nullish(),judgment:u(St),passage:u(Ct),peer:u(p),pendingWebQuery:u(r()),personLead:a(),result:f,searchRequestId:n().nullish(),subject:u(_)}),Tt=i({entity:u(m),newsId:o()}),Et=i({descending:a(),field:c([`ID`,`FIRST_NAME`,`LAST_NAME`,`FULL_NAME`,`SLUG`,`CREATED_AT`,`UPDATED_AT`,`STATUS`,`GENDER`,`AMOUNT_INVESTED`,`TOTAL_INVESTMENTS`]),sortKey:r().nullish()}),Dt=i({order:u(Et),relevance:mt.nullish()}),Ot=i({confidence:se,employerSemanticQuery:r().nullish(),execution:P,fallbackUsed:a(),filter:ft,interpretation:r(),sort:Dt,unsupported:r().nullish()}),kt=i({currentCompany:r().nullish(),headline:r().nullish(),id:n(),location:r().nullish(),name:r(),named:r(),organizationEvidence:c([`headline`,`profile`,`none`]).nullish(),photoUrl:r().nullish(),profileUrl:r(),slug:r().regex(/^[a-z0-9_-]+$/).max(255)}),At=i({interpretation:Ot,investment:u(xt),personLead:a(),profile:u(kt),result:ne,searchRequestId:n().nullish()}),jt=c([`place`,`size`,`type`]),Mt=Object.assign(t([jt,r()]),{enum:jt.enum}),Nt=c([`country`,`state`,`city`]),Pt=Object.assign(t([Nt,r()]),{enum:Nt.enum}),Ft=i({count:o().min(1),entityFilter:R,label:r(),level:Pt.nullish()}),It=i({dimension:Mt,key:r(),option:u(Ft),prompt:r()}),Lt=i({candidateCount:s().int(),question:u(It),sampleCount:o()}),Rt=i({label:r(),query:r()}),zt=i({key:r(),option:u(Rt),prompt:r()}),Bt=i({entity:wt,entityDetail:u(re),narrowing:Lt.nullish(),news:v,newsEntityMention:u(Tt),person:At,personDetail:u(g),personLead:a(),provenance:We,qualifier:zt.nullish(),section:u(Ke).optional()}),B=`entityFilter`;function Vt(e,t){let n=`${B}.${t}`;return(e.requestBody??[]).flatMap(({parameter:e})=>e).filter(({name:e})=>e===n||e.startsWith(`${n}[].`))}function Ht(e,t){let n,r=[];for(let e of t){let t=Object.entries(e).filter(e=>e[1]!==void 0&&e[1]!==null),[i]=t;if(i===void 0||t.length>1)return S(`A narrowing option must set exactly one ${B} field; this one sets ${t.length}.`);let[a,o]=i;a===n&&Array.isArray(o)||(r=[]),n=a;for(let e of Array.isArray(o)?o:[o])r.some(t=>JSON.stringify(t)===JSON.stringify(e))||r.push(e)}if(n===void 0)return x(`No narrowing picked`,null);let i=Kt(e,n,r);return i.ok&&i.data!==null?x(`Narrowing answer resolved`,{field:n,option:i.data}):S(i.summary)}function V({label:e,level:t}){return t==null?e:`${e} · ${t}`}function Ut(e){return e.option.flatMap(({parameter:e,value:t})=>t.flatMap(t=>[e.flag.split(` `)[0]??e.name,t]))}function Wt(e){return e.map(E).join(` `)}function Gt({question:e,candidateCount:t,sampleCount:n},r){let i=Math.max(...e.flatMap(({option:e})=>e.map(e=>V(e).length))),a=Math.max(...e.flatMap(({option:e})=>e.map(({count:e})=>String(e).length)));return[n<t?`narrow (top ${n} of ${t}):`:`narrow:`,...e.flatMap(({prompt:e,option:t})=>[` ${C(e)}`,...t.map(e=>{let t=r===void 0?null:Ht(r,[e.entityFilter]),n=t?.ok===!0&&t.data!==null?Wt(Ut(t.data)):`entityFilter=${JSON.stringify(e.entityFilter)}`;return` ${C(V(e)).padEnd(i)} ${String(e.count).padStart(a)} ${n}`})])]}function Kt(e,t,n){let r=`${B}.${t}`,i=Vt(e,t),a=S(`This CLI has no option for ${r}; update it to answer this question.`),o=n.filter(qt);if(o.length===0){let e=i.find(({name:e})=>e===r);return e===void 0||!n.every(Jt)?a:x(`Field values`,[{parameter:e,value:n.map(String)}])}if(o.length!==n.length)return a;let s=new Set(o.flatMap(e=>Object.keys(e).filter(t=>H(e[t])))),c=[...i.map(({name:e})=>e.slice(`${r}[].`.length)).filter(e=>s.has(e)),...[...s].filter(e=>!i.some(({name:t})=>t===`${r}[].${e}`))],l=o.every(e=>c.every(t=>H(e[t]))),u=[];for(let e of c){let t=i.find(({name:t})=>t===`${r}[].${e}`);if(t===void 0)return a;let n=[];for(let[t,r]of o.entries()){let i=r[e];if(H(i)){if(!Jt(i))return a;n.push(l?String(i):`${t}:${String(i)}`)}}u.push({parameter:t,value:n})}return x(`Row values`,u)}function qt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function H(e){return e!=null}var U=30,Yt=8,W=10,Xt=2,Zt=[`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`],Qt=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]);function $t(e,t,n,{trailer:r=[],heading:i,...a}={}){let o=a.transport??`cli`,s=i===void 0?[]:[i];if(typeof t==`string`)return ye([...s,t].join(`
3
+ `),a,r);let c=be(t,r,o);if(c!==null)return _e([...s,c].join(`
4
+ `),r,a);let l=dn(t);if(l===null)return null;let u=e.find(({operationId:e})=>e===l.operationId),d=me(u?.detailField,l.response),f=[...d.hiddenNote,...r],p=(e,t)=>_e(`${e.trimEnd()}\n`,t,a),m=u?.parameters??[],h={...l,response:d.response,parameters:m,transport:o},g=Se(h.response,e,o)??Ce(h.response,e,o);if(g!==null)return p([...s,...g].join(`
5
+ `),r);let _=en(h);if(_!==null){let e=_.narrowing===null?[]:Gt(_.narrowing,u);return p([...s,..._.lines].join(`
6
+ `),[...e,...f])}let ee=h.summary??n??h.operationId??`OpenAPI call succeeded`,v=[...s,ee,`${h.method} ${h.endpoint}`],y=ve(an(h),120-v.length-1-f.length,ge-Ee.byteLength(`${[...v,...f].join(`
7
+ `)}\n`,`utf8`),a);return p([...v,...y].filter(Boolean).join(`
8
+ `),f)}function en({response:e,...t}){let n=Bt.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o,narrowing:s}=n.data;return{lines:[...(o.incompleteScope??[]).map(e=>`${e} incomplete: partial results`),...r.answer?tn(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})=>C(`${e} rejected: ${t}`)),[`entities:`,...G(r.result,t)].join(`
9
+ `),[`people:`,...G(i.result,t)].join(`
10
+ `),[`news:`,...G(a,t)].join(`
11
+ `)],narrowing:s?.question.length?s:null}}function tn(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${C(e)}`).join(`
12
+ `)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>C(` - ${e}:${t} entity=${n}`)).join(`
13
+ `)}`;return[`answer:\n ${pe(e.text).replaceAll(`
14
+ `,`
15
+ `)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function nn(e){let t=dn(e)?.response,n=Q(t)?t.interpretation:void 0;if(!Q(n))return null;let r=P.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=he(n.filter),{unsupported:s,fallbackUsed:c}=n,l=[`strategy: requested=${i} used=${a}`,...Q(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${rn(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``];return xe(l.filter(Boolean).join(`
16
+ `),{appendNewline:!0})}var rn=e=>$(e)?C(e):Array.isArray(e)&&e.every($)?e.map(e=>C(e)).join(`, `):JSON.stringify(e);function an(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a,transport:o}=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 s=i===void 0||n===`GET`?``:`status=${i}`,c=Q(t)&&!X(t)?fn(t):null,l=c===null?void 0:Q(c.context.interpretation)?he(c.context):c.context,u=l!==void 0&&Q(l)?Object.entries(l):[],d=u.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(Q)),f=new Set(d.map(([e])=>e)),p=Object.fromEntries(u.filter(([e])=>!f.has(e)));return[s,...X(t)?G(t,e,r):c===null?mn(t)?cn(t,[`filter`],t.meta,o):hn(t)?cn(t,[`arrayFilterEntry`,`rangeFilterEntry`],t.filtersMeta,o):gn(t)?ln(t,o):typeof t==`string`?t.split(`
17
+ `):K(t,``):[...G(c.page,e,r),...Object.keys(p).length===0?[]:K(p,``),...d.flatMap(([e,t])=>[`${e}:`].concat(on(t,o)))]].filter(Boolean)}function G(e,t,n){let r=un(t),i=e.numberOfElements??e.content.length,a=Math.min(e.content.length,U),o=Math.max(1,a),s=(e.number??0)*(e.size??i),c=(e.totalElements??0)-s-i,l=e.number===void 0?``:` page=${e.number}`,u=e.size===void 0?``:` size=${e.size}`,d=e.totalElements===void 0?``:` total=${e.totalElements}`,f=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,p=(e.number??0)+1,m=e.totalPages===void 0||p<e.totalPages,h=w(`page`,t.parameters);return[`rows=${i}${l}${u}${d}${f}`,a>=i?``:`page rows omitted: ${i-a} (${a}/${i} shown); ${e.content.length>a?D(t.transport,`.content`):`reread with ${w(`size`,t.parameters)} ${o} and ${h} ${Math.floor((s+a)/o)} through ${Math.floor((s+i-1)/o)} (MCP: size, page); pages start at 0`}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${E(n)}`,c<=0||n!==void 0?``:m&&i===e.size?`more: ${c} rows not shown; use ${h} or ${w(`size`,t.parameters)} to see them`:`more: ${c} more matched but this response returns only these ${i}; narrow the query to reach them${m?` (${h} ${p} starts after this page)`:``}`,...on(e.content.slice(0,a),t.transport)].filter(Boolean)}function on(e,t){if(e.length===0)return[`(empty)`];if(!e.every(Q))return q(e,``);let n=sn(e);if(n.length===0)return q(e,``);let r=e.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)=>fe(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))),e.length>U&&s.push(`... ${e.length-U} more rows omitted; ${D(t)}`),s}function sn(e){let t=e.map(e=>J(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=Zt.filter(e=>n.has(e)),i=new Set(r.map(Y)),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(Y(e))?!1:(n&&i.add(Y(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,Yt-s.length);return[...s,...c].slice(0,Yt)}function cn(e,t,n,r){let i=t.flatMap(t=>e[t].map((e,n)=>({...e,path:`.${t}[${n}].choiceOption`}))),a=n!==void 0&&Q(n)?n:{},o=[`total`,`limit`].flatMap(e=>typeof a[e]==`number`?[` ${e}=${a[e]}`]:[]).join(``),s=[`filters=${i.length}${o}`];for(let e of i){let t=e.choiceOption.length,n=e.choiceOptionTotal===null?`unknown (degraded)`:e.choiceOptionTotal??t,i=e.choiceOptionTruncated===!0?` truncated`:``;s.push(`- ${e.filterKey} (${e.label}): choices ${t}/${n}${i}`);for(let t of e.choiceOption.slice(0,W))s.push(` ${w(e.filterKey)} ${E(t.value)}`);t>W&&s.push(` ... ${t-W} choices omitted for ${e.filterKey}; ${D(r,e.path)}`)}return s}function ln(e,t){let n=w(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,W).map(e=>`${n} ${E(e)}`),e.result.length>W?`... ${e.result.length-W} matches omitted; ${D(t,`.result`)}`:``].filter(Boolean)}function un({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Qt.has(e)&&t.length>0).map(([e,n])=>`${w(e,t)} ${E(n)}`)}function dn(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:ce.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(`statusDescription`)??t(`summary`),nextCursor:i===``?void 0:i,response:s?.data}}function K(e,t,n){if(e===void 0)return[];if($(e))return[`${t}${T(e,n)}`];if(Array.isArray(e))return q(e,t,n);let r=[];for(let[n,i]of Object.entries(e)){if(i===void 0)continue;let e=$(i)?`${t}${n}: ${T(i,n)}`:null;if(r.push(e??`${t}${n}:`),e===null)for(let e of K(i,`${t} `,n))r.push(e)}return r.length===0?[`${t}(empty)`]:r}function q(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e){let e=$(i)?`${t}- ${T(i,n)}`:null;if(r.push(e??`${t}-`),e===null)for(let e of K(i,`${t} `))r.push(e)}return r}function J(e,t=``,n=0){return $(e)?t.length===0?{}:{[t]:C(e,t)}:n>Xt?{}: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 $(r)?[[i,C(r,i)]]:Object.entries(J(r,i,n+1))}))}var Y=e=>e.split(`.`,1)[0],X=e=>Q(e)&&Array.isArray(e.content);function fn(e){let[t,...n]=Object.entries(e).filter(e=>X(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 pn(e){return Q(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var mn=e=>Q(e)&&Z(e.filter),hn=e=>Q(e)&&Z(e.arrayFilterEntry)&&Z(e.rangeFilterEntry),Z=e=>Array.isArray(e)&&e.every(pn),gn=e=>Q(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),Q=e=>typeof e==`object`&&!!e&&!Array.isArray(e),$=e=>typeof e!=`object`||!e;export{Ht as a,Wt as c,Ne as d,je as f,Vt as i,Bt as l,ke as m,nn as n,Ut as o,Fe as p,B as r,V as s,$t as t,Mt as u};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aventurevc/aventure-cli",
3
- "version": "0.8.507",
3
+ "version": "0.8.509",
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": "d7ad271374de11fc18263126ca5f8162e9eef82d",
36
+ "commit": "62e6b33097e60a15238c1b7b4ee471db5f99ae5f",
37
37
  "openapiPath": "openapi/openapi.json",
38
- "openapiSha256": "df757bb1af7e79406e85136bc75f38787180bd039c24923f3475d4173079b937"
38
+ "openapiSha256": "83f4b3bcaf279d82bb2cb72ef8c0650d0e25725614fce6ef2912513adc8f8e66"
39
39
  },
40
40
  "scripts": {}
41
41
  }
@@ -1,11 +0,0 @@
1
- import{a as e,n as t,o as n,r,t as i}from"./commander-DEj7N1b9.js";import{a}from"./package-DEeHDoOT.js";import{l as o,o as s,r as c}from"./env-CMJ0DtbB.js";import{c as l,p as u,r as d}from"./result-envelope-DhuT_8lW.js";import{B as f,U as p,o as m,q as h,t as g,u as _,y as v,z as y}from"./tool-policy-DYjF2wFZ.js";import{i as b}from"./logging-DqesyM4A.js";import{t as ee}from"./openapi-snapshot-C3NgiUZo.js";import{h as te,p as ne}from"./help-catalog-ByQFO96d.js";import{r as re,t as ie}from"./cli-help-policy-BCuXaWdv.js";import{a as x,c as S,d as ae,f as oe,i as C,l as w,m as se,n as ce,p as le,r as ue,s as de,t as fe,u as pe}from"./startup-auth-DGDPMIp_.js";import{t as T}from"./openapi-commands-Cyvu5wdW.js";import{n as me,t as he}from"./operations-metadata-DnrouEku.js";import{a as E,i as ge,t as D}from"./output-mode-CE87SvLV.js";import{S as _e,_ as O,a as ve,b as k,c as ye,d as be,f as xe,g as Se,h as Ce,i as A,l as we,m as Te,n as Ee,o as De,p as Oe,r as ke,s as Ae,t as je,u as Me,v as j,x as Ne,y as M}from"./generated-option-order-DazIk15u.js";import{n as Pe,t as Fe}from"./deprecated-command-bF9Q8_F6.js";import{a as Ie,i as Le,n as Re,r as ze}from"./payload-operand-guard-C8eAl3-g.js";import{fileURLToPath as Be}from"node:url";import{readFile as Ve}from"node:fs/promises";function N(e,t){let n=h(t);return{...n===void 0?void 0:e.schemas[n],...t}}function He(e,t,n){let r=t;for(let t of n.split(`.`)){let n=N(e,r).properties?.[t.replace(/\[\]$/u,``)];if(n===void 0)return!1;r=t.endsWith(`[]`)?N(e,n).items:n}let i=N(e,r);return i.type===`array`&&(i.minItems??0)===0}function Ue(e){let t=[];for(let n of e.split(`.`).toReversed())t={[n.replace(/\[\]$/u,``)]:n.endsWith(`[]`)?[t]:t};return JSON.stringify(t)}function We(e,t,n){let r=`${e} requires JSON body path(s): ${n.join(`, `)}`;if(t.kind===`multipart`)return`${r}. ${n.includes(`body`)?`For multipart --from-file, wrap the endpoint JSON under top-level "body".`:`For multipart --from-file, put the missing nested path(s) inside top-level "body".`}`;let i=ee(),a=p(i.paths,e)?.operation.requestBody?.content?.[t.contentType]?.schema,o=t.description.split(/(?<=\.)\s+/u),s=n.flatMap(e=>{let n=t.parameter.filter(({name:t})=>t.startsWith(`${e}[].`)).map(({flag:e})=>e.split(` `)[0]);if(n.length===0)return[];let r=He(i.components,a,e)?`, or ${Ue(e)} in a --from-file JSON body to send none`:``,s=o.filter(t=>t.includes(e));return[`${e} takes one entry through ${n.join(`, `)}${r}.${s.map(e=>` Contract: ${e}`).join(``)}`]});return s.length===0?r:`${r}. ${s.join(` `)}`}async function Ge(e){let t;try{t=e===`-`?await Ke():await Ve(e,`utf8`)}catch(t){return d(`Could not read input: ${t.message}`,[`path=${e}`])}try{if(t.trim().length===0)return l(`No input provided`,null);let e=JSON.parse(t);return l(`Input parsed`,e)}catch(e){return d(`Input is not valid JSON: ${e.message}`)}}async function Ke(){if(process.stdin.isTTY)throw Error(`--from-file - requires JSON on stdin, but stdin is a TTY`);process.stdin.setEncoding(`utf8`);let e=``;for await(let t of process.stdin)e+=t;return e}var P=`--content-type`;function qe(e,n,r){let i=e=>!r?.has(e)&&(r?.add(e),!0),a=n.requestBody??[];if(a.length>1&&i(P)){let n=a.map(({contentType:e})=>e);e.addOption(new t(`${P} <media-type>`,`Select the request body encoding, never an uploaded file's media type; omit for ${n[0]}.`).choices(n).argParser(Ye(a)))}if(z(n)&&i(`--from-file`)){let r=a[0];if(r===void 0)throw Error(`${n.operationId} has no request body`);e.addOption(new t(`--from-file <path>`,ve(r,r.requiredPath)).argParser(F(`--from-file`)))}let o=De(a).filter(e=>i(I(e.variant[0].parameter)));for(let n of o.toSorted((e,t)=>Ee(e.variant[0].parameter,t.variant[0].parameter))){let{descriptor:r,parameter:i}=n.variant[0],o=new t(A(n),a.length>1?ke(n):ye(r,i));a.length===1&&i.envName!==void 0&&o.env(i.envName);let s=a.length===1?Ae(r,i.optionKey):[];s.length>0&&o.conflicts(s),a.length>1?o.argParser(Je):j(i.name)||i.schemaType===`array`?o.argParser(Xe):o.argParser(F(i.flag)),e.addOption(o),o.envVar!==void 0&&e.on(`optionEnv:${o.name()}`,()=>{let t=e.opts()[i.optionKey];typeof t==`string`&&t.trim()&&e.setOptionValueWithSource(i.optionKey,t.trim(),`env`)})}ct(e,n,o)}function Je(e,t){return t===void 0?e:typeof t==`string`?[t,e]:[...t,e]}function Ye(e){return(t,r)=>{if(r!==void 0)throw new n(`${P} was already given; pass it once.`);let i=v(e,t);if(!i.ok)throw new n(i.summary);return t}}function Xe(e,t){return[...t??[],e]}function F(e){let t=e.split(/\s+/u)[0]??e;return(e,r)=>{if(r!==void 0)throw new n(`${t} was already given; pass it once.`);return e}}async function Ze(e,t){let n=w(e,t),r=v(e.requestBody??[],n);if(!r.ok||r.data===null)return d(r.summary,r.warnings);let i=r.data;if(i===void 0)return l(`No body`,void 0);let a=Qe(e,i,t);if(a!==null)return d(a);let o=Te(e.operationId,i,t);if(!o.ok)return d(o.summary,o.warnings);t=o.data;let s=$e(i,t);if(s!==null)return d(s);let c=await nt(t);if(!c.ok)return d(c.summary,c.warnings);let u=Ce(e.requestBody??[],i,c.data);if(u!==null)return d(u);let f=tt(e.operationId,i,c.data);if(!f.ok)return f;let p=Se(e.operationId,i,c.data);if(p!==null)return d(p);let m=rt(e.operationId,i,t);if(!m.ok)return m;if(c.data===void 0&&m.data===void 0)return i.required?d(st(e.operationId,i)):l(`No body`,void 0);let h=at(e.operationId,i,c.data,m.data);if(!h.ok||h.data===void 0)return h;if(i.schemaType===`array`&&!Array.isArray(h.data))return d(`${e.operationId} requires a JSON array body.`);if(i.parameter.length>0&&!M(h.data)){let t=i.kind===`multipart`?` keyed by multipart part name`:` body`;return d(`${e.operationId} requires a JSON object${t}.`)}let g=et(i,h.data);if(g.length>0)return d(`${e.operationId} requires body option(s): ${g.join(`, `)}`);let _=h.data,y=M(_)?k(i).filter(e=>!O(_,e)):[];return y.length>0?d(We(e.operationId,i,y)):h}function Qe(e,t,n){let r=new Set(t.parameter.map(({optionKey:e})=>e));for(let i of e.requestBody??[])if(i!==t)for(let t of i.parameter){if(r.has(t.optionKey)||n[t.optionKey]===void 0)continue;let i=(e.requestBody??[]).filter(e=>e.parameter.some(({optionKey:e})=>e===t.optionKey)).map(({contentType:e})=>e);return`${I(t)} requires ${P} ${i.join(` or `)}.`}return null}function $e(e,t){for(let n of e.cliConflicts??[]){let e=n.filter(e=>t[e]!==void 0);if(e.length>1)return`Options ${e.join(`, `)} cannot be used together.`}return null}function et(e,t){return M(t)?e.parameter.filter(e=>e.required&&!O(t,e.name)).map(I):[]}function tt(e,t,n){let r=_e(t,n);return r===null?l(`Body file paths validated`,null):d(`${e} --from-file contains ${r.message}`)}async function nt(e){let t=typeof e.fromFile==`string`?e.fromFile:void 0;if(t===void 0)return l(`No body file`,void 0);let n=await Ge(t);if(!n.ok)return d(n.summary,n.warnings);let r=u.safeParse(n.data);return r.success?l(`Input parsed`,r.data):d(`Input is not valid JSON value: ${r.error.message}`)}function rt(e,t,n){let r={},i=!1;for(let e of t.parameter){let a=Ne(e,n[e.optionKey]);if(!a.ok||a.data===null)return d(a.summary,a.warnings);let o=a.data;if(o===void 0)continue;let s=it(t,n,r,e,o);if(!s.ok)return d(s.summary,s.warnings);i=!0}if(!i)return l(`No direct body options`,void 0);let a=be(e,t,n,r);return a===null?l(`Direct body options parsed`,r):a}function it(e,t,n,r,i){let a=we(e,t,r);if(a===null){let e=ot(r,i);return e.ok?xe(n,r.name,e.data,r.schemaType===`array`):d(e.summary,e.warnings)}let o=Me(e,t,r,a);if(o!==null)return d(o);let s=r.schemaType===`array`,c=s?r.itemSchemaType:r.schemaType;for(let[e,t]of a.rows){let i=[];for(let e of t){let t=R(r,c,e);if(!t.ok)return d(t.summary,t.warnings);i.push(t.data)}for(let t of s?[i]:i){let i=Oe(n,r.name,e,t);if(!i.ok)return i}}return l(`Body value assigned`,null)}var I=e=>e.flag.split(` `)[0]??e.name;function at(e,t,n,r){if(n===void 0)return l(`Direct body parsed`,r);if(r===void 0)return l(`Input parsed`,n);if(M(n)&&M(r))try{return l(`Input parsed`,L(t,n,r))}catch(t){return d(`${e} ${t instanceof Error?t.message:String(t)}`)}return d(`${e} cannot combine --from-file with direct body options unless the file body is an object.`)}function L(e,t,n,r=``){let i={...t};for(let[t,a]of Object.entries(n)){let n=i[t],o=`${r}${t}`;if(M(n)&&M(a))i[t]=L(e,n,a,`${o}.`);else if(n===void 0||n===a)i[t]=a;else throw Error(`sets JSON key '${o}' both in --from-file and with ${e.parameter.find(({name:e})=>e===o)?.flag.split(` `)[0]??`body options`} — set it in one place${Array.isArray(n)?`: move the per-item fields inside the matching '${o}[]' object(s) in the file body`:ne.test(o)?`; keep multi-line text in the --from-file body`:``}.`)}return i}function ot(e,t){if(typeof t==`boolean`)return l(`Body value parsed`,t);if(t===void 0||typeof t==`string`)return R(e,e.schemaType,t??``);let n=[],r=j(e.name)&&e.schemaType!==`array`?e.schemaType:e.itemSchemaType;for(let i of t){let t=R(e,r,i);if(!t.ok)return t;n.push(t.data)}return l(`Body value parsed`,n)}function R(e,t,n){if(n===`null`&&e.nullable&&t===e.schemaType)return l(`Body value parsed`,null);let r=e.name;if(t===`boolean`)return n===`true`?l(`Body value parsed`,!0):n===`false`?l(`Body value parsed`,!1):d(`${r} must be true or false.`);if(t===`number`||t===`integer`){let e=n.trim(),i=Number(e);return e===``||!Number.isFinite(i)?d(`${r} must be a finite ${t}.`):t===`integer`&&!Number.isInteger(i)?d(`${r} must be an integer.`):l(`Body value parsed`,i)}return l(`Body value parsed`,n)}function st(e,t){let n=t.parameter.filter(e=>e.required);if(n.length>0&&t.requiredPath.every(e=>n.some(({name:t})=>t===e||t.startsWith(`${e}.`))))return`${e} requires body option(s): ${n.map(I).join(`, `)}`;let r=k(t);if(r.length>0)return`${e} requires --from-file with JSON body path(s): ${r.join(`, `)}`;let i=t.parameter.map(I).join(`, `);return i.length===0?`${e} requires --from-file`:`${e} requires --from-file or body option(s): ${i}`}function ct(e,t,n){let r=[...t.parameters,...n.map(({variant:e})=>e[0].parameter)];(t.requestBody?.length??0)>1&&r.push({optionKey:`contentType`,flag:P,location:`body`}),z(t)&&r.push({optionKey:`fromFile`,flag:`--from-file`,location:`body`}),je(e.options,r)}function z(e){return(e.requestBody??[]).some(e=>e.kind!==`multipart`||e.parameter.some(e=>e.schemaFormat!==`binary`))}function lt(e,t,n=a().bin[0]){e.helpCommand(!1);let r=e.commands.find(e=>e.name()===`help`)??e.command(`help`);r.summary(`Show full documentation for a command, search the catalog, or ask a question`).description("Show a command's full documentation offline. Select it by command path,\noperationId, or `<METHOD> <path>`; `<command> --help` prints only its usage.\n`help catalog [query...]` searches or lists every operation;\n`help ask <question>` answers a platform question.").argument(`[command...]`,"command path, operationId, or METHOD and path, e.g. `help entities get`"),r.addOption(new ut(r)),r.hook(`preSubcommand`,e=>{e.opts().help&&e.help()}),D(r),r.action(async function(r){let i=r.flatMap(e=>e.split(/\s+/u).filter(Boolean)),{emit:a}=await import(`./output-CgaHhOg3.js`),o=this.optsWithGlobals();if(o.help&&i.length===0){this.outputHelp();return}let s=G(e,i),c=t.find(t=>s!==void 0&&G(e,t.cliPath)===s);if(o.help||s!==void 0&&c===void 0){s===void 0&&this.error(`unknown command '${i.join(` `)}' (run \`${n} --help\` for the command tree)`),s.outputHelp();return}let u=c===void 0?await pt(i,t):l(`Resolved by command path`,{operationId:c.operationId});if(u.ok&&u.data?.command!==void 0&&this.error(`unknown command '${i.join(` `)}' (run \`${n} --help\` for the command tree)`),!u.ok||u.data===null){a({mode:E(o)},u);return}let{writeShowResult:d}=await import(`./operations-catalog-qerms2d4.js`);d({...o,...u.data},t,E(o,`text`),n)}),ft(e,t,n)}var ut=class extends t{helpCommand;constructor(e){super(`-h, --help`,`display help for command`),this.helpCommand=e}is(e){if(e!==this.short&&e!==this.long)return!1;let t=this.helpCommand.parent?.args??[],n=t.findIndex(e=>e===this.helpCommand.name()||this.helpCommand.aliases().includes(e)),r=n<0?void 0:t[n+1];return r===void 0||r.startsWith(`-`)?!0:!this.helpCommand.commands.some(e=>e.name()===r||e.aliases().includes(r))}},B=2,V=6,dt={formatHelp(e,t){let n=n=>r.prototype.formatHelp.call(this,e,Object.assign(Object.create(t),n));if(t.visibleCommands(e).length===0)return n({});let i=t.padWidth(e,t),a={padWidth:()=>i,visibleOptions:()=>[],showGlobalOptions:!1},o=n({...a,visibleCommands:()=>[]}),s=n({padWidth:()=>i,visibleCommands:()=>[]}).slice(o.length);return n(a)+s},visibleCommands(e){let t=r.prototype.visibleCommands.call(this,e);return e.parent===null?t.filter(e=>S[e.name()]?.listed!==!1):t},subcommandTerm(e){let t=r.prototype.subcommandTerm.call(this,e);return e.commands.length>0&&e.registeredArguments.length===0?`${t} <command>`:t},formatItem(e,t,n,i){let a=i.helpWidth??80,o=a-t-4;return n===``||o>=i.minWidthToWrap?r.prototype.formatItem.call(i,e,t,n,i):`${` `.repeat(B)}${e}\n${H(n,a,i)}`}};function H(e,t,n){return n.boxWrap(e,t-V).replace(/^/gmu,` `.repeat(V))}function ft(e,t,n){for(let r of t){let i=G(e,r.cliPath);i!==void 0&&i.addHelpText(`after`,()=>{let e=i.createHelp(),a=i.configureOutput().getOutHelpWidth?.();e.prepareContext(a===void 0?{}:{helpWidth:a});let o=e.helpWidth??80,s=te(r.operationId,t,n),c=U(me(r.header),o,e),l=U(he(r.errorResponse),o,e);return`\n${[...s,...c,...l].join(`
2
- `)}\n`})}}function U(e,t,n){let[r,...i]=e;return r===void 0?[]:[``,r,...i.map(e=>H(e.trimStart(),t,n).replace(/^ +/u,` `.repeat(B)))]}var W='Accepted selectors: `<METHOD> <route template or concrete path>`, an operationId, or a CLI command path such as "entities get".';async function pt(e,t){let[n=``,...r]=e.join(` `).trim().split(/\s+/u),[i,...a]=t.filter(e=>e.path===n);if(r.length===0&&i!==void 0)return a.length===0?l(`Resolved by route`,{operationId:i.operationId}):d(`${n} is served by ${[i,...a].map(({method:e})=>e).join(`, `)}; name the method, as in \`help ${i.method} ${n}\`.`,[W]);let o=y.find(e=>e===n.toLowerCase());if(o===void 0||r.length===0){let n=e.join(` `).trim();return l(`Resolved by name`,t.some(e=>e.operationId===n)?{operationId:n}:{command:n})}let s=f(o),c=r.join(``),u=t.find(e=>e.method===s&&e.path===c);if(u!==void 0)return l(`Resolved by route template`,{operationId:u.operationId});let{resolveOpenApiOperationSelector:p}=await import(`./openapi-call-DZE6bLbj.js`),m=p({method:s,path:c});return!m.ok||m.data===null?d(m.summary,[...m.warnings,W]):l(`Resolved by method and path`,{operationId:m.data.operation.operationId})}function G(e,t){let n=e;for(let e of t){let t=n.commands.find(t=>t.name()===e||t.aliases().includes(e));if(t===void 0)return;n=t}return n}function mt(e,t,n){if(e.cliPath[0]!==`lookup`||!ht(n))return null;let r=[...(e.requestBody??[]).flatMap(e=>e.parameter),...e.parameters,{name:`fromFile`,optionKey:`fromFile`}],i=r.filter(({optionKey:e},t)=>r.findIndex(t=>t.optionKey===e)===t).filter(({optionKey:e})=>t[e]!==void 0).map(({name:e,optionKey:n})=>`${e}=${String(t[n])}`),a=`no record for ${i.length===0?`the given input`:i.join(`, `)}`;return n.ok?d(a):d(a,[],{httpStatus:n.httpStatus,problem:n.problem})}function ht(e){return e.ok?Array.isArray(e.data)&&e.data.length===0:e.httpStatus===404}function gt(t,n,r,i){let a=_t(t,r),o=a instanceof e?[]:a,s=o[0],c=i.bin[0],l=[{selected:s===`auth`,register:async()=>{let{registerBuiltinAuthCommands:e}=await import(`./builtin-auth-CCSpEwe1.js`);e(n,c)}},{selected:s===`agents`,register:async()=>{let{registerBuiltinAgentSetupCommand:e}=await import(`./builtin-agent-setup-B2Xvqera.js`);e(n,c)}},{selected:s===`update`,register:async()=>{let{registerBuiltinUpdateCommand:e}=await import(`./builtin-update-CA6jNqDJ.js`);e(n,i)}},{selected:s===`batch`,register:async()=>{let{registerBuiltinBatchCommand:e}=await import(`./builtin-batch-DdGyCjlR.js`);e(n,r,c)}},{selected:s===`research`||s===`research-runs`||s===`data-engineering`,register:async()=>{let{registerBuiltinRunWaitCommand:e}=await import(`./builtin-run-wait-BCNt76cG.js`);await e(n)}},{selected:s===`completion`,register:async()=>{let{registerCompletionCommand:e}=await import(`./completion-LkPy50Y-.js`);e(n,r,c)}},{selected:s===`help`,register:async()=>{let{registerHelpCatalogCommand:e}=await import(`./operations-KPl8_NhR.js`);e(n,r,c)}},{selected:s===`command-catalog`,register:async()=>{let{registerRetiredCommandCatalog:e}=await import(`./operations-KPl8_NhR.js`);e(n,r,c)}}],u=s===void 0||s===`help`||s===`completion`||s===`command-catalog`||!l.some(e=>e.selected)&&!r.some(e=>e.cliPath[0]===s),d=1;for(;d<o.length&&r.some(e=>o.slice(0,d+1).every((t,n)=>e.cliPath[n]===t));)d++;let f=o.slice(0,d),p=u?r:r.filter(e=>f.slice(0,e.cliPath.length).every((t,n)=>e.cliPath[n]===t)),m=new Set,h=async(e=!1)=>{for(let t of l)(e||u||t.selected)&&!m.has(t)&&(await t.register(),m.add(t))};return{generated:p,fullTree:u,rootHelp:t.length>0&&t.every(e=>e===`--help`||e===`-h`),registerBuiltin:h,async completeTree(e){e(n,r.filter(e=>!p.includes(e))),await h(!0)}}}function _t(t,n){try{return new i().parseOptions([...C(t,n).commandArgv]).operands}catch(t){if(!(t instanceof e))throw t;return t}}var vt=new Set(T.map(e=>e.cliPath.join(` `)));function K(e,t){e.showHelpAfterError(!1).exitOverride(t(e)),e.commands.length===0?e.hook(`preAction`,Re):e.registeredArguments.length===0&&!vt.has(Ie(e).join(` `))&&e.addHelpOption(new Le(e));for(let n of e.commands)K(n,t)}function q(e){return ie[re(e,S)??`cli`]}function J(e,t,n,{rootHelp:r=!1}={}){let i=t.map(e=>{let t=e.cliPath[0]??``;return{spec:e,top:t,rank:q(t).rank}}).toSorted((e,t)=>e.rank-t.rank||e.top.localeCompare(t.top)).map(e=>e.spec),a=new Set(i.filter(e=>fe(e.cliPath[0])).map(e=>e.cliPath[0]??``)),o=new Set,s=new Set;for(let{cliPath:e,deprecated:t}of i)for(let n=1;n<e.length;n++){let r=e.slice(0,n).join(` `);o.add(r),t!==!0&&s.add(r)}let c=new Set(i.map(({cliPath:e})=>e.join(` `)));for(let t of i){let i=!1;for(let e=1;e<t.cliPath.length;e++)i||=c.has(t.cliPath.slice(0,e).join(` `));yt(e,t,a,s,o.has(t.cliPath.join(` `))||i,n,!r||t.cliPath.length===1)}}function yt(e,n,r,i,a,o,s){let c=n.cliPath,l=e,u=``,f=!r.has(c[0]??``);for(let e of c.slice(0,-1)){u=u===``?e:`${u} ${e}`;let t=f&&u===e||!i.has(u);l=bt(l,e,u,t)}let p=c.at(-1)??n.operationId,h=n.deprecated===!0&&i.has(c.join(` `)),v=l.commands.find(e=>e.name()===p)??l.command(p,n.deprecated===!0&&!h?{hidden:!0}:{}),y=n.requestBody?.flatMap(({parameter:e})=>e)??[];if(v.summary((h?S[c.join(` `)]?.summary:void 0)??(n.summary||n.operationId)).description([`${n.method} ${n.path}.`,n.summary||n.description,`Full documentation: ${o} help ${n.cliPath.join(` `)}`,n.requestBody?.[0]?.kind===`json`||[...n.parameters,...y].some(e=>m(e.schemaType,e.itemSchemaType))?g:``].filter(Boolean).join(`
3
- `)),!s)return;let b=le(n);for(let e of n.parameters)xt(v,e,a||e===b);qe(v,n),_(n.intent)&&!v.options.some(e=>e.long===`--execute`)&&v.addOption(new t(`--execute`).hideHelp()),D(v),v.hook(`preAction`,e=>oe(e,n)),n.explain===!0&&v.option(`--explain`,`Print the search strategy and parsed constraints before the results`),b!==void 0&&v.argument(`[text...]`,b.description||`Same as ${pe(b.flag)}.`),v.action(async function(){let{emit:e,emitSearchExplanation:t}=await import(`./output-CgaHhOg3.js`),r=Object.assign(this.optsWithGlobals(),{environment:this.opts().environment}),i=E(r),a=r;if(b!==void 0){let t=se(b,this.args,r);if(!t.ok)return e({mode:i},{...t,notDispatched:!0});if(t.data===null)return e({mode:i},t);a=t.data}let o=ae(n,a);if(o.length>0){let t=`missing required options: ${o.join(`, `)}`;return e({mode:i},d(t,[],{notDispatched:!0}))}let s=await St(n,a,i),c=mt(n,a,s);if(c!==null)return e({mode:i},c);r.explain===!0&&s.ok&&t(i,s.data),s.ok&&s.data instanceof Uint8Array&&i!==`csv`&&i!==`xlsx`?process.stdout.write(s.data):e({mode:i},s)})}function bt(e,t,n,r){let i=e.commands.find(e=>e.name()===t);if(i!==void 0)return i;let a=S[n],o=e.command(t,r?{hidden:!0}:{}).helpCommand(!1);return a!==void 0&&o.summary(a.summary).description(a.summary),o}function xt(e,n,r=!1){let i=n.description||`${n.name} ${n.location} parameter`,a=n.defaultValue===void 0?void 0:typeof n.defaultValue==`string`||typeof n.defaultValue==`boolean`?n.defaultValue:[...n.defaultValue];if(n.legacyFlag!==void 0){let o=new t(n.flag,i);a!==void 0&&o.default(a);let s=new t(n.legacyFlag,i).conflicts(n.optionKey);e.addOption(o).addOption(s),e.hook(`preAction`,e=>{let t=e.opts(),i=t[n.optionKey],a=t[s.attributeName()];a===void 0?!r&&n.required&&i===void 0&&e.error(`error: required option '${o.flags}' not specified`,{code:`commander.missingMandatoryOptionValue`}):(i===void 0||e.getOptionValueSource(n.optionKey)==="default")&&e.setOptionValueWithSource(n.optionKey,a,`cli`)})}else a===void 0?n.required&&!r?e.requiredOption(n.flag,i):e.option(n.flag,i):e.option(n.flag,i,a)}async function St(e,t,n){let{buildOpenApiPath:r,runOpenApiCall:i}=await import(`./openapi-call-DZE6bLbj.js`),{pendingResult:a}=await import(`./output-CgaHhOg3.js`),o=await Ze(e,t);if(!o.ok)return{...o,notDispatched:!0};let s=!1,c=Object.fromEntries(e.parameters.filter(e=>e.location===`path`).map(e=>{let n=t[e.optionKey];if(Array.isArray(n))return[e.name,n.at(0)??``];if(n===void 0)throw Error(`Missing required option ${e.optionKey}`);return[e.name,String(n)]})),l=Object.fromEntries(e.parameters.filter(e=>e.location===`query`).flatMap(e=>{let n=t[e.optionKey];if(n===void 0||Array.isArray(n)&&n.length===0)return[];let r=Array.isArray(n)||typeof n==`boolean`?n:String(n);return[[e.name,r]]})),u=Object.fromEntries(e.parameters.filter(e=>e.location===`header`).flatMap(e=>{let n=t[e.optionKey];return n===void 0||Array.isArray(n)&&n.length===0?[]:[[e.name,Array.isArray(n)?n.join(`,`):String(n)]]})),d=await i({method:e.method,path:r(e.operationId,c),searchParams:l,headers:u,body:o.data,contentType:w(e,t),auth:e.auth,responseFormat:ge(n),responseBytes:e.binaryResponse===!0,pendingResult:a,onDispatch:()=>{s=!0}});return Fe(e,d.ok||s?d:{...d,notDispatched:!0})}async function Y(e,n){let r=n.bin[0],i=Pe(T),a=ce(e,i),l=a===`required`?i:de(i),u=new ze;u.enablePositionalOptions(!x(e)&&C(e,i).positionalOptions).name(r).usage(`[--environment <environment>] <command> [subcommand] [options]`).configureHelp(dt).summary(`CLI for the aVenture API: companies, people, and news, with the funding, publications, and classifications attached to them`).description(`The aVenture research API from your terminal. Three records — companies,
4
- people, and news — carry everything else: funding, publications, and tags.
5
-
6
- Mutations execute directly; --execute is a deprecated no-op.
7
- The aVenture MCP server runs these same operations through the same API client.`).addOption(new t(`--environment <environment>`,`route all API calls to a mapped API environment (default: API_URL host, else API_ENV, else ${c})`).choices([...o()])).showHelpAfterError(`(run \`${r} --help\` for usage)`),(x(e)||e.every(e=>e.startsWith(`-`)))&&u.version(n.version);let d=gt(e,u,l,n);J(u,d.generated,r,{rootHelp:d.rootHelp}),await d.registerBuiltin(),lt(u,l,r);for(let e of u.commands)e.helpGroup()||e.helpGroup(q(e.name()).heading);let f;if(K(u,e=>t=>{throw f=(async()=>{!d.fullTree&&![`commander.helpDisplayed`,`commander.version`].includes(t.code)&&await d.completeTree((e,t)=>J(e,t,r));let{commandExitHandler:n}=await import(`./parse-error-hint-CTKc2qdc.js`);try{n(e)(t)}catch(e){if(e!==t)throw e}})(),t}),a===`required`){let e=[u];for(;e.length>0;){let t=e.pop();t!==void 0&&(e.push(...t.commands),t.hook(`preAction`,async(e,t)=>{e===t&&await ue(`required`)}))}}let p=new Set(u.commands.filter(e=>[`entities`,`people`,`news`].includes(e.name())).flatMap(e=>e.commands.map(e=>e.name())));return u.addHelpText(`after`,[``,`Record subcommands under entities, people, and news:`,...[[`search`,` search Find many of that record from a plain-English query or a filter`],[`lookup`,` lookup Find one news article; companies and people use the root lookup`],[`get`,` get Read one record`],[`list`,` list Read many records`],[`create`,` create, update, delete Write; each needs a credential that permits it`]].flatMap(([e,t])=>p.has(e)?[t]:[]),``,`Authentication (every command that calls aVenture needs a credential):`,` Create one at ${s}/sign-up, then run: ${r} auth login`,` AUTH_TOKEN aVenture API key, for CI and other non-interactive shells`,` Check what this shell holds with: ${r} auth status\n`,`Output modes (per command):`,` --text compact lines, the terminal default; --json the full envelope`,` --csv Print CSV rows or preserve server CSV bytes.`,` --xlsx Write server XLSX bytes with --to-file; use --csv otherwise.`,` --data response data as JSON, the default when piped or non-TTY`,` --data-full uncapped, for bounded programs, never LLM agents`,` --all-fields --text plus the detail fields it hides by default
8
- `,`Exit codes:`,` 0 envelope.ok === true
9
- 1 envelope.ok === false
10
- `,`Examples:`,` $ ${r} auth login`,` $ ${r} lookup --name Stripe --url https://stripe.com`,` $ ${r} search "fintech companies in Austin"\n`,`Run \`${r} <command> --help\` for its subcommands and options,`,`or \`${r} help <command>\` for its full documentation.`].join(`
11
- `)),{program:u,exitPreparation:()=>f}}var X=a(Be(import.meta.url)),Z=X.bin[0];async function Q(e,t){process.exitCode=1;let n=e instanceof Error?e:Error(String(e)),r={...d(`${Z} ${t}: ${n.message}`,[n.name||`Error`]),counts:{exitCode:1}};b({component:Z,event:`fatal`,message:n.message,error:n}),process.stderr.write(`${Z} fatal (${t}): ${n.stack??n.message}\n`);try{let{BearerVerificationUnavailableError:e}=await import(`./openapi-call-DZE6bLbj.js`),{emitJson:t}=await import(`./output-CgaHhOg3.js`),i=n instanceof e?{httpStatus:n.problem.status,problem:n.problem}:{};r={...r,...i},t(r)}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`${Z} fatal reporting failed: ${t}\n`),process.stdout.write(`${JSON.stringify(r)}\n`)}}var Ct=e=>{if(e.code!==`EPIPE`)throw e;process.exit(0)};for(let e of[process.stdout,process.stderr])e.on(`error`,Ct);process.on(`uncaughtException`,e=>Q(e,`uncaughtException`)),process.on(`unhandledRejection`,e=>Q(e,`unhandledRejection`));var $=await Y(process.argv.slice(2),X);try{await $.program.parseAsync()}catch(t){await $.exitPreparation(),t instanceof e?process.exitCode=t.exitCode:await Q(t,`parseAsync`)}export{};
@@ -1 +0,0 @@
1
- export{t as logoutCliCredentials}from"./logout-Ds94CRXY.js";
@@ -1 +0,0 @@
1
- export{n as materializeCliOAuthBearerCredential,r as materializeSavedCliOAuthBearerCredential}from"./oauth-bearer-credential-CEb_TJb0.js";