@aventurevc/aventure-cli 0.8.329 → 0.8.330
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.
- package/dist/aventure-cli/index.js +1 -1
- package/dist/aventure-cli/unified-operations.json +1 -1
- package/dist/chunks/{auth-status-check-DjYzLlZd.js → auth-status-check-Bn-Exs4v.js} +1 -1
- package/dist/chunks/{auth-status-check-CfuY4jG_.js → auth-status-check-C0ZkA0Zg.js} +1 -1
- package/dist/chunks/{aventure-cli-uR2Oa6_d.js → aventure-cli-BKLtoGsF.js} +5 -5
- package/dist/chunks/{batch-io-BnDffwjs.js → batch-io-CNCmiftn.js} +1 -1
- package/dist/chunks/{builtin-auth-BncCqGN7.js → builtin-auth-DhNAtbLr.js} +2 -2
- package/dist/chunks/{builtin-run-wait-D40W8cvn.js → builtin-run-wait-CRFnlxDQ.js} +1 -1
- package/dist/chunks/{builtin-update-B7e-AFgq.js → builtin-update-CrLAPpwj.js} +1 -1
- package/dist/chunks/{completion-CuzJij7X.js → completion-BQqzwDFU.js} +1 -1
- package/dist/chunks/confidence-DmTRnwhU.js +1 -0
- package/dist/chunks/detail-BYhBYyxt.js +1 -0
- package/dist/chunks/detail-ZRoF1EEk.js +1 -0
- package/dist/chunks/help-catalog-C0LDzcH8.js +2 -0
- package/dist/chunks/help-intent-CfhJC272.js +1 -0
- package/dist/chunks/mcp-generation-contract-DTUHvKtT.js +1 -0
- package/dist/chunks/{mcp-generation-contract-Cb8xs2vs.js → mcp-generation-contract-DXdYzZUB.js} +1 -1
- package/dist/chunks/{openapi-commands-yLuWPzSd.js → openapi-commands-DOYLGid-.js} +1 -1
- package/dist/chunks/openapi-commands-DnvABChy.js +1 -0
- package/dist/chunks/openapi-snapshot.json +1 -1
- package/dist/chunks/{operations-DTP6ywi8.js → operations-LMcL7Cyf.js} +2 -2
- package/dist/chunks/{operations-catalog-YZP79HnO.js → operations-catalog-BD6qtuBN.js} +1 -1
- package/dist/chunks/operations-catalog-DoDy2h08.js +1 -0
- package/dist/chunks/{operations-metadata-B9OJHBi7.js → operations-metadata-Cab2JIZj.js} +1 -1
- package/dist/chunks/{output-BIou2Yr8.js → output-DFAaCcIR.js} +1 -1
- package/dist/chunks/{output-DT4hCeKV.js → output-Dn-4dPa1.js} +1 -1
- package/dist/chunks/{parse-error-hint-DbOBsk3R.js → parse-error-hint-DKmnmSuc.js} +2 -2
- package/dist/chunks/text-response-CdQ9ZLmO.js +17 -0
- package/package.json +3 -3
- package/dist/chunks/detail-BIy84SoF.js +0 -1
- package/dist/chunks/detail-BiztrlKS.js +0 -1
- package/dist/chunks/help-catalog-n_tlskK9.js +0 -2
- package/dist/chunks/help-intent-BsgVzXOR.js +0 -1
- package/dist/chunks/mcp-generation-contract-I403fV6e.js +0 -1
- package/dist/chunks/openapi-commands-Dl7iihhP.js +0 -1
- package/dist/chunks/operations-catalog-BvWSH_2n.js +0 -1
- package/dist/chunks/text-response-YBQbBWST.js +0 -17
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./commander-DEj7N1b9.js";import{a as t}from"./package-DEeHDoOT.js";import{c as n}from"./result-envelope-D0HcstPt.js";import{t as r}from"./output-
|
|
1
|
+
import{n as e}from"./commander-DEj7N1b9.js";import{a as t}from"./package-DEeHDoOT.js";import{c as n}from"./result-envelope-D0HcstPt.js";import{t as r}from"./output-DFAaCcIR.js";import{a as i,t as a}from"./output-mode-fGjpw49W.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-BD6qtuBN.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-
|
|
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-DXdYzZUB.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-D0HcstPt.js";import{s as r}from"./tool-policy-C41oB3KJ.js";import{i}from"./output-spill-BxmvuwHv.js";import"./startup-auth-BwunIIJL.js";import{i as a,r as o}from"./operations-metadata-
|
|
1
|
+
import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-D0HcstPt.js";import{s as r}from"./tool-policy-C41oB3KJ.js";import{i}from"./output-spill-BxmvuwHv.js";import"./startup-auth-BwunIIJL.js";import{i as a,r as o}from"./operations-metadata-Cab2JIZj.js";import{t as s}from"./output-DFAaCcIR.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-BD6qtuBN.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-D0HcstPt.js";import{
|
|
1
|
+
import{a as e}from"./package-DEeHDoOT.js";import{c as t,r as n}from"./result-envelope-D0HcstPt.js";import{T as r,h as i,v as a,y as o}from"./help-catalog-C0LDzcH8.js";import{a as s,n as c}from"./help-intent-CfhJC272.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-D0HcstPt.js";import{o as r}from"./logging-D4S_7NkY.js";import{i,n as a,r as o,t as s}from"./output-spill-BxmvuwHv.js";import{n as c}from"./human-text-cap-dR2SJQJC.js";import{t as l}from"./openapi-commands-
|
|
1
|
+
import{a as e}from"./package-DEeHDoOT.js";import{n as t,r as n}from"./result-envelope-D0HcstPt.js";import{o as r}from"./logging-D4S_7NkY.js";import{i,n as a,r as o,t as s}from"./output-spill-BxmvuwHv.js";import{n as c}from"./human-text-cap-dR2SJQJC.js";import{t as l}from"./openapi-commands-DnvABChy.js";import{a as u,i as d,n as f,r as p,t as m}from"./text-response-CdQ9ZLmO.js";import{resolve as h}from"node:path";import{tmpdir as g}from"node:os";import{randomUUID as _}from"node:crypto";function v(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=`Pending: ${e.operationId??`request`}${a===void 0?``:` job ${a}`} is still running.`+(s===void 0?``:` Retry-After: ${s}.`)+(o===void 0?``:` Poll GET ${o} for the result.`);return{...e,summary:c,warnings:[...e.warnings,c],ids:a===void 0?e.ids:[...new Set([...e.ids,a])],references:o===void 0?e.references:[...new Set([...e.references,o])]}}function y(e){let t=C(e);return k(t),process.stdout.write(`${JSON.stringify(t)}\n`),t}function b(e){let t,n=C(e,{foldRows:!1,humanText:!0,onSpill:e=>{t=p(e)}});k(n);let r=m(l,n.data,n.summary,{trailer:x(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(...T(n.problem)),i.push(...x(n)),process.stdout.write(c(i.join(`
|
|
3
3
|
`),{appendNewline:!0})),n}function x(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 S(e,t){if(e.mode===`csv`||e.mode===`xlsx`){if(!t.ok){S({mode:`json`},t);return}if(e.mode===`xlsx`&&!(t.data instanceof Uint8Array)){S({mode:`json`},n(`This operation does not offer XLSX; use --csv.`));return}let r=t.data instanceof Uint8Array?t.data:u(o(t.data));a()===void 0?(k(t),process.stdout.write(r)):S({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`?C(s,{allowSpill:r===void 0}):s;k(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`?y(s):b(s)).ok||(process.exitCode=1)}function C(e,n={}){let r={...d(e,l),...n},a=t(e,r),o=!1;if(n.humanText===!0&&e.ok&&m(l,a.data,a.summary,{trailer:x(a),onOmission:()=>{o=!0}}),n.allowSpill===!1||!e.ok||r.write===!0||!o&&(a===e||a.truncated!==!0))return a;let c=process.env.AVENTURE_HARNESS_RUN_DATA_ROOT,u=h(c?h(c,`scratchpad`):g(),`aventure-output-${_()}.json`);s(u);let f,v=i(e,e=>{f=e});return v.ok?(n.onSpill?.(u),t(e,{...r,exactRecovery:p(u),spill:f})):v}function w(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 T(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(...E(e),...D(`unknownParameters`,e.unknownParameters),...D(`validParameters`,e.validParameters),...O(e.resolution)),t}function E(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 D(e,t){return t!=null&&t.length>0?[` ${e}: ${t.join(`, `)}`]:[]}function O(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 k(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{v as a,w as i,b as n,y as r,S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as emit,r as emitJson,i as emitSearchExplanation,a as pendingResult}from"./output-
|
|
1
|
+
export{t as emit,r as emitJson,i as emitSearchExplanation,a as pendingResult}from"./output-DFAaCcIR.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{u as e}from"./tool-policy-C41oB3KJ.js";import{c as t,s as n}from"./startup-auth-BwunIIJL.js";import{t as r}from"./openapi-commands-
|
|
1
|
+
import{u as e}from"./tool-policy-C41oB3KJ.js";import{c as t,s as n}from"./startup-auth-BwunIIJL.js";import{t as r}from"./openapi-commands-DnvABChy.js";import{_ as i,g as a}from"./help-catalog-C0LDzcH8.js";import{r as o}from"./operations-metadata-Cab2JIZj.js";import{n as s}from"./operations-catalog-BD6qtuBN.js";import{a as c,t as l}from"./payload-operand-guard-DcFvteTB.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
|
-
`)}function R(e,t=``){if(e.commands.length>0&&!A(c(e)))return;let
|
|
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(`
|
|
5
5
|
`)||void 0}function B(e){return t=>{if(t.code===`commander.missingMandatoryOptionValue`){let n=e.options.filter(t=>t.mandatory&&e.getOptionValue(t.attributeName())===void 0);if(n.length>1){let e=n.map(e=>e.flags.split(`, `).at(-1)??e.flags);process.stderr.write(`error: missing required options: ${e.join(`, `)}\n`)}let r=m(e);for(let e of r)process.stderr.write(`error: unknown option '${e}'\n`);for(let n of[h(e)??(r.length>0?R(e):void 0),l(e),f(e,t),...N(e)])n!==void 0&&process.stderr.write(`${n}\n`)}else if(t.code===`commander.excessArguments`){let t=l(e)??P(e);t!==void 0&&process.stderr.write(`${t}\n`)}else if(t.code===`commander.unknownOption`){let n=u(t,`unknown option`),r=h(e)??x(e,t)??(n!==void 0&&!t.message.includes(`
|
|
6
6
|
(Did you mean `)?I(e,n)??D(e,[n.replace(/^--/u,``)],process.argv.slice(process.argv.indexOf(n)+1))??R(e,n)??L(e,c(e).slice(1).join(` `)||n.replace(/^--/u,``)):void 0);r!==void 0&&process.stderr.write(`${r}\n`)}else if(t.code===`commander.unknownCommand`){let n=z(e,t);n!==void 0&&process.stderr.write(`${n}\n`)}else if(t.code===`commander.helpDisplayed`){let[n]=e.args;if(n?.startsWith(`-`)===!1&&e.registeredArguments.length===0){let r=[_(e).name(),...c(e)].join(` `);t.exitCode=1,process.stderr.write(`hint: ${r} takes no '${n}' subcommand; the help shown is for ${r}\n`)}}throw t}}export{B as commandExitHandler};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{A as e,C as t,E as n,S as r,_ as i,c as a,d as o,g as s,i as c,n as l,s as u,x as d}from"./iso-l1vOidnb.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-ZRoF1EEk.js";import{t as ce}from"./person-owner-BRGa5Dee.js";import{r as le}from"./run-qEqhQEga.js";import{n as _}from"./allowance-type-DBLLduSR.js";import{t as ue}from"./confidence-DmTRnwhU.js";import{p as de}from"./result-envelope-D0HcstPt.js";import{a as fe,s as pe}from"./tool-policy-C41oB3KJ.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-C0LDzcH8.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
|
+
`}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
|
+
`),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.step.length===0?[``,`This catalog task has no planned steps yet.`]:[...e.input.length===0?[]:[``,`Inputs:`,...e.input.map(({key:e,type:t,description:n,required:r})=>` ${e} (${t}, ${r===!1?`optional`:`required`}): ${n}`)],``,`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=>He(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 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)}, ${Ue(t,[...l,...u])}`]})}function He(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),We(n)]}),s=[L(i),`<n>`,L(a),`<n>`];return[`${I(t)}, in windows: ${Ue(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 Ue(e,t){return[E,...e.cliPath,...t].join(` `)}function L(e){return e.flag.split(/\s+/u)[0]??e.flag}function We(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}var Ge=i({detail:r(),field:r().nullish(),scope:c([`entity`,`person`,`news`])}),Ke=c([`auto`,`exact`,`keyword`,`semantic`,`natural`,`hybrid`]),qe=Object.assign(t([Ke,r()]),{enum:Ke.enum}),R=i({modeRequested:qe,modeUsed:qe}),Je=i({answerUnavailable:a(),entity:R,incompleteScope:u(c([`entity`,`person`,`news`])).optional(),news:R,person:R,rejection:u(Ge),unavailable:u(c([`entity`,`person`,`news`]))}),Ye=i({enrichmentRunId:n().nullish(),entityId:n()}),Xe=c([`numeric`,`overlap`,`containment`]),Ze=Object.assign(t([Xe,r()]),{enum:Xe.enum}),Qe=i({matchMode:Ze.nullish(),max:o().nullish(),min:o().nullish()}),$e=i({sortPriority:c([`NONE`,`ANY_LOGO_FIRST`,`REAL_LOGO_FIRST`]).optional()}),et=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()}),tt=i({averageAmountInvestedUsdRange:u(z).optional(),largestAmountInvestedUsdRange:u(z).optional(),smallestAmountInvestedUsdRange:u(z).optional(),totalAmountInvestedUsdRange:u(z).optional(),totalInvestmentRange:u(B).optional()}),nt=c([`any`,`every`]),rt=i({amountInvestedRange:u(z).optional(),amountRaisedRange:u(z).optional(),dateAnnouncedRange:et.nullish(),investedAmountRaisedRange:u(z).optional(),investedCompanyName:u(r()).optional(),investedCountry:u(r()).optional(),investedIndustry:u(r()).optional(),investedRound:u(r()).optional(),investorActivity:tt.optional(),investorName:u(r()).optional(),investorNameMatch:nt.nullish(),lastRoundYearRange:u(B).optional(),rankByInvestmentActivity:a().nullish(),round:u(r()).optional(),totalRaisedRange:u(z).optional(),valuationRange:u(z).optional()}),it=c([`NONE`,`COMPANY_LISTING_READY`]),at=c([`Operating`,`Acquired`,`Acquired Subsidiary`,`Closed`,`Closed (Acquihire)`,`Inactive`]),ot=i({identifier:r().max(255).nullish(),idType:r()}),st=d({max:r().regex(/^-?[0-9]+(\.[0-9]+)?$/).nullish(),measurementBasis:r().nullish(),min:r().regex(/^-?[0-9]+(\.[0-9]+)?$/).nullish(),reportingScope:r().nullish(),targetPath:r(),valueResearchDetail: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(Qe).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:rt.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:$e.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(at).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:it.optional(),rankByProminence:a().nullish(),researchDetailRange:u(st).max(10).optional(),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(ot).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(Qe).optional(),entityId:u(n()).optional(),entityName:u(r()).optional(),featured:a().nullish(),fundraiseActivity:rt.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:$e.optional(),mainProduct:u(r()).optional(),noteworthyOnly:a().optional(),operatingStatus:u(at).optional(),originCountry:u(r()).optional(),person:u(r()).optional(),portfolioHeadquartersCity:u(r()).optional(),portfolioHeadquartersCountry:u(r()).optional(),portfolioHeadquartersState:u(r()).optional(),qualityGate:it.optional(),rankByProminence:a().nullish(),researchDetailRange:u(st).max(10).optional(),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(ot).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:tt.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(Ye).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:Je,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
|
+
`),{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(`
|
|
5
|
+
`),r);let h=Ht(p);if(h!==null)return d(h.join(`
|
|
6
|
+
`),u);let g=[p.summary??n??p.operationId??`OpenAPI call succeeded`,`${p.method} ${p.endpoint}`],ee=ve(Kt(p),117-u.length,Se-ke.byteLength(`${[...g,...u].join(`
|
|
7
|
+
`)}\n`,`utf8`),i);return d([...g,...ee].filter(Boolean).join(`
|
|
8
|
+
`),u)}function Ht({response:e,...t}){let n=It.safeParse(e);if(!n.success)return null;let{entity:r,person:i,news:a,provenance:o}=n.data;return[...(o.incompleteScope??[]).map(e=>`${e} incomplete: partial results`),...r.answer?Ut(r.answer):[],...o.unavailable.map(e=>`${e} unavailable: retry this scope later`),...o.answerUnavailable?[`answer unavailable: retry this search later`]:[],...o.rejection.map(({scope:e,detail:t})=>v(`${e} rejected: ${t}`)),[`entities:`,...W(r.result,t)].join(`
|
|
9
|
+
`),[`people:`,...W(i.result,t)].join(`
|
|
10
|
+
`),[`news:`,...W(a,t)].join(`
|
|
11
|
+
`)]}function Ut(e){let t=`relatedQuery:\n${e.relatedQuery.map(e=>` - ${v(e)}`).join(`
|
|
12
|
+
`)}`,n=`citations:\n${e.citation.map(({source:e,sourceId:t,entityId:n})=>v(` - ${e}:${t} entity=${n}`)).join(`
|
|
13
|
+
`)}`;return[`answer:\n ${he(e.text).replaceAll(`
|
|
14
|
+
`,`
|
|
15
|
+
`)}`,...e.relatedQuery.length===0?[]:[t],...e.citation.length===0?[]:[n]]}function Wt(e){let t=Zt(e)?.response,n=Q(t)?t.interpretation:void 0;if(!Q(n))return null;let r=R.safeParse(n.execution);if(!r.success)return null;let{modeRequested:i,modeUsed:a}=r.data,o=_e(n.filter),{unsupported:s,fallbackUsed:c}=n,l=[`strategy: requested=${i} used=${a}`,...Q(o)?[`constraints:`,...Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[` ${e}: ${Gt(t)}`])]:[],typeof s==`string`&&s.trim().length>0?`unsupported: ${s}`:``,c===!0?`fallback: semantic search over the original query`:``];return ye(l.filter(Boolean).join(`
|
|
16
|
+
`),{appendNewline:!0})}var Gt=e=>$(e)?v(e):Array.isArray(e)&&e.every($)?e.map(e=>v(e)).join(`, `):JSON.stringify(e);function Kt(e){let{response:t,method:n,nextCursor:r,httpStatus:i,location:a,transport:o}=e;if(t===void 0)return a!==void 0&&i!==void 0?[`status=${i} redirect=${a}`]:i===void 0?[]:[`status=${i} no response body`];let s=i===void 0||n===`GET`?``:`status=${i}`,c=Q(t)&&!X(t)?Qt(t):null,l=c===null?void 0:Q(c.context.interpretation)?_e(c.context):c.context,u=l!==void 0&&Q(l)?Object.entries(l):[],d=u.filter(e=>Array.isArray(e[1])&&e[1].length>0&&e[1].every(Q)),f=new Set(d.map(([e])=>e)),p=Object.fromEntries(u.filter(([e])=>!f.has(e)));return[s,...X(t)?W(t,e,r):c===null?en(t)?G(t,[`filter`],t.meta,o):tn(t)?G(t,[`arrayFilterEntry`,`rangeFilterEntry`],t.filtersMeta,o):nn(t)?Yt(t,o):typeof t==`string`?t.split(`
|
|
17
|
+
`):K(t,``):[...W(c.page,e,r),...Object.keys(p).length===0?[]:K(p,``),...d.flatMap(([e,t])=>[`${e}:`].concat(qt(t,o)))]].filter(Boolean)}function W(e,t,n){let r=Xt(t),i=e.numberOfElements??e.content.length,a=Math.min(e.content.length,H),o=Math.max(1,a),s=(e.number??0)*(e.size??i),c=(e.totalElements??0)-s-i,l=e.number===void 0?``:` page=${e.number}`,u=e.size===void 0?``:` size=${e.size}`,d=e.totalElements===void 0?``:` total=${e.totalElements}`,f=e.totalPages===void 0?``:` totalPages=${e.totalPages}`,p=(e.number??0)+1,m=e.totalPages===void 0||p<e.totalPages,h=y(`page`,t.parameters);return[`rows=${i}${l}${u}${d}${f}`,a>=i?``:`page rows omitted: ${i-a} (${a}/${i} shown); ${e.content.length>a?S(t.transport,`.content`):`reread with ${y(`size`,t.parameters)} ${o} and ${h} ${Math.floor((s+a)/o)} through ${Math.floor((s+i-1)/o)} (MCP: size, page); pages start at 0`}`,r.length>0?`filters: ${r.join(` `)}`:``,n===void 0?``:`next: --cursor ${x(n)}`,c<=0||n!==void 0?``:m&&i===e.size?`more: ${c} rows not shown; use ${h} or ${y(`size`,t.parameters)} to see them`:`more: ${c} more matched but this response returns only these ${i}; narrow the query to reach them${m?` (${h} ${p} starts after this page)`:``}`,...qt(e.content.slice(0,a),t.transport)].filter(Boolean)}function qt(e,t){if(e.length===0)return[`(empty)`];if(!e.every(Q))return q(e,``);let n=Jt(e);if(n.length===0)return q(e,``);let r=e.slice(0,H).map(e=>{let t=J(e);return n.map(e=>t[e]??``)}),i=n.map(e=>e.split(`.`).at(-1)??e),a=i.map((e,t)=>{let n=r.map(e=>e[t]??``),i=Math.max(e.length,...n.map(e=>e.length));return e===`id`||e.endsWith(`Id`)?i:Math.min(32,i)}),o=e=>e.map((e,t)=>me(e,a[t]??12).padEnd(a[t]??12)).join(` `),s=[o(i),o(a.map(e=>`-`.repeat(e)))];return r.forEach(e=>s.push(o(e))),e.length>H&&s.push(`... ${e.length-H} more rows omitted; ${S(t)}`),s}function Jt(e){let t=e.map(e=>J(e)),n=new Set(t.flatMap(e=>Object.keys(e))),r=zt.filter(e=>n.has(e)),i=new Set(r.map(Y)),a=[...n].filter(e=>{let n=t.every(t=>/^-?\d+(?:\.\d+)?$/u.test(t[e]??`0`));return!e.includes(`.`)||/id$/iu.test(e)||i.has(Y(e))?!1:(n&&i.add(Y(e)),n)}),o=[...n].filter(e=>/(?:^|\.)id$/u.test(e)).slice(0,1),s=[...new Set([...r,...o,...a])],c=[...n].filter(e=>!s.includes(e)).filter(e=>!e.toLowerCase().includes(`logo`)).slice(0,Lt-s.length);return[...s,...c].slice(0,Lt)}function G(e,t,n,r){let i=t.flatMap(t=>e[t].map((e,n)=>({...e,path:`.${t}[${n}].choiceOption`}))),a=n!==void 0&&Q(n)?n:{},o=[`total`,`limit`].flatMap(e=>typeof a[e]==`number`?[` ${e}=${a[e]}`]:[]).join(``),s=[`filters=${i.length}${o}`];for(let e of i){let t=e.choiceOption.length,n=e.choiceOptionTotal===null?`unknown (degraded)`:e.choiceOptionTotal??t,i=e.choiceOptionTruncated===!0?` truncated`:``;s.push(`- ${e.filterKey} (${e.label}): choices ${t}/${n}${i}`),e.choiceOption.slice(0,U).forEach(t=>{s.push(` ${y(e.filterKey)} ${x(t.value)}`)}),t>U&&s.push(` ... ${t-U} choices omitted for ${e.filterKey}; ${S(r,e.path)}`)}return s}function Yt(e,t){let n=y(e.filterKey);return[`${e.filterKey}: ${e.result.length} matches`,...e.result.slice(0,U).map(e=>`${n} ${x(e)}`),e.result.length>U?`... ${e.result.length-U} matches omitted; ${S(t,`.result`)}`:``].filter(Boolean)}function Xt({endpoint:e,parameters:t}){let n=e.indexOf(`?`);return n<0?[]:[...new URLSearchParams(e.slice(n+1)).entries()].filter(([e,t])=>!Bt.has(e)&&t.length>0).map(([e,n])=>`${y(e,t)} ${x(n)}`)}function Zt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:void 0},[n,r,i]=[t(`method`),t(`endpoint`),t(`nextCursor`)];if(n===void 0||r===void 0)return null;let a=Reflect.get(e,`httpStatus`),o=Reflect.get(e,`response`),s=o===void 0?void 0:de.safeParse(o);return s!==void 0&&!s.success?null:{method:n,endpoint:r,httpStatus:typeof a==`number`?a:void 0,location:t(`location`),operationId:t(`operationId`),summary:t(`summary`),nextCursor:i===``?void 0:i,response:s?.data}}function K(e,t,n){if(e===void 0)return[];if($(e))return[`${t}${b(e,n)}`];if(Array.isArray(e))return q(e,t,n);let r=[];for(let[n,i]of Object.entries(e))if(i!==void 0){if($(i))r.push(`${t}${n}: ${b(i,n)}`);else{r.push(`${t}${n}:`);for(let e of K(i,`${t} `,n))r.push(e)}}return r.length===0?[`${t}(empty)`]:r}function q(e,t,n){if(e.length===0)return[`${t}(empty)`];let r=[];for(let i of e)if($(i))r.push(`${t}- ${b(i,n)}`);else{r.push(`${t}-`);for(let e of K(i,`${t} `))r.push(e)}return r}function J(e,t=``,n=0){return $(e)?t.length===0?{}:{[t]:v(e,t)}:n>Rt?{}:Array.isArray(e)?e[0]===void 0?{}:J(e[0],t,n+1):Object.fromEntries(Object.entries(e).flatMap(([e,r])=>{if(r===void 0)return[];let i=t.length===0?e:`${t}.${e}`;return $(r)?[[i,v(r,i)]]:Object.entries(J(r,i,n+1))}))}var Y=e=>e.split(`.`,1)[0],X=e=>Q(e)&&Array.isArray(e.content);function Qt(e){let[t,...n]=Object.entries(e).filter(e=>X(e[1])&&typeof e[1].totalElements==`number`);if(t===void 0||n.length>0)return null;let[r,i]=t;return{page:i,context:Object.fromEntries(Object.entries(e).filter(([e])=>e!==r))}}function $t(e){return Q(e)&&typeof e.label==`string`&&typeof e.filterKey==`string`&&Array.isArray(e.choiceOption)}var en=e=>Q(e)&&Z(e.filter),tn=e=>Q(e)&&Z(e.arrayFilterEntry)&&Z(e.rangeFilterEntry),Z=e=>Array.isArray(e)&&e.every($t),nn=e=>Q(e)&&typeof e.filterKey==`string`&&Array.isArray(e.result)&&e.result.every(e=>typeof e==`string`),Q=e=>typeof e==`object`&&!!e&&!Array.isArray(e),$=e=>typeof e!=`object`||!e;export{Me as a,Re as i,Wt as n,Be as r,Vt as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aventurevc/aventure-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.330",
|
|
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": "
|
|
36
|
+
"commit": "42f0a6a1e830c83922f8d356f9e410c24ffd87eb",
|
|
37
37
|
"openapiPath": "openapi/openapi.json",
|
|
38
|
-
"openapiSha256": "
|
|
38
|
+
"openapiSha256": "dbbccc8d4eebbb0bcc87cc110f81a172a78634aeb759c86f4019f20f1b5b43c7"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {}
|
|
41
41
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{t as EntityDetailSchema}from"./detail-BiztrlKS.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,E as t,S as n,_ as r,c as i,d as a,f as ee,g as o,i as s,n as c,p as l,s as u,t as d}from"./iso-l1vOidnb.js";import{t as f}from"./person-owner-BRGa5Dee.js";import{a as p,i as te,o as ne,r as m,t as re}from"./run-qEqhQEga.js";import{n as h}from"./allowance-type-DBLLduSR.js";var ie=s([`domicile`,`dominant`,`origin`]),ae=r({endDate:d().nullish(),id:a(),isCurrent:i(),role:ie.nullish(),startDate:d().nullish()}),oe=r({id:a().nullish(),name:n()}),se=r({countryCodeChar2:n().nullish(),countryCodeChar3:n().nullish(),id:a().nullish(),name:n(),unRegion:n().nullish(),unSubregion:n().nullish()}),ce=r({id:a().nullish(),name:n(),stateAbbrev:n().nullish()}),g=r({address:a().nullish(),addressLine1:n().nullish(),addressLine2:n().nullish(),association:u(ae).optional(),city:oe.nullish(),country:se.nullish(),countryAbbrev:n().nullish(),createdAt:c({offset:!0}).nullish(),fullAddress:n().nullish(),id:a().nullish(),isCurrent:i().nullish(),isHq:i().nullish(),isPrimary:i().nullish(),latitude:o().nullish(),longitude:o().nullish(),postalCode:n().nullish(),state:ce.nullish(),stateAbbrev:n().nullish(),street:n().nullish(),updatedAt:c({offset:!0}).nullish()}),le=s([`editorial`,`standardized`]),ue=Object.assign(e([le,n()]),{enum:le.enum}),de=r({isCurrent:i().nullish(),isPrimary:i().nullish(),name:n().max(255),registry:ue}),_=ee(de,r({bucket:n().nullish(),classificationId:a().nullish(),createdAt:c({offset:!0}).nullish(),id:a(),isCurrent:i().nullish(),isPrimary:i().nullish(),name:n().max(255),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),type:n(),updatedAt:c({offset:!0}).nullish()})),fe=r({category:n(),classificationId:a().nullish(),code:a().nullish(),codeText:n().max(255).nullish(),createdAt:c({offset:!0}).nullish(),edition:n().max(128).nullish(),id:a(),isCurrent:i().nullish(),isPrimary:i().nullish(),level:a().nullish(),name:n().max(255),registry:ue,updatedAt:c({offset:!0}).nullish()}),pe=r({geoLocationExposure:u(_).default([]).optional(),industry:u(_).default([]).optional(),mainProduct:u(_).default([]).optional(),standardizedClassification:u(fe).default([]).optional(),tag:u(_).default([]).optional(),typeCustomer:u(_).default([]).optional(),typeModel:u(_).default([]).optional(),typeOwnership:u(_).default([]).optional(),typeRevenue:u(_).default([]).optional(),typeTechnologyUsed:u(_).default([]).optional()}),me=s([`fundraiseRound`,`researchDetail`]),he=s([`preMoney`,`postMoney`,`reported`]),ge=r({amount:n().regex(/^-?[0-9]+(\.[0-9]+)?$/),asOfDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),basis:he.nullish(),currency:n().nullish(),postMoneyUsd:n().regex(/^-?[0-9]+(\.[0-9]+)?$/).nullish(),referenceValue:n().nullish(),source:me,sourceRef:n()}),_e=s([`UNKNOWN`,`NOT_APPLICABLE`,`RECORDED`]),v=s(`Angel.Pre-Seed.Seed.Series A.Series B.Series C.Series D.Series E.Series F.Series G.Series H.Series I.Series J.Series K.Series L.Series M.Series N.Series O.Series P.Series Q.Series R.Series S.Series T.Series U.Series V.Series W.Series X.Series Y.Series Z.Late Stage Private.Investment Firm.Fund.Nonprofit.Government.Public.Acquired.Acquired Subsidiary.Bankrupt`.split(`.`)),ve=Object.assign(e([v,n()]),{enum:v.enum}),y=r({applicability:_e.nullish(),currency:n().nullish(),currentValuation:ge.nullish(),disclosedStage:n().nullish(),disclosedStageTransactionId:t().nullish(),fundingRoundCount:a(),investorCount:a(),latestValuation:o().nullish(),mostRecentAmount:o().nullish(),mostRecentDate:d().nullish(),stage:ve.nullish(),totalRaised:o(),totalRaisedAmountRoundCount:a().nullish(),totalRaisedRoundCount:a().nullish(),totalRaisedUsd:o().nullish(),totalRaisedUsdRoundCount:a().nullish(),unconvertedRoundCount:a()}),b=r({expanded:n().nullish(),generatedDescription:n().nullish(),short:n().nullish()}),ye=s([`cloudflare`,`akamai`,`fastly`,`awsCloudfront`,`vercel`,`netlify`,`sucuri`,`incapsula`,`bunny`,`keycdn`,`cdn77`,`gcore`,`cdnetworks`,`azureCdn`,`leaseweb`,`digitalocean`,`stackpath`,`googlecloudCdn`,`none`,`unknown`]),be=s([`static`,`jsRequired`,`jsEnhanced`]),x=n(),S=r({crawlCdnProvider:ye.nullish(),crawlRenderMode:be.nullish(),createdAt:c({offset:!0}).nullish(),id:a().nullish(),isCurrent:i().nullish(),isPrimary:i().nullish(),owner:f.nullish(),sourceId:n().nullish(),status:n().nullish(),statusChecked:c({offset:!0}).nullish(),updatedAt:c({offset:!0}).nullish(),url:n(),urlType:x}),C=r({address:u(g),classification:pe,fundingDetail:y.nullish(),headquartersAddressId:a().nullish(),headquartersRemoteAsOf:c({offset:!0}).nullish(),publicControllingParentId:t().nullish(),text:b,urlLink:u(S)}),w=s([`SAFE`,`Convertible Note`,`Preferred Stock`,`Common Stock`,`Other Equity`,`Bond`,`Loan`,`Other Debt`,`Grant`,`Token`]),T=r({amountInvested:o().nullish(),createdAt:c({offset:!0}),financialInstrumentType:w.nullish(),id:t(),investor:f,investorName:n().nullish(),investorSlug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),leadInvestor:i(),transactionId:t(),updatedAt:c({offset:!0})}),E=r({core:m,fundingDetail:y.nullish()}),D=r({lastFetchedAt:c({offset:!0}).nullish(),publishedAt:c({offset:!0}).nullish(),recordedAt:c({offset:!0}),sourceDetail:n()}),O=s([`High`,`Medium`,`Low`,`Verified`]),xe=s([`direct`,`managedFund`]),k=r({round:n()}),A=r({amountInvested:o().nullish(),attributionType:xe,beneficialEntityId:t().nullish(),fundManagerRelationshipId:a().nullish(),joinId:t(),leadInvestor:i(),recordedEntityId:t().nullish(),round:k.nullish(),transactionId:t()}),Se=s([`round`,`roundType`,`financialInstrumentType`,`investorCount`,`amountRaised`,`currency`,`dateAnnounced`,`dateFundingComplete`,`valuationPostMoney`,`valuationPreMoney`,`dateInvestorExit`,`status`]),j=r({amountRaised:o().int().nullish(),createdAt:c({offset:!0}).nullish(),currency:n().nullish(),dataConfidence:O.nullish(),dateAnnounced:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),dateFundingComplete:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),dateInvestorExit:c({offset:!0}).nullish(),entity:E.nullish(),financialInstrumentType:w.nullish(),id:t(),investor:u(T).nullish(),investorAttribution:A.nullish(),investorCount:a().nullish(),publicSource:D.nullish(),rawRoundLabel:n().nullish(),round:n().nullish(),roundType:n().nullish(),sourceAttribution:u(A),unsupportedField:u(Se).optional(),updatedAt:c({offset:!0}).nullish(),valuationPostMoney:o().int().nullish(),valuationPreMoney:o().int().nullish()}),M=s([`Company`,`Private company`,`Public company`,`Public`,`Investment Firm`,`Fund`,`Nonprofit`,`Government`,`Business Line`,`Product`,`Service`,`Acquired Subsidiary`,`Acquired`,`Closed`,`Closed (Acquihire)`,`Inactive`]),Ce=Object.assign(e([M,n()]),{enum:M.enum}),N=r({headline:Ce,isAcquired:i().nullish(),isClosed:i().nullish(),isTerminal:i().nullish()}),P=r({entity:m,headquarters:g.nullish(),relationshipType:s([`fundManagerFirm`,`productService`])}),we=r({fundingStage:ve.nullish(),ownership:u(n()),pricingModel:u(n()),profileStatus:N.optional(),sellsTo:u(n()),totalRaised:o().nullish(),website:n().nullish()}),F=r({asOf:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),comparisonSignals:we.nullish(),createdAt:c({offset:!0}).nullish(),detail:n().nullish(),entity:m,id:a().nullish(),isCurrent:i().nullish(),isPrimary:i().nullish(),profileStatus:N.nullish(),publicSource:D.nullish(),get relationship(){return u(F)},relationshipType:n(),sourceEntityId:t().nullish(),targetEntityId:t().nullish(),updatedAt:c({offset:!0}).nullish()}),I=F,L=r({accelerator:m,acceleratorName:n(),asOfDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),batch:n().nullish(),id:n(),program:n().nullish(),status:n().nullish()}),R=s([`text`,`numeric`,`monetary`,`percentage`,`date`]),Te=s([`pastDue`,`withinThreeMonths`,`threeToSixMonths`,`sixToTwelveMonths`,`twelveToTwentyFourMonths`,`beyondTwoYears`]),Ee=r({asOfDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),bucket:Te,monthsFromNow:a(),targetDate:c({offset:!0})}),z=r({asOfDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),currentEligible:i().nullish(),decimalValue:n().nullish(),derivedRange:Ee.nullish(),discreteValue:o().nullish(),entityId:t(),id:a(),measurementBasis:n().nullish(),publicSource:D.nullish(),reportingScope:n().nullish(),textValue:n().nullish(),typeResearchDetail:n(),updatedAt:c({offset:!0}).nullish(),valueResearchDetail:n().nullish(),valueType:R}),B=r({characterCount:a(),meetsRequirements:i(),violation:u(n()),wordCount:a()}),V=r({compliance:B.nullish(),entityId:t(),id:a(),publicSource:D.nullish(),text:n(),textType:n(),updatedAt:c({offset:!0}).nullish()}),De=r({acceleratorParticipation:u(L),detail:u(z),snippet:u(V)}),H=s([`auto-match`,`needs-review`,`approved`,`rejected`]),Oe=r({createdAt:c({offset:!0}),entityId:t(),href:n().nullish(),internal:i(),matchStatus:H.nullish(),mention:n().nullish(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:h.nullish(),updatedAt:c({offset:!0})}),ke=r({createdAt:c({offset:!0}),href:n().nullish(),matchStatus:H.nullish(),mention:n().nullish(),personId:t(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),updatedAt:c({offset:!0})}),Ae=r({end:a().min(1),entity:Oe.nullish(),person:ke.nullish(),start:a().min(0)}),U=r({author:n().nullish(),category:n().nullish(),createdAt:c({offset:!0}).nullish(),excerpt:n().nullish(),externalNewsArticle:i().nullish(),id:a(),newsImageThumbnail:n().nullish(),newsUrlOriginal:n().nullish(),publication:n().nullish(),publishedAt:c({offset:!0}).nullish(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),title:n(),titleMention:u(Ae).optional(),updatedAt:c({offset:!0}).nullish()}),je=s([`aventureBlog`,`personalBlog`,`employerBlog`,`linkedin`,`xTwitter`,`medium`,`substack`,`other`]),Me=r({author:n().nullish(),createdAt:c({offset:!0}),externalId:n().nullish(),id:t(),isCurrent:i(),lastFetchedAt:c({offset:!0}).nullish(),mentionedEntityId:u(t()),mentionedPersonId:u(t()),owner:f,publishedAt:c({offset:!0}).nullish(),summary:n().nullish(),summaryGeneratedAt:c({offset:!0}).nullish(),title:n().nullish(),topic:n().nullish(),type:je,updatedAt:c({offset:!0}),url:n()}),Ne=s([`OPERATING`,`ACQUIRED`,`CLOSED`,`PUBLIC`,`UNKNOWN`]),Pe=Object.assign(e([Ne,n()]),{enum:Ne.enum}),Fe=s([`low`,`medium`,`high`]),Ie=r({asOfDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),currentEligible:i().nullish(),dataConfidence:Fe.nullish(),dateValue:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),decimalValue:n().nullish(),measurementBasis:n().nullish(),numericValue:o().nullish(),referenceValue:n().nullish(),reportingScope:n().nullish(),source:n().nullish(),textValue:n().nullish(),updatedAt:c({offset:!0}).nullish(),valueType:R}),Le=r({asOfDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),fact:Ie,id:n()}),Re=r({fundraiseInvestorJoin:i(),fundraiseTransaction:i(),operatingStatus:i(),relationship:i()}),ze=s([`Acquisition`,`Acquired`,`Acquired Subsidiary`]),Be=s([`Announced`,`Announced; subject to approvals and closing conditions`,`Active`,`Closed`,`Completed`,`In Progress`,`Open`]),Ve=r({acquiredEntity:m,acquirerEntity:m,amount:o().int().nullish(),announcedAt:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),asOf:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),completedAt:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),createdAt:c({offset:!0}).nullish(),currency:n().nullish(),dataConfidence:O.nullish(),evidence:Re,fundraiseTransactionId:t().nullish(),investorJoinId:t().nullish(),isCurrent:i().nullish(),publicSource:D.nullish(),relationshipId:a(),status:ze,transactionStatus:Be.nullish(),updatedAt:c({offset:!0}).nullish()}),He=r({entity:l(()=>$),investorAttribution:u(A),round:u(k),roundCount:a()}),Ue=s([`entity`,`person`,`newsArticle`,`blogPost`,`text`,`classificationTag`,`classificationCode`,`product`,`service`,`agentHelpDoc`,`researchSnippet`,`sourceDocument`]),We=Object.assign(e([Ue,n()]),{enum:Ue.enum}),W=r({computedAt:c({offset:!0}),cosineDistance:o(),cosineScore:o(),modelVersion:n(),rank:a(),sourceHash:n(),sourceId:n(),sourceType:We}),Ge=r({acceleratorParticipation:u(L),detail:u(z)}),G=r({core:m,enrichment:C,fundraiseRound:u(j),profileStatus:N.optional(),provider:P.nullish(),research:Ge,semanticMatch:W.nullish()}),K=r({isMonogram:i(),picture:n().nullish(),pictureVariant:u(ne).nullish()}),q=r({associationId:a(),endDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),entityAddress:u(g),entityId:t(),entityLogo:p,entityName:n().nullish(),entityOperatingStatus:n().nullish(),entitySlug:n().regex(/^[a-z0-9_-]+$/).max(255),entityType:h.nullish(),entityUrlLink:u(S),isCurrent:i().nullish(),personAddress:u(g),personId:t(),personImage:K,personName:n(),personSlug:n().regex(/^[a-z0-9_-]+$/).max(255),personUrlLink:u(S),score:a().nullish(),startDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),titleFunction:n().nullish(),titleId:a().nullish(),titleLevel:n().nullish(),titleName:n().nullish()}),Ke=s([`curated`,`semantic`,`precomputed`,`derived`,`computed`]),qe=r({compositeScore:o().nullish(),cosineScore:o().nullish(),curatedAsOf:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),curatedRelationshipType:n().nullish(),curatedSource:n().nullish(),derivedFromEntityId:t().nullish(),matchedSectionWeight:o().nullish(),origin:Ke,rank:a(),sharedSectionCount:a().nullish()}),Je=r({entity:G,similarity:qe}),Ye=r({core:m,fundingDetail:y.nullish(),similarity:qe,urlLink:u(S)}),Xe=r({compliance:B.nullish(),createdAt:c({offset:!0}).nullish(),get expandedText(){return Xe.nullish()},expandedTextId:a().nullish(),id:a(),isCurrent:i().nullish(),isPrimary:i().nullish(),language:n().nullish(),owner:f,text:n(),textName:n().nullish(),textType:n(),updatedAt:c({offset:!0}).nullish()}),Ze=Xe,Qe=s([`stored`,`derivedFromPreAndRaised`,`derivedFromPostMinusRaised`,`reportedAssumedPost`]),$e=r({amountRaised:o().int().nullish(),asOfDate:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/),confidence:Fe,currency:n(),decimalValue:n().nullish(),declaredBasis:he,derivation:Qe,detailId:a().nullish(),label:n().nullish(),measurementBasis:n().nullish(),reportingScope:n().nullish(),source:me,sourceRef:n(),valuationPostMoney:o().int().nullish(),valuationPreMoney:o().int().nullish()}),et=r({createdAt:c({offset:!0}).nullish(),description:n().nullish(),forkCount:a(),githubId:o().int(),homepageUrl:n().nullish(),id:o().int(),isArchived:i(),isFork:i(),language:n().nullish(),license:n().nullish(),name:n(),ownerLogin:n(),repoCreatedAt:c({offset:!0}).nullish(),repoPushedAt:c({offset:!0}).nullish(),stargazerCount:a(),topic:u(n()),updatedAt:c({offset:!0}).nullish(),url:n()}),tt=r({entity:m,funding:y}),nt=r({industry:_,recipientCount:a()}),J=r({empty:i().optional(),sorted:i().optional(),unsorted:i().optional()}),Y=r({offset:o().int().optional(),paged:i().optional(),pageNumber:a().optional(),pageSize:a().optional(),sort:J.optional(),unpaged:i().optional()}),rt=r({amountRaised:o().nullish(),dateAnnounced:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),id:t(),image:p,investorCount:a().nullish(),nameBrand:n(),round:n().nullish(),status:n().nullish(),valuationPostMoney:o().nullish()}),it=r({entity:m,headquartersCity:n().nullish(),headquartersCountry:n().nullish(),headquartersRegion:n().nullish(),industry:n().nullish()}),at=r({amount:o().nullish(),company:it,date:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),fundraiseTransaction:rt.nullish(),fundraiseTransactionId:t(),id:n(),investmentDate:c({offset:!0}),investorAttribution:A.nullish(),round:n().nullish()}),ot=r({investorAttribution:u(A),person:l(()=>Q),round:u(k),roundCount:a()}),st=s([`maidenName`,`formerName`,`stageName`]),ct=r({displayable:i().nullish(),name:n(),type:st.nullish()}),X=r({bioUpdatedAt:c({offset:!0}).nullish(),createdAt:c({offset:!0}).nullish(),gender:n().nullish(),id:t(),image:K,lastModifiedAt:c({offset:!0}).nullish(),nameAlias:u(ct),nameDisplay:n(),nameFirst:n().nullish(),nameFull:n(),nameLast:n().nullish(),nameMiddle:n().nullish(),nickname:n().nullish(),publicId:n().regex(/^p[0-9A-Za-z]{12}$/).nullish(),semanticMatch:W.nullish(),slug:n().regex(/^[a-z0-9_-]+$/).max(255),suffix:n().nullish(),text:b,updatedAt:c({offset:!0}).nullish()}),lt=s([`precomputed`,`live`]),ut=r({compositeScore:o().nullish(),cosineScore:o().nullish(),matchedSectionWeight:o().nullish(),origin:lt,rank:a(),sharedSectionCount:a().nullish()}),dt=r({currentRole:q.nullish(),person:X,similarity:ut}),ft=s([`by`,`about`]),pt=s([`newsArticle`,`blogPost`,`externalSocialPost`,`repositoryOwner`,`repository`,`webSite`,`webPage`,`researchPaper`]),mt=r({canonicalUrl:n().nullish(),contentId:n(),contentType:pt,createdAt:c({offset:!0}).nullish(),publishedAt:c({offset:!0}).nullish(),relation:ft.nullish(),sourceDomain:n().nullish(),sourceName:n().nullish(),summary:n().nullish(),title:n(),topic:n().nullish(),updatedAt:c({offset:!0}).nullish(),url:n().nullish(),year:a().nullish()}),ht=s([`listed`,`suspended`,`delisted`]),gt=Object.assign(e([ht,n()]),{enum:ht.enum}),_t=s([`ein`,`secCik`,`ticker`,`lei`,`duns`,`isin`,`cusip`,`crd`,`firmCrd`,`secPrivateFundId`,`npi`,`ipedsUnitId`,`ncesSchoolId`,`ncesLeaId`,`ncesPssId`,`orcid`,`fdicCert`,`ncuaCharter`,`rssd`,`holdingCompanyRssd`,`signalNfxFirm`,`signalNfxPerson`,`signalNfxCompany`,`folk`]),vt=Object.assign(e([_t,n()]),{enum:_t.enum}),yt=r({createdAt:c({offset:!0}),effectiveFrom:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),effectiveTo:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),id:a(),identifier:n(),idType:vt,listingStanding:gt.nullish(),owner:f,shareClass:n().nullish(),source:n().nullish(),standingAsOf:n().regex(/^(?!0000)[0-9]{4}(?:-(?:0[1-9]|1[0-2])(?:-(?:0[1-9]|[12][0-9]|3[01])(?:T(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?(?:Z|[+-](?:(?:0[0-9]|1[0-7]):[0-5][0-9]|18:00)))?)?)?$/).nullish(),updatedAt:c({offset:!0}),venue:n().nullish()});r({content:u(Me).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(e([_,fe])).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(Le).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(m).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(Ve).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(l(()=>$)).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(T).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(j).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(l(()=>He)).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(G).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(q).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(I).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(z).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(V).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(Je).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(Ye).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(Ze).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(S).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u($e).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(et).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(re).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()});var bt=r({content:u(tt).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),xt=r({content:u(nt).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()});r({content:u(U).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(X).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(l(()=>Q)).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(at).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(l(()=>ot)).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(dt).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()}),r({content:u(mt).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()});var St=r({content:u(G),number:a(),size:a(),totalElements:o().int(),totalPages:a()}),Ct=r({content:u(U),number:a(),size:a(),totalElements:o().int(),totalPages:a()}),wt=r({content:u(X),number:a(),size:a(),totalElements:o().int(),totalPages:a()});r({content:u(yt).optional(),empty:i().optional(),first:i().optional(),last:i().optional(),number:a().optional(),numberOfElements:a().optional(),pageable:Y.optional(),size:a().optional(),sort:J.optional(),totalElements:o().int().optional(),totalPages:a().optional()});var Tt=r({ambiguousSectorCount:a(),classifiedRecipientCount:a(),observedAt:c({offset:!0}),outcome:Pe,rankableRecipientCount:a(),recipient:l(()=>bt),recipientCount:a(),sector:l(()=>xt),unknownSectorCount:a()}),Et=r({count:a(),stage:n()}),Dt=r({acquiredRecipientCount:a().nullish(),attributedInvestmentCount:a(),averageAmountInvestedUsd:o().nullish(),closedRecipientCount:a().nullish(),currentPortfolioCount:a(),largestAmountInvestedUsd:o().nullish(),operatingRecipientCount:a().nullish(),portfolio:l(()=>Tt).nullish(),portfolioCompanyCount:a(),publicRecipientCount:a().nullish(),smallestAmountInvestedUsd:o().nullish(),topInvestmentStage:u(Et),totalAmountInvestedUsd:o().nullish(),totalInvestment:a(),totalPortfolioExit:a(),totalWriteOff:a()}),Ot=r({address:u(g),urlLink:u(S)}),Z=r({isCurrent:i().nullish(),personId:t(),personImage:K,personName:n(),personSlug:n().regex(/^[a-z0-9_-]+$/).max(255),titleName:n().nullish()}),kt=r({entity:E,keyPerson:u(Z)}),At=r({colleague:u(Z),employeeCount:Le.nullish(),entity:E,primaryAddress:g.nullish(),recentNews:u(U),similarEntity:u(kt)}),jt=r({overlapCount:a(),person:Z,round:n().nullish(),sharedEntity:m.nullish(),transactionId:t().nullish()}),Mt=r({careerContext:u(At),coInvestor:u(jt),computedAt:c({offset:!0}).nullish()}),Q=r({articleCount:a().nullish(),association:u(q),blogPost:u(Me).nullish(),core:X,coveringRunId:t().nullish(),enrichment:Ot,graph:Mt.nullish(),investment:u(at),investorActivity:l(()=>Dt).nullish(),nameAlias:u(ct),similar:u(dt).nullish()}),$=r({core:m,coveringRunId:t().nullish(),enrichment:C,fundraiseRound:u(j),newsArticle:u(U),person:u(l(()=>Q)),profileStatus:N.optional(),provider:P.nullish(),publicUrl:n().nullish(),relationship:u(I),research:De,sitemap:te,uniqueId:u(yt)});export{wt as a,W as c,x as d,Ct as i,Oe as l,Q as n,Je as o,St as r,G as s,$ as t,j as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{C as t,S as n,_ as r,c as i,d as a,g as o,i as s,s as c}from"./iso-l1vOidnb.js";import{c as l,d as u,l as ee,s as d,u as te}from"./tool-policy-C41oB3KJ.js";import{i as ne,t as f}from"./human-text-cap-dR2SJQJC.js";import{n as re,t as ie}from"./contract-parameter-DtCFCd5o.js";var p=2,ae=new Set(`a.an.the.and.or.for.to.of.in.on.at.by.with.from.into.is.are.be.do.does.how.what.which.that.this.these.those.i.me.my.we.our.you.your.it.its.please.want.need.can.could.should.would`.split(`.`));function m(e,t){let n=v(t);n.length!==0&&(e.add(n),(n===`individual`||n===`individuals`)&&m(e,`person`),h(e,oe(n),n),h(e,se(n),n))}function oe(e){if(e===`people`)return`person`;let t=e.endsWith(`ies`)?e.slice(0,-3):``;if(t.length>=p&&!t.endsWith(`v`)&&/[^aeiou]$/u.test(t))return`${e.slice(0,-3)}y`;let n=e.endsWith(`es`)?e.slice(0,-2):``;if(n.length>=p&&n!==`us`&&/(?:s|ss|sh|ch|x|z)$/u.test(n))return n;if(e.length>p&&e.endsWith(`s`)&&!e.endsWith(`ss`)&&!e.endsWith(`us`)&&e!==`news`)return e.slice(0,-1)}function se(e){if(e===`person`)return`people`;if(e!==`new`&&e!==`news`&&e!==`status`&&e!==`us`){if(e.length>=p&&e.endsWith(`y`)&&/[^aeiou]y$/u.test(e))return`${e.slice(0,-1)}ies`;if(!(e.length>=p&&e.endsWith(`es`)))return e.length>=p&&/(?:s|ss|sh|ch|x|z)$/u.test(e)?`${e}es`:e.endsWith(`s`)?void 0:`${e}s`}}function h(e,t,n){t!==void 0&&t!==n&&t.length>=p&&/^[a-z]+$/u.test(t)&&e.add(t)}function g(e){let t=new Set(_(e)),n=Array.from(t);for(let e of n)m(t,e);return t}function ce(e){return _(e).map(g)}function le(e,t){if(e.length===0)return!1;let n=g(t.join(` `));return e.every(e=>[...e].some(e=>n.has(e)))}function _(e){return v(e).split(/[^a-z0-9]+/u).filter(e=>e.length>0&&!ae.has(e))}function v(e){return e.trim().replace(/([a-z0-9])([A-Z])/gu,`$1 $2`).replace(/[_-]/gu,` `).replace(/\s+/gu,` `).toLowerCase().replace(/\blook up\b/gu,`lookup`)}function y(e,t){return e.map(e=>{let n=e.requestBody??[],r=[...e.parameters.map(e=>b(e)),...n.flatMap(e=>e.parameter.map(t=>b(t,n.length>1?e.contentType:void 0))),...ue(n)],i=[t,...e.cliPath].join(` `),a=e.mutates===!0||te(e.intent),o=n[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:a,destructive:ee(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse?null:u(e,`public`),body:{hasBody:o!==void 0,kind:o?.kind??null,...o!==void 0&&n.length>1?{contentType:o.contentType}:{},required:o?.required??!1,description:o?.description??``,requiredPath:o?.requiredPath??[]},flags:r,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},...e.header===void 0||e.header.length===0?{}:{header:e.header},summary:e.summary,description:e.description,...e.deprecated===void 0?{}:{deprecated:e.deprecated}}})}function b(e,t){let n=e.flag.split(/\s+/u);return{name:n[0]??e.flag,optionKey:e.optionKey,wireName:e.name,location:e.location,required:e.required,placeholder:n.length<=1?null:n.slice(1).join(` `),description:e.description,choices:e.choices??[],...t===void 0?{}:{contentType:t}}}function ue(e){if((e?.length??0)<=1)return[];let t=e?.map(({contentType:e})=>e)??[];return[{name:`--content-type`,optionKey:`contentType`,wireName:`Content-Type`,location:`body`,required:!1,placeholder:`<media-type>`,description:`Select the request body encoding, never an uploaded file's media type; omit for ${t[0]}.`,choices:t}]}function x(e){return e.flags.filter(({contentType:t})=>t===void 0||t===e.body.contentType)}var de=[`-id`,`-slug`,`-url`],fe=[`--id`,`--slug`,`--url`],pe=`/v1/lookup`,me=`--from-file "<path>"`;function he(t,n,r=e().bin[0]){let i=y(n,r),a=i.find(e=>e.operationId===t);return a===void 0?[]:w(a,i)}function S(t,n,r=e().bin[0]){let i=n.find(e=>e.operationId===t),[a]=i===void 0?[]:y([i],r);return a&&C(a,E(a,!1))}function ge(t,n,r,i=e().bin[0]){let a=e=>{let t=e.findIndex((e,t)=>r[t]!==e);return t===-1?e.length:t},o=`${r[0]} get`,[s,c]=n.filter(({method:e,path:n,parameters:r,cliPath:i})=>{let s=r.filter(({location:e})=>e===`path`),[c]=s;return e===`GET`&&s.length===1&&c?.flag.split(/\s+/u)[0]===t&&n.endsWith(`/{${c.name}}`)&&(a(i)>1||i.join(` `)===o)}).toSorted((e,t)=>a(t.cliPath)-a(e.cliPath));if(s!==void 0&&(c===void 0||a(c.cliPath)!==a(s.cliPath)))return S(s.operationId,n,i)}function C(e,t){return[e.cli.command,...t,`--data`].join(` `)}function w(e,t){return[`example: ${C(e,E(e))}`,..._e(e,t)]}function _e(e,t){return x(e).flatMap(e=>{if(!e.required||!e.optionKey.endsWith(`Id`))return[];let n=`${e.optionKey.slice(0,-2)}Slug`,r=t.find(e=>e.method===`GET`&&/\/lookup(?:-exact)?$/u.test(e.path)&&e.flags.some(e=>e.optionKey===n)),i=r?.flags.find(e=>e.optionKey===n);if(r===void 0||i===void 0)return[];let a=`${r.cli.command} ${D(i)} --data`,o=t.find(e=>e.method===`POST`&&e.path===pe),s=o?.flags.find(e=>e.optionKey===`name`),c=o?.flags.find(e=>e.optionKey===`kind`),l=c?.choices.find(t=>e.optionKey.toUpperCase().startsWith(t)),u=`lookup: ${e.name} from a slug: ${a}`;return o===void 0||s===void 0||c===void 0||l===void 0?[u]:[u,`lookup: ${e.name} from a name or URL: ${o.cli.command} ${c.name} ${l} ${D(s)} --data, then match.owner.${e.optionKey} when status is MATCHED`]})}var T=/(?:^|\.)text$/u;function E(e,t=!0){let n=x(e),r=n.filter(e=>e.required),i=e.body.kind===`json`&&n.some(e=>e.location===`body`&&T.test(e.wireName)&&(e.required||!e.wireName.includes(`.`))),a=i?r.filter(e=>e.location!==`body`):r,o=(r.length>0||!t?a:ve(e)).map(D);return i||(e.body.required||e.body.requiredPath.length>0)&&!a.some(e=>e.location===`body`)?[...o,me]:o}function ve(e){let t=new Set;m(t,e.resource);for(let n of de)for(let r of t){let t=e.flags.find(e=>e.name===`--${r}${n}`);if(t!==void 0)return[t]}for(let t of fe){let n=e.flags.find(e=>e.name===t);if(n!==void 0)return[n]}return[]}function D(e){return e.placeholder===null?e.name:`${e.name} "${e.placeholder}"`}var O=s([`HIGH`,`MEDIUM`,`LOW`]),ye=s([`PAID_PLAN`,`DAILY_ALLOWANCE`]),k=s([`OPERATION`,`SKILL`,`PROMPT`,`COMPLETION_GATE`,`RESEARCH_DETAIL_TYPE`,`RESEARCH_SNIPPET_TYPE`,`TEXT_TYPE`]),A=Object.assign(t([k,n()]),{enum:k.enum}),j=r({billingAccess:ye.nullish(),excerpt:n(),sourceId:n(),sourceType:A,sourceVersion:n().nullish()}),be=r({instruction:n(),operationId:n(),planTaskKey:c(n()).optional(),publishesAnalysis:i().optional(),stepKey:n().optional(),title:n().nullish()}),xe=r({body:n(),expectation:n(),method:c(n()),override:n(),reject:c(n()),typeCatalog:n()}),M=r({cliCommand:n(),mcpTool:n().nullish(),step:be,title:n().nullish(),writeGuidance:xe.nullish()}),N=s([`ENTITY`,`NEWS`,`TEXT`,`FACT`,`WRITER_BRIEF`]),Se=Object.assign(t([N,n()]),{enum:N.enum}),Ce=r({allowedValue:n().nullish(),description:n(),key:n(),required:i().default(!0).optional(),type:Se}),P=r({catalogRevision:a().optional(),gateId:c(n()).optional(),input:c(Ce),step:c(M),taskKey:n().optional()}),F=s([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),I=r({candidate:c(j),operationId:n().nullish(),outcome:F,probability:o().nullish(),taskKey:n().nullish(),taskPlan:P.nullish()}),we=r({answer:n(),citation:c(j),confidence:O,resolution:I.nullish()});function L(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>R(t,re(e,t))),r=(t?.parameter??[]).map(t=>R(t,ie(e,t)));return{selector:n.filter(e=>e.location===`path`||z(e)),pagination:n.filter(B),filter:[...n.filter(V),...r.filter(V)],body:r.filter(e=>!V(e))}}function R(e,t){let{in:n,inputName:r,...i}=e;return{...i,flag:l(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function z(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function B(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function V(e){return e.location!==`path`&&!z(e)&&!B(e)}function H(e){return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,tool:d(e),scope:e.projection.scope,requiredInput:De(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]}}function U(e,t){let n=e.requestBody?.[0],r=H(e),i=W(e);return t?{...r,...i===void 0?{}:{paidPlan:i},resource:e.resource,bodyKind:n?.kind??null,bodyRequired:n?.required??!1,requiredBodyPath:n?.requiredPath??[],argument:L(e)}:{...r,optionalInput:Oe(e),arrayInput:ke(e),...i===void 0?{}:{paidPlan:i}}}function Te(e){let t=L(e),n=e=>e.filter(e=>e.required);return{...U(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function Ee(e){let{cli:t,scope:n,...r}=H(e),i=W(e);return{...r,...i===void 0?{}:{paidPlan:i},optionalDetailOmitted:!0}}function De(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function Oe(e){let t=e.requestBody?.[0],n=new Set(t?.requiredPath??[]);return{query:e.parameter.filter(e=>e.in===`query`&&!e.required).map(({name:e})=>e),body:(t?.parameter??[]).filter(({name:e})=>!n.has(e)).map(({name:e})=>e)}}function W(e){return e.response.find(({status:e})=>e===`402`)?.description}function ke(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var G=160,K=`Operation catalog matches`,Ae=[`whole`,`described`,`requiredDescribed`,`optionalNamed`,`optionalGrouped`],q=e=>`${[K,...e].join(`
|
|
2
|
-
`)}\n`;function je(e,t=[],n=`mcp`){if(!Array.isArray(e)||e.length===0||!e.every(Pe))return null;let r=e,i=n===`mcp`?`structuredContent.data`:`the --data --to-file <path> output`,a=e=>ne([K,...e,...t]);for(let e of Ae){let t=[...r.flatMap(t=>X(t,e)),...Y(r,e,i)];if(a(t))return q(t)}let o=(e,t=r.length-e)=>{let n=r.slice(e),a=n.length-t;return[...r.slice(0,e).flatMap(e=>X(e,`optionalGrouped`)),...Y(r.slice(0,e),`optionalGrouped`,i),...n.length===0?[]:[`... ${n.length} more operations omitted to fit ${f} UTF-8 bytes: ${[...n.slice(0,t).map(({operationId:e})=>e),...a>0?[`and ${a} more in ${i}`]:[]].join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`]]},s=[...r.keys()].findLast(e=>a(o(e)));return q(s===void 0?o(0,[...r.keys()].findLast(e=>a(o(0,e)))??0):o(s))}var J=e=>`call aventure_help with q=<operationId> and limit=1; inspect argument and optionalInput in ${e} for the retained inputs`;function Y(e,t,n){let r=t===`optionalGrouped`&&e.some(e=>X(e,t).some(e=>e.includes(`.{`)))?[`... optional input names sharing a prefix are grouped: a.{b, c} names a.b and a.c.`]:[];return[...Me(e,t,n),...r]}function Me(e,t,n){let r=e.flatMap(e=>`argument`in e?Object.values(e.argument).flat():[]),i=t===`whole`?0:r.filter(e=>e.description.length>G&&(t===`described`||e.required)).length,a=i===0?[]:[`... ${i} argument descriptions shortened; inspect each row's argument in ${n} for full descriptions.`];if(e.some(e=>`optionalDetailOmitted`in e))return[...a,e.some(e=>`argument`in e)?`... optional argument details omitted: the full list exceeds the result cap; ${J(n)}.`:`... optional inputs omitted: the full list exceeds the result cap; call aventure_help with q=<operationId> and limit=1 to read one operation's inputs.`];if(t===`whole`||!e.some(e=>`argument`in e))return[];if(t===`described`)return a;let o=t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`,s=r.filter(({required:e})=>!e).length;return[...a,`... ${s} ${o} omitted to fit ${f} UTF-8 bytes; ${n} carries them, and ${J(n)}.`]}function X(e,t){let n=`argument`in e?Object.values(e.argument).flat():[],r=n.filter(({required:e})=>!e).map(({name:e})=>e);return[`${e.operationId} ${e.method} ${e.path} (${e.tool})`,` ${e.summary}`,` required: ${e.requiredInput.length===0?`none`:e.requiredInput.join(`, `)}`,` responseContentType: ${e.responseContentType.length===0?`none`:e.responseContentType.join(`, `)}`,...`optionalInput`in e?Object.entries(e.optionalInput).filter(([,e])=>e.length>0).map(([e,n])=>` optional ${e}: ${Z(n,t)}`):[],...`arrayInput`in e&&e.arrayInput.length>0?[` JSON array inputs: ${e.arrayInput.join(`, `)}`]:[],...`paidPlan`in e&&e.paidPlan!==void 0?[` paid plan: ${e.paidPlan}`]:[],...n.filter(({required:e})=>e||t!==`optionalNamed`&&t!==`optionalGrouped`).map(e=>Ne(e,e.required||t!==`requiredDescribed`,t)),...(t===`optionalNamed`||t===`optionalGrouped`)&&r.length>0?[` optional inputs: ${Z(r,t)}`]:[]]}function Z(e,t){if(t!==`optionalGrouped`)return e.join(`, `);let n=new Map;for(let t of e){let e=n,r=t.split(`.`);r.forEach((t,n)=>{let i=e.get(t)??{end:!1,child:new Map};e.set(t,i),n===r.length-1&&(i.end=!0),e=i.child})}let r=(e,t)=>{let n=[...t.child].flatMap(([n,i])=>t.child.size===1?r(`${e}.${n}`,i):r(n,i));return[...t.end?[e]:[],...t.child.size>1?[`${e}.{${n.join(`, `)}}`]:n]};return[...n].flatMap(([e,t])=>r(e,t)).join(`, `)}function Ne(e,t,n){let r=[e.location,e.required?`required`:void 0,e.schemaType,e.schemaFormat,e.schemaEnum===void 0?void 0:`choices: ${e.schemaEnum.join(`, `)}`,e.itemSchemaEnum===void 0?void 0:`item choices: ${e.itemSchemaEnum.join(`, `)}`,e.schemaDefault===void 0?void 0:`default: ${JSON.stringify(e.schemaDefault)}`,e.itemSchemaType===void 0?void 0:`items: ${e.itemSchemaType}${e.itemSchemaFormat===void 0?``:` (${e.itemSchemaFormat})`}`].filter(e=>e!==void 0).join(`, `),i=` ${e.name} (${r})`;return t?`${i}: ${n===`whole`||e.description.length<=G?e.description:`${e.description.slice(0,157)}...`}`:i}function Pe(e){return typeof e==`object`&&!!e&&`operationId`in e&&typeof e.operationId==`string`&&`requiredInput`in e&&Array.isArray(e.requiredInput)&&`intent`in e&&`summary`in e}function Q(e){let t=t=>{let n=(`parameter`in e?e.parameter:e.parameters.map(e=>({...e,in:e.location,schemaDefault:e.defaultValue}))).filter(e=>e.in===t&&e.required&&e.schemaDefault===void 0).map(({name:e})=>[e,`<${e}>`]);return n.length===0?void 0:Object.fromEntries(n)},n=t(`path`),r=t(`query`);return{tool:d(e),arguments:{operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:Ie(e)}}}}var Fe=4;function Ie(e){let t=e.requestBody?.[0];if(t===void 0)return{};if(t.requiredPath.length>0||e.intent!==`lookup`||t.schemaType===`array`)return Le(t.requiredPath);let n=t.parameter;return Object.fromEntries(n.flatMap(e=>{let{name:t,schemaType:n,schemaFormat:r}=e,i=`optionKey`in e?e.choices:e.schemaEnum;return t.includes(`.`)||n!==`string`||r!==void 0?[]:i===void 0?[[t,`<${t}>`]]:i.length>Fe?[]:[[t,`<${i.join(`|`)}>`]]}))}function Le(e){let t={},n=e.filter(t=>!e.some(e=>e.startsWith(`${t}.`)||e.startsWith(`${t}[]`)));for(let e of n){let n=e.split(`.`),r=n.slice(0,-1).reduce(Re,t);r[n.at(-1)??e]=`<${e}>`}return t}function Re(e,t){let n=t.replace(/\[\]$/u,``),r=e[n],i=Array.isArray(r)?r[0]:r;if(typeof i==`object`&&i&&!Array.isArray(i))return i;let a={};return e[n]=t.endsWith(`[]`)?[a]:a,a}function ze(e){let t=W(e);return{mcpCall:Q(e),...t===void 0?{}:{paidPlan:t}}}function Be(e){let t=$(e.description);return{useFor:t.useFor||e.summary||e.description||`${e.method} ${e.path}`,notFor:t.notFor}}function $(e){let t=e.match(/USE FOR:\s*([\s\S]*?)(?:NOT FOR:|$)/iu),n=e.match(/NOT FOR:\s*([\s\S]*?)$/iu);return{useFor:t?.[1]?.trim()??``,notFor:n?.[1]?.trim()??``}}export{le as C,ce as D,v as E,m as S,_ as T,he as _,je as a,y as b,Ee as c,F as d,P as f,x as g,T as h,ze as i,Te as l,O as m,$ as n,Q as o,A as p,Be as r,U as s,K as t,we as u,ge as v,g as w,S as x,w as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,i as t,r as n}from"./result-envelope-D0HcstPt.js";import{V as r,m as i,n as a,u as o}from"./tool-policy-C41oB3KJ.js";import{t as s}from"./openapi-snapshot-C3NgiUZo.js";import{C as c,D as l,E as u,S as d,T as f,c as p,i as m,l as h,n as g,o as _,r as v,s as y,t as b,u as x,w as S}from"./help-catalog-n_tlskK9.js";var C=/\b(?:https?:\/\/)?(?:[a-z0-9-]+\.)+[a-z]{2,}(?::\d+)?(?:\/\S*)?/giu,w=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/giu,T=/^[a-z0-9]+(?:-[a-z0-9]+)+$/u,E=250,D=40,O=100;function k(e,t){let n=new Set,r=[],i=/\bslugs?\b/iu.test(e);return{text:e.replace(w,()=>(n.add(`uuid`),` `)).replace(C,e=>{n.add(`url`);let t=e.replace(/^(?:https?:\/\/)?[^/]+/iu,``).replace(/[?#].*$/su,``).split(`/`).filter(e=>e.length>0).map(e=>e.toLowerCase()),i=t.at(-1);return i!==void 0&&T.test(i)&&(n.add(`slug`),t.pop()),r.push(...t.flatMap(e=>e.split(/[^a-z0-9]+/u))),` `}).split(/\s+/u).filter(e=>{let r=e.replace(/^[^a-z0-9]+|[^a-z0-9]+$/giu,``).toLowerCase(),a=T.test(r)&&!t.has(r)&&(i||/\d/u.test(r));return a&&n.add(`slug`),!a}).join(` `).trim(),kind:n,urlPathWord:r.filter(e=>e.length>0)}}function A(e,t,n){return e===`uuid`?/(?:^id|Id)$/u.test(t)&&n.includes(`{${t}}`):t===e}function j(e,t){let n=new Set;for(let r of e){let e=new Set;d(e,r);let i=t.filter(({cliPath:t})=>e.has(t[0]??``)),a=i.length>0?i:t.filter(({cliPath:t})=>t.some(t=>e.has(t)));for(let{resource:e}of a)n.add(e)}return n}function M(e,t,n){if(n.intent!==`read`&&n.intent!==`lookup`)return 0;let r=new Set(f(n.summary)),i=0;for(let t of e.kind)n.directParameterName.some(e=>A(t,e,n.path))&&(i+=E,r.has(t)&&(i+=D));if(i===0)return 0;let a=new Set(f(`${n.summary} ${n.description}`));return(t.size>0?t.has(n.resource):e.urlPathWord.some(e=>{let t=new Set;return d(t,e),[...t].some(e=>a.has(e))}))&&(i+=O),i}var N=40,P=4,F=3,I=1,L=new Map,R=new WeakMap;function z(e){let t=L.get(e);if(t!==void 0)return t;let n=s(),a=r(n.paths,e),o=a===null?new Map:i(n,a.operation.responses,F);return L.set(e,o),o}function B(e,t,n){let r=0,i=V(n);for(let[e,i]of n)t.has(e.toLowerCase())&&(r+=N*(4-i)/4);for(let t of e){let e=Math.min(...[...t].map(e=>i.get(e)??1/0));e<=I&&(r+=P*(2-e))}return r}function V(e){let t=R.get(e);if(t!==void 0)return t;let n=new Map;for(let[t,r]of e){if(r>I)continue;let e=new Set;for(let n of f(t))d(e,n);for(let t of e)n.set(t,Math.min(n.get(t)??r,r))}return R.set(e,n),n}var H=5,U=.5,W=15,G=30,K=2,ee=100,q=.5;function J(e,t,n){if(e.trim().length===0)return t.map(e=>({item:e,score:1}));let r=t.map(e=>({item:e,fields:n(e)})),i=k(e,new Set(r.flatMap(({fields:e})=>e.cliPath))),a=j(i.urlPathWord,r.map(({fields:e})=>e)),o=u(i.text);if(o.length===0&&i.kind.size===0)return t.map(e=>({item:e,score:1}));let s=S(o),c=l(o),d=new Set(i.text.toLowerCase().split(/[^a-z0-9]+/u));return r.map(({item:e,fields:t})=>({item:e,fields:t,score:(o.length===0?0:$({normalizedQuery:o,tokens:s,termForm:c,queryWord:d},t))+M(i,a,t)})).filter(({score:e})=>e>0).toSorted((e,t)=>Number(e.fields.deprecated===!0)-Number(t.fields.deprecated===!0)||t.score-e.score||e.fields.cliPath.length-t.fields.cliPath.length||e.fields.cliPath.join(` `).localeCompare(t.fields.cliPath.join(` `))||e.fields.operationId.localeCompare(t.fields.operationId)).map(({item:e,score:t})=>({item:e,score:t}))}var Y=new WeakMap;function X(e){let t=Y.get(e);if(t!==void 0)return t;let n=e.requestBody??[],r=[...e.parameter,...n.flatMap(e=>e.parameter)],i={...e,cliPath:e.projection.cliPath,enumParameter:r.map(e=>({values:e.itemSchemaEnum??e.schemaEnum??[],direct:e.name===e.inputName})),parameterName:r.flatMap(e=>[e.name,e.inputName]),directParameterName:e.parameter.map(e=>e.name),parameterDescription:[...r,...n].map(({description:e})=>e),responseFieldLevel:z(e.operationId)};return Y.set(e,i),i}function Z(n,r){let i=n.q?.trim()??``,a=J(i,r.filter(e=>Q(n,e)&&(i.length>0||e.deprecated!==!0)),X),o=(a[0]?.score??0)*U,s=a.filter(({score:e})=>e>=o),c=n.limit===void 0||!Number.isFinite(n.limit)?H:n.limit,l=Math.min(s.length,Math.max(0,Math.trunc(c))),u=s.slice(0,l).map(({item:e})=>e),d={totalOperations:r.length,matched:s.length,returned:u.length},f=u.length===1,m=u.map(e=>y(e,f)),g=e(b,m,{counts:d}),_=t(g),v=f?u.map(h):u.map(p);return{summary:b,data:_?m:v,counts:d}}function Q(e,t){let{root:n}=e;return!(e.method!==void 0&&t.method!==e.method||e.scope!==void 0&&t.projection.scope!==e.scope||n&&t.resource!==n&&t.projection.cliPath[0]!==n)}function $({normalizedQuery:e,tokens:t,termForm:n,queryWord:r},i){let a=oe(i),s=ie(i),l=0;a.some(t=>t===e)&&(l+=100),a.some(t=>t.includes(e))&&(l+=40),l+=ae(e,a);let p=new Set(a.flatMap(f)),m=new Set(s.flatMap(f));for(let e of t)a.some(t=>t===e)?l+=20:m.has(e)?l+=8:p.has(e)&&(l+=K);for(let e of i.cliPath){let n=new Set;for(let t of e.split(`-`))d(n,t);[...n].some(e=>t.has(e))&&(l+=W)}c(n,s)&&(l+=200),n.length>1&&s.some(t=>t.includes(e))&&(l+=ee),i.parameterName.some(t=>u(t)===e)&&(l+=G);let h=new Set(i.parameterDescription.flatMap(f));for(let e of t)h.has(e)&&(l+=K);return l+=ce(t,i.enumParameter),[`list`,`search`,`find`,`browse`].some(e=>t.has(e))&&/^(?:list|search)[A-Z]/u.test(i.operationId)&&(l+=30),l+=B(n,r,i.responseFieldLevel),l-=se(e,t,i.description),o(i.intent)&&!re(r)?l*q:l}var te=`edit change set fix rename link unlink mark publish correct`.split(` `),ne=new Set([...Object.entries(a).filter(([,e])=>o(e)).map(([e])=>e),...te]);function re(e){return[...e].some(e=>ne.has(e))}function ie(e){return[e.operationId,e.cliPath.join(` `),e.summary].map(u).filter(e=>e.length>0)}function ae(e,t){let n=f(e),r=0;for(let e=0;e<n.length-1;e+=1){let i=n.slice(e,e+2).join(` `);t.some(e=>e.includes(i))&&(r+=24)}return r}function oe(e){return[...new Set([e.operationId,e.method,e.path,e.resource,e.intent,e.cliPath.join(` `),e.summary,(g(e.description).useFor||e.description).slice(0,240)].map(u).filter(e=>e.length>0))]}function se(e,t,n){let r=u(g(n).notFor);if(r.length===0)return 0;let i=r.includes(e)?40:0,a=new Set(f(r));for(let e of t)r===e?i+=20:a.has(e)&&(i+=8);return i}function ce(e,t){let n=0;for(let{values:r,direct:i}of t)r.some(t=>le(e,t))&&(n+=i?40:10);return n}function le(e,t){let n=f(t);return n.length>0&&n.every(t=>e.has(t))}function ue(e){return typeof e.data==`object`&&e.data!==null&&`response`in e.data?e.data.response:void 0}async function de(t,r,i,a){let o=t.q?.trim()??``;if(o.length===0)return n(`Provide q to resolve a request to one operation.`);let s=i.find(({resource:e,intent:t,deprecated:n})=>e===`help`&&t===`search`&&n!==!0);if(s===void 0)return n(`This build ships no help resolve operation.`);let c=await a(s,{body:{question:o,resolve:!0,...t.scope===void 0?{}:{scope:t.scope===`read`?`READ`:`WRITE`}}});if(!c.ok)return{...c,data:null};let l=x.safeParse(ue(c));if(!l.success||l.data.resolution==null)return n(`The help resolve operation returned no resolution.`,c.warnings,{httpStatus:c.httpStatus});let{answer:u,resolution:d}=l.data,f=e=>r.find(t=>t.operationId===e),p=f(d.operationId),h=d.taskPlan??void 0,g=(h?.step??[]).map(({step:e})=>({step:e,contract:f(e.operationId)})),y=[...new Set([...d.operationId!=null&&p===void 0?[d.operationId]:[],...g.filter(({contract:e})=>e===void 0).map(({step:e})=>e.operationId)])];return y.some(e=>!i.some(t=>t.operationId===e))?n(`No operation on this connection answers that request.`):e(y.length===0?`Help resolution`:`Help resolution this connection cannot finish: it cannot run ${y.join(`, `)}.`,{outcome:d.outcome,probability:d.probability,answer:u,candidate:d.candidate.filter(({sourceId:e})=>i.some(({operationId:t})=>t===e)).map(({sourceId:e})=>{let t=f(e);return t===void 0?{sourceId:e}:Object.assign({sourceId:e},m(t))}),...p===void 0?{}:{operation:{operationId:p.operationId,apiRoute:`${p.method} ${p.path}`,...v(p),...m(p)}},...(d.taskKey,{}),...h===void 0?{}:{taskPlan:{input:h.input,step:g.map(({contract:e,step:{stepKey:t,instruction:n,operationId:r}})=>e===void 0?{instruction:n,operationId:r}:{instruction:n,mcpCall:_(e)})}}},{warnings:y.map(e=>i.some(t=>t.operationId===e)?`Operation ${e} is in this server's catalog, but your grant does not allow it.`:`Operation ${e} is outside this server's catalog, so no credential runs it here.`)})}export{z as a,de as i,J as n,Z as r,X as t};
|