@aventurevc/aventure-cli 0.8.375 → 0.8.377

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/aventure-cli/command-catalog.compact.txt +4 -4
  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-CyC8mPzO.js → api-key-login-HxO90zZg.js} +1 -1
  5. package/dist/chunks/{auth-status-check-BNlKGio3.js → auth-status-check-BgK_EGba.js} +1 -1
  6. package/dist/chunks/{auth-status-check-BYJ8IgaI.js → auth-status-check-ChVskE_o.js} +1 -1
  7. package/dist/chunks/aventure-cli-BOeuXsFY.js +11 -0
  8. package/dist/chunks/{batch-io-YwyP0QnX.js → batch-io-7hJMsmDC.js} +1 -1
  9. package/dist/chunks/{builtin-auth-BQYtyqcc.js → builtin-auth-D-GkfRAY.js} +3 -3
  10. package/dist/chunks/{builtin-run-wait-gPZaj8qk.js → builtin-run-wait-CW8cjU_4.js} +1 -1
  11. package/dist/chunks/builtin-update-EouHjFfI.js +3 -0
  12. package/dist/chunks/completion-CK8FjFgx.js +20 -0
  13. package/dist/chunks/{contract-BIzf16k0.js → contract-DOJ1nOWe.js} +1 -1
  14. package/dist/chunks/{help-catalog-Db3ruw_w.js → help-catalog-D4POjaKy.js} +1 -1
  15. package/dist/chunks/{help-intent-BeaPBtNB.js → help-intent-y-RYgFLl.js} +1 -1
  16. package/dist/chunks/logout-C8Va35A4.js +1 -0
  17. package/dist/chunks/{logout-CeZ-vvDH.js → logout-D6h-V6G1.js} +1 -1
  18. package/dist/chunks/mcp-generation-contract-BXWfdrBP.js +1 -0
  19. package/dist/chunks/{mcp-generation-contract-Bh6gDna7.js → mcp-generation-contract-DJI0ybL0.js} +1 -1
  20. package/dist/chunks/{openapi-commands-DERQN9jw.js → openapi-commands-Bj9kd7Ot.js} +1 -1
  21. package/dist/chunks/openapi-commands-D2cR4Sia.js +1 -0
  22. package/dist/chunks/openapi-composites-IdxI7cAF.js +1 -0
  23. package/dist/chunks/openapi-snapshot.json +1 -1
  24. package/dist/chunks/{operations-Bc5t9zxG.js → operations-BbFwMbOk.js} +2 -2
  25. package/dist/chunks/{operations-catalog-nJlhk-sF.js → operations-catalog-BIUEtrYQ.js} +1 -1
  26. package/dist/chunks/operations-catalog-C3V8hZcS.js +1 -0
  27. package/dist/chunks/{operations-metadata-CauJAAOi.js → operations-metadata-BNjc1gvF.js} +1 -1
  28. package/dist/chunks/{output-K4fvXMJs.js → output-BC9p-2is.js} +1 -1
  29. package/dist/chunks/{output-CVKmUFCg.js → output-DMNogkJ9.js} +1 -1
  30. package/dist/chunks/{parse-error-hint-Dolrr-18.js → parse-error-hint-sXDWDgLh.js} +1 -1
  31. package/dist/chunks/{startup-auth-h5LTZHnK.js → startup-auth-5RU9GcrY.js} +1 -1
  32. package/dist/chunks/startup-auth-CY7esllD.js +1 -0
  33. package/dist/chunks/{text-response-CPmezbdP.js → text-response-BHunsqe0.js} +1 -1
  34. package/package.json +3 -3
  35. package/dist/chunks/aventure-cli-xGo1j8TD.js +0 -11
  36. package/dist/chunks/builtin-update-DEcqizpu.js +0 -3
  37. package/dist/chunks/completion-BbM2zJBc.js +0 -20
  38. package/dist/chunks/logout-Dwb_0wIa.js +0 -1
  39. package/dist/chunks/mcp-generation-contract-BDR47TM9.js +0 -1
  40. package/dist/chunks/openapi-commands-7CICQJgh.js +0 -1
  41. package/dist/chunks/openapi-composites-CO9Q6ihp.js +0 -1
  42. package/dist/chunks/operations-catalog-qNCvacp4.js +0 -1
  43. package/dist/chunks/startup-auth-TXsHk23I.js +0 -1
@@ -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-gysspwld.js";import{t as r}from"./output-K4fvXMJs.js";import{a as i,t as a}from"./output-mode-BTvVMe2M.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-nJlhk-sF.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-gysspwld.js";import{t as r}from"./output-BC9p-2is.js";import{a as i,t as a}from"./output-mode-BTvVMe2M.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-BIUEtrYQ.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
- `)}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-Bh6gDna7.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};
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-DJI0ybL0.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};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-gysspwld.js";import{s as r}from"./tool-policy-tF_fUufj.js";import{i}from"./output-spill-CyN6xeGJ.js";import"./startup-auth-TXsHk23I.js";import{i as a,r as o}from"./operations-metadata-CauJAAOi.js";import{t as s}from"./output-K4fvXMJs.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-gysspwld.js";import{s as r}from"./tool-policy-tF_fUufj.js";import{i}from"./output-spill-CyN6xeGJ.js";import"./startup-auth-CY7esllD.js";import{i as a,r as o}from"./operations-metadata-BNjc1gvF.js";import{t as s}from"./output-BC9p-2is.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(`
@@ -0,0 +1 @@
1
+ export{s as writeShowResult}from"./operations-catalog-BIUEtrYQ.js";
@@ -1,2 +1,2 @@
1
- import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-gysspwld.js";import{T as r,h as i,v as a,y as o}from"./help-catalog-Db3ruw_w.js";import{a as s,n as c}from"./help-intent-BeaPBtNB.js";function l(i,a,l=e().bin[0]){let u=i.limit===void 0?void 0:Number(i.limit);if(u!==void 0&&(i.limit?.trim()===``||!Number.isInteger(u)||u<0))return n(`Invalid --limit value: ${JSON.stringify(i.limit)} (expected a non-negative integer)`,["Pass a non-negative integer, e.g. `--limit 20`."]);let d=o(a,l),f=r(i.root??``),m=[...new Set(d.map(({cli:e})=>r(e.path.at(0)??``)))].toSorted();if(f.length>0&&!m.includes(f))return n(`Unknown --root value: ${JSON.stringify(i.root)}`,[`Pass one of: ${m.join(`, `)}.`]);let h=c(i.q??``,d.filter(e=>p(e,i)),e=>({...e,cliPath:e.cli.path,enumParameter:e.flags.map(({choices:e,location:t})=>({values:e,direct:t!==`body`})),parameterName:e.flags.flatMap(({wireName:e,optionKey:t})=>[e,t]),directParameterName:e.flags.filter(({location:e})=>e!==`body`).map(({wireName:e})=>e),parameterDescription:[e.body.description,...e.flags.map(({description:e})=>e)],responseFieldLevel:s(e.operationId)})).map(({item:e})=>e),g=h.slice(0,u);return t(`Operation catalog matches`,{operation:g,count:{totalOperations:a.length,matched:h.length,returned:g.length}})}function u(r,i,a=e().bin[0]){let s=o(i,a),c=r.operationId===void 0?d(s,r.command):s.find(e=>e.operationId===r.operationId);if(c===void 0){let e=y(r.command??``),t=s.map(e=>e.cli.command).filter(t=>t.startsWith(`${a} ${e} `));if(t.length>0)return n(`${e} is a command group; show one of its subcommands.`,[`Run \`${a} help <subcommand>\` with one of:`,...t]);let o=e.split(` `),c=new Set([...[...o.keys()].map(e=>o.slice(e+1).join(` `)),...o.slice(1).map((e,t)=>o.toSpliced(t,2,`${o[t]}-${e}`).join(` `))]),u=l({q:r.command??r.operationId},i,a),d=[...s.filter(({cli:e})=>e.path.length>1&&c.has(e.path.join(` `))).toSorted((e,t)=>t.cli.path.length-e.cli.path.length),...u.data?.operation??[]];return n(`Generated operation not found`,[...[...new Set(d.map(({cli:e,operationId:t})=>`${e.command} (operationId ${t})`))].slice(0,3).map(e=>`closest: ${e}`),`List candidates with \`${a} help catalog "<text>"\`.`])}return t(`Generated operation detail`,{operation:c,usage:h(c,s)})}function d(t,n){if(n===void 0)return;let{bin:r}=e(),i=y(n,r);return t.find(e=>y(e.cli.command,r)===i)}var f=(e,t)=>e===void 0||e===`all`||e===`any`||e===String(t);function p(e,t){return(t.root===void 0||m(e,t.root))&&f(t.scope,e.scope)&&f(t.mutates,e.mutates)&&f(t.destructive,e.destructive)&&f(t.intent,e.intent)&&f(t.method,e.method)}function m(e,t){let n=r(t);return n.length===0||r(e.cli.path.at(0)??``)===n}function h(e,t){let n=i(e);return[`cli: ${e.cli.command}`,`${e.method} ${e.path}`,`operationId: ${e.operationId}`,`resource: ${e.resource}`,`intent: ${e.intent}`,`scope: ${e.scope}`,`mutates: ${e.mutates}`,`destructive: ${e.destructive}`,`mcpTool: ${e.mcpTool??`unavailable (CLI-only operation)`}`,e.body.hasBody?`body: kind=${e.body.kind??`unknown`} required=${e.body.required} requiredPath=${e.body.requiredPath.join(`,`)}`:`body: none`,...e.successResponse===void 0?[]:[`success: ${e.successResponse}`],...[!0,!1].flatMap(t=>[`path`,`query`,`header`,`body`].map(r=>{let i=n.filter(e=>e.required===t&&e.location===r),a=v(`${t?`required`:`optional`} ${r} flags`,i);return t&&r===`body`&&e.body.kind===`json`&&i.length>0?`${a} (required unless --from-file sets JSON key(s) ${i.map(({wireName:e})=>e).join(`, `)})`:a})),...a(e,t),...g(e.header),..._(e.errorResponse),``,e.summary,e.description].filter(e=>e.length>0).join(`
1
+ import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-gysspwld.js";import{T as r,h as i,v as a,y as o}from"./help-catalog-D4POjaKy.js";import{a as s,n as c}from"./help-intent-y-RYgFLl.js";function l(i,a,l=e().bin[0]){let u=i.limit===void 0?void 0:Number(i.limit);if(u!==void 0&&(i.limit?.trim()===``||!Number.isInteger(u)||u<0))return n(`Invalid --limit value: ${JSON.stringify(i.limit)} (expected a non-negative integer)`,["Pass a non-negative integer, e.g. `--limit 20`."]);let d=o(a,l),f=r(i.root??``),m=[...new Set(d.map(({cli:e})=>r(e.path.at(0)??``)))].toSorted();if(f.length>0&&!m.includes(f))return n(`Unknown --root value: ${JSON.stringify(i.root)}`,[`Pass one of: ${m.join(`, `)}.`]);let h=c(i.q??``,d.filter(e=>p(e,i)),e=>({...e,cliPath:e.cli.path,enumParameter:e.flags.map(({choices:e,location:t})=>({values:e,direct:t!==`body`})),parameterName:e.flags.flatMap(({wireName:e,optionKey:t})=>[e,t]),directParameterName:e.flags.filter(({location:e})=>e!==`body`).map(({wireName:e})=>e),parameterDescription:[e.body.description,...e.flags.map(({description:e})=>e)],responseFieldLevel:s(e.operationId)})).map(({item:e})=>e),g=h.slice(0,u);return t(`Operation catalog matches`,{operation:g,count:{totalOperations:a.length,matched:h.length,returned:g.length}})}function u(r,i,a=e().bin[0]){let s=o(i,a),c=r.operationId===void 0?d(s,r.command):s.find(e=>e.operationId===r.operationId);if(c===void 0){let e=y(r.command??``),t=s.map(e=>e.cli.command).filter(t=>t.startsWith(`${a} ${e} `));if(t.length>0)return n(`${e} is a command group; show one of its subcommands.`,[`Run \`${a} help <subcommand>\` with one of:`,...t]);let o=e.split(` `),c=new Set([...[...o.keys()].map(e=>o.slice(e+1).join(` `)),...o.slice(1).map((e,t)=>o.toSpliced(t,2,`${o[t]}-${e}`).join(` `))]),u=l({q:r.command??r.operationId},i,a),d=[...s.filter(({cli:e})=>e.path.length>1&&c.has(e.path.join(` `))).toSorted((e,t)=>t.cli.path.length-e.cli.path.length),...u.data?.operation??[]];return n(`Generated operation not found`,[...[...new Set(d.map(({cli:e,operationId:t})=>`${e.command} (operationId ${t})`))].slice(0,3).map(e=>`closest: ${e}`),`List candidates with \`${a} help catalog "<text>"\`.`])}return t(`Generated operation detail`,{operation:c,usage:h(c,s)})}function d(t,n){if(n===void 0)return;let{bin:r}=e(),i=y(n,r);return t.find(e=>y(e.cli.command,r)===i)}var f=(e,t)=>e===void 0||e===`all`||e===`any`||e===String(t);function p(e,t){return(t.root===void 0||m(e,t.root))&&f(t.scope,e.scope)&&f(t.mutates,e.mutates)&&f(t.destructive,e.destructive)&&f(t.intent,e.intent)&&f(t.method,e.method)}function m(e,t){let n=r(t);return n.length===0||r(e.cli.path.at(0)??``)===n}function h(e,t){let n=i(e);return[`cli: ${e.cli.command}`,`${e.method} ${e.path}`,`operationId: ${e.operationId}`,`resource: ${e.resource}`,`intent: ${e.intent}`,`scope: ${e.scope}`,`mutates: ${e.mutates}`,`destructive: ${e.destructive}`,`mcpTool: ${e.mcpTool??`unavailable (CLI-only operation)`}`,e.body.hasBody?`body: kind=${e.body.kind??`unknown`} required=${e.body.required} requiredPath=${e.body.requiredPath.join(`,`)}`:`body: none`,...e.successResponse===void 0?[]:[`success: ${e.successResponse}`],...[!0,!1].flatMap(t=>[`path`,`query`,`header`,`body`].map(r=>{let i=n.filter(e=>e.required===t&&e.location===r),a=v(`${t?`required`:`optional`} ${r} flags`,i);return t&&r===`body`&&e.body.kind===`json`&&i.length>0?`${a} (required unless --from-file sets JSON key(s) ${i.map(({wireName:e})=>e).join(`, `)})`:a})),...a(e,t),...g(e.header),..._(e.errorResponse),``,e.summary,e.description].filter(e=>e.length>0).join(`
2
2
  `)}function g(e=[]){return e.length===0?[]:[`Response headers:`,...e.map(({name:e,type:t,format:n,required:r,description:i})=>` ${e} (${n===void 0?t:`${t}/${n}`}, ${r?`required`:`optional`})${i.length===0?``:` ${i}`}`)]}function _(e){return e.length===0?[]:[`Errors:`,...e.map(({status:e,description:t})=>` ${e} ${t}`)]}function v(e,t){return`${e}: ${t.length===0?`none`:t.map(e=>e.name).join(` `)}`}function y(t,n=e().bin){let[r=``,...i]=t.trim().split(/\s+/u);return(n.includes(r)?i:[r,...i]).join(` `)}export{u as i,g as n,l as r,_ as t};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./package-DEeHDoOT.js";import{n as t,r as n}from"./result-envelope-gysspwld.js";import{o as r}from"./logging-DjleD1u2.js";import{i,n as a,r as o,t as s}from"./output-spill-CyN6xeGJ.js";import{n as c}from"./human-text-cap-dR2SJQJC.js";import{t as l}from"./openapi-commands-7CICQJgh.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./text-response-CPmezbdP.js";import{resolve as g}from"node:path";import{tmpdir as _}from"node:os";import{randomUUID as v}from"node:crypto";function y(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:u(o,l),d=`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:d,warnings:[...e.warnings,d],ids:a===void 0?e.ids:[...new Set([...e.ids,a])],references:o===void 0?e.references:[...new Set([...e.references,o])]}}function b(e){let t=w(e);return A(t),process.stdout.write(`${JSON.stringify(t)}\n`),t}function x(e){let t,n=w(e,{foldRows:!1,humanText:!0,onSpill:e=>{t=m(e)}});A(n);let r=h(l,n.data,n.summary,{trailer:S(n),exactRecovery:t}),i=[];if(n.ok&&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-gysspwld.js";import{o as r}from"./logging-DjleD1u2.js";import{i,n as a,r as o,t as s}from"./output-spill-CyN6xeGJ.js";import{n as c}from"./human-text-cap-dR2SJQJC.js";import{t as l}from"./openapi-commands-D2cR4Sia.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./text-response-BHunsqe0.js";import{resolve as g}from"node:path";import{tmpdir as _}from"node:os";import{randomUUID as v}from"node:crypto";function y(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:u(o,l),d=`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:d,warnings:[...e.warnings,d],ids:a===void 0?e.ids:[...new Set([...e.ids,a])],references:o===void 0?e.references:[...new Set([...e.references,o])]}}function b(e){let t=w(e);return A(t),process.stdout.write(`${JSON.stringify(t)}\n`),t}function x(e){let t,n=w(e,{foldRows:!1,humanText:!0,onSpill:e=>{t=m(e)}});A(n);let r=h(l,n.data,n.summary,{trailer:S(n),exactRecovery:t}),i=[];if(n.ok&&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(...E(n.problem)),i.push(...S(n)),process.stdout.write(c(i.join(`
3
3
  `),{appendNewline:!0})),n}function S(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 C(e,t){if(e.mode===`csv`||e.mode===`xlsx`){if(!t.ok){C({mode:`json`},t);return}if(e.mode===`xlsx`&&!(t.data instanceof Uint8Array)){C({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?(A(t),process.stdout.write(r)):C({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`?w(s,{allowSpill:r===void 0}):s;A(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`?b(s):x(s)).ok||(process.exitCode=1)}function w(e,n={}){let r={...d(e,l),...n},a=t(e,r),o=!1;if(n.humanText===!0&&e.ok&&h(l,a.data,a.summary,{trailer:S(a),onOmission:()=>{o=!0}}),n.allowSpill===!1||!e.ok||r.write===!0&&n.humanText===!0||!o&&(a===e||a.truncated!==!0))return a;let c=process.env.AVENTURE_HARNESS_RUN_DATA_ROOT,u=g(c?g(c,`scratchpad`):_(),`aventure-output-${v()}.json`);s(u);let f,p=i(e,e=>{f=e});return p.ok?(n.onSpill?.(u),t(e,{...r,exactRecovery:m(u),spill:f})):p}function T(e,t){if(typeof t==`object`&&t&&`httpStatus`in t&&t.httpStatus===202)return;let n=f(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 E(e){let t=[];typeof e.code==`string`&&t.push(` code: ${e.code}`),typeof e.detail==`string`&&t.push(` detail: ${e.detail}`),typeof e.hint==`string`&&t.push(` hint: ${e.hint}`),typeof e.suggestion==`string`&&t.push(` suggestion: ${e.suggestion}`);let n=Object.entries(e.suggestions??{});if(n.length>0){let e=n.map(([e,t])=>`${e}=${t}`).join(`; `);t.push(` suggestions: ${e}`)}return typeof e.requiredRole==`string`&&t.push(` requiredRole: ${e.requiredRole}`),t.push(...D(e),...O(`unknownParameters`,e.unknownParameters),...O(`validParameters`,e.validParameters),...k(e.resolution)),t}function D(e){let t=[];return typeof e.limitType==`string`&&t.push(`limitType=${e.limitType}`),typeof e.used==`number`&&t.push(`used=${e.used}`),typeof e.limit==`number`&&t.push(`limit=${e.limit}`),typeof e.remaining==`number`&&t.push(`remaining=${e.remaining}`),typeof e.resetAt==`string`&&t.push(`resetAt=${e.resetAt}`),typeof e.windowSeconds==`number`&&t.push(`windowSeconds=${e.windowSeconds}`),typeof e.retryAfterSeconds==`number`&&t.push(`retryAfterSeconds=${e.retryAfterSeconds}`),t.length>0?[` meter: ${t.join(` `)}`]:[]}function O(e,t){return t!=null&&t.length>0?[` ${e}: ${t.join(`, `)}`]:[]}function k(e){if(e==null)return[];let t=[`action=${e.action}`];return typeof e.parameter==`string`&&t.push(`parameter=${e.parameter}`),typeof e.fieldPath==`string`&&t.push(`fieldPath=${e.fieldPath}`),typeof e.endpoint==`string`&&t.push(`endpoint=${e.endpoint}`),e.acceptedValue!==null&&e.acceptedValue!==void 0&&e.acceptedValue.length>0&&t.push(`acceptedValue=${e.acceptedValue.join(`, `)}`),typeof e.retryable==`boolean`&&t.push(`retryable=${e.retryable}`),[` resolution: ${t.join(` `)}`]}function A(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{y as a,T as i,x as n,b as r,C as t};
@@ -1 +1 @@
1
- export{t as emit,r as emitJson,i as emitSearchExplanation,a as pendingResult}from"./output-K4fvXMJs.js";
1
+ export{t as emit,r as emitJson,i as emitSearchExplanation,a as pendingResult}from"./output-BC9p-2is.js";
@@ -1,4 +1,4 @@
1
- import{u as e}from"./tool-policy-tF_fUufj.js";import{c as t,s as n}from"./startup-auth-TXsHk23I.js";import{t as r}from"./openapi-commands-7CICQJgh.js";import{_ as i,g as a}from"./help-catalog-Db3ruw_w.js";import{r as o}from"./operations-metadata-CauJAAOi.js";import{n as s}from"./operations-catalog-nJlhk-sF.js";import{a as c,t as l}from"./payload-operand-guard-CMRWjXtt.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(t,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,i=[]){let a=c(e),o=n(r).map(e=>e.cliPath).filter(e=>e[0]!==a[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,i)}`}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(r.toReversed().map(e=>[e.cliPath.join(` `),e])),M=e=>j.get(e.join(` `));function N(e){let t=c(e).join(` `),i=n(r),o=i.find(e=>e.cliPath.join(` `)===t);return o===void 0?[]:a(o.operationId,i,_(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,i=[];for(let a of r){let r=C(t,a.cliPath);if(r===void 0)continue;let o=r.options.map(d);if(e(a.intent))i.push(o);else for(let e of o)n.add(e)}let[a=[],...o]=i;return new Set(a.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,i=!0){let a=_(e),l=a.commands.find(e=>e.name()===`help`),u=l?.commands.find(e=>e.name()===`catalog`);if(l===void 0||u===void 0)return;let f=[a.name(),l.name(),u.name(),t],p=c(e).at(0),m=u.options.find(e=>d(e)===`--root`),h=i&&m!==void 0&&S(p)?p:void 0;m!==void 0&&h!==void 0&&f.push(d(m),h);let g=n(r),v=o({q:t,root:h,limit:`3`},g,a.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-tF_fUufj.js";import{c as t,s as n}from"./startup-auth-CY7esllD.js";import{t as r}from"./openapi-commands-D2cR4Sia.js";import{_ as i,g as a}from"./help-catalog-D4POjaKy.js";import{r as o}from"./operations-metadata-BNjc1gvF.js";import{n as s}from"./operations-catalog-BIUEtrYQ.js";import{a as c,t as l}from"./payload-operand-guard-CMRWjXtt.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(t,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,i=[]){let a=c(e),o=n(r).map(e=>e.cliPath).filter(e=>e[0]!==a[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,i)}`}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(r.toReversed().map(e=>[e.cliPath.join(` `),e])),M=e=>j.get(e.join(` `));function N(e){let t=c(e).join(` `),i=n(r),o=i.find(e=>e.cliPath.join(` `)===t);return o===void 0?[]:a(o.operationId,i,_(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,i=[];for(let a of r){let r=C(t,a.cliPath);if(r===void 0)continue;let o=r.options.map(d);if(e(a.intent))i.push(o);else for(let e of o)n.add(e)}let[a=[],...o]=i;return new Set(a.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,i=!0){let a=_(e),l=a.commands.find(e=>e.name()===`help`),u=l?.commands.find(e=>e.name()===`catalog`);if(l===void 0||u===void 0)return;let f=[a.name(),l.name(),u.name(),t],p=c(e).at(0),m=u.options.find(e=>d(e)===`--root`),h=i&&m!==void 0&&S(p)?p:void 0;m!==void 0&&h!==void 0&&f.push(d(m),h);let g=n(r),v=o({q:t,root:h,limit:`3`},g,a.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,t=``){if(e.commands.length>0&&!A(c(e)))return;let a=e.options.flatMap(e=>e.hidden?[]:[d(e)]),o=n(r),s=i(t,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: ${a.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(`
@@ -1 +1 @@
1
- export{n as commandAuthMaterializationMode,r as materializeCommandCredential}from"./startup-auth-TXsHk23I.js";
1
+ export{n as commandAuthMaterializationMode,r as materializeCommandCredential}from"./startup-auth-CY7esllD.js";
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./commander-DEj7N1b9.js";import{c as r,f as i,t as a}from"./env-mczLNx0e.js";import{c as o,r as s}from"./result-envelope-gysspwld.js";import{y as c}from"./tool-policy-tF_fUufj.js";import{n as l}from"./cli-help-policy-DpJK4TlK.js";function u(e,t){return e.parameters.filter(e=>e.required&&t[e.optionKey]===void 0).map(e=>e.flag)}function d(e,t){return(e.requestBody?.length??0)>1&&typeof t.contentType==`string`?t.contentType:void 0}var f=e=>typeof e==`string`&&e.trim()===``;function p(e,t){let n=new Set([...t.parameters,...(t.requestBody??[]).flatMap(({parameter:e})=>e)].filter(e=>e.required).map(e=>e.optionKey));for(let t of e.options){let r=t.attributeName(),i=e.getOptionValue(r);if(!(Array.isArray(i)?i.some(f):f(i)))continue;let a=Array.isArray(i)?i.filter(e=>!f(e)):[];a.length>0?e.setOptionValue(r,a):(n.has(r)&&e.error(`error: option '${t.flags}' requires a value`),e.setOptionValue(r,void 0))}}function m(e){return e.split(` `)[0]??e}function h(e){if(e.requestBody===void 0||e.requestBody.length===0){let[t,n]=e.parameters.filter(e=>e.required);return n===void 0&&t?.schemaType===`string`?t:void 0}if(e.requestBody.length!==1||e.parameters.some(e=>e.required))return;let t=e.requestBody[0]?.parameter??[],n=t.filter(e=>e.required);if(n.length===1&&n[0]?.schemaType===`string`)return n[0];if(n.length!==0||e.intent!==`search`)return;let r=t.filter(e=>{let t=e.name.split(`.`).at(-1);return e.schemaType===`string`&&(t===`query`||t===`search`)});return r.length===1?r[0]:void 0}function g(e,t,n){let r=t.join(` `).trim();return r.length===0?o(`No positional text`,n):n[e.optionKey]===void 0?o(`Positional text parsed`,{...n,[e.optionKey]:r}):s(`Unexpected argument "${r}": ${m(e.flag)} already sets this value, and this command has no subcommand by that name. Drop "${r}".`)}var _={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`},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 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:`Classification tags on a company, and suggested tags`},"entities classifications catalog":{summary:`Get the Company Classification Taxonomy`},"entities classifications suggestions":{summary:`Suggest Classifications for a Company`},"entities classifications tags":{summary:`List Classification Tags`},"entities 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 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 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 you file for a company, Product, Service, or person, 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 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 `Prefer: respond-async` search accepted"}};function v(e){return x(e,y())}function y(){return!!i().userBearerToken?.trim()}function b(e){return y()||!l(e,_)}function x(e,t){return t?e:e.filter(e=>!l(e.cliPath[0],_)||e.visibility!==`private`).map(S)}function S(e){let t=e.parameters.filter(C),n=e.requestBody?.map(e=>{let t=e.parameter.filter(C);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 C=e=>e.visibility!==`private`;async function w(e){if(e===`none`||process.env[a.authToken]?.trim())return;let{materializeCliOAuthBearerCredential:t,materializeSavedCliOAuthBearerCredential:n}=await import(`./oauth-bearer-credential-DWt52dzz.js`),{materializeCliApiKeyBearerCredential:r}=await import(`./api-key-bearer-credential-CZJ90toU.js`);await(e===`stored`?n():t()),await r()}function T(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 E(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=>O(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 D(r,i){let a=r.indexOf(`--`),o=r.slice(0,a===-1?r.length:a);if(T(r))return`none`;let s=E(r,i),u=new n().exitOverride().configureOutput({writeErr:()=>void 0}).addOption(new e(`--content-type <media-type>`)),f=u.parseOptions([...s.commandArgv]).operands;s.environment!==void 0&&(process.env.API_ENV=s.environment);let p=i.find(e=>O(f,e.cliPath)),m=p===void 0?void 0:d(p,u.opts());if(p!==void 0&&m!==void 0){let e=c(p.requestBody??[],m);if(!e.ok)throw new t(e.summary)}let h=f.at(0);return h===void 0?`stored`:h===`update`||h===`auth`&&p===void 0?`none`:o.some(e=>e===`--help`||e===`-h`)?(p??(h===`help`?i.find(e=>O(f.slice(1),e.cliPath)):void 0))!==void 0||l(h,_)?`stored`:`none`:l(h,_)?`required`:h===`help`&&f[1]===`catalog`?`optional`:h===`help`?p===void 0?`stored`:`required`:h===`agents`&&f[1]===`setup`?`required`:[`command-catalog`,`completion`].includes(h)?`optional`:h===`batch`?`required`:p===void 0?`optional`:`required`}function O(e,t){return t.every((t,n)=>e[n]===t)}export{T as a,_ as c,u as d,p as f,E as i,d as l,g as m,D as n,x as o,h as p,w as r,v as s,b as t,m as u};
@@ -1,4 +1,4 @@
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 ee,n as te,o as ne,p as re,r as ie,s as ae,t as oe,u as se}from"./detail-BjWGmB2_.js";import{t as ce}from"./person-owner-BW4xz8uH.js";import{r as le}from"./run-BaWFP48s.js";import{n as _}from"./allowance-type-BVr12WiL.js";import{t as ue}from"./confidence-CjeYTBnf.js";import{p as de}from"./result-envelope-gysspwld.js";import{a as fe,s as pe}from"./tool-policy-tF_fUufj.js";import{a as v,c as me,i as he,l as ge,n as y,r as b,s as x,t as _e}from"./text-field-jFKOGMzr.js";import{a as ve,n as ye,o as be,r as xe,s as S,t as Se}from"./human-text-cap-dR2SJQJC.js";import{a as Ce,b as we,d as C,f as Te,o as Ee,p as De,u as Oe}from"./help-catalog-Db3ruw_w.js";import{Buffer as ke}from"node:buffer";function Ae(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,w(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(w).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 w(e){return e===null?``:typeof e==`string`?e:JSON.stringify(e)}function T(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
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 ee,n as te,o as ne,p as re,r as ie,s as ae,t as oe,u as se}from"./detail-BjWGmB2_.js";import{t as ce}from"./person-owner-BW4xz8uH.js";import{r as le}from"./run-BaWFP48s.js";import{n as _}from"./allowance-type-BVr12WiL.js";import{t as ue}from"./confidence-CjeYTBnf.js";import{p as de}from"./result-envelope-gysspwld.js";import{a as fe,s as pe}from"./tool-policy-tF_fUufj.js";import{a as v,c as me,i as he,l as ge,n as y,r as b,s as x,t as _e}from"./text-field-jFKOGMzr.js";import{a as ve,n as ye,o as be,r as xe,s as S,t as Se}from"./human-text-cap-dR2SJQJC.js";import{a as Ce,b as we,d as C,f as Te,o as Ee,p as De,u as Oe}from"./help-catalog-D4POjaKy.js";import{Buffer as ke}from"node:buffer";function Ae(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,w(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(w).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 w(e){return e===null?``:typeof e==`string`?e:JSON.stringify(e)}function T(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
2
  `}function je(e){let{column:t,record:n}=Ae(e);return t.length===0?``:T(t)+n.map(e=>T(t.map(t=>e.get(t)??``))).join(``)}function Me(t){let n=de.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 je(n.data)}var E=`aventure`;function D(e,t,n=`cli`){let r=t.find(t=>t.operationId===e);if(n===`mcp`&&r?.tool!==void 0){let e=Ee(r);return`${e.tool} ${JSON.stringify(e.arguments)}`}let i=r?.cliPath;return i===void 0?void 0:`${E} ${i.join(` `)}`}function O(e,t,n=e,r=`cli`){return r===`mcp`?D(e,t,r)??e:we(e,t,`aventure`)??n}function Ne(e,t,n=`cli`){let r=Oe.safeParse(e);if(!r.success)return null;let{answer:i,citation:a,confidence:o,resolution:s}=r.data;if(s!=null)return Pe(i,s,t,n);let c=i.trimEnd().split(`
3
3
  `),l=new Set(a.flatMap(({sourceType:e,sourceId:r})=>{if(e!==De.options[0].enum.OPERATION)return[];let i=D(r,t,n);return i===void 0?[]:[i]}));return l.size>0&&c.push(``,n===`mcp`?`MCP calls:`:`Commands:`,...[...l].map(e=>` ${e}`)),c.push(``,`Confidence: ${o}`),a.length===0||(c.push(`Sources (${a.length}):`),c.push(...a.map(({excerpt:e,sourceId:t})=>{let n=e.trim();return n.length>0?` - ${t}: ${n}`:` - ${t}`}))),c}function Pe(e,t,n,r){let{outcome:i,operationId:a,probability:o,candidate:s,taskKey:c,taskPlan:l}=t,u=[l==null?e.trimEnd():k(l)],d=[``,`Outcome: ${i}${o==null?``:` (probability ${o.toFixed(2)})`}`];switch(i){case C.enum.TASK_PLAN:return[...u,...l==null?[]:A(l,n,r),...d];case C.enum.OPERATION_ADVICE:{let e=s.filter(({sourceId:e})=>e!==a);return[...u,...a==null?[]:[``,r===`mcp`?`MCP call:`:`Command:`,` ${O(a,n,a,r)}`],...d,...e.length===0?[]:[`Alternatives: ${e.map(({sourceId:e})=>e).join(`, `)}`]]}case C.enum.CLARIFY:return[...u,...c==null?[]:[``,`Leading catalog task: ${c}`],...j(`Candidates:`,s,n,r),...d];case C.enum.ABSTAIN:return[...u,...j(`Nearest operations:`,s,n,r),...d];default:throw Error(`Unhandled help resolution outcome ${String(i)}`)}}function Fe(e,t,n=`cli`){let r=Te.safeParse(e);return r.success?[k(r.data),...A(r.data,t,n)]:null}var k=({taskKey:e,catalogRevision:t})=>e===void 0?`Run these steps in order.`:`Run catalog task ${e}${t===void 0?``:` (catalog revision ${t})`}.`;function A(e,t,n){return[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n,required:r})=>` ${e} (${t}, ${r===!1?`optional`:`required`}): ${n}`)],...e.step.length===0?[``,`This catalog task has no planned steps yet.`]:[``,`Steps:`,...e.step.flatMap(({step:r,cliCommand:i,writeGuidance:a},o)=>[` ${o+1}. ${r.stepKey===void 0?``:`${r.stepKey}: `}${O(r.operationId,t,i,n)}`,` ${r.instruction}`,...Ie(e,o,a)])],...e.gateId?.length?[``,`Completion gates: ${e.gateId.join(`, `)}`]:[]]}function Ie(e,t,n){if(n==null)return[];let r=JSON.stringify(n),i=e.step.findIndex(({writeGuidance:e})=>JSON.stringify(e)===r);return i===t?[` Write guidance:`,` - Expectation: ${n.expectation}`,` - Body: ${n.body}`,` - Read first: ${n.typeCatalog}`,` - Rejected when:`,...n.reject.map(e=>` - ${e}`),` - Override: ${n.override}`,` - Method: ${n.method.join(`; `)}`]:[` Write guidance: as step ${i+1}.`]}function j(e,t,n,r){if(t.length===0)return[];let i=t.map(({sourceId:e,excerpt:t})=>({command:D(e,n,r)??e,excerpt:t})),a=Math.max(...i.map(({command:e})=>e.length));return[``,e,...i.map(({command:e,excerpt:t})=>` ${e.padEnd(a)} # ${t}`)]}var M=/\{([^}]+)\}/gu,Le=/(?:^r|R)evision$/u;function Re(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&&fe(a.intent),s=[...o&&e.endpoint!==void 0?P(e.endpoint.split(`?`)[0]??``,r,!1,n,Ve(e.data)).map(e=>n===`mcp`?e:`${e} --data --to-file <path>`):[],...e.references.filter(e=>!i(e)).flatMap(N).flatMap(e=>P(e.pathname,r,!0,n)),...e.references.filter(i).flatMap(N).flatMap(e=>Ue(e,r,n))],c=n===`mcp`?ze:void 0;return s.length===0?{write:o,narrowerRead:c}:{exactRecovery:`Read the full result ${s.join(`; `)}.`,write:o,narrowerRead:c}}var ze=`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 Be(e){return`Inline output is truncated; full payload written to ${e}; read it with your file tool.`}function Ve(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)&&Le.test(e)?[[e,String(t)]]:[])):new Map}function He(e,t){let n=t.filter(e=>e.method===`GET`);return P(new URL(e,`https://status.invalid`).pathname,n,!0,`cli`)[0]}function N(e){return URL.canParse(e)?[new URL(e)]:[]}function P(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(M)].map(([,e])=>e),o=RegExp(`^${t.path.replace(M,`([^/]+)`)}$`,`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[F(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?[]:[L(r),s[n+1]??``]}),u=c.flatMap(({parameter:e,pin:t})=>[L(e),t]);return[`${I(t)}, ${We(t,[...l,...u])}`]})}function Ue(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: ${F(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?[]:[L(t),Ge(n)]}),s=[L(i),`<n>`,L(a),`<n>`];return[`${I(t)}, in windows: ${We(t,[...o,...s])}, advancing ${L(i)} until a window returns fewer than ${L(a)} units`]})}function F(e,t){return`${pe(e)} ${JSON.stringify({operationId:e.operationId,...t})}`}function I(e){return e.auth===`write`?`with admin sign-in`:`with any sign-in`}function We(e,t){return[E,...e.cliPath,...t].join(` `)}function L(e){return e.flag.split(/\s+/u)[0]??e.flag}function Ge(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}var Ke=i({detail:r(),field:r().nullish(),scope:c([`entity`,`person`,`news`])}),qe=c([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),Je=Object.assign(t([qe,r()]),{enum:qe.enum}),R=i({modeRequested:Je,modeUsed:Je}),Ye=i({answerUnavailable:a(),entity:R,incompleteScope:u(c([`entity`,`person`,`news`])).optional(),news:R,person:R,rejection:u(Ke),unavailable:u(c([`entity`,`person`,`news`]))}),Xe=i({enrichmentRunId:n().nullish(),entityId:n()}),Ze=c([`numeric`,`overlap`,`containment`]),Qe=Object.assign(t([Ze,r()]),{enum:Ze.enum}),$e=i({matchMode:Qe.nullish(),max:o().nullish(),min:o().nullish()}),et=i({sortPriority:c([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),tt=i({max:l({offset:!0}).nullish(),min:l({offset:!0}).nullish()}),z=i({max:s().nullish(),min:s().nullish()}),B=i({max:o().nullish(),min:o().nullish()}),nt=i({averageAmountInvestedUsdRange:u(z).optional(),largestAmountInvestedUsdRange:u(z).optional(),smallestAmountInvestedUsdRange:u(z).optional(),totalAmountInvestedUsdRange:u(z).optional(),totalInvestmentRange:u(B).optional()}),rt=c([`any`,`every`]),it=i({amountInvestedRange:u(z).optional(),amountRaisedRange:u(z).optional(),dateAnnouncedRange:tt.nullish(),dateFundingCompleteRange:tt.nullish(),investedAmountRaisedRange:u(z).optional(),investedCompanyName:u(r()).optional(),investedCountry:u(r()).optional(),investedIndustry:u(r()).optional(),investedRound:u(r()).optional(),investorActivity:nt.optional(),investorEntityId:u(n()).optional(),investorName:u(r()).optional(),investorNameMatch:rt.nullish(),lastRoundYearRange:u(B).optional(),rankByInvestmentActivity:a().nullish(),round:u(r()).optional(),totalRaisedRange:u(z).optional(),valuationRange:u(z).optional()}),at=c([`NONE`,`COMPANY_LISTING_READY`]),ot=c([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),st=i({identifier:r().max(255).nullish(),idType:r()}),ct=i({category:r(),code:o().nullish(),codeText:r().max(255).nullish(),edition:r().max(128).nullish(),hasEdition:a().nullish()}),lt=c([`hostPath`,`domain`]),ut=d({acceleratorBrand:u(r()).optional(),acceleratorCohort:u(r()).optional(),acceleratorName:u(r()).optional(),acceleratorStatus:u(r()).optional(),affinity:u(r()).optional(),closedLast:a().optional(),employeeCountRange:u($e).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:it.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:et.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(ot).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:at.optional(),rankByProminence:a().nullish(),semanticQuery:r().nullish(),slug:u(r().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:u(r()).optional(),standardizedClassification:u(ct).max(20).optional(),suppressLateStage:a().nullish(),suppressNonOperating:a().nullish(),suppressZeroTotalRaised:a().nullish(),tag:u(r()).optional(),textSearch:r().nullish(),typeCustomer:u(r()).optional(),typeModel:u(r()).optional(),typeOwnership:u(r()).optional(),typeRecord:u(_).optional(),typeRevenue:u(r()).optional(),typeTechnologyUsed:u(r()).optional(),uniqueId:u(st).max(20).optional(),url:r().nullish(),urlDomain:r().nullish(),urlMatchMode:lt.nullish(),urlType:re.nullish(),yearFoundedRange:u(B).optional()}),dt=d({acceleratorBrand:u(r()).optional(),acceleratorCohort:u(r()).optional(),acceleratorName:u(r()).optional(),acceleratorStatus:u(r()).optional(),affinity:u(r()).optional(),closedLast:a().optional(),employeeCountRange:u($e).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:it.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:et.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(ot).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:at.optional(),rankByProminence:a().nullish(),slug:u(r().regex(/^[a-z0-9_-]+$/).max(255)).optional(),stage:u(r()).optional(),standardizedClassification:u(ct).max(20).optional(),suppressLateStage:a().nullish(),suppressNonOperating:a().nullish(),suppressZeroTotalRaised:a().nullish(),tag:u(r()).optional(),textSearch:r().nullish(),typeCustomer:u(r()).optional(),typeModel:u(r()).optional(),typeOwnership:u(r()).optional(),typeRecord:u(_).optional(),typeRevenue:u(r()).optional(),typeTechnologyUsed:u(r()).optional(),uniqueId:u(st).max(20).optional(),url:r().nullish(),urlDomain:r().nullish(),urlMatchMode:lt.nullish(),urlType:re.nullish(),yearFoundedRange:u(B).optional()}),ft=i({entityFilter:dt.nullish(),isCurrent:a().nullish(),personTitle:u(r()).optional()}),pt=c([`CURRENT`,`PAST`,`ANY`]),mt=i({amountInvestedRange:u(z).nullish(),amountRaisedRange:u(z).nullish(),entityName:u(r()).nullish(),investedCompany:u(r()).nullish(),personTitle:u(r()).nullish(),round:u(r()).nullish(),totalInvestmentCount:u(B).nullish(),typeRecord:u(_).nullish()}),ht=i({additionalAssociation:ft.nullish(),arrayFilter:mt.optional(),entityFilter:dt.optional(),entityId:n().nullish(),entitySlug:r().nullish(),firstName:r().nullish(),includeAddress:a().nullish(),includeUrl:a().nullish(),investorActivity:nt.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:pt.nullish()}),gt=c([`discovery`,`profile`,`peer`,`comparison`]),_t=c([`keyword`,`semantic`]),vt=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`]),yt=Object.assign(t([vt,r()]),{enum:vt.enum}),bt=i({descending:a(),field:yt,sortKey:r().nullish()}),xt=i({order:u(bt),relevance:_t.nullish()}),St=i({confidence:ue,execution:R,fallbackUsed:a(),filter:ut,intent:gt,interpretation:r(),personAssociation:ht.nullish(),sort:xt,subjectEntityName:u(r()),unsupported:r().nullish()}),V=i({changedAt:l({offset:!0}).nullish(),dataSourceUpdatedAt:l({offset:!0}).nullish(),pendingApproval:o().nullish(),sourceId:r().nullish(),status:r().nullish()}),Ct=i({fundManagerRelationshipSource:V.nullish(),fundraiseTransaction:h,fundraiseTransactionSource:V.nullish(),investorJoinSource:V.nullish()}),wt=i({evidence:Ct,investor:ce,semanticMatch:se.nullish()}),Tt=i({entityId:n(),matchedOffering:le.nullish(),probability:s(),webUrl:u(r())}),Et=i({entityId:n(),label:r(),publishedAt:l({offset:!0}).nullish(),score:s(),source:ie,sourceId:r(),text:r(),url:r().nullish()}),Dt=i({answer:te.nullish(),filing:u(Xe).nullish(),hiddenNonOperatingCount:s().int().nullish(),interpretation:St,investment:u(wt),judgment:u(Tt),passage:u(Et),peer:u(p),pendingWebQuery:u(r()),personLead:a(),result:f,searchRequestId:n().nullish(),subject:u(ee)}),Ot=i({entity:u(m),newsId:o()}),kt=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()}),At=i({order:u(kt),relevance:_t.nullish()}),jt=i({confidence:ue,employerSemanticQuery:r().nullish(),execution:R,fallbackUsed:a(),filter:ht,interpretation:r(),sort:At,unsupported:r().nullish()}),Mt=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)}),Nt=i({interpretation:jt,investment:u(wt),personLead:a(),profile:u(Mt),result:ae,searchRequestId:n().nullish()}),Pt=i({label:r(),query:r()}),Ft=i({key:r(),option:u(Pt),prompt:r()}),It=i({entity:Dt,entityDetail:u(oe),news:ne,newsEntityMention:u(Ot),person:Nt,personDetail:u(g),personLead:a(),provenance:Ye,qualifier:Ft.nullish(),section:u(c([`person`,`company`,`productService`,`investor`])).optional()}),H=30,Lt=8,U=10,Rt=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`],Bt=new Set([`page`,`size`,`sort`,`cursor`,`mode`,`projection`]);function Vt(e,t,n,{trailer:r=[],...i}={}){let a=i.transport??`cli`;if(typeof t==`string`)return be(t,i,r);let o=Ce(t,r,a);if(o!==null)return xe(o,r,i);let s=Zt(t);if(s===null)return null;let c=e.find(({operationId:e})=>e===s.operationId),l=ge(c?.detailField,s.response),u=[...l.hiddenNote,...r],d=(e,t)=>ye([e.trimEnd(),...t].join(`
4
4
  `),{appendNewline:!0,preservedTrailerLines:t.length>0?t.length:void 0,...i}),f=c?.parameters??[],p={...s,response:l.response,parameters:f,transport:a},m=Ne(p.response,e,a)??Fe(p.response,e,a);if(m!==null)return d(m.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aventurevc/aventure-cli",
3
- "version": "0.8.375",
3
+ "version": "0.8.377",
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": "23e3f70022319b915a277392ba8e225d416f13f4",
36
+ "commit": "8a6186f73f465049d3cd8892b9a453acf9018da5",
37
37
  "openapiPath": "openapi/openapi.json",
38
- "openapiSha256": "4dca3c48226b55509b13aa9efc4acb3439b02d514b883c0f3a71a2d8526fc9ef"
38
+ "openapiSha256": "fa05ba23b01c19ea00e54f60f7a2957f6488b6bb5af69ae97a768f6dc83778cc"
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{a as o,c as s,r as c}from"./env-mczLNx0e.js";import{c as l,p as u,r as d}from"./result-envelope-gysspwld.js";import{L as f,R as p,o as m,t as h,u as g,y as _}from"./tool-policy-tF_fUufj.js";import{i as v}from"./logging-DjleD1u2.js";import{r as y,t as ee}from"./cli-help-policy-DpJK4TlK.js";import{a as b,c as x,d as te,f as ne,i as S,l as C,m as re,n as ie,p as ae,r as oe,s as se,t as ce,u as le}from"./startup-auth-TXsHk23I.js";import{t as w}from"./openapi-commands-7CICQJgh.js";import{g as ue,m as de}from"./help-catalog-Db3ruw_w.js";import{n as fe,t as pe}from"./operations-metadata-CauJAAOi.js";import{a as T,i as me,t as E}from"./output-mode-BTvVMe2M.js";import{S as he,_ as D,a as ge,b as O,c as _e,d as ve,f as ye,g as be,h as xe,i as Se,l as k,m as A,n as j,o as Ce,p as we,r as Te,s as Ee,t as De,u as Oe,v as M,x as ke,y as N}from"./generated-option-order-CUW9Kkar.js";import{n as Ae,t as je}from"./deprecated-command-bF9Q8_F6.js";import{a as Me,i as Ne,n as Pe,r as Fe}from"./payload-operand-guard-CMRWjXtt.js";import{fileURLToPath as Ie}from"node:url";import{readFile as Le}from"node:fs/promises";async function Re(e){let t;try{t=e===`-`?await ze():await Le(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 ze(){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 Be(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(He(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>`,ge(r,r.requiredPath)).argParser(F(`--from-file`)))}let o=Ce(a).filter(e=>i(I(e.variant[0].parameter)));for(let n of o.toSorted((e,t)=>j(e.variant[0].parameter,t.variant[0].parameter))){let{descriptor:r,parameter:i}=n.variant[0],o=new t(Se(n),a.length>1?Te(n):_e(r,i));a.length===1&&i.envName!==void 0&&o.env(i.envName);let s=a.length===1?Ee(r,i.optionKey):[];s.length>0&&o.conflicts(s),a.length>1?o.argParser(Ve):M(i.name)||i.schemaType===`array`?o.argParser(Ue):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`)})}nt(e,n,o)}function Ve(e,t){return t===void 0?e:typeof t==`string`?[t,e]:[...t,e]}function He(e){return(t,r)=>{if(r!==void 0)throw new n(`${P} was already given; pass it once.`);let i=_(e,t);if(!i.ok)throw new n(i.summary);return t}}function Ue(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 We(e,t){let n=C(e,t),r=_(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=Ge(e,i,t);if(a!==null)return d(a);let o=A(e.operationId,i,t);if(!o.ok)return d(o.summary,o.warnings);t=o.data;let s=Ke(i,t);if(s!==null)return d(s);let c=await Xe(t);if(!c.ok)return d(c.summary,c.warnings);let u=xe(e.requestBody??[],i,c.data);if(u!==null)return d(u);let f=Ye(e.operationId,i,c.data);if(!f.ok)return f;let p=be(e.operationId,i,c.data);if(p!==null)return d(p);let m=Ze(e.operationId,i,t);if(!m.ok)return m;if(c.data===void 0&&m.data===void 0)return i.required?d(tt(e.operationId,i)):l(`No body`,void 0);let h=$e(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&&!N(h.data)){let t=i.kind===`multipart`?` keyed by multipart part name`:` body`;return d(`${e.operationId} requires a JSON object${t}.`)}let g=Je(i,h.data);if(g.length>0)return d(`${e.operationId} requires body option(s): ${g.join(`, `)}`);let v=h.data,y=N(v)?O(i).filter(e=>!D(v,e)):[];return y.length>0?d(qe(e.operationId,i,y)):h}function Ge(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 Ke(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 qe(e,t,n){let r=`${e} requires JSON body path(s): ${n.join(`, `)}`;return t.kind===`multipart`?`${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".`}`:r}function Je(e,t){return N(t)?e.parameter.filter(e=>e.required&&!D(t,e.name)).map(I):[]}function Ye(e,t,n){let r=he(t,n);return r===null?l(`Body file paths validated`,null):d(`${e} --from-file contains ${r.message}`)}async function Xe(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 Re(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 Ze(e,t,n){let r={},i=!1;for(let e of t.parameter){let a=ke(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=Qe(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=ve(e,t,n,r);return a===null?l(`Direct body options parsed`,r):a}function Qe(e,t,n,r,i){let a=k(e,t,r);if(a===null){let e=et(r,i);return e.ok?ye(n,r.name,e.data,r.schemaType===`array`):d(e.summary,e.warnings)}let o=Oe(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.name,c,e);if(!t.ok)return d(t.summary,t.warnings);i.push(t.data)}for(let t of s?[i]:i){let i=we(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 $e(e,t,n,r){if(n===void 0)return l(`Direct body parsed`,r);if(r===void 0)return l(`Input parsed`,n);if(N(n)&&N(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(N(n)&&N(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`:de.test(o)?`; keep multi-line text in the --from-file body`:``}.`)}return i}function et(e,t){if(typeof t==`boolean`)return l(`Body value parsed`,t);if(t===void 0||typeof t==`string`)return R(e.name,e.schemaType,t??``);let n=[],r=M(e.name)&&e.schemaType!==`array`?e.schemaType:e.itemSchemaType;for(let i of t){let t=R(e.name,r,i);if(!t.ok)return t;n.push(t.data)}return l(`Body value parsed`,n)}function R(e,t,n){if(t===`boolean`)return n===`true`?l(`Body value parsed`,!0):n===`false`?l(`Body value parsed`,!1):d(`${e} must be true or false.`);if(t===`number`||t===`integer`){let r=n.trim(),i=Number(r);return r===``||!Number.isFinite(i)?d(`${e} must be a finite ${t}.`):t===`integer`&&!Number.isInteger(i)?d(`${e} must be an integer.`):l(`Body value parsed`,i)}return l(`Body value parsed`,n)}function tt(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=O(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 nt(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`}),De(e.options,r)}function z(e){return(e.requestBody??[]).some(e=>e.kind!==`multipart`||e.parameter.some(e=>e.schemaFormat!==`binary`))}function rt(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 it(r)),r.hook(`preSubcommand`,e=>{e.opts().help&&e.help()}),E(r),r.action(async function(r){let{emit:i}=await import(`./output-CVKmUFCg.js`),a=this.optsWithGlobals();if(a.help&&r.length===0){this.outputHelp();return}let o=G(e,r),s=t.find(t=>o!==void 0&&G(e,t.cliPath)===o);if(a.help||o!==void 0&&s===void 0){o===void 0&&this.error(`unknown command '${r.join(` `)}' (run \`${n} --help\` for the command tree)`),o.outputHelp();return}let c=s===void 0?await st(r,t):l(`Resolved by command path`,{operationId:s.operationId});if(c.ok&&c.data?.command!==void 0&&this.error(`unknown command '${r.join(` `)}' (run \`${n} --help\` for the command tree)`),!c.ok||c.data===null){i({mode:T(a)},c);return}let{writeShowResult:u}=await import(`./operations-catalog-qNCvacp4.js`);u({...a,...c.data},t,T(a,`text`),n)}),ot(e,t,n)}var it=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,at={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=>x[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 ot(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=ue(r.operationId,t,n),c=U(fe(r.header),o,e),l=U(pe(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 st(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=f.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=p(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:m}=await import(`./openapi-call-BIM3sLgO.js`),h=m({method:s,path:c});return!h.ok||h.data===null?d(h.summary,[...h.warnings,W]):l(`Resolved by method and path`,{operationId:h.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 ct(e,t,n){if(e.cliPath[0]!==`lookup`||!lt(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 lt(e){return e.ok?Array.isArray(e.data)&&e.data.length===0:e.httpStatus===404}function ut(t,n,r,i){let a=dt(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-BQYtyqcc.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-DEcqizpu.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-gPZaj8qk.js`);await e(n)}},{selected:s===`completion`,register:async()=>{let{registerCompletionCommand:e}=await import(`./completion-BbM2zJBc.js`);e(n,r,c)}},{selected:s===`help`,register:async()=>{let{registerHelpCatalogCommand:e}=await import(`./operations-Bc5t9zxG.js`);e(n,r,c)}},{selected:s===`command-catalog`,register:async()=>{let{registerRetiredCommandCatalog:e}=await import(`./operations-Bc5t9zxG.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 dt(t,n){try{return new i().parseOptions([...S(t,n).commandArgv]).operands}catch(t){if(!(t instanceof e))throw t;return t}}var K=new Set(w.map(e=>e.cliPath.join(` `)));function q(e,t){e.showHelpAfterError(!1).exitOverride(t(e)),e.commands.length===0?e.hook(`preAction`,Pe):e.registeredArguments.length===0&&!K.has(Me(e).join(` `))&&e.addHelpOption(new Ne(e));for(let n of e.commands)q(n,t)}function J(e){return ee[y(e,x)??`cli`]}function Y(e,t,n,{rootHelp:r=!1}={}){let i=t.map(e=>{let t=e.cliPath[0]??``;return{spec:e,top:t,rank:J(t).rank}}).toSorted((e,t)=>e.rank-t.rank||e.top.localeCompare(t.top)).map(e=>e.spec),a=new Set(i.filter(e=>ce(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)}for(let t of i)ft(e,t,a,s,o.has(t.cliPath.join(` `)),n,!r||t.cliPath.length===1)}function ft(e,t,n,r,i,a,o){let s=t.cliPath,c=e,l=``,u=!n.has(s[0]??``);for(let e of s.slice(0,-1)){l=l===``?e:`${l} ${e}`;let t=u&&l===e||!r.has(l);c=pt(c,e,l,t)}let f=s.at(-1)??t.operationId,p=t.deprecated===!0&&r.has(s.join(` `)),_=c.commands.find(e=>e.name()===f)??c.command(f,t.deprecated===!0&&!p?{hidden:!0}:{}),v=t.requestBody?.flatMap(({parameter:e})=>e)??[];if(_.summary((p?x[s.join(` `)]?.summary:void 0)??(t.summary||t.operationId)).description([`${t.method} ${t.path}.`,t.summary||t.description,`Full documentation: ${a} help ${t.cliPath.join(` `)}`,t.requestBody?.[0]?.kind===`json`||[...t.parameters,...v].some(e=>m(e.schemaType,e.itemSchemaType))?h:``].filter(Boolean).join(`
3
- `)),!o)return;let y=ae(t);for(let e of t.parameters)mt(_,e,i||e===y);Be(_,t),g(t.intent)&&!_.options.some(e=>e.long===`--execute`)&&_.option(`--execute`,`Deprecated; accepted and ignored. This command executes by its verb.`,!1),E(_),_.hook(`preAction`,e=>ne(e,t)),t.explain===!0&&_.option(`--explain`,`Print the search strategy and parsed constraints before the results`),y!==void 0&&_.argument(`[text...]`,y.description||`Same as ${le(y.flag)}.`),_.action(async function(){let{emit:e,emitSearchExplanation:n}=await import(`./output-CVKmUFCg.js`),r=Object.assign(this.optsWithGlobals(),{environment:this.opts().environment}),i=T(r),a=r;if(y!==void 0){let t=re(y,this.args,r);if(!t.ok||t.data===null)return e({mode:i},t);a=t.data}let o=te(t,a);if(o.length>0)return e({mode:i},d(`missing required options: ${o.join(`, `)}`));let s=await ht(t,a,i),c=ct(t,a,s);if(c!==null)return e({mode:i},c);r.explain===!0&&s.ok&&n(i,s.data),s.ok&&s.data instanceof Uint8Array&&i!==`csv`&&i!==`xlsx`?process.stdout.write(s.data):e({mode:i},s)})}function pt(e,t,n,r){let i=e.commands.find(e=>e.name()===t);if(i!==void 0)return i;let a=x[n],o=e.command(t,r?{hidden:!0}:{}).helpCommand(!1);return a!==void 0&&o.summary(a.summary).description(a.summary),o}function mt(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 ht(e,t,n){let{buildOpenApiPath:r,runOpenApiCall:i}=await import(`./openapi-call-BIM3sLgO.js`),{pendingResult:a}=await import(`./output-CVKmUFCg.js`),o=await We(e,t);if(!o.ok)return o;let s=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)]})),c=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]]})),l=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)]]})),u=await i({method:e.method,path:r(e.operationId,s),searchParams:c,headers:l,body:o.data,contentType:C(e,t),auth:e.auth,responseFormat:me(n),responseBytes:e.binaryResponse===!0,pendingResult:a});return je(e,u)}async function gt(e,n){let r=n.bin[0],i=Ae(w),a=ie(e,i),l=a===`required`?i:se(i),u=new Fe;u.enablePositionalOptions(!b(e)&&S(e,i).positionalOptions).name(r).usage(`[--environment <environment>] <command> [subcommand] [options]`).configureHelp(at).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([...s()])).showHelpAfterError(`(run \`${r} --help\` for usage)`),(b(e)||e.every(e=>e.startsWith(`-`)))&&u.version(n.version);let d=ut(e,u,l,n);Y(u,d.generated,r,{rootHelp:d.rootHelp}),await d.registerBuiltin(),rt(u,l,r);for(let e of u.commands)e.helpGroup()||e.helpGroup(J(e.name()).heading);let f;if(q(u,e=>t=>{throw f=(async()=>{!d.fullTree&&![`commander.helpDisplayed`,`commander.version`].includes(t.code)&&await d.completeTree((e,t)=>Y(e,t,r));let{commandExitHandler:n}=await import(`./parse-error-hint-Dolrr-18.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 oe(`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 ${o}/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(Ie(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}};v({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-BIM3sLgO.js`),{emitJson:t}=await import(`./output-CVKmUFCg.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 _t=e=>{if(e.code!==`EPIPE`)throw e;process.exit(0)};for(let e of[process.stdout,process.stderr])e.on(`error`,_t);process.on(`uncaughtException`,e=>Q(e,`uncaughtException`)),process.on(`unhandledRejection`,e=>Q(e,`unhandledRejection`));var $=await gt(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,3 +0,0 @@
1
- import{a as e,n as t,r as n,t as r}from"./package-DEeHDoOT.js";import{c as i,r as a}from"./result-envelope-gysspwld.js";import{t as o}from"./output-K4fvXMJs.js";import{a as s,t as c}from"./output-mode-BTvVMe2M.js";import{t as l}from"./completion-setup-CwJt88xW.js";import{spawnSync as u}from"node:child_process";import{basename as d,dirname as f,relative as p,resolve as m,sep as h}from"node:path";import{existsSync as g,lstatSync as _,mkdirSync as v,mkdtempSync as y,readdirSync as b,readlinkSync as x,realpathSync as S,renameSync as C,symlinkSync as w}from"node:fs";import{randomUUID as T}from"node:crypto";var E=new Intl.Collator(void 0,{numeric:!0}),D=2e4,O=[`lib`,`aventurevc-releases`];function k(t,n=e()){let r=n.registry===``?`Requires npm authentication for @aventurevc packages.`:`Installs from npm.`;c(t.command(`update`).summary(`Check for or install the latest release`).description([`Compare the running CLI version against the latest published`,`release and install it into the active published bin prefix.`,``,`Refuses to install when the running binary is the working-tree build`,`(rebuild that checkout instead). ${r}`,`--execute is deprecated, accepted, and ignored; update executes by its verb.`].join(`
2
- `)).option(`--execute`,`Deprecated; accepted and ignored. This command executes by its verb.`,!1).option(`--release <version>`,`Install and activate exactly this version, not the latest.`)).action(e=>o({mode:s(e)},A(void 0,`apply`,e.release)))}function A(r,o=`apply`,s){let c=r;try{c??=e(process.argv[1])}catch(e){return a(e instanceof Error?e.message:String(e),[`invalid_package_metadata`])}let l=c.name,u=c.version,f=c.registry===``?``:t,p=c.registry===``&&l===`@aventurevc/aventure-cli`,h=s;if(h===void 0){let e=j([`view`,f,`version`,`--silent`,`--global`],c,{timeout:D});if(!e.ok)return{...e,data:null};if(h=(e.data??``).trim(),h===``)return a(`npm view ${f} returned empty version`,[`empty_stdout`])}let _=s!==void 0||p||E.compare(u,h)<0,x={targetPackage:f,runningPackage:l,currentVersion:u,latestVersion:h,upgradeAvailable:_,upgradeInstalled:!1};if(o===`check`)return i(`${l}@${u} → ${f}@${h} (${_?`available`:`up to date`})`,x);if(c.workingTreeRoot!==null)return a(`Refusing to install over the working-tree build at ${c.workingTreeRoot}; rebuild via make instead`,["running CLI is npm-linked from the back-end checkout — `update` is for published bins"]);try{let e=P(c),t=m(e,...O),r=d(f),a=m(t,`${r}-current`),o=f===``?[f,``]:[f,n],l=F(e,c),p=s??[h,l?.version??u].reduce((e,t)=>E.compare(e,t)<0?t:e,u);v(t,{recursive:!0});let _=[N(c),...g(a)?[S(a)]:[],...b(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>m(t,e.name))],C,w=null,T=!1;for(let t of new Set(_.filter(t=>t!==e))){let e=M(t,o,p,c.registry);if(e.ok&&e.data!==null){C=t,w=e.data;break}}if(C===void 0){C=y(m(t,`${r}-${encodeURIComponent(p)}-`));let e=j([`install`,`-g`,`--prefix`,C,...o.map(e=>`${e}@${p}`)],c,{stdio:[`ignore`,`inherit`,`inherit`]});if(!e.ok)return{...e,data:null};T=!0;let n=M(C,o,p,c.registry);if(!n.ok)return{...n,data:null};w=n.data}if(w===null)throw Error(`release verification produced no package`);let D=I(C,e,a,w,s),k=R();return i(`${f} active at ${D}`,{...x,upgradeInstalled:T||s!==void 0||l?.version!==D,installPrefix:e,verifiedVersion:D,completionRefreshed:k.refreshed,completionRefreshMessage:k.message})}catch(e){return a(`${f} update failed: ${L(e)}`,[`existing releases were preserved`])}}function j(e,t,n={}){let r={...process.env};t.registry===``?r.NODE_AUTH_TOKEN??=r.GH_PACKAGES_TOKEN:delete r.GH_PACKAGES_TOKEN;let o=t.registry;if(t.registry===``){let e=u(`npm`,[`config`,`get`,`@aventurevc:registry`,`--global`],{env:r,encoding:`utf8`});if(e.error||e.status!==0){let t=e.error?.message??(e.stderr??``).trim();return a(`npm config get @aventurevc:registry exited ${e.status}`,[t||`no stderr`])}let t=e.stdout.trim().replace(/\/?$/,`/`);t.startsWith(`https://`)&&t!==`https://registry.npmjs.org/`&&(o=t)}let s=[...e,`--@aventurevc:registry=${o}`],c=u(`npm`,s,{env:r,encoding:`utf8`,...n});if(c.error)return c.signal===`SIGTERM`&&n.timeout!==void 0?a(`npm ${e[0]??``} did not answer within ${n.timeout}ms`,[`timeout`]):a(`npm ${e[0]??``} failed to start: ${c.error.message}`,[`spawn_error`]);if(c.status!==0){let t=(c.stderr??``).trim().split(`
3
- `).slice(-3).join(` | `);return a(`npm ${e.join(` `)} exited ${c.status}`,[t||`no stderr`])}return i(`npm ok`,c.stdout??``)}function M(t,n,r,o){try{let a=n.map(n=>{let i=e(m(t,`lib`,`node_modules`,...n.split(`/`),`package.json`));if(i.name!==n||i.version!==r||i.registry!==o)throw Error(`${n} does not match ${r} from ${o}`);for(let e of i.bin)if(!S(m(t,`bin`,e)).startsWith(`${i.packageRoot}${h}`))throw Error(`${e} escapes ${i.packageRoot}`);return i});for(let e of a){let n=m(t,`bin`,e.bin[0]),i=u(process.execPath,[n,`--version`],{encoding:`utf8`,timeout:D});if(i.error)throw Error(`${e.name} verification failed: ${i.error.message}`);let a=(i.stdout??``).trim();if(i.status!==0||a!==r)throw Error(`${e.name} expected ${r} but reported ${a||`empty output`}`)}return i(`CLI and MCP release verified`,a)}catch(e){return a(`release verification failed: ${L(e)}`,[`release prefix: ${t}`])}}function N(e){let t=f(e.packageRoot),n=f(t),r=f(n);if(d(t)!==e.name.split(`/`)[0]||d(n)!==`node_modules`||d(r)!==`lib`)throw Error(`the running package is not in a verifiable global npm prefix; npm install was not run`);if(!e.entryPath.startsWith(`${e.packageRoot}${h}`))throw Error(`the running entry escapes its package root`);return f(r)}function P(e){let t=N(e),n=`${h}${O.join(h)}${h}`,r=t.lastIndexOf(n);return r<0?t:t.slice(0,r)}function F(t,n){let i=n.registry===``?d(``):r,a=m(t,`bin`,i);if(!g(a))return null;let o=e(a);if(o.registry!==n.registry)throw Error(`${a} belongs to another product`);return o}function I(t,n,r,i,a){let o=i[0];if(o===void 0)throw Error(`release contains no CLI`);let s=m(n,`bin`);v(s,{recursive:!0});let c=i.flatMap(t=>t.bin.filter((t,n)=>{let r=m(s,t);if(!g(r)||e(r).registry===o.registry)return!0;if(o.registry!==``&&n>0)return!1;throw Error(`${r} belongs to another product`)}));if(!g(r)){let e=y(m(f(r),`${d(r)}-seed-`));v(m(e,`bin`));for(let n of c){let r=m(s,n);w(S(g(r)?r:m(t,`bin`,n)),m(e,`bin`,n))}try{w(p(f(r),e),r)}catch(e){if(!(e instanceof Error&&`code`in e&&e.code===`EEXIST`))throw e}}if(!_(r).isSymbolicLink())throw Error(`${r} is not a release symlink`);for(let e of c){let t=p(s,m(r,`bin`,e)),n=m(s,`.${e}-${T()}`);w(t,n),C(n,m(s,e))}for(let e of c){let t=m(s,e);if(!_(t).isSymbolicLink()||m(s,x(t))!==m(r,`bin`,e))throw Error(`${t} does not follow the product current pointer`)}let l=F(n,o);if(a===void 0&&l!==null&&E.compare(l.version,o.version)>0)return l.version;let u=`${r}-${T()}`;return w(p(f(r),t),u),C(u,r),o.version}function L(e){return e instanceof Error?e.message:String(e)}function R(){try{return l()}catch(e){return{refreshed:!1,message:e instanceof Error?e.message:String(e)}}}export{k as registerBuiltinUpdateCommand,A as runUpdate};
@@ -1,20 +0,0 @@
1
- import{a as e}from"./package-DEeHDoOT.js";import{t}from"./openapi-commands-7CICQJgh.js";import{n,r}from"./completion-setup-CwJt88xW.js";import{o as i}from"./generated-option-order-CUW9Kkar.js";import a from"node:process";function o(i,o=t,s=e().bin[0]){let l=i.command(`completion`).summary(`Generate shell completion scripts`).description(`Generate shell completion scripts for the aVenture CLI.`);for(let e of[`bash`,`fish`,`zsh`])l.command(e).summary(`Print ${e} shell completions`).description(`Print ${e} completion definitions for ${s}.`).action(()=>{a.stdout.write(c(i,e,o))});n(l,s),r(l,s)}function s(){return e().bin}function c(e,n,r=t,i=s()){let a=_(r);return n===`fish`?[`# fish completions for ${i.join(`, `)}`,...u(e),...i.map(e=>`complete -c ${N(e)} -e`),`${A(i)} -f`,...d(e,i),...f(e,a,i),``].join(`
2
- `):l(e,n,a,i)}function l(e,t,n,r){let i=t===`zsh`?`typeset -ga `:``,a=`complete -F _aventure_cli ${r.map(e=>e.replaceAll(`'`,`'\\''`)).join(` `)}`,[o,s,c]=b(e,n);return[...t===`zsh`?[`#compdef ${r.join(` `)}`]:[],`# ${t} completions for ${r.join(`, `)}`,`${i}_aventure_cli_commands=(`,...o.map(e=>` ${e}`),`)`,`${i}_aventure_cli_options=(`,...s.map(e=>` ${e}`),`)`,`${i}_aventure_cli_values=(`,...c.map(e=>` ${e}`),`)`,``,...C(t),...t===`bash`?[a,``]:[``]].join(`
3
- `)}function u(e){return[`function __aventure_cli_command_path\n set -l global_value_options ${p(e).filter(e=>e.required||e.optional).flatMap(e=>E(e)??[]).map(N).join(` `)}\n set -l tokens (commandline -xpc)\n if test (count $tokens) -gt 0\n set -e tokens[1]\n end\n set -l path\n set -l skip_next 0\n for token in $tokens\n if test $skip_next -eq 1\n set skip_next 0\n continue\n end\n if string match -q -- '--*=*' $token\n set -l name (string replace -r '^--([^=]+)=.*$' '$1' -- $token)\n contains -- $name $global_value_options; and continue\n end\n if string match -q -- '--*' $token\n set -l name (string replace -r '^--' '' -- $token)\n if contains -- $name $global_value_options\n set skip_next 1\n continue\n end\n break\n end\n if string match -q -- '-*' $token\n break\n end\n set -a path $token\n end\n printf '%s\\n' $path\nend\n`,`function __aventure_cli_path_is
4
- set -l expected $argv
5
- set -l actual (__aventure_cli_command_path)
6
- if test (count $actual) -ne (count $expected)
7
- return 1
8
- end
9
- if test (count $expected) -eq 0
10
- return 0
11
- end
12
- for index in (seq (count $expected))
13
- if test $actual[$index] != $expected[$index]
14
- return 1
15
- end
16
- end
17
- return 0
18
- end
19
- `].flatMap(e=>e.split(`
20
- `))}function d(e,t){return y(e).map(e=>`${A(t)} -f -n ${N(j(e.parentPath))} -a ${N(e.name)} -d ${N(e.description)}`).toSorted((e,t)=>e.localeCompare(t))}function f(e,t,n){return D(e).flatMap(e=>{let r=k(e),i=r.length===0?void 0:j(r);return p(e).flatMap(e=>{let a=t.get(v(r,e));return S(a)?m(e,i,a,n):[]})}).toSorted((e,t)=>e.localeCompare(t))}function p(e){return e.parent===null?e.createHelp().visibleOptions(e):e.options}function m(e,t,n,r){let i=E(e);if(i===void 0)return[];let a=e.argChoices??x(n),o=[`-l ${N(i)}`,e.short===void 0?``:`${e.short.startsWith(`--`)?`-l`:`-s`} ${N(e.short.replace(/^-+/,``))}`].filter(Boolean),s=t===void 0?``:` -n ${N(t)}`,c=e.required||e.optional?h(a,g(i,n)):`-f`,l=`${A(r)}${s} ${o.join(` `)} ${c}`;return a===void 0||a.length===0?[`${l} -d ${N(M(e.description))}`]:a.map(t=>`${l} -a ${N(t)} -d ${N(M(e.description))}`)}function h(e,t){return e!==void 0&&e.length>0?`-x`:t?`-r -F`:`-r -f`}function g(e,t){return e===`from-file`?!0:t===void 0||t.some(({location:e})=>e!==`body`)?!1:t.every(({schemaFormat:e})=>e===`binary`)?!0:t.length===1&&[`file`,`path`].includes(e.split(`-`).at(-1)??``)}function _(e){return new Map(e.flatMap(e=>[...e.parameters.map(e=>[e]),...i(e.requestBody??[]).map(({variant:e})=>e.map(({parameter:e})=>e))].flatMap(t=>{let n=t[0];if(n===void 0)throw Error(`Generated CLI option has no parameter`);return[[v(e.cliPath,n),t]]})))}function v(e,t){let n=`flag`in t?t.flag.split(/\s+/)[0]?.replace(/^--/,``):E(t);if(`flag`in t&&(n===void 0||n.length===0||n===t.flag))throw Error(`Cannot render completion for option flag: ${t.flag}`);return`${e.join(`\0`)}\u0000${n??``}`}function y(e){return D(e).flatMap(e=>e.commands.filter(O).map(t=>({parentPath:k(e),name:t.name(),description:M(t.summary()||t.description()||t.name())})))}function b(e,t){let n=[],r=[];for(let i of D(e)){let e=k(i);for(let a of p(i)){let i=E(a);if(i===void 0)continue;let o=t.get(v(e,a));if(!S(o))continue;let s=a.argChoices??x(o),c=`none`;(a.required||a.optional)&&(c=s!==void 0&&s.length>0?`choice`:`scalar`,c===`scalar`&&g(i,o)&&(c=`file`)),n.push(w([e.join(` `),`--${i}`,a.short??``,a.description,c]));for(let t of s??[])r.push(w([e.join(` `),`--${i}`,t,a.description]))}}return[y(e).map(e=>w([e.parentPath.join(` `),e.name,e.description])).toSorted((e,t)=>e.localeCompare(t)),n.toSorted((e,t)=>e.localeCompare(t)),r.toSorted((e,t)=>e.localeCompare(t))]}function x(e){let t=e?.[0]?.choices;if(e!==void 0&&t!==void 0)return e.every(e=>e.choices?.length===t.length&&e.choices.every((e,n)=>e===t[n]))?t:void 0}function S(e){return e?.some(({visibility:e})=>e!==`private`)??!0}function C(e){let t=e===`bash`,n=t?`COMP_WORDS`:`words`,r=t?`COMP_CWORD`:`CURRENT`,i=t?"${path[*]}":"${(j: :)path}",a=t?'"${_aventure_cli_options[@]}"':`$_aventure_cli_options`,o=t?'"${_aventure_cli_values[@]}"':`$_aventure_cli_values`,s=t?'"${_aventure_cli_commands[@]}"':`$_aventure_cli_commands`;return[`function _aventure_cli {`,` local current="\${${n}[${r}]}" previous="\${${n}[${r}-1]}" row row_path long short description mode name value option token key prefix candidate file_current`,...t?[` COMPREPLY=()`]:[],` local index=${t?1:2} skip_next=0; local -a path names descriptions`,` while (( index < ${r} )); do`,` token="\${${n}[index]}"; (( skip_next )) && { skip_next=0; (( index++ )); continue; }`,` if [[ "$token" == -* && "$token" != "-" && "$token" != "--" ]]; then`,` option="\${token%%=*}"; key="${i}"; mode=''`,` for row in ${a}; do IFS='|' read -r row_path long short description mode <<< "$row"; [[ "$row_path" == "$key" && ( "$long" == "$option" || "$short" == "$option" ) ]] && break; mode=''; done`,` [[ -n "$mode" && "$mode" != none && "$token" != *=* ]] && skip_next=1`,` elif [[ "$token" != -* ]]; then path+=("$token"); fi`,` (( index++ ))`,` done`,` key="${i}"`,` if [[ "$current" == --*=* || ( "$previous" == -* && "$current" != -* ) ]]; then`,` option="$previous"; prefix=''; file_current="$current"; [[ "$current" == --*=* ]] && { option="\${current%%=*}"; prefix="$option="; file_current="\${current#*=}"; }`,` for row in ${a}; do IFS='|' read -r row_path long short description mode <<< "$row"; [[ "$row_path" == "$key" && ( "$long" == "$option" || "$short" == "$option" ) ]] && { option="$long"; break; }; mode=''; done`,t?` [[ "$mode" == file ]] && { while IFS= read -r candidate; do COMPREPLY+=("$prefix$candidate"); done < <(compgen -f -- "$file_current"); return 0; }`:` [[ "$mode" == file ]] && { _files; return 0; }`,t?` [[ "$mode" == choice ]] && for row in ${o}; do IFS='|' read -r row_path long value description <<< "$row"; [[ "$row_path" == "$key" && "$long" == "$option" ]] && { candidate="$prefix$value"; [[ "$candidate" == "$current"* ]] && COMPREPLY+=("$candidate"); }; done`:` [[ "$mode" == choice ]] && for row in ${o}; do IFS='|' read -r row_path long value description <<< "$row"; [[ "$row_path" == "$key" && "$long" == "$option" ]] && { names+=("$prefix$value"); descriptions+=("$description"); }; done`,` elif [[ "$current" == -* ]]; then`,` for row in ${a}; do`,` IFS='|' read -r row_path long short description mode <<< "$row"`,t?` [[ "$row_path" == "$key" ]] && { [[ "$long" == "$current"* ]] && COMPREPLY+=("$long"); [[ -n "$short" && "$short" == "$current"* ]] && COMPREPLY+=("$short"); }`:` [[ "$row_path" == "$key" ]] && { names+=("$long"); descriptions+=("$description"); [[ -n "$short" ]] && { names+=("$short"); descriptions+=("$description"); }; }`,` done`,` elif [[ "$previous" != -* ]]; then`,` for row in ${s}; do`,` IFS='|' read -r row_path name description <<< "$row"`,t?` [[ "$row_path" == "$key" ]] && { [[ "$name" == "$current"* ]] && COMPREPLY+=("$name"); }`:` [[ "$row_path" == "$key" ]] && { names+=("$name"); descriptions+=("$description"); }`,` done`,` fi`,...t?[]:[" (( ${#names} )) && compadd -d descriptions -a names"],` return 0`,`}`,...t?[]:[`_aventure_cli "$@"`]]}function w(e){return`$'${e.map(T).join(`|`)}'`}function T(e){return M(e).replaceAll(`\\`,`\\\\`).replaceAll(`'`,`\\'`).replaceAll(`|`,` `)}function E(e){return e.long?.replace(/^--/,``)}function D(e){return[e,...e.commands.filter(O).flatMap(e=>D(e))]}var O=e=>e.parent?.createHelp().visibleCommands(e.parent).includes(e)??!0;function k(e){let t=[];for(let n=e;n?.parent!==null;n=n.parent)t.unshift(n.name());return t}function A(e){return`complete ${e.map(e=>`-c ${N(e)}`).join(` `)}`}function j(e){return[`__aventure_cli_path_is`,...e.map(N)].join(` `)}function M(e){return e.replace(/\s+/g,` `).trim()}function N(e){return`'${e.replace(/[\r\n\t]/g,` `).replaceAll(`\\`,`\\\\`).replaceAll(`'`,`\\'`)}'`}export{o as registerCompletionCommand};
@@ -1 +0,0 @@
1
- export{t as logoutCliCredentials}from"./logout-CeZ-vvDH.js";