@aventurevc/aventure-cli 0.8.260 → 0.8.261
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/command-catalog.compact.txt +38 -24
- package/dist/aventure-cli/index.js +1 -1
- package/dist/aventure-cli/unified-operations.json +148 -342
- package/dist/chunks/{api-key-bearer-credential-BTq9cAKP.js → api-key-bearer-credential-D586Q1L7.js} +1 -1
- package/dist/chunks/api-key-bearer-credential-DEZKjKL-.js +1 -0
- package/dist/chunks/api-key-credential-BTOE6OP7.js +3 -0
- package/dist/chunks/{api-key-credential-DzDcIKGs.js → api-key-credential-Dhxu48K0.js} +1 -1
- package/dist/chunks/api-key-credential-verification-ByidurRw.js +1 -0
- package/dist/chunks/{api-key-credential-verification-D2blVIRu.js → api-key-credential-verification-CLDJp2EL.js} +1 -1
- package/dist/chunks/api-key-login-CjtYJ3gZ.js +7 -0
- package/dist/chunks/api-target-vxev2RKl.js +1 -0
- package/dist/chunks/auth-status-check-CBAOjP51.js +1 -0
- package/dist/chunks/auth-status-check-WiIab5rr.js +1 -0
- package/dist/chunks/auth-status-render-CU_PMZ_L.js +2 -0
- package/dist/chunks/aventure-cli-CcqeEzmy.js +11 -0
- package/dist/chunks/batch-io-AThKCROV.js +1 -0
- package/dist/chunks/builtin-auth-Bzy6zRSn.js +6 -0
- package/dist/chunks/builtin-research-run-wait-B7MXQW7y.js +1 -0
- package/dist/chunks/{builtin-update-F0HKnfKe.js → builtin-update-C2tGv5iK.js} +1 -1
- package/dist/chunks/{cli-help-policy-DKV7chuM.js → cli-help-policy-DEf3PBDq.js} +1 -1
- package/dist/chunks/completion-Brdxwd5D.js +20 -0
- package/dist/chunks/{contract-parameter-C7Ead17E.js → contract-parameter-CppTkTpe.js} +1 -1
- package/dist/chunks/contract-v51xXOaI.js +1 -0
- package/dist/chunks/credential-redaction-DkES7qwH.js +1 -0
- package/dist/chunks/credential-store-Ch55NV_o.js +2 -0
- package/dist/chunks/detail-De_7DRUQ.js +1 -0
- package/dist/chunks/detail-zcQG4hro.js +1 -0
- package/dist/chunks/entity-BtU2r6nM.js +1 -0
- package/dist/chunks/generated-option-order-CudU6Yw8.js +1 -0
- package/dist/chunks/help-catalog-DXLgbwPh.js +2 -0
- package/dist/chunks/{help-intent-Ck5LJ9aC.js → help-intent-DC10zwQI.js} +1 -1
- package/dist/chunks/logout-Bs50m2g8.js +1 -0
- package/dist/chunks/logout-D7EITSv9.js +1 -0
- package/dist/chunks/{mcp-generation-contract-BIeGZmML.js → mcp-generation-contract-C0y3TZUi.js} +1 -1
- package/dist/chunks/mcp-generation-contract-k7dlT9-w.js +1 -0
- package/dist/chunks/oauth-bearer-credential-Bix_p8zz.js +1 -0
- package/dist/chunks/oauth-bearer-credential-DwXPmP36.js +1 -0
- package/dist/chunks/oauth-credential-CwYfd2EW.js +1 -0
- package/dist/chunks/oauth-credential-JVu2zmhX.js +1 -0
- package/dist/chunks/{oauth-login-DEqo9C-G.js → oauth-login-BpxCHH22.js} +1 -1
- package/dist/chunks/{oauth-login-BoWRyiMk.js → oauth-login-CiogIeg7.js} +3 -3
- package/dist/chunks/{openapi-call-DObkFneE.js → openapi-call-B0yBAEZ1.js} +2 -2
- package/dist/chunks/{openapi-call-C2DSQh2x.js → openapi-call-DYyq894o.js} +1 -1
- package/dist/chunks/openapi-commands-C5w02b1B.js +1 -0
- package/dist/chunks/{openapi-commands-D1Bjfem-.js → openapi-commands-mEE4Rxi0.js} +1 -1
- package/dist/chunks/openapi-composites-CAAz75K-.js +1 -0
- package/dist/chunks/openapi-snapshot-Bw7ueJ1l.js +1 -0
- package/dist/chunks/operations-CUWhuNdR.js +3 -0
- package/dist/chunks/operations-catalog-CAbEVZgR.js +1 -0
- package/dist/chunks/operations-catalog-D87F8Iu0.js +7 -0
- package/dist/chunks/operations-metadata-C2C2xcH3.js +2 -0
- package/dist/chunks/output-CCqnNodZ.js +4 -0
- package/dist/chunks/{output-CuZPzAlH.js → output-CuBlPNWB.js} +1 -1
- package/dist/chunks/output-mode-DIXw-DJj.js +1 -0
- package/dist/chunks/output-mode-halBRI36.js +1 -0
- package/dist/chunks/{parse-error-hint-C6VGe_NR.js → parse-error-hint-BagTo1Mq.js} +2 -2
- package/dist/chunks/{run-detail-CIBpS8hz.js → run-detail-DDP5CJqb.js} +1 -1
- package/dist/chunks/{startup-auth-B4zldrFK.js → startup-auth-CLsaje8f.js} +1 -1
- package/dist/chunks/startup-auth-Go5G3eIL.js +1 -0
- package/dist/chunks/text-response-CS_MJNUc.js +16 -0
- package/dist/chunks/tool-policy-BKMbulwX.js +1 -0
- package/package.json +3 -3
- package/dist/chunks/api-key-bearer-credential-CVcJxkw2.js +0 -1
- package/dist/chunks/api-key-credential-BFOFznef.js +0 -3
- package/dist/chunks/api-key-credential-verification-Dwd-qqAU.js +0 -1
- package/dist/chunks/api-key-login-B2iWS8j_.js +0 -7
- package/dist/chunks/auth-status-render-DtKkm4Nj.js +0 -2
- package/dist/chunks/aventure-cli-CyRcmK1h.js +0 -11
- package/dist/chunks/batch-io-l87mE7Ym.js +0 -1
- package/dist/chunks/builtin-auth-BzN0DeX5.js +0 -17
- package/dist/chunks/builtin-research-run-wait-0Nfzicqd.js +0 -1
- package/dist/chunks/completion-DEnWzb9C.js +0 -20
- package/dist/chunks/contract-BgjxlOnT.js +0 -1
- package/dist/chunks/credential-redaction-BbeDpMUf.js +0 -1
- package/dist/chunks/credential-store-yivldnnZ.js +0 -2
- package/dist/chunks/detail-DFVJrldR.js +0 -1
- package/dist/chunks/detail-DP6lF4pb.js +0 -1
- package/dist/chunks/entity-Cg2n2mP0.js +0 -1
- package/dist/chunks/generated-option-order-0l9dYmAK.js +0 -1
- package/dist/chunks/help-catalog-PjbSvhQY.js +0 -2
- package/dist/chunks/logout-6FG-rkmk.js +0 -1
- package/dist/chunks/logout-C6gksSro.js +0 -1
- package/dist/chunks/mcp-generation-contract-BXN1e5sx.js +0 -1
- package/dist/chunks/oauth-bearer-credential-Bck2hv18.js +0 -1
- package/dist/chunks/oauth-bearer-credential-C5jKo8Q5.js +0 -1
- package/dist/chunks/oauth-credential-C2uLXL3z.js +0 -1
- package/dist/chunks/oauth-credential-Dl2t7SrT.js +0 -1
- package/dist/chunks/openapi-commands-DlyuuuLD.js +0 -1
- package/dist/chunks/openapi-composites-B9JPhVYN.js +0 -1
- package/dist/chunks/openapi-snapshot-CYmg22H9.js +0 -1
- package/dist/chunks/operations-C-iAOsyp.js +0 -2
- package/dist/chunks/operations-catalog-Co_WOkDJ.js +0 -7
- package/dist/chunks/operations-catalog-wWCK90Jo.js +0 -1
- package/dist/chunks/operations-metadata-f89kI3gd.js +0 -2
- package/dist/chunks/output-BeXk_9Ef.js +0 -5
- package/dist/chunks/output-mode-BMhOAO06.js +0 -1
- package/dist/chunks/output-mode-vV9080Ml.js +0 -1
- package/dist/chunks/private-live-identity-AuYLZJvL.js +0 -1
- package/dist/chunks/private-live-identity-w8v84cKs.js +0 -1
- package/dist/chunks/startup-auth-CB7kyta-.js +0 -1
- package/dist/chunks/text-response-DqVfmBxR.js +0 -16
- package/dist/chunks/tool-policy-DfLvQfqr.js +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"./commander-DEj7N1b9.js";import{a}from"./package-DEeHDoOT.js";import{a as o,c as s,l as c,r as l}from"./env-DSqe8wia.js";import{c as u,p as d,r as f}from"./result-envelope-BJO8Am4v.js";import{R as p,b as m,l as h,o as g,t as _,z as v}from"./tool-policy-DfLvQfqr.js";import{i as y}from"./logging-81KzSgWu.js";import{i as ee,n as te,t as ne}from"./cli-help-policy-DKV7chuM.js";import{a as re,c as ie,d as ae,f as oe,l as se,n as ce,o as b,r as le,s as x,t as ue,u as de}from"./startup-auth-CB7kyta-.js";import{_ as fe,h as pe}from"./help-catalog-PjbSvhQY.js";import{n as me,t as he}from"./operations-metadata-f89kI3gd.js";import{t as S}from"./openapi-commands-DlyuuuLD.js";import{a as C,i as w,t as T}from"./output-mode-BMhOAO06.js";import{S as ge,_ as E,a as _e,b as D,c as ve,d as ye,f as be,g as O,h as xe,i as Se,l as Ce,m as k,n as A,o as we,p as Te,r as Ee,s as De,t as Oe,u as ke,v as j,x as Ae,y as je}from"./generated-option-order-0l9dYmAK.js";import{a as Me,i as Ne,n as Pe,r as Fe}from"./payload-operand-guard-CaQWY0J1.js";import{fileURLToPath as Ie}from"node:url";import{readFile as Le}from"node:fs/promises";async function Re(e){let t;try{t=e===`-`?await ze():await Le(e,`utf8`)}catch(t){return f(`Could not read input: ${t.message}`,[`path=${e}`])}try{if(t.trim().length===0)return u(`No input provided`,null);let e=JSON.parse(t);return u(`Input parsed`,e)}catch(e){return f(`Input is not valid JSON: ${e.message}`)}}async function ze(){if(process.stdin.isTTY)throw Error(`--from-file - requires JSON on stdin, but stdin is a TTY`);process.stdin.setEncoding(`utf8`);let e=``;for await(let t of process.stdin)e+=t;return e}var M=`--content-type`;function Be(e,n,r){let i=e=>!r?.has(e)&&(r?.add(e),!0),a=n.requestBody??[];if(a.length>1&&i(M)){let n=a.map(({contentType:e})=>e);e.addOption(new t(`${M} <media-type>`,`Select the request body encoding, never an uploaded file's media type; omit for ${n[0]}.`).choices(n).argParser(He(a)))}if(z(n)&&i(`--from-file`)){let r=a[0];if(r===void 0)throw Error(`${n.operationId} has no request body`);e.addOption(new t(`--from-file <path>`,_e(r,r.requiredPath)).argParser(N(`--from-file`)))}let o=we(a).filter(e=>i(I(e.variant[0].parameter)));for(let n of o.toSorted((e,t)=>A(e.variant[0].parameter,t.variant[0].parameter))){let{descriptor:r,parameter:i}=n.variant[0],o=new t(Se(n),a.length>1?Ee(n):ve(r,i));a.length===1&&i.envName!==void 0&&o.env(i.envName);let s=a.length===1?De(r,i.optionKey):[];s.length>0&&o.conflicts(s),a.length>1?o.argParser(Ve):E(i.name)||i.schemaType===`array`?o.argParser(Ue):o.argParser(N(i.flag)),e.addOption(o),o.envVar!==void 0&&e.on(`optionEnv:${o.name()}`,()=>{let t=e.opts()[i.optionKey];typeof t==`string`&&t.trim()&&e.setOptionValueWithSource(i.optionKey,t.trim(),`env`)})}et(e,n,o)}function Ve(e,t){return t===void 0?e:typeof t==`string`?[t,e]:[...t,e]}function He(e){return(t,r)=>{if(r!==void 0)throw new n(`${M} was already given; pass it once.`);let i=m(e,t);if(!i.ok)throw new n(i.summary);return t}}function Ue(e,t){return[...t??[],e]}function N(e){let t=e.split(/\s+/u)[0]??e;return(e,r)=>{if(r!==void 0)throw new n(`${t} was already given; pass it once.`);return e}}async function P(e,t){let n=x(e,t),r=m(e.requestBody??[],n);if(!r.ok||r.data===null)return f(r.summary,r.warnings);let i=r.data;if(i===void 0)return u(`No body`,void 0);let a=We(e,i,t);if(a!==null)return f(a);let o=be(e.operationId,i,t);if(!o.ok)return f(o.summary,o.warnings);t=o.data;let s=Ge(i,t);if(s!==null)return f(s);let c=await Je(t);if(!c.ok)return f(c.summary,c.warnings);let l=k(e.requestBody??[],i,c.data);if(l!==null)return f(l);let d=qe(e.operationId,i,c.data);if(!d.ok)return d;let p=xe(e.operationId,i,c.data);if(p!==null)return f(p);let h=Ye(e.operationId,i,t);if(!h.ok)return h;if(c.data===void 0&&h.data===void 0)return i.required?f($e(e.operationId,i)):u(`No body`,void 0);let g=Ze(e.operationId,i,c.data,h.data);if(!g.ok||g.data===void 0)return g;if(i.schemaType===`array`&&!Array.isArray(g.data))return f(`${e.operationId} requires a JSON array body.`);if(i.parameter.length>0&&!j(g.data)){let t=i.kind===`multipart`?` keyed by multipart part name`:` body`;return f(`${e.operationId} requires a JSON object${t}.`)}let _=F(i,g.data);if(_.length>0)return f(`${e.operationId} requires body option(s): ${_.join(`, `)}`);let v=g.data,y=j(v)?D(i).filter(e=>!O(v,e)):[];return y.length>0?f(Ke(e.operationId,i,y)):g}function We(e,t,n){let r=new Set(t.parameter.map(({optionKey:e})=>e));for(let i of e.requestBody??[])if(i!==t)for(let t of i.parameter){if(r.has(t.optionKey)||n[t.optionKey]===void 0)continue;let i=(e.requestBody??[]).filter(e=>e.parameter.some(({optionKey:e})=>e===t.optionKey)).map(({contentType:e})=>e);return`${I(t)} requires ${M} ${i.join(` or `)}.`}return null}function Ge(e,t){for(let n of e.cliConflicts??[]){let e=n.filter(e=>t[e]!==void 0);if(e.length>1)return`Options ${e.join(`, `)} cannot be used together.`}return null}function Ke(e,t,n){let r=`${e} requires JSON body path(s): ${n.join(`, `)}`;return t.kind===`multipart`?`${r}. ${n.includes(`body`)?`For multipart --from-file, wrap the endpoint JSON under top-level "body".`:`For multipart --from-file, put the missing nested path(s) inside top-level "body".`}`:r}function F(e,t){return j(t)?e.parameter.filter(e=>e.required&&!O(t,e.name)).map(I):[]}function qe(e,t,n){let r=ge(t,n);return r===null?u(`Body file paths validated`,null):f(`${e} --from-file contains ${r.message}`)}async function Je(e){let t=typeof e.fromFile==`string`?e.fromFile:void 0;if(t===void 0)return u(`No body file`,void 0);let n=await Re(t);if(!n.ok)return f(n.summary,n.warnings);let r=d.safeParse(n.data);return r.success?u(`Input parsed`,r.data):f(`Input is not valid JSON value: ${r.error.message}`)}function Ye(e,t,n){let r={},i=!1;for(let e of t.parameter){let a=Ae(e,n[e.optionKey]);if(!a.ok||a.data===null)return f(a.summary,a.warnings);let o=a.data;if(o===void 0)continue;let s=Xe(t,n,r,e,o);if(!s.ok)return f(s.summary,s.warnings);i=!0}if(!i)return u(`No direct body options`,void 0);let a=Ce(e,t,n,r);return a===null?u(`Direct body options parsed`,r):a}function Xe(e,t,n,r,i){let a=je(r,i);if(a===null){let e=Qe(r,i);return e.ok?ke(n,r.name,e.data,r.schemaType===`array`):f(e.summary,e.warnings)}if(a.plain.length>0)return f(`${I(r)} mixes row-form values with plain value(s): ${a.plain.join(`, `)} — prefix every value with its 0-based ${a.container}[] row index, as 0:value.`);let o=Te(e,t,a.container);for(let e of a.rows.keys())if(!(e<o))return f(`${I(r)} names ${a.container}[] row ${e}, but these options build at most ${o} ${a.container}[] row(s) — number rows from 0, and name the row of a value that itself starts with digits and a colon, as 0:0:00 for the value 0:00.`);for(let[e,t]of a.rows){let i=[];for(let e of t){let t=R(r.name,r.itemSchemaType,e);if(!t.ok)return f(t.summary,t.warnings);i.push(t.data)}let a=ye(n,r.name,e,i);if(!a.ok)return a}return u(`Body value assigned`,null)}var I=e=>e.flag.split(` `)[0]??e.name;function Ze(e,t,n,r){if(n===void 0)return u(`Direct body parsed`,r);if(r===void 0)return u(`Input parsed`,n);if(j(n)&&j(r))try{return u(`Input parsed`,L(t,n,r))}catch(t){return f(`${e} ${t instanceof Error?t.message:String(t)}`)}return f(`${e} cannot combine --from-file with direct body options unless the file body is an object.`)}function L(e,t,n,r=``){let i={...t};for(let[t,a]of Object.entries(n)){let n=i[t],o=`${r}${t}`;if(j(n)&&j(a))i[t]=L(e,n,a,`${o}.`);else if(n===void 0||n===a)i[t]=a;else throw Error(`sets JSON key '${o}' both in --from-file and with ${e.parameter.find(({name:e})=>e===o)?.flag.split(` `)[0]??`body options`} — set it in one place${Array.isArray(n)?`: move the per-item fields inside the matching '${o}[]' object(s) in the file body`:pe.test(o)?`; keep multi-line text in the --from-file body`:``}.`)}return i}function Qe(e,t){if(typeof t==`boolean`)return u(`Body value parsed`,t);if(t===void 0||typeof t==`string`)return R(e.name,e.schemaType,t??``);let n=[],r=E(e.name)&&e.schemaType!==`array`?e.schemaType:e.itemSchemaType;for(let i of t){let t=R(e.name,r,i);if(!t.ok)return t;n.push(t.data)}return u(`Body value parsed`,n)}function R(e,t,n){if(t===`boolean`)return n===`true`?u(`Body value parsed`,!0):n===`false`?u(`Body value parsed`,!1):f(`${e} must be true or false.`);if(t===`number`||t===`integer`){let r=n.trim(),i=Number(r);return r===``||!Number.isFinite(i)?f(`${e} must be a finite ${t}.`):t===`integer`&&!Number.isInteger(i)?f(`${e} must be an integer.`):u(`Body value parsed`,i)}return u(`Body value parsed`,n)}function $e(e,t){let n=t.parameter.filter(e=>e.required);if(n.length>0&&t.requiredPath.every(e=>n.some(({name:t})=>t===e||t.startsWith(`${e}.`))))return`${e} requires body option(s): ${n.map(I).join(`, `)}`;let r=D(t);if(r.length>0)return`${e} requires --from-file with JSON body path(s): ${r.join(`, `)}`;let i=t.parameter.map(I).join(`, `);return i.length===0?`${e} requires --from-file`:`${e} requires --from-file or body option(s): ${i}`}function et(e,t,n){let r=[...t.parameters,...n.map(({variant:e})=>e[0].parameter)];(t.requestBody?.length??0)>1&&r.push({optionKey:`contentType`,flag:M,location:`body`}),z(t)&&r.push({optionKey:`fromFile`,flag:`--from-file`,location:`body`}),Oe(e.options,r)}function z(e){return(e.requestBody??[]).some(e=>e.kind!==`multipart`||e.parameter.some(e=>e.schemaFormat!==`binary`))}function tt(e,t,n=a().bin[0]){e.helpCommand(!1);let r=e.commands.find(e=>e.name()===`help`)??e.command(`help`);r.summary(`Show full documentation for a command, or ask a question`).description("Show a command's full documentation offline. Select it by command path,\noperationId, or `<METHOD> <path>`; `<command> --help` prints only its usage.\n`help ask <question>` or `help --ask <question>` answers a platform question.").argument(`[command...]`,"command path, operationId, or METHOD and path, e.g. `help entities get`"),r.addOption(new nt(r)),r.hook(`preSubcommand`,e=>{e.opts().help&&e.help()});let i=at(t);i!==void 0&&r.option(`--ask <question>`,i.summary),T(r),r.action(async function(r){let{emit:a}=await import(`./output-CuZPzAlH.js`),o=this.optsWithGlobals();if(o.help&&r.length===0){this.outputHelp();return}if(!o.help&&i!==void 0&&o.ask!==void 0){let e=C(o);if(r.length>0){a({mode:e},f(`Use either a command path or --ask, not both.`));return}a({mode:e},await st(i,o.ask,o.environment,e));return}let s=G(e,r),c=t.find(t=>s!==void 0&&G(e,t.cliPath)===s);if(o.help||s!==void 0&&c===void 0){s===void 0&&this.error(`unknown command '${r.join(` `)}' (run \`${n} --help\` for the command tree)`),s.outputHelp();return}let l=c===void 0?await ot(r,t):u(`Resolved by command path`,{operationId:c.operationId});if(l.ok&&l.data?.command!==void 0&&this.error(`unknown command '${r.join(` `)}' (run \`${n} --help\` for the command tree)`),!l.ok||l.data===null){a({mode:C(o)},l);return}let{writeShowResult:d}=await import(`./operations-catalog-wWCK90Jo.js`);d({...o,...l.data},t,C(o,`text`),n)}),it(e,t,n)}var nt=class extends t{helpCommand;constructor(e){super(`-h, --help`,`display help for command`),this.helpCommand=e}is(e){if(e!==this.short&&e!==this.long)return!1;let t=this.helpCommand.parent?.args??[],n=t.findIndex(e=>e===this.helpCommand.name()||this.helpCommand.aliases().includes(e)),r=n<0?void 0:t[n+1];return r===void 0||r.startsWith(`-`)?!0:!this.helpCommand.commands.some(e=>e.name()===r||e.aliases().includes(r))}},B=2,V=6,rt={formatHelp(e,t){let n=n=>r.prototype.formatHelp.call(this,e,Object.assign(Object.create(t),n));if(t.visibleCommands(e).length===0)return n({});let i=t.padWidth(e,t),a={padWidth:()=>i,visibleOptions:()=>[],showGlobalOptions:!1},o=n({...a,visibleCommands:()=>[]}),s=n({padWidth:()=>i,visibleCommands:()=>[]}).slice(o.length);return n(a)+s},visibleCommands(e){let t=r.prototype.visibleCommands.call(this,e);return e.parent===null?t.filter(e=>!te.has(e.name())):t},subcommandTerm(e){let t=r.prototype.subcommandTerm.call(this,e);return e.commands.length>0&&e.registeredArguments.length===0?`${t} <command>`:t},formatItem(e,t,n,i){let a=i.helpWidth??80,o=a-t-4;return n===``||o>=i.minWidthToWrap?r.prototype.formatItem.call(i,e,t,n,i):`${` `.repeat(B)}${e}\n${H(n,a,i)}`}};function H(e,t,n){return n.boxWrap(e,t-V).replace(/^/gmu,` `.repeat(V))}function it(e,t,n){for(let r of t){let i=G(e,r.cliPath);i!==void 0&&i.addHelpText(`after`,()=>{let e=i.createHelp(),a=i.configureOutput().getOutHelpWidth?.();e.prepareContext(a===void 0?{}:{helpWidth:a});let o=e.helpWidth??80,s=fe(r.operationId,t,n),c=U(me(r.header),o,e),l=U(he(r.errorResponse),o,e);return`\n${[...s,...c,...l].join(`
|
|
2
|
-
`)}\n`})}}function U(e,t,n){let[r,...i]=e;return r===void 0?[]:[``,r,...i.map(e=>H(e.trimStart(),t,n).replace(/^ +/u,` `.repeat(B)))]}function at(e){let[t,...n]=e.filter(e=>{let[t,n,...r]=e.cliPath;return t===`help`&&n!==void 0&&r.length===0&&K(e)!==void 0});return n.length===0?t:void 0}var W='Accepted selectors: `<METHOD> <route template or concrete path>`, an operationId, or a CLI command path such as "entities get".';async function ot(e,t){let[n=``,...r]=e.join(` `).trim().split(/\s+/u),[i,...a]=t.filter(e=>e.path===n);if(r.length===0&&i!==void 0)return a.length===0?u(`Resolved by route`,{operationId:i.operationId}):f(`${n} is served by ${[i,...a].map(({method:e})=>e).join(`, `)}; name the method, as in \`help ${i.method} ${n}\`.`,[W]);let o=p.find(e=>e===n.toLowerCase());if(o===void 0||r.length===0){let n=e.join(` `).trim();return u(`Resolved by name`,t.some(e=>e.operationId===n)?{operationId:n}:{command:n})}let s=v(o),c=r.join(``),l=t.find(e=>e.method===s&&e.path===c);if(l!==void 0)return u(`Resolved by route template`,{operationId:l.operationId});let{resolveOpenApiOperationSelector:d}=await import(`./openapi-call-C2DSQh2x.js`),m=d({method:s,path:c});return!m.ok||m.data===null?f(m.summary,[...m.warnings,W]):u(`Resolved by method and path`,{operationId:m.data.operation.operationId})}function G(e,t){let n=e;for(let e of t){let t=n.commands.find(t=>t.name()===e||t.aliases().includes(e));if(t===void 0)return;n=t}return n}async function st(e,t,n,r){let{buildOpenApiPath:i,runOpenApiCall:a}=await import(`./openapi-call-C2DSQh2x.js`),o=K(e);if(o===void 0)return f(`The \`${e.cliPath.join(` `)}\` operation no longer takes a single required text body; run it directly instead of \`help --ask\`.`);n!==void 0&&(process.env.API_ENV=n);let s=await P(e,{[o.optionKey]:t});return s.ok?await a({method:e.method,path:i(e.operationId,{}),searchParams:{},body:s.data,auth:e.auth,responseFormat:w(r)}):s}function K(e){if(e.requestBody?.length!==1||e.parameters.some(e=>e.required))return;let t=(e.requestBody[0]?.parameter??[]).filter(e=>e.required);return t.length===1&&t[0]?.schemaType===`string`?t[0]:void 0}function ct(e,t,n){if(e.cliPath[0]!==`lookup`||!lt(n))return null;let r=e.parameters.filter(e=>t[e.optionKey]!==void 0).map(e=>`${e.name}=${String(t[e.optionKey])}`),i=`no record for ${r.length===0?`the given input`:r.join(`, `)}`;return n.ok?f(i):f(i,[],{httpStatus:n.httpStatus,problem:n.problem})}function lt(e){return e.ok?Array.isArray(e.data)&&e.data.length===0:e.httpStatus===404}function ut(e,t){if(e.deprecated!==!0)return t;let n=e.description.match(/^Deprecated:[^.]*\./u)?.[0]??`Deprecated; run \`help ${e.cliPath.join(` `)}\` for its replacement.`;return{...t,warnings:[n,...t.warnings]}}function dt(t,n,r,i){let a=ft(t),o=a instanceof e?[]:a,s=o[0],c=i.bin[0],l=[{selected:s===`auth`,register:async()=>{let{registerBuiltinAuthCommands:e}=await import(`./builtin-auth-BzN0DeX5.js`);e(n,c)}},{selected:s===`agents`,register:async()=>{let{registerBuiltinAgentSetupCommand:e}=await import(`./builtin-agent-setup-B2Xvqera.js`);e(n,c)}},{selected:s===`update`,register:async()=>{let{registerBuiltinUpdateCommand:e}=await import(`./builtin-update-F0HKnfKe.js`);e(n,i)}},{selected:s===`batch`,register:async()=>{let{registerBuiltinBatchCommand:e}=await import(`./builtin-batch-DdGyCjlR.js`);e(n,r,c)}},{selected:s===`research-runs`,register:async()=>{let{registerBuiltinResearchRunWaitCommand:e}=await import(`./builtin-research-run-wait-0Nfzicqd.js`);e(n)}},{selected:s===`completion`,register:async()=>{let{registerCompletionCommand:e}=await import(`./completion-DEnWzb9C.js`);e(n,r,c)}},{selected:s===`command-catalog`,register:async()=>{let{registerOperationsCommand:e}=await import(`./operations-C-iAOsyp.js`);e(n,r,c)}}],u=s===void 0||s===`help`||s===`completion`||s===`command-catalog`||!l.some(e=>e.selected)&&!r.some(e=>e.cliPath[0]===s),d=1;for(;d<o.length&&r.some(e=>o.slice(0,d+1).every((t,n)=>e.cliPath[n]===t));)d++;let f=o.slice(0,d),p=u?r:r.filter(e=>f.slice(0,e.cliPath.length).every((t,n)=>e.cliPath[n]===t)),m=new Set,h=async(e=!1)=>{for(let t of l)(e||u||t.selected)&&!m.has(t)&&(await t.register(),m.add(t))};return{generated:p,fullTree:u,registerBuiltin:h,async completeTree(e){e(n,r.filter(e=>!p.includes(e))),await h(!0)}}}function ft(n){try{return new i().exitOverride().configureOutput({writeErr:()=>void 0}).addOption(new t(`--environment <environment>`)).parseOptions([...n]).operands}catch(t){if(!(t instanceof e))throw t;return t}}var pt=new Set(S.map(e=>e.cliPath.join(` `)));function q(e,t){e.showHelpAfterError(!1).exitOverride(t(e)),e.commands.length===0?e.hook(`preAction`,Pe):e.registeredArguments.length===0&&!pt.has(Me(e).join(` `))&&e.addHelpOption(new Ne(e));for(let n of e.commands)q(n,t)}function J(e){return ne[ee(e,b)??`cli`]}function Y(e,t,n){let r=t.map(e=>{let t=e.cliPath[0]??``;return{spec:e,top:t,rank:J(t).rank}}).toSorted((e,t)=>e.rank-t.rank||e.top.localeCompare(t.top)).map(e=>e.spec),i=new Set(r.filter(e=>ue(e.cliPath[0])).map(e=>e.cliPath[0]??``)),a=new Set,o=new Set;for(let{cliPath:e,deprecated:t}of r)for(let n=1;n<e.length;n++){let r=e.slice(0,n).join(` `);a.add(r),t!==!0&&o.add(r)}for(let t of r)mt(e,t,i,o,a.has(t.cliPath.join(` `)),n)}function mt(e,t,n,r,i,a){let o=t.cliPath,s=e,c=``,l=!n.has(o[0]??``);for(let e of o.slice(0,-1)){c=c===``?e:`${c} ${e}`;let t=l&&c===e||!r.has(c);s=ht(s,e,c,t)}let u=o.at(-1)??t.operationId,d=s.commands.find(e=>e.name()===u)??s.command(u,t.deprecated===!0?{hidden:!0}:{}),p=t.requestBody?.flatMap(({parameter:e})=>e)??[];d.summary(t.summary||t.operationId).description([`${t.method} ${t.path}.`,t.summary||t.description,`Full documentation: ${a} help ${t.cliPath.join(` `)}`,t.requestBody?.[0]?.kind===`json`||[...t.parameters,...p].some(e=>g(e.schemaType,e.itemSchemaType))?_:``].filter(Boolean).join(`
|
|
3
|
-
`));let m=ae(t);for(let e of t.parameters)gt(d,e,i||e===m);Be(d,t),h(t.intent)&&!d.options.some(e=>e.long===`--execute`)&&d.option(`--execute`,`Deprecated; accepted and ignored. This command executes by its verb.`,!1),T(d),d.hook(`preAction`,e=>de(e,t)),t.explain===!0&&d.option(`--explain`,`Print the search strategy and parsed constraints before the results`),m!==void 0&&d.argument(`[text...]`,m.description||`Same as ${ie(m.flag)}.`),d.action(async function(){let{emit:e,emitSearchExplanation:n}=await import(`./output-CuZPzAlH.js`),r=this.optsWithGlobals(),i=C(r),a=r;if(m!==void 0){let t=oe(m,this.args,r);if(!t.ok||t.data===null)return e({mode:i},t);a=t.data}let o=se(t,a);if(o.length>0)return e({mode:i},f(`missing required options: ${o.join(`, `)}`));let s=await _t(t,a,i),c=ct(t,a,s);if(c!==null)return e({mode:i},c);r.explain===!0&&s.ok&&n(i,s.data),s.ok&&s.data instanceof Uint8Array&&i!==`csv`&&i!==`xlsx`?process.stdout.write(s.data):e({mode:i},s)})}function ht(e,t,n,r){let i=e.commands.find(e=>e.name()===t);if(i!==void 0)return i;let a=b[n],o=e.command(t,r?{hidden:!0}:{}).helpCommand(!1);return a!==void 0&&o.summary(a.summary).description(a.summary),o}function gt(e,n,r=!1){let i=n.description||`${n.name} ${n.location} parameter`,a=n.defaultValue===void 0?void 0:typeof n.defaultValue==`string`||typeof n.defaultValue==`boolean`?n.defaultValue:[...n.defaultValue];if(n.legacyFlag!==void 0){let o=new t(n.flag,i);a!==void 0&&o.default(a);let s=new t(n.legacyFlag,i).conflicts(n.optionKey);e.addOption(o).addOption(s),e.hook(`preAction`,e=>{let t=e.opts(),i=t[n.optionKey],a=t[s.attributeName()];a===void 0?!r&&n.required&&i===void 0&&e.error(`error: required option '${o.flags}' not specified`,{code:`commander.missingMandatoryOptionValue`}):(i===void 0||e.getOptionValueSource(n.optionKey)==="default")&&e.setOptionValueWithSource(n.optionKey,a,`cli`)})}else a===void 0?n.required&&!r?e.requiredOption(n.flag,i):e.option(n.flag,i):e.option(n.flag,i,a)}async function _t(e,t,n){let{buildOpenApiPath:r,runOpenApiCall:i}=await import(`./openapi-call-C2DSQh2x.js`),{pendingResult:a}=await import(`./output-CuZPzAlH.js`);if(t.environment!==void 0){let e=c(t.environment);if(e===null)return f(`Unknown aVenture environment '${t.environment}'`,[`Use one of: ${s().join(`, `)}`]);process.env.API_ENV=e}let o=await P(e,t);if(!o.ok)return o;let l=Object.fromEntries(e.parameters.filter(e=>e.location===`path`).map(e=>{let n=t[e.optionKey];if(Array.isArray(n))return[e.name,n.at(0)??``];if(n===void 0)throw Error(`Missing required option ${e.optionKey}`);return[e.name,String(n)]})),u=Object.fromEntries(e.parameters.filter(e=>e.location===`query`).flatMap(e=>{let n=t[e.optionKey];if(n===void 0||Array.isArray(n)&&n.length===0)return[];let r=Array.isArray(n)||typeof n==`boolean`?n:String(n);return[[e.name,r]]})),d=Object.fromEntries(e.parameters.filter(e=>e.location===`header`).flatMap(e=>{let n=t[e.optionKey];return n===void 0||Array.isArray(n)&&n.length===0?[]:[[e.name,Array.isArray(n)?n.join(`,`):String(n)]]}));return ut(e,await i({method:e.method,path:r(e.operationId,l),searchParams:u,headers:d,body:o.data,contentType:x(e,t),auth:e.auth,responseFormat:w(n),responseBytes:e.binaryResponse===!0,pendingResult:a}))}async function vt(e,n){let r=n.bin[0],i=ce(e,S),a=i===`required`?S:re(S),c=new Fe;c.name(r).usage(`<command> [subcommand] [options]`).configureHelp(rt).version(n.version).summary(`CLI for the aVenture API: companies, people, and news, with the funding, publications, and classifications attached to them`).description(`The aVenture research API from your terminal. Three records — companies,
|
|
4
|
-
people, and news — carry everything else: funding, publications, and tags.
|
|
5
|
-
|
|
6
|
-
Mutations execute directly; --execute is a deprecated no-op.
|
|
7
|
-
The aVenture MCP server tools execute through this same CLI.`).addOption(new t(`--environment <environment>`,`route all API calls to a mapped API environment (default: API_URL host, else API_ENV, else ${l})`).choices([...s()])).showHelpAfterError(`(run \`${r} --help\` for usage)`);let u=dt(e,c,a,n);Y(c,u.generated,r),await u.registerBuiltin(),tt(c,a,r);for(let e of c.commands)e.helpGroup()||e.helpGroup(J(e.name()).heading);let d;if(q(c,e=>t=>{throw d=(async()=>{!u.fullTree&&![`commander.helpDisplayed`,`commander.version`].includes(t.code)&&await u.completeTree((e,t)=>Y(e,t,r));let{commandExitHandler:n}=await import(`./parse-error-hint-C6VGe_NR.js`);try{n(e)(t)}catch(e){if(e!==t)throw e}})(),t}),i===`required`){let e=[c];for(;e.length>0;){let t=e.pop();t!==void 0&&(e.push(...t.commands),t.hook(`preAction`,async(e,t)=>{e===t&&await le(`required`)}))}}let f=new Set(c.commands.filter(e=>[`entities`,`people`,`news`].includes(e.name())).flatMap(e=>e.commands.map(e=>e.name())));return c.addHelpText(`after`,[``,`Record subcommands under entities, people, and news:`,...[[`search`,` search Find many of that record from a plain-English query or a filter`],[`lookup`,` lookup Find one news article; companies and people use the root lookup`],[`get`,` get Read one record`],[`list`,` list Read many records`],[`create`,` create, update, delete Write; each needs a credential that permits it`]].flatMap(([e,t])=>f.has(e)?[t]:[]),``,`Authentication (every command that calls aVenture needs a credential):`,` Create one at ${o}/sign-up, then run: ${r} auth login`,` AUTH_TOKEN aVenture API key, for CI and other non-interactive shells`,` Check what this shell holds with: ${r} auth status\n`,`Output modes (per command):`,` --text compact lines, the terminal default; --json the full envelope`,` --csv Print CSV rows or preserve server CSV bytes.`,` --xlsx Write server XLSX bytes with --to-file; use --csv otherwise.`,` --data response data as JSON, the default when piped or non-TTY`,` --data-full uncapped, for bounded programs, never LLM agents`,` --all-fields --text plus the detail fields it hides by default
|
|
8
|
-
`,`Exit codes:`,` 0 envelope.ok === true
|
|
9
|
-
1 envelope.ok === false
|
|
10
|
-
`,`Examples:`,` $ ${r} auth login`,` $ ${r} lookup --name Stripe --url https://stripe.com`,` $ ${r} search "fintech companies in Austin"\n`,`Run \`${r} <command> --help\` for its subcommands and options,`,`or \`${r} help <command>\` for its full documentation.`].join(`
|
|
11
|
-
`)),{program:c,exitPreparation:()=>d}}var X=a(Ie(import.meta.url)),Z=X.bin[0];async function Q(e,t){let{BearerVerificationUnavailableError:n}=await import(`./openapi-call-C2DSQh2x.js`),{emitJson:r}=await import(`./output-CuZPzAlH.js`),i=e instanceof Error?e:Error(String(e));y({component:Z,event:`fatal`,message:i.message,error:i}),process.stderr.write(`${Z} fatal (${t}): ${i.stack??i.message}\n`);let a=i instanceof n?{httpStatus:i.problem.status,problem:i.problem}:{};r({...f(`${Z} ${t}: ${i.message}`,[i.name||`Error`],a),counts:{exitCode:1}}),process.exit(1)}var yt=e=>{if(e.code!==`EPIPE`)throw e;process.exit(0)};for(let e of[process.stdout,process.stderr])e.on(`error`,yt);process.on(`uncaughtException`,e=>Q(e,`uncaughtException`)),process.on(`unhandledRejection`,e=>Q(e,`unhandledRejection`));var $=await vt(process.argv.slice(2),X);try{await $.program.parseAsync()}catch(t){await $.exitPreparation(),t instanceof e?process.exitCode=t.exitCode:await Q(t,`parseAsync`)}export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./package-DEeHDoOT.js";import{c as e,r as t}from"./result-envelope-BJO8Am4v.js";import"./operations-metadata-f89kI3gd.js";import"node:path";import"node:fs";import"node:fs/promises";import"node:crypto";function n(n,r,i,a){let o=Number(r);return!Number.isInteger(o)||o<i||o>a?t(`${n} must be an integer between ${i} and ${a}, got "${r}"`):e(`${n} parsed`,o)}export{n as parseBoundedInt};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./commander-DEj7N1b9.js";import{a as t}from"./package-DEeHDoOT.js";import{a as n,f as r,t as i}from"./env-DSqe8wia.js";import{c as a,r as o}from"./result-envelope-BJO8Am4v.js";import{r as s}from"./auth-resolver-DNIqLoKm.js";import{a as c,t as l}from"./credential-redaction-BbeDpMUf.js";import{n as u}from"./contract-BgjxlOnT.js";import{t as d}from"./openapi-composites-B9JPhVYN.js";import{n as f,t as p}from"./openapi-commands-DlyuuuLD.js";import{t as m}from"./output-BeXk_9Ef.js";import{a as h,t as g}from"./output-mode-BMhOAO06.js";var _=[{name:`cli-version`,purpose:`running CLI against the latest published release`},{name:`api-schemas`,purpose:`the installed @aventurevc/api-schemas contracts resolve`},{name:`api-host`,purpose:`the selected API host answers`},{name:`auth`,purpose:`which credential signs in, as which account and role, never secrets`},{name:`catalog`,purpose:`this CLI knows every operation the API serves`}];function v(e,n=t().bin[0]){g(e.command(`doctor`).summary(`One-call selftest: CLI version, schemas, API host, auth scope, command catalog`).description(["Run every environment check in one call and report `{ ok, check: [...] }`:",..._.map(e=>` - ${e.name}: ${e.purpose}`),``,`Exit code is 0 only when no check failed; a skipped check (no registry reachable) or a`,`warned one (the account read failed) does not fail the run. Each failing message names the command that fixes it.`,"--json always carries the report at `.data`; --data prints the report directly when",`every check passes and the result envelope when one fails, like every other command.`].join(`
|
|
2
|
-
`))).action(async function(e){let{emit:t}=await import(`./output-CuZPzAlH.js`),r=this.optsWithGlobals();r.environment!==void 0&&(process.env.API_ENV=r.environment),t({mode:h(e)},await y(n))})}async function y(e){let t=S(),n=await C(e),[r,i]=await Promise.all([w(e),T(t,e)]),s=[n.check,r,i.check,await D(e),P(t,i.servedFingerprint,n.upgradeAvailable,e)],c={pass:b(s,`pass`),warn:b(s,`warn`),fail:b(s,`fail`),skip:b(s,`skip`)},l=s.filter(e=>e.status===`fail`).map(e=>e.message),u={ok:l.length===0,check:s},d=[`doctor: ${c.pass} pass, ${c.warn} warn, ${c.fail} fail, ${c.skip} skip`,...s.map(e=>` ${e.name} ${e.status} — ${e.message}`)].join(`
|
|
3
|
-
`);return u.ok?a(d,u,{counts:c}):{...o(d,l,{counts:c}),data:u}}function b(e,t){return e.filter(e=>e.status===t).length}function x(e,t,n){return{name:e,status:t,message:n}}function S(){return p.find(e=>e.intent===`status`&&e.resource===`status`)}async function C(e){let{runUpdate:n}=await import(`./builtin-update-F0HKnfKe.js`),r=t(),i=n(r,`check`);if(!i.ok||i.data===null)return{check:x(`cli-version`,`skip`,`Could not compare ${r.version} against the registry (${i.summary}); rerun \`${e} update\` with registry access.`),upgradeAvailable:null};let{targetPackage:a,currentVersion:o,latestVersion:s,upgradeAvailable:c}=i.data;return{check:c?x(`cli-version`,`fail`,`Upgrade ${a} from ${o} to ${s}: run \`${e} update\`.`):x(`cli-version`,`pass`,`${a} ${o} matches the latest published release.`),upgradeAvailable:c}}async function w(e){try{let{EntityDetailSchema:e}=await import(`./detail-DP6lF4pb.js`);if(typeof e.safeParse!=`function`)throw Error(`EntityDetailSchema does not expose a Zod parser`);return x(`api-schemas`,`pass`,`Installed @aventurevc/api-schemas contracts resolve beyond the CLI startup path.`)}catch(t){return x(`api-schemas`,`fail`,`Reinstall the CLI: run \`${e} update\` — ${l(t)}.`)}}async function T(e,t){let{runOpenApiCall:n}=await import(`./openapi-call-C2DSQh2x.js`),i=e??{method:`GET`,path:`/info`,auth:`none`},a;try{a=r().host}catch(e){return{check:x(`api-host`,`fail`,`Correct API_ENV or pass \`--environment <name>\` — ${l(e)}.`),servedFingerprint:null}}let s=await n({method:i.method,path:i.path,auth:i.auth,responseFormat:`json`}).catch(e=>o(l(e)));return s.ok?{check:x(`api-host`,`pass`,`${i.method} ${i.path} answered at ${a}.`),servedFingerprint:e===void 0?null:E(s.data)}:{check:x(`api-host`,`fail`,s.httpStatus===401?`Replace or unset the credential ${a} rejected, or run \`${t} auth login\`, then rerun \`${t} auth doctor\` — ${i.method} ${i.path} returned ${s.summary}.`:`Point the CLI at a reachable API host with \`--environment <name>\` or API_URL, then rerun \`${t} auth doctor\` — ${i.method} ${i.path} at ${a} returned ${s.summary}.`),servedFingerprint:null}}function E(e){if(typeof e!=`object`||!e||e instanceof Uint8Array)return null;let{response:t}=e;if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t.operationFingerprint;return typeof n==`string`&&n.length>0?n:null}async function D(e){let{isOAuthCredentialExpired:t}=await import(`./oauth-credential-Dl2t7SrT.js`),n=s(),[r,a]=await Promise.all([k(),A()]);if(a.state===`unavailable`&&a.cause===`environment`)return x(`auth`,`fail`,`Fix the environment configuration first — ${a.summary}.`);let o=n.present,c=a.state===`found`&&a.stored.activation===`active`;if(!o&&r.state===`invalid`)return x(`auth`,`fail`,`Saved OAuth credential is invalid; run \`${e} auth login\` to sign in again after verification — ${r.summary}.`);if(!o&&r.state===`found`&&t(r.stored.credential)&&r.stored.credential.tokens.refresh_token===void 0)return x(`auth`,`fail`,`Saved OAuth access token is expired without a refresh token; run \`${e} auth login\` to sign in again.`);if(!o&&!c&&r.state===`unavailable`)return x(`auth`,`fail`,`Make the OS keyring or the CLI config directory usable before \`${e} auth login\`, or inject ${i.authToken} through the environment — ${r.summary}.`);if(o||r.state===`found`||c){let t=await O(e,n);return x(`auth`,t.status,`Credential source available: ${await j(n,r,a)}; ${t.text}.`)}return a.state===`unavailable`?x(`auth`,`fail`,`Make the OS keyring or the CLI config directory usable before \`${e} auth login --key\`, or inject ${i.authToken} through the environment — ${a.summary}.`):x(`auth`,`fail`,`Run \`${e} auth login\` for OAuth or \`${e} auth login --key\` for an API key. For non-interactive use, set ${i.authToken} in the environment.`)}async function O(e,t){let{refreshCliCredentials:n}=await import(`./auth-status-render-DtKkm4Nj.js`),{inspectPrivateLiveIdentity:i}=await import(`./private-live-identity-w8v84cKs.js`),a=c(r().host),o=await n(e),s=`credential=${t.present?t.source??`env`:o.materialized??`none`}`;try{if(o.failure!==null)throw Error(o.failure);let e=await i(`write`);if(e===null)return{status:`pass`,text:`${s} host=${a}`};let t=e.rbacRole.length===0?`none`:e.rbacRole.join(`,`);return{status:`pass`,text:`${s} account=${e.email??e.id} role=${t} host=${a}`}}catch(t){return{status:`warn`,text:`${s} account=unread host=${a} — GET /v1/auth/me returned ${l(t,[r().userBearerToken])}; run \`${e} auth status --verify write\``}}}async function k(){let{inspectOAuthCredentialStorage:e}=await import(`./oauth-credential-Dl2t7SrT.js`),t;try{t=c(r().host)}catch(e){return{state:`unavailable`,summary:l(e)}}return await e(t)}async function A(){let{inspectApiKeyCredentialStorage:e}=await import(`./api-key-credential-DzDcIKGs.js`),t;try{t=c(r().host)}catch(e){return{state:`unavailable`,summary:l(e),cause:`environment`}}try{return await e(t)}catch(e){return{state:`unavailable`,summary:l(e),cause:`storage`}}}async function j(e,t,n){let{summarizeCredential:r}=await import(`./auth-status-render-DtKkm4Nj.js`);return[r(e),`oauth=${await N(t)}`,`api-key=${await M(n)}`].join(` `)}async function M(e){let{apiKeyExpiryQualifier:t}=await import(`./auth-status-render-DtKkm4Nj.js`);if(e.state!==`found`)return e.state===`missing`?`unset`:`unavailable`;let n=c(r().host);return`${e.stored.activation}${t(n,e)}`}async function N(e){let{isOAuthCredentialExpired:t}=await import(`./oauth-credential-Dl2t7SrT.js`);switch(e.state){case`found`:return t(e.stored.credential)?`expired`:`stored`;case`missing`:return`unset`;case`invalid`:return`invalid`;case`unavailable`:return`unavailable`;default:throw Error(`Unsupported OAuth credential state`)}}function P(e,t,n,r){let i=p.length;if(e===void 0)return x(`catalog`,`skip`,`The public catalog omits deployment-status metadata and holds ${i} operations.`);if(t===null)return x(`catalog`,`skip`,`Could not read the served operation fingerprint, so drift is unproven; this catalog holds ${i} operations at ${f}.`);if(t===`d9c4d86f6eee2e0d`)return x(`catalog`,`pass`,`${i} generated operations match the set the API serves (${f}).`);let a=`This catalog describes a different operation set than the API serves (${f} vs ${t})`;return n===!0?x(`catalog`,`fail`,`${a}: run \`${r} update\`.`):x(`catalog`,`skip`,n===!1?`${a}, and this CLI is already the latest published release: either the deployed API is older than this CLI, or a newer CLI has not been published yet.`:`${a}, and the registry did not answer, so it is unknown whether a newer release describes it: rerun \`${r} update\` with registry access.`)}var F=u(d,`oauth`),I=[u(d,`start`),u(d,`poll`),u(d,`acknowledge`)],L=u(d,`revoke`);function R(n,r=t().bin[0]){let a=H(n);v(a,r);let s=[`${F.description} Default method: OAuth in your browser.`,`With --key: ${I.map(({description:e})=>e).join(` `)}`].join(`
|
|
4
|
-
`);g(V(a,[F,...I],s)).action(z),g(V(a,[L],L.description)).action(B),g(a.command(`status`).summary(`Keep saved credentials current and report them`).description(`Runs the same credential materialization every command runs, then reports:
|
|
5
|
-
- auth: whether AUTH_TOKEN was already set in this shell's environment
|
|
6
|
-
- oauth: the saved OAuth identity and access-token expiry for the selected API host;
|
|
7
|
-
an expired token is renewed with its refresh token and a token the sign-in service rejects is retired
|
|
8
|
-
- api-key: the saved aVenture API key, re-verified with aVenture sign-in and its cached metadata updated
|
|
9
|
-
- selected: the credential the next command sends
|
|
10
|
-
- providers: GET /v1/auth/providers (browser sign-in and the CLI OAuth client)
|
|
11
|
-
- api: running CLI package version plus GET /info build metadata
|
|
12
|
-
|
|
13
|
-
Saved credentials are sent only to the selected API host and aVenture sign-in, never printed.
|
|
14
|
-
--verify read|write additionally runs a live permission probe for that scope; it does not
|
|
15
|
-
execute or authorize an arbitrary API operation.`).addOption(new e(`--verify <scope>`,`verify one permission-probe scope`).choices([`read`,`write`]))).action(async function(e){U(this),m({mode:h(e)},await W(r,e.verify))}),a.command(`token`).summary(`Print the bearer token the next command sends`).description([`Runs the same credential materialization every command runs, then prints the selected`,`bearer token alone on stdout: ${i.authToken} when set, otherwise the saved OAuth`,`access token (renewed when expired) or the saved aVenture API key.`,`Use it where another client needs this CLI's sign-in, such as an MCP client's header helper.`].join(`
|
|
16
|
-
`)).action(async function(){let{refreshCliCredentials:e}=await import(`./auth-status-render-DtKkm4Nj.js`);U(this);let t=await e(r),n=process.env[i.authToken]?.trim();t.failure===null&&n!==void 0&&n.length>0?process.stdout.write(`${n}\n`):m({mode:`text`},t.failure===null?Q(`auth token: no credentials resolved`,null,r,{oauth:!0,apiKey:!0}):o(`auth token: ${t.failure}`))})}async function z(e){U(this);let t=h(e);if(e.providers===!0){m({mode:t},await K());return}let n=e.key===!0?await(await import(`./api-key-login-B2iWS8j_.js`)).loginApiKeyCredential({noBrowser:!e.browser,clientLabel:e.clientLabel}):await(await import(`./oauth-login-DEqo9C-G.js`)).loginOAuthCredential({noBrowser:!e.browser});m({mode:t},n)}async function B(e){let{logoutCliCredentials:t}=await import(`./logout-6FG-rkmk.js`);U(this),m({mode:h(e)},await t({forgetLocal:e.forgetLocal===!0}))}function V(e,t,n){let[r]=t,i=e.command(r.command.slice(r.command.indexOf(` `)+1)).summary(r.summary).description(n),a=new Set;for(let e of t)for(let t of[...e.bodyOption,...e.localOption])a.has(t.flag)||(a.add(t.flag),`required`in t&&t.required?i.requiredOption(t.flag,t.description):i.option(t.flag,t.description));return i}function H(e){return(e.commands.find(e=>e.name()===`auth`)??e.command(`auth`)).summary(`Sign in, sign out, and check credentials`).description([`\`${F.command}\`: ${F.summary}; \`--key\` ${I[0].summary.toLowerCase()}.`,`\`${L.command}\`: ${L.summary}.`,"`auth status` reports local credential provenance, sign-in providers, and CLI/API build metadata.","`auth doctor` runs the one-call selftest and prints `{ ok, check: [...] }`.","`auth token` prints the bearer token the next command sends."].join(`
|
|
17
|
-
`))}function U(e){let t=e.optsWithGlobals();t.environment!==void 0&&(process.env.API_ENV=t.environment)}async function W(e,n){let{resolveAuthStatus:s}=await import(`./auth-resolver-C57QMMUe.js`),{inspectOAuthCredentialStorage:u}=await import(`./oauth-credential-Dl2t7SrT.js`),{apiKeyCredentialDiagnostics:d,inspectLiveAuth:f,oauthCredentialDiagnostics:p,refreshCliCredentials:m,renderAuthStatus:h}=await import(`./auth-status-render-DtKkm4Nj.js`),g;try{g=c(r().host)}catch(e){return o(`auth status: invalid API host — ${l(e)}`)}let _=s(),v=m(e),[y,b]=await Promise.all([Z(`/info`,`GET /info`),q()]),x=await v,[S,C]=await Promise.all([u(g),G(g)]),w=n===void 0?null:await f(n,S,C.inspection,x),T=t().version,E=d(g,C.inspection,C.verification),D=h({cliName:e,cliVersion:T,apiVersion:y.ok?await Y(y.data):null,oauth:S,apiKey:E,providers:b,resolved:_,refresh:x,live:w}),O={cli:{version:T},api:y.ok?y.data??null:null,auth:{[i.authToken]:_},selected:x.materialized,oauth:p(g,S),apiKey:E,providers:b,live:w,...y.ok?{}:{apiError:y.summary}};return x.failure===null?!y.ok&&y.httpStatus===401?{...o(`auth status: the API rejected the selected credential (401) | ${D}`,[`Replace or unset ${i.authToken}, or run \`${e} auth login\`.`]),data:O}:w!==null&&w.error!==null?{...o(`auth status: ${w.scope} permission probe failed — ${w.error}`,[w.error]),data:O}:w!==null||_.present||S.state===`found`||C.inspection.state===`found`?a(D,O):Q(`auth status: no credentials resolved | ${D}`,O,e,{oauth:S.state===`missing`,apiKey:C.inspection.state===`missing`}):{...o(`auth status: ${x.failure} | ${D}`,[x.failure]),data:O}}async function G(e){let{refreshStoredApiKeyCredential:t}=await import(`./api-key-credential-verification-D2blVIRu.js`),n=await J(e);if(n.state!==`found`)return{inspection:n,verification:null};let{stored:r,verification:i}=await t(n.stored);return{inspection:{state:`found`,stored:r},verification:i}}async function K(){let e=await q();return e.state===`found`?a(`Sign-in providers for the selected API host`,e.catalog):o(`auth login --providers: ${e.summary}`)}async function q(){try{let{fetchAuthProviderCatalog:e}=await import(`./oauth-login-DEqo9C-G.js`);return{state:`found`,catalog:await e()}}catch(e){return{state:`unavailable`,summary:l(e)}}}async function J(e){try{let{inspectApiKeyCredentialStorage:t}=await import(`./api-key-credential-DzDcIKGs.js`);return await t(e)}catch(e){return{state:`invalid`,summary:l(e)}}}async function Y(e){let{SystemBuildSchema:t}=await import(`./system-build-z_cn0X5C.js`);if(!X(e))return null;let n=t.safeParse(Reflect.get(e,`response`));if(!n.success)return null;let r=n.data.build.version?.trim();return r&&r.length>0?r:null}function X(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function Z(e,t){let{runOpenApiCall:n}=await import(`./openapi-call-C2DSQh2x.js`);return await n({method:`GET`,path:e,auth:`none`,responseFormat:`json`}).catch(e=>o(`${t} failed: ${e instanceof Error?e.message:String(e)}`))}function Q(e,t,r,a){return{...o(e,[...a.apiKey?[`For an API key (works over SSH), run \`${r} auth login --key\`.`]:[],...a.oauth?[`For OAuth, run \`${r} auth login\`; without a browser it prints a device code.`]:[],`For non-interactive use, set ${i.authToken} to an aVenture API key (create one at ${n}/settings/api-keys).`]),data:t}}export{R as registerBuiltinAuthCommands};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,r as t}from"./result-envelope-BJO8Am4v.js";import{t as n}from"./output-BeXk_9Ef.js";import{a as r,t as i}from"./output-mode-BMhOAO06.js";var a=5e3,o=6e4,s=3e4,c=86400;function l(e){let t=e.commands.find(e=>e.name()===`research-runs`);if(t===void 0)return;let a=t.command(`wait`).summary(`Wait for one research run to finish, then report its outcome`).description("Polls `research-runs get` with backoff until the run is completed, failed, or stopped, then prints its status, error, failure class, spend, and last event time; a timeout reports the last event time so a stalled run shows. Exits nonzero when the run failed or stopped, or when --timeout passes first.").requiredOption(`--run-id <uuid>`,`Research run id`).option(`--timeout <seconds>`,`Total seconds to wait`,`1800`);i(a),a.action(async function(){let e=this.optsWithGlobals();n({mode:r(e)},await u(e))})}async function u(e){let{setTimeout:n}=await import(`node:timers/promises`),{buildOpenApiPath:r}=await import(`./openapi-call-C2DSQh2x.js`),{parseBoundedInt:i}=await import(`./batch-io-l87mE7Ym.js`),s=i(`--timeout`,e.timeout,1,c);if(!s.ok||s.data===null)return t(s.summary);let l=Date.now()+s.data*1e3,u=r(`getResearchRun`,{runId:e.runId}),p=a,m=`not read yet`,h=(n=`after ${s.data}s`)=>t(`Run ${e.runId} is still ${m} ${n}`,[`Wait longer with --timeout, or read it with \`research-runs get --run-id ${e.runId}\`.`]);for(;;){if(l-Date.now()<=0)return h();let e=0,t=await f(u,l);if(t.kind===`deadline`)return h();if(t.kind===`refused`)return t.envelope;if(t.kind===`detail`){let{run:e}=t.detail;if(e.status===`completed`||e.status===`failed`||e.status===`stopped`)return await d(t.detail,l);m=`${e.status}, last event ${t.detail.lastEventAt??`none`}`}else m=`unread (${t.reason})`,e=(t.retryAfterSeconds??0)*1e3;let r=l-Date.now();if(r<=0||e>=r)return h(r<=0?`after ${s.data}s`:`and the API asks for ${e/1e3}s, past the ${s.data}s --timeout`);let i=Math.max(e,a+Math.random()*(p-a));await n(Math.min(i,r)),p=Math.min(p*2,o)}}async function d(t,n){let{readResearchRunSpend:r}=await import(`./research-run-spend-D9aXcq6b.js`),{run:i}=t,a=await r({runId:i.id,deadline:n}),o={runId:i.id,status:i.status,error:i.error??null,failureClass:i.failureClass??null,publicUrl:t.publicUrl??null,finishedAt:i.finishedAt??null,lastEventAt:t.lastEventAt??null,...a.costUsd===null?{}:{costUsd:a.costUsd}},s={warnings:a.warning===void 0?[]:[a.warning]},c=a.costUsd===null?``:`; spend $${a.costUsd.toFixed(4)}`;if(i.status===`completed`)return e(`Run ${i.id} completed${c}`,o,s);let l=i.failureClass?` (${i.failureClass})`:``,u=i.error?`: ${i.error}`:``;return{...e(`Run ${i.id} ${i.status}${l}${c}${u}`,o,s),ok:!1}}async function f(e,n){let{HarnessRunDetailSchema:r}=await import(`./run-detail-CIBpS8hz.js`),{runOpenApiCall:i}=await import(`./openapi-call-C2DSQh2x.js`),{isTransientRefusal:a,isTransportFailure:o}=await import(`./request-replay-CWSOo3El.js`),{retrySeconds:c}=await import(`./response-problem-DYbgVdhl.js`),l=n-Date.now();if(l<=0)return{kind:`deadline`};let u=AbortSignal.timeout(Math.min(s,l)),d;try{d=await i({method:`GET`,path:e,auth:`auto`,responseFormat:`json`,signal:u})}catch(e){if(o(e)||u.aborted&&e instanceof Error&&e.cause instanceof Error&&e.cause.name===`AbortError`&&e.cause.cause===u.reason)return{kind:`transient`,reason:String(e)};throw e}if(!d.ok){let{problem:n}=d;if(n!==void 0&&a(n.status,n)){let e=c(n.retryAfterSeconds);return{kind:`transient`,reason:d.summary,...e===void 0?{}:{retryAfterSeconds:e}}}return{kind:`refused`,envelope:t(`GET ${e} failed: ${d.summary}`,d.warnings,{problem:n})}}let f=d.data,p=r.safeParse(typeof f==`object`&&f&&`response`in f?f.response:void 0);return p.success?{kind:`detail`,detail:p.data}:{kind:`refused`,envelope:t(`${e} returned an unexpected body: ${p.error.message}`)}}export{l as registerBuiltinResearchRunWaitCommand};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{t}from"./openapi-commands-DlyuuuLD.js";import{n,r}from"./completion-setup-CwJt88xW.js";import{o as i}from"./generated-option-order-0l9dYmAK.js";import a from"node:process";function o(i,o=t,s=e().bin[0]){let l=i.command(`completion`).summary(`Generate shell completion scripts`).description(`Generate shell completion scripts for the aVenture CLI.`);for(let e of[`bash`,`fish`,`zsh`])l.command(e).summary(`Print ${e} shell completions`).description(`Print ${e} completion definitions for ${s}.`).action(()=>{a.stdout.write(c(i,e,o))});n(l,s),r(l,s)}function s(){return e().bin}function c(e,n,r=t,i=s()){let a=_(r);return n===`fish`?[`# fish completions for ${i.join(`, `)}`,...u(e),...i.map(e=>`complete -c ${N(e)} -e`),`${A(i)} -f`,...d(e,i),...f(e,a,i),``].join(`
|
|
2
|
-
`):l(e,n,a,i)}function l(e,t,n,r){let i=t===`zsh`?`typeset -ga `:``,a=`complete -F _aventure_cli ${r.map(e=>e.replaceAll(`'`,`'\\''`)).join(` `)}`,[o,s,c]=b(e,n);return[...t===`zsh`?[`#compdef ${r.join(` `)}`]:[],`# ${t} completions for ${r.join(`, `)}`,`${i}_aventure_cli_commands=(`,...o.map(e=>` ${e}`),`)`,`${i}_aventure_cli_options=(`,...s.map(e=>` ${e}`),`)`,`${i}_aventure_cli_values=(`,...c.map(e=>` ${e}`),`)`,``,...C(t),...t===`bash`?[a,``]:[``]].join(`
|
|
3
|
-
`)}function u(e){return[`function __aventure_cli_command_path\n set -l global_value_options ${p(e).filter(e=>e.required||e.optional).flatMap(e=>E(e)??[]).map(N).join(` `)}\n set -l tokens (commandline -xpc)\n if test (count $tokens) -gt 0\n set -e tokens[1]\n end\n set -l path\n set -l skip_next 0\n for token in $tokens\n if test $skip_next -eq 1\n set skip_next 0\n continue\n end\n if string match -q -- '--*=*' $token\n set -l name (string replace -r '^--([^=]+)=.*$' '$1' -- $token)\n contains -- $name $global_value_options; and continue\n end\n if string match -q -- '--*' $token\n set -l name (string replace -r '^--' '' -- $token)\n if contains -- $name $global_value_options\n set skip_next 1\n continue\n end\n break\n end\n if string match -q -- '-*' $token\n break\n end\n set -a path $token\n end\n printf '%s\\n' $path\nend\n`,`function __aventure_cli_path_is
|
|
4
|
-
set -l expected $argv
|
|
5
|
-
set -l actual (__aventure_cli_command_path)
|
|
6
|
-
if test (count $actual) -ne (count $expected)
|
|
7
|
-
return 1
|
|
8
|
-
end
|
|
9
|
-
if test (count $expected) -eq 0
|
|
10
|
-
return 0
|
|
11
|
-
end
|
|
12
|
-
for index in (seq (count $expected))
|
|
13
|
-
if test $actual[$index] != $expected[$index]
|
|
14
|
-
return 1
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
return 0
|
|
18
|
-
end
|
|
19
|
-
`].flatMap(e=>e.split(`
|
|
20
|
-
`))}function d(e,t){return y(e).map(e=>`${A(t)} -f -n ${N(j(e.parentPath))} -a ${N(e.name)} -d ${N(e.description)}`).toSorted((e,t)=>e.localeCompare(t))}function f(e,t,n){return D(e).flatMap(e=>{let r=k(e),i=r.length===0?void 0:j(r);return p(e).flatMap(e=>{let a=t.get(v(r,e));return S(a)?m(e,i,a,n):[]})}).toSorted((e,t)=>e.localeCompare(t))}function p(e){return e.parent===null?e.createHelp().visibleOptions(e):e.options}function m(e,t,n,r){let i=E(e);if(i===void 0)return[];let a=e.argChoices??x(n),o=[`-l ${N(i)}`,e.short===void 0?``:`${e.short.startsWith(`--`)?`-l`:`-s`} ${N(e.short.replace(/^-+/,``))}`].filter(Boolean),s=t===void 0?``:` -n ${N(t)}`,c=e.required||e.optional?h(a,g(i,n)):`-f`,l=`${A(r)}${s} ${o.join(` `)} ${c}`;return a===void 0||a.length===0?[`${l} -d ${N(M(e.description))}`]:a.map(t=>`${l} -a ${N(t)} -d ${N(M(e.description))}`)}function h(e,t){return e!==void 0&&e.length>0?`-x`:t?`-r -F`:`-r -f`}function g(e,t){return e===`from-file`?!0:t===void 0||t.some(({location:e})=>e!==`body`)?!1:t.every(({schemaFormat:e})=>e===`binary`)?!0:t.length===1&&[`file`,`path`].includes(e.split(`-`).at(-1)??``)}function _(e){return new Map(e.flatMap(e=>[...e.parameters.map(e=>[e]),...i(e.requestBody??[]).map(({variant:e})=>e.map(({parameter:e})=>e))].flatMap(t=>{let n=t[0];if(n===void 0)throw Error(`Generated CLI option has no parameter`);return[[v(e.cliPath,n),t]]})))}function v(e,t){let n=`flag`in t?t.flag.split(/\s+/)[0]?.replace(/^--/,``):E(t);if(`flag`in t&&(n===void 0||n.length===0||n===t.flag))throw Error(`Cannot render completion for option flag: ${t.flag}`);return`${e.join(`\0`)}\u0000${n??``}`}function y(e){return D(e).flatMap(e=>e.commands.map(t=>({parentPath:k(e),name:t.name(),description:M(t.summary()||t.description()||t.name())})))}function b(e,t){let n=[],r=[];for(let i of D(e)){let e=k(i);for(let a of p(i)){let i=E(a);if(i===void 0)continue;let o=t.get(v(e,a));if(!S(o))continue;let s=a.argChoices??x(o),c=`none`;(a.required||a.optional)&&(c=s!==void 0&&s.length>0?`choice`:`scalar`,c===`scalar`&&g(i,o)&&(c=`file`)),n.push(w([e.join(` `),`--${i}`,a.short??``,a.description,c]));for(let t of s??[])r.push(w([e.join(` `),`--${i}`,t,a.description]))}}return[y(e).map(e=>w([e.parentPath.join(` `),e.name,e.description])).toSorted((e,t)=>e.localeCompare(t)),n.toSorted((e,t)=>e.localeCompare(t)),r.toSorted((e,t)=>e.localeCompare(t))]}function x(e){let t=e?.[0]?.choices;if(e!==void 0&&t!==void 0)return e.every(e=>e.choices?.length===t.length&&e.choices.every((e,n)=>e===t[n]))?t:void 0}function S(e){return e?.some(({visibility:e})=>e!==`private`)??!0}function C(e){let t=e===`bash`,n=t?`COMP_WORDS`:`words`,r=t?`COMP_CWORD`:`CURRENT`,i=t?"${path[*]}":"${(j: :)path}",a=t?'"${_aventure_cli_options[@]}"':`$_aventure_cli_options`,o=t?'"${_aventure_cli_values[@]}"':`$_aventure_cli_values`,s=t?'"${_aventure_cli_commands[@]}"':`$_aventure_cli_commands`;return[`function _aventure_cli {`,` local current="\${${n}[${r}]}" previous="\${${n}[${r}-1]}" row row_path long short description mode name value option token key prefix candidate file_current`,...t?[` COMPREPLY=()`]:[],` local index=${t?1:2} skip_next=0; local -a path names descriptions`,` while (( index < ${r} )); do`,` token="\${${n}[index]}"; (( skip_next )) && { skip_next=0; (( index++ )); continue; }`,` if [[ "$token" == -* && "$token" != "-" && "$token" != "--" ]]; then`,` option="\${token%%=*}"; key="${i}"; mode=''`,` for row in ${a}; do IFS='|' read -r row_path long short description mode <<< "$row"; [[ "$row_path" == "$key" && ( "$long" == "$option" || "$short" == "$option" ) ]] && break; mode=''; done`,` [[ -n "$mode" && "$mode" != none && "$token" != *=* ]] && skip_next=1`,` elif [[ "$token" != -* ]]; then path+=("$token"); fi`,` (( index++ ))`,` done`,` key="${i}"`,` if [[ "$current" == --*=* || ( "$previous" == -* && "$current" != -* ) ]]; then`,` option="$previous"; prefix=''; file_current="$current"; [[ "$current" == --*=* ]] && { option="\${current%%=*}"; prefix="$option="; file_current="\${current#*=}"; }`,` for row in ${a}; do IFS='|' read -r row_path long short description mode <<< "$row"; [[ "$row_path" == "$key" && ( "$long" == "$option" || "$short" == "$option" ) ]] && { option="$long"; break; }; mode=''; done`,t?` [[ "$mode" == file ]] && { while IFS= read -r candidate; do COMPREPLY+=("$prefix$candidate"); done < <(compgen -f -- "$file_current"); return 0; }`:` [[ "$mode" == file ]] && { _files; return 0; }`,t?` [[ "$mode" == choice ]] && for row in ${o}; do IFS='|' read -r row_path long value description <<< "$row"; [[ "$row_path" == "$key" && "$long" == "$option" ]] && { candidate="$prefix$value"; [[ "$candidate" == "$current"* ]] && COMPREPLY+=("$candidate"); }; done`:` [[ "$mode" == choice ]] && for row in ${o}; do IFS='|' read -r row_path long value description <<< "$row"; [[ "$row_path" == "$key" && "$long" == "$option" ]] && { names+=("$prefix$value"); descriptions+=("$description"); }; done`,` elif [[ "$current" == -* ]]; then`,` for row in ${a}; do`,` IFS='|' read -r row_path long short description mode <<< "$row"`,t?` [[ "$row_path" == "$key" ]] && { [[ "$long" == "$current"* ]] && COMPREPLY+=("$long"); [[ -n "$short" && "$short" == "$current"* ]] && COMPREPLY+=("$short"); }`:` [[ "$row_path" == "$key" ]] && { names+=("$long"); descriptions+=("$description"); [[ -n "$short" ]] && { names+=("$short"); descriptions+=("$description"); }; }`,` done`,` elif [[ "$previous" != -* ]]; then`,` for row in ${s}; do`,` IFS='|' read -r row_path name description <<< "$row"`,t?` [[ "$row_path" == "$key" ]] && { [[ "$name" == "$current"* ]] && COMPREPLY+=("$name"); }`:` [[ "$row_path" == "$key" ]] && { names+=("$name"); descriptions+=("$description"); }`,` done`,` fi`,...t?[]:[" (( ${#names} )) && compadd -d descriptions -a names"],` return 0`,`}`,...t?[]:[`_aventure_cli "$@"`]]}function w(e){return`$'${e.map(T).join(`|`)}'`}function T(e){return M(e).replaceAll(`\\`,`\\\\`).replaceAll(`'`,`\\'`).replaceAll(`|`,` `)}function E(e){return e.long?.replace(/^--/,``)}function D(e){return[e,...e.commands.filter(O).flatMap(e=>D(e))]}var O=e=>e.parent?.createHelp().visibleCommands(e.parent).includes(e)??!0;function k(e){let t=[];for(let n=e;n?.parent!==null;n=n.parent)t.unshift(n.name());return t}function A(e){return`complete ${e.map(e=>`-c ${N(e)}`).join(` `)}`}function j(e){return[`__aventure_cli_path_is`,...e.map(N)].join(` `)}function M(e){return e.replace(/\s+/g,` `).trim()}function N(e){return`'${e.replace(/[\r\n\t]/g,` `).replaceAll(`\\`,`\\\\`).replaceAll(`'`,`\\'`)}'`}export{o as registerCompletionCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./commander-DEj7N1b9.js";import{s as t}from"./tool-policy-DfLvQfqr.js";import{a as n,o as r}from"./cli-help-policy-DKV7chuM.js";import{n as i,t as a}from"./contract-parameter-C7Ead17E.js";function o(e){return e.toSorted((e,t)=>e.projection.cliPath.length-t.projection.cliPath.length||e.projection.cliPath.join(` `).localeCompare(t.projection.cliPath.join(` `))||e.operationId.localeCompare(t.operationId)).map(e=>{let t=e.parameter.flatMap(t=>{if(t.in!==`path`&&t.in!==`query`&&t.in!==`header`)return[];let n=t.in;return(t.in===`query`&&t.itemProperty!==void 0?t.itemProperty:[t]).map(t=>{let r=d(t,i(e,t),n);if(t.legacyName===void 0)return r;let a=d(t,i(e,t,t.legacyName),n).flag;return a===r.flag?r:Object.assign(r,{legacyFlag:a})})}),n=e.requestBody?.map(n=>{let r=l(e,t,n),i=c(n.cliConflicts,r),a=i.length===0?{}:{cliConflicts:i};return Object.assign({},n,{parameter:r},a)}),r=e.response.find(({status:e})=>e.startsWith(`2`)),a=r?.schemaName?.replace(/Schema$/,``);return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,cliPath:e.projection.cliPath,summary:e.summary,description:e.description,binaryResponse:e.binaryResponse?!0:void 0,explain:e.explain?!0:void 0,deprecated:e.deprecated?!0:void 0,requestBody:n,mutationReadback:e.mutationReadback,scope:e.projection.scope,auth:e.projection.auth,visibility:e.projection.visibility,mutates:e.projection.mutates,completionEvidence:e.completionEvidence,errorResponse:e.errorResponse,successResponse:a,detailField:r?.detailField,header:r?.header,parameters:t}})}function s(e,t){let[n,r]=e.filter(e=>e.role===t);if(n===void 0||r!==void 0)throw Error(`Generated composite CLI role '${t}' is incomplete`);return n}function c(e,t){let n=new Map(t.map(({name:e,optionKey:t})=>[e,t]));return(e??[]).map(e=>e.map(e=>{let t=n.get(e);if(t===void 0)throw Error(`x-aventure-cli-conflicts field '${e}' was removed from the generated CLI projection`);return t}))}function l(e,t,n){let r=new Set(t.map(e=>e.optionKey));(e.requestBody?.length??0)>1&&r.add(`contentType`);let i=new Set(t.filter(e=>e.location===`path`).map(e=>e.name));return n.parameter.toSorted((e,t)=>u(e.name)-u(t.name)).flatMap(t=>{if(!t.required&&(r.has(t.inputName)||i.has(t.name)))return[];let n=a(e,t,r);return r.add(n),[d(t,n,`body`)]})}function u(e){let t=e.split(`.`).at(-1);return t===`min`?0:t===`max`?1:2}function d(i,a,o){let s=i.itemSchemaEnum??i.schemaEnum,c=r(i.schemaType,i.itemSchemaType,i.schemaFormat,a),l=`${t(a)} ${i.schemaType===`boolean`?`[${c}]`:`<${c}>`}`;return{name:i.name,optionKey:new e(l).attributeName(),flag:l,required:i.required&&i.schemaDefault===void 0,description:n(i.description,s),schemaType:i.schemaType,schemaFormat:i.schemaFormat,itemSchemaType:i.itemSchemaType,defaultValue:f(i.schemaDefault),choices:s,...i.envName===void 0?{}:{envName:i.envName},...i.visibility&&{visibility:i.visibility},location:o}}var f=e=>Array.isArray(e)?e.map(String):typeof e==`number`?String(e):e;export{s as n,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./response-problem-BAThXgJO.js";function t(e){let t=e.trim();if(t.length===0)throw Error(`API host must not be blank`);let n=new URL(a(t)?t:`${o(t)}://${t}`),r=s(n.hostname);if(n.protocol!==`https:`&&n.protocol!==`http:`||n.username.length>0||n.password.length>0||n.pathname!==`/`&&n.pathname!==``||n.search.length>0||n.hash.length>0)throw Error(`API host must contain only an HTTP(S) host and optional port`);if(n.protocol===`http:`&&!r)throw Error(`stored credentials require HTTPS except for loopback API hosts`);return{host:n.host.toLowerCase(),origin:n.origin,isLoopback:r}}function n(e){return t(e).host}function r(e){return{...e,host:t(e.host).origin}}function i(e){let n=t(e);if(n.isLoopback)return`http://localhost:3000`;if(n.host===`api.aventure.vc`)return`https://aventure.vc`;throw Error(`no first-party browser origin is configured for API host ${n.host}`)}function a(e){return/^[a-z][a-z\d+.-]*:\/\//iu.test(e)}function o(e){let t=e.split(`/`,1)[0]?.toLowerCase()??``;try{return s(new URL(`http://${t}`).hostname)?`http`:`https`}catch{return`https`}}function s(e){let t=e.toLowerCase();return t===`localhost`||t===`127.0.0.1`||t===`0.0.0.0`||t===`[::1]`}function c(t,n=[]){let r=t instanceof Error?t.message:String(t);return e(r,n)}function l(t,n=[]){let r=e(t.title,n),i=e(t.detail?.trim()??``,n);return`${t.status} ${r}${i?` — ${i}`:``}`}export{n as a,t as i,l as n,s as o,i as r,r as s,c as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./package-DEeHDoOT.js";import{n as t,t as n}from"./auth-resolver-DNIqLoKm.js";import{o as r}from"./logging-81KzSgWu.js";import{o as i,t as a}from"./credential-redaction-BbeDpMUf.js";import{execFile as o}from"node:child_process";import{dirname as s,join as c}from"node:path";import{platform as l}from"node:os";import{chmod as u,mkdir as d,readFile as f,rename as p,rm as m,stat as h,writeFile as g}from"node:fs/promises";import{AsyncLocalStorage as _}from"node:async_hooks";import{setTimeout as v}from"node:timers/promises";import{randomUUID as y}from"node:crypto";var b=2;function x(e,t){return w(e,t).redactedUrl}async function S(e,t,n){let r=w(e,t);return await C(new URL(r.openerUrl),n)}async function C(e,t){let n=t.environment??process.env,r=t.operatingSystem??l(),i=T(t.noBrowser,n,r);if(i!==null)return{state:`skipped`,reason:i};let a=E(r,e.toString());if(a===null)return{state:`failed`,reason:`unsupported browser-opening platform: ${r}`};try{return await D(a.command,a.arguments),{state:`opened`,reason:null}}catch{return{state:`failed`,reason:`browser opener failed`}}}function w(e,t){let{id:n,verificationUrl:r,pollSecret:a}=e,o,s;try{o=new URL(r),s=new URL(t)}catch{throw Error(`broker returned an invalid browser verification URL`)}if(s.username.length>0||s.password.length>0||s.pathname!==`/`||s.search.length>0||s.hash.length>0)throw Error(`configured browser origin must contain only an origin`);let c=i(s.hostname);if(s.protocol!==`https:`&&!(s.protocol===`http:`&&c))throw Error(`configured browser origin must use HTTPS except for loopback development`);let l=new URLSearchParams(o.hash.slice(1)),u=[...l.keys()],d=l.getAll(`cliAuthorizationId`),f=l.getAll(`browserSecret`),p=f[0]??``;if(o.origin!==s.origin||o.protocol!==s.protocol||o.username.length>0||o.password.length>0||o.pathname!==`/settings/developer`||o.search.length>0||u.length!==b||d.length!==1||d[0]!==n||f.length!==1||p.length===0||a.length===0||p===a)throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`);let m;try{m=decodeURIComponent(r)}catch{throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`)}if(r.includes(a)||m.includes(a))throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`);let h=new URL(o);return h.hash=new URLSearchParams({cliAuthorizationId:n,browserSecret:`<redacted>`}).toString(),{openerUrl:r,redactedUrl:h.toString()}}function T(e,t,n){return e?`--no-browser was set`:n===`darwin`&&t.CODEX_SESSION_ID?`macOS Codex browser process boundary`:t.SSH_CONNECTION||t.SSH_CLIENT||t.SSH_TTY?`SSH/headless session detected`:(n===`linux`||n===`freebsd`)&&!t.DISPLAY&&!t.WAYLAND_DISPLAY?`no graphical display detected`:null}function E(e,t){return e===`darwin`?{command:`open`,arguments:[t]}:e===`win32`?{command:`rundll32.exe`,arguments:[`url.dll,FileProtocolHandler`,t]}:e===`linux`||e===`freebsd`?{command:`xdg-open`,arguments:[t]}:null}function D(e,t){return new Promise((n,r)=>{o(e,[...t],{timeout:5e3,windowsHide:!0},e=>e?r(e):n())})}var O=100,k=3e4,A=6e4,j=new _;function M(){return c(s(n()),`credentials.json`)}function N(e){return`OS keyring is unusable (${e}); the credential will be stored in ${M()} (mode 0600).\n`}async function P(e,t){let n=(await V())[e]?.[t];if(n!==void 0)return{record:{provider:`file`,value:n}};try{let n=await(await B(e,t)).getPassword()??void 0;return n===void 0?{}:{record:{provider:`keyring`,value:n}}}catch(e){return{keyringFailure:z(e)}}}async function F(e,t,n){if((await V())[e]?.[t]!==void 0)return await I(e,t,n,`file store holds this account`);let r;try{let i=await B(e,t);if(await i.setPassword(n),await i.getPassword()===n)return await W(e,t,void 0),`keyring`;r=`Error: keyring readback did not match`}catch(e){r=z(e,[n])}return await I(e,t,n,r)}async function I(e,t,n,r){if(await W(e,t,n),(await V())[e]?.[t]!==n)throw Error(`credential storage did not confirm a durable write (keyring: ${r}; file: readback did not match)`);return`file`}async function L(e,t){try{let n=await B(e,t),r;try{await n.deleteCredential()}catch(e){r=e}let i;try{i=await n.getPassword()??void 0}catch(e){throw Error(`OS keyring removal outcome is unknown (${z(r??e)})`,{cause:e})}if(i!==void 0)throw Error(`OS keyring did not confirm removal (${z(r)})`,r===void 0?void 0:{cause:r})}finally{await W(e,t,void 0)}}async function R(e,t){let n=`${t}:probe:${y()}`,r=`aventure-cli-credential-probe:${y()}`,i;try{let t=await B(e,n);await t.setPassword(r);let a=await(await B(e,n)).getPassword(),o=await t.deleteCredential(),s=await(await B(e,n)).getPassword()??void 0;if(a!==r)i=`Error: probe readback did not match`;else if(!o||s!==void 0)i=`Error: probe cleanup was not confirmed`;else return{provider:`keyring`}}catch(e){i=z(e,[r])}try{await U(async()=>{await W(e,n,r);let t=(await V())[e]?.[n];if(await W(e,n,void 0),t!==r)throw Error(`probe readback did not match`)})}catch(e){throw Error(`credential storage is unavailable (keyring: ${i}; file ${M()}: ${z(e,[r])})`,{cause:e})}return{provider:`file`,keyringFailure:i}}function z(e,t=[]){if(!(e instanceof Error))return`Error`;let n=e.name||`Error`,[r=``]=a(e,t).trim().split(`
|
|
2
|
-
`,1);return r&&r!==n?`${n}: ${r}`:n}async function B(e,t){let n=l(),r=n===`linux`||n===`freebsd`?T(!1,process.env,n):null;if(r!==null)throw Error(`OS keyring unlock prompt is unreachable (${r})`);let{AsyncEntry:i}=await import(`@napi-rs/keyring`);return new i(e,t)}async function V(){let e=M(),n;try{n=await f(e,`utf8`)}catch(e){if(t(e,`ENOENT`))return{};throw e}let r;try{r=JSON.parse(n)}catch(t){return await H(e,t)}return K(r)?r:await H(e,void 0)}async function H(n,i){let a=`${n}.corrupt-${new Date().toISOString().replace(/[:.]/gu,`-`)}`;try{await p(n,a)}catch(e){if(t(e,`ENOENT`))return{};throw Error(`${n} is not a valid credential file and could not be moved aside`,{cause:e})}return r({component:e().bin[0],event:`credential_file_quarantined`,message:`${n} is not a valid credential file; moved it to ${a} and continuing with an empty file store`,...i===void 0?{}:{error:i}}),{}}async function U(e){if(j.getStore()===!0)return await e();let n=`${M()}.lock`;await d(s(n),{recursive:!0,mode:448});let r=Date.now()+k,i=y();for(;;){try{await g(n,i,{flag:`wx`,mode:384});break}catch(e){if(!t(e,`EEXIST`))throw e}if(await h(n).then(e=>Date.now()-e.mtimeMs,()=>0)>A)await m(n,{force:!0});else if(Date.now()>r)throw Error(`credential store is locked by another CLI process (${n})`);else await v(O)}try{return await j.run(!0,e)}finally{await f(n,`utf8`).catch(()=>``)===i&&await m(n,{force:!0})}}async function W(e,t,n){await U(async()=>await G(e,t,n))}async function G(e,t,n){let r=M(),i=await V(),a={...i[e]};if(n===void 0?delete a[t]:a[t]=n,Object.keys(a).length===0?delete i[e]:i[e]=a,Object.keys(i).length===0){await m(r,{force:!0});return}await d(s(r),{recursive:!0,mode:448});let o=`${r}.${y()}.tmp`;await g(o,`${JSON.stringify(i,null,2)}\n`,{mode:384}),await u(o,384),await p(o,r)}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.values(e).every(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.values(e).every(e=>typeof e==`string`))}export{U as a,S as c,P as i,x as l,N as n,F as o,R as r,C as s,L as t};
|
|
@@ -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,s as l,t as u}from"./iso-l1vOidnb.js";import{t as d}from"./person-owner-BRGa5Dee.js";import{n as te,r as ne,t as f}from"./entity-Cg2n2mP0.js";import{t as re}from"./type-C0VR7LD-.js";var ie=s([`domicile`,`dominant`,`origin`]),ae=r({endDate:u().nullish(),id:a(),isCurrent:i(),role:ie.nullish(),startDate:u().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()}),p=r({address:a().nullish(),addressLine1:n().nullish(),addressLine2:n().nullish(),association:l(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()}),m=s([`editorial`,`standardized`]),h=Object.assign(e([m,n()]),{enum:m.enum}),le=r({isCurrent:i().nullish(),isPrimary:i().nullish(),name:n().max(255),registry:h}),g=ee(le,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()})),_=r({category:n(),classificationId:a().nullish(),code:a().nullish(),createdAt:c({offset:!0}).nullish(),id:a(),isCurrent:i().nullish(),isPrimary:i().nullish(),level:a().nullish(),name:n().max(255),registry:h,updatedAt:c({offset:!0}).nullish()}),ue=r({geoLocationExposure:l(g).default([]).optional(),industry:l(g).default([]).optional(),mainProduct:l(g).default([]).optional(),standardizedClassification:l(_).default([]).optional(),tag:l(g).default([]).optional(),typeCustomer:l(g).default([]).optional(),typeModel:l(g).default([]).optional(),typeOwnership:l(g).default([]).optional(),typeRevenue:l(g).default([]).optional(),typeTechnologyUsed:l(g).default([]).optional()}),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(`.`)),y=Object.assign(e([v,n()]),{enum:v.enum}),b=r({currency:n().nullish(),fundingRoundCount:a(),investorCount:a(),latestValuation:o().nullish(),mostRecentAmount:o().nullish(),mostRecentDate:u().nullish(),stage:y.nullish(),totalRaised:o(),totalRaisedUsd:o().nullish(),unconvertedRoundCount:a()}),x=r({expanded:n().nullish(),generatedDescription:n().nullish(),short:n().nullish()}),de=s([`cloudflare`,`akamai`,`fastly`,`awsCloudfront`,`vercel`,`netlify`,`sucuri`,`incapsula`,`bunny`,`keycdn`,`cdn77`,`gcore`,`cdnetworks`,`azureCdn`,`leaseweb`,`digitalocean`,`stackpath`,`googlecloudCdn`,`none`,`unknown`]),fe=s([`static`,`jsRequired`,`jsEnhanced`]),S=n(),C=r({crawlCdnProvider:de.nullish(),crawlRenderMode:fe.nullish(),createdAt:c({offset:!0}).nullish(),id:a().nullish(),isCurrent:i().nullish(),isPrimary:i().nullish(),owner:d.nullish(),sourceId:n().nullish(),status:n().nullish(),statusChecked:c({offset:!0}).nullish(),updatedAt:c({offset:!0}).nullish(),url:n(),urlType:S}),w=r({address:l(p),classification:ue,fundingDetail:b.nullish(),headquartersAddressId:a().nullish(),headquartersRemoteAsOf:c({offset:!0}).nullish(),text:x,urlLink:l(C)}),T=s([`SAFE`,`Convertible Note`,`Preferred Stock`,`Common Stock`,`Other Equity`,`Bond`,`Loan`,`Other Debt`,`Grant`,`Token`]),E=r({amountInvested:o().nullish(),createdAt:c({offset:!0}),financialInstrumentType:T.nullish(),id:t(),investor:d,investorName:n().nullish(),investorSlug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),leadInvestor:i(),transactionId:t(),updatedAt:c({offset:!0})}),D=r({core:f,fundingDetail:b.nullish()}),O=r({lastFetchedAt:c({offset:!0}).nullish(),publishedAt:c({offset:!0}).nullish(),recordedAt:c({offset:!0}),sourceDetail:n()}),k=s([`High`,`Medium`,`Low`,`Verified`]),pe=s([`direct`,`managedFund`]),A=r({round:n()}),j=r({amountInvested:o().nullish(),attributionType:pe,beneficialEntityId:t().nullish(),fundManagerRelationshipId:a().nullish(),joinId:t(),leadInvestor:i(),recordedEntityId:t().nullish(),round:A.nullish(),transactionId:t()}),M=r({amountRaised:o().int().nullish(),createdAt:c({offset:!0}).nullish(),currency:n().nullish(),dataConfidence:k.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:D.nullish(),financialInstrumentType:T.nullish(),id:t(),investor:l(E).nullish(),investorAttribution:j.nullish(),investorCount:a().nullish(),publicSource:O.nullish(),round:n().nullish(),roundType:n().nullish(),sourceAttribution:l(j),updatedAt:c({offset:!0}).nullish(),valuationPostMoney:o().int().nullish(),valuationPreMoney:o().int().nullish()}),N=r({entity:f,headquarters:p.nullish(),relationshipType:s([`fundManagerFirm`,`productService`])}),me=r({fundingStage:y.nullish(),ownership:l(n()),pricingModel:l(n()),sellsTo:l(n()),totalRaised:o().nullish(),website:n().nullish()}),P=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:me.nullish(),createdAt:c({offset:!0}).nullish(),detail:n().nullish(),entity:f,id:a().nullish(),isCurrent:i().nullish(),isPrimary:i().nullish(),publicSource:O.nullish(),get relationship(){return l(P)},relationshipType:n(),sourceEntityId:t().nullish(),targetEntityId:t().nullish(),updatedAt:c({offset:!0}).nullish()}),F=P,I=r({accelerator:f,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()}),L=s([`text`,`numeric`,`monetary`,`percentage`,`date`]),he=s([`pastDue`,`withinThreeMonths`,`threeToSixMonths`,`sixToTwelveMonths`,`twelveToTwentyFourMonths`,`beyondTwoYears`]),ge=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:he,monthsFromNow:a(),targetDate:c({offset:!0})}),R=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(),derivedRange:ge.nullish(),discreteValue:o().nullish(),entityId:t(),id:a(),publicSource:O.nullish(),textValue:n().nullish(),typeResearchDetail:n(),updatedAt:c({offset:!0}).nullish(),valueResearchDetail:n().nullish(),valueType:L}),z=r({characterCount:a(),meetsRequirements:i(),violation:l(n()),wordCount:a()}),B=r({compliance:z.nullish(),entityId:t(),id:a(),publicSource:O.nullish(),text:n(),textType:n(),updatedAt:c({offset:!0}).nullish()}),_e=r({acceleratorParticipation:l(I),detail:l(R),snippet:l(B)}),V=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(),updatedAt:c({offset:!0}).nullish()}),ve=s([`aventureBlog`,`personalBlog`,`employerBlog`,`linkedin`,`xTwitter`,`medium`,`substack`,`other`]),H=r({author:n().nullish(),createdAt:c({offset:!0}),externalId:n().nullish(),id:t(),isCurrent:i(),lastFetchedAt:c({offset:!0}).nullish(),mentionedEntityId:l(t()),mentionedPersonId:l(t()),owner:d,publishedAt:c({offset:!0}).nullish(),summary:n().nullish(),summaryGeneratedAt:c({offset:!0}).nullish(),title:n().nullish(),topic:n().nullish(),type:ve,updatedAt:c({offset:!0}),url:n()}),ye=r({count:a(),stage:n()}),be=r({attributedInvestmentCount:a(),averageAmountInvestedUsd:o().nullish(),currentPortfolioCount:a(),largestAmountInvestedUsd:o().nullish(),portfolioCompanyCount:a(),smallestAmountInvestedUsd:o().nullish(),topInvestmentStage:l(ye),totalAmountInvestedUsd:o().nullish(),totalInvestment:a(),totalPortfolioExit:a(),totalWriteOff:a()}),xe=s([`nickname`,`maidenName`,`formerName`,`stageName`]),U=r({displayable:i().nullish(),name:n(),type:xe.nullish()}),W=r({isMonogram:i(),picture:n().nullish()}),G=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:l(p),entityId:t(),entityLogo:ne,entityName:n().nullish(),entityOperatingStatus:n().nullish(),entitySlug:n().regex(/^[a-z0-9_-]+$/).max(255),entityType:re.nullish(),entityUrlLink:l(C),isCurrent:i().nullish(),personAddress:l(p),personId:t(),personImage:W,personName:n(),personSlug:n().regex(/^[a-z0-9_-]+$/).max(255),personUrlLink:l(C),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()}),Se=r({address:l(p),urlLink:l(C)}),K=s([`low`,`medium`,`high`]),Ce=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:K.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(),numericValue:o().nullish(),referenceValue:n().nullish(),source:n().nullish(),textValue:n().nullish(),updatedAt:c({offset:!0}).nullish(),valueType:L}),q=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:Ce,id:n()}),J=r({isCurrent:i().nullish(),personId:t(),personImage:W,personName:n(),personSlug:n().regex(/^[a-z0-9_-]+$/).max(255),titleName:n().nullish()}),we=r({entity:D,keyPerson:l(J)}),Te=r({colleague:l(J),employeeCount:q.nullish(),entity:D,primaryAddress:p.nullish(),recentNews:l(V),similarEntity:l(we)}),Ee=r({overlapCount:a(),person:J,round:n().nullish(),sharedEntity:f.nullish(),transactionId:t().nullish()}),De=r({careerContext:l(Te),coInvestor:l(Ee),computedAt:c({offset:!0}).nullish()}),Oe=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:ne,investorCount:a().nullish(),nameBrand:n(),round:n().nullish(),status:n().nullish(),valuationPostMoney:o().nullish()}),ke=r({entity:f,headquartersCity:n().nullish(),headquartersCountry:n().nullish(),headquartersRegion:n().nullish(),industry:n().nullish()}),Y=r({amount:o().nullish(),company:ke,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:Oe.nullish(),fundraiseTransactionId:t(),id:n(),investmentDate:c({offset:!0}),investorAttribution:j.nullish(),round:n().nullish()}),X=s([`entity`,`person`,`newsArticle`,`blogPost`,`text`,`classificationTag`,`classificationCode`,`product`,`service`,`agentHelpDoc`,`researchSnippet`,`sourceDocument`]),Ae=Object.assign(e([X,n()]),{enum:X.enum}),Z=r({computedAt:c({offset:!0}),cosineDistance:o(),cosineScore:o(),modelVersion:n(),rank:a(),sourceHash:n(),sourceId:n(),sourceType:Ae}),Q=r({bioUpdatedAt:c({offset:!0}).nullish(),createdAt:c({offset:!0}).nullish(),gender:n().nullish(),id:t(),image:W,lastModifiedAt:c({offset:!0}).nullish(),nameAlias:l(U),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:Z.nullish(),slug:n().regex(/^[a-z0-9_-]+$/).max(255),suffix:n().nullish(),text:x,updatedAt:c({offset:!0}).nullish()}),je=s([`precomputed`,`live`]),Me=r({compositeScore:o().nullish(),cosineScore:o().nullish(),matchedSectionWeight:o().nullish(),origin:je,rank:a(),sharedSectionCount:a().nullish()}),$=r({currentRole:G.nullish(),person:Q,similarity:Me}),Ne=r({articleCount:a().nullish(),association:l(G),blogPost:l(H).nullish(),core:Q,enrichment:Se,graph:De.nullish(),investment:l(Y),investorActivity:be.nullish(),nameAlias:l(U),similar:l($).nullish()}),Pe=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`]),Fe=Object.assign(e([Pe,n()]),{enum:Pe.enum}),Ie=r({createdAt:c({offset:!0}),id:a(),identifier:n(),idType:Fe,owner:d,source:n().nullish(),updatedAt:c({offset:!0})}),Le=r({core:f,enrichment:w,fundraiseRound:l(M),newsArticle:l(V),person:l(Ne),provider:N.nullish(),publicUrl:n().nullish(),relationship:l(F),research:_e,sitemap:te,uniqueId:l(Ie)});export{g as A,O as C,S as D,C as E,b as O,k as S,w as T,F as _,Q as a,j as b,q as c,H as d,V as f,I as g,R as h,$ as i,_ as k,K as l,z as m,Ie as n,Z as o,B as p,Ne as r,Y as s,Le as t,G as u,N as v,E as w,A as x,M as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{t as EntityDetailSchema}from"./detail-DFVJrldR.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e,S as t,_ as n,c as r,d as i,i as a,n as o,s}from"./iso-l1vOidnb.js";import{t as c}from"./type-C0VR7LD-.js";var l=n({isMonogram:r(),logo:t().nullish(),logoSquare:t().nullish()}),u=a([`alternativeDba`,`relatedLegal`]),d=n({displayable:r().nullish(),name:t(),type:u.nullish()}),f=n({hasAcquisitions:r().default(!1).optional(),hasAnalysis:r(),hasEmployees:r(),hasFundraising:r(),hasNews:r(),productServiceSlug:s(t())}),p=n({defaultCurrency:t().nullish(),foundedYear:i().nullish(),id:e(),image:l,lastModifiedAt:o({offset:!0}).nullish(),nameAlias:s(d),nameBrand:t(),nameLegal:t().nullish(),operatingStatus:t().nullish(),publicId:t().regex(/^e[0-9A-Za-z]{11}$/).nullish(),publicUrl:t().nullish(),sitemap:f.nullish(),slug:t().regex(/^[a-z0-9_-]+$/).max(255),typeRecord:c,updatedAt:o({offset:!0}).nullish()});export{f as n,l as r,p as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,r as t}from"./result-envelope-BJO8Am4v.js";import{t as n}from"./private-readback-DX42Bf2b.js";import{a as r,c as i,l as a,s as o}from"./cli-help-policy-DKV7chuM.js";function s(n,r,i){let a={...i};for(let e of r.parameter){let r=e.envName;if(r===void 0)continue;let i=process.env[r]?.trim();if(i===void 0||i.length===0)continue;let o=a[e.optionKey];if(o!==void 0&&(typeof o!=`string`||o!==i))return{...t(`${n} ${e.flag.split(` `)[0]??e.name} conflicts with ${r}; omit the flag or use ${i}.`),data:a};o===void 0&&(a[e.optionKey]=i)}return e(`Environment-bound options applied`,a)}function c(e,t,n){if(!D(n))return null;for(let r of t.parameter){let t=r.envName,i=t===void 0?void 0:process.env[t]?.trim();if(t===void 0||i===void 0||i.length===0||!S(n,r.name))continue;let a=x(n,r.name);if(typeof a!=`string`||a!==i)return`${e} ${r.name} in --from-file conflicts with ${t}; omit the field or use ${i}.`}return null}function l(e){let t=new Set(e.parameter.map(({name:e})=>e));return e.kind===`multipart`?e.requiredPath:e.requiredPath.filter(e=>!t.has(e))}function u(t,n,r,i=!1){if(i||!T(n)||!Array.isArray(r))return O(t,n,r);for(let[e,i]of r.entries()){let r=O(t,n,i,e);if(!r.ok)return r}return e(`Body value assigned`,null)}function d(e,t,n,r){return O(e,t,r,n)}function f(e){let t=[];for(let n of e.split(`.`)){let e=A(n);if(t.push(e.key),e.isArray)return t.join(`.`)}return null}function p(e,t){let n=f(t);if(n===null)return null;let r=b(e,n.split(`.`));return Array.isArray(r)?{path:n,rowCount:r.length,firstHole:y(r)}:null}function m(n,r){if(T(n.name)||n.schemaType===`array`)return e(`Repeated body option selected`,typeof r==`string`?[r]:r);if(!Array.isArray(r))return e(`Scalar body option selected`,r);let i=n.flag.split(` `)[0]??n.name;return r.length===1?e(`Scalar body option selected`,r[0]):t(`${i} was already given; pass it once.`)}var h=/^(?<row>\d+):(?<item>.*)$/su;function g(e,t){let n=f(e.name);if(e.schemaType!==`array`||n===null||t===void 0||typeof t==`boolean`)return null;let r=new Map,i=[];for(let e of typeof t==`string`?[t]:t){let t=h.exec(e)?.groups,n=t?.row,a=t?.item;if(n===void 0||a===void 0){i.push(e);continue}let o=r.get(Number(n));o===void 0?r.set(Number(n),[a]):o.push(a)}return r.size===0?null:{container:n,rows:r,plain:i}}function _(e,t,n){let r=0;for(let i of e.parameter){let e=t[i.optionKey];e!==void 0&&typeof e!=`boolean`&&f(i.name)===n&&(r=Math.max(r,typeof e==`string`?1:e.length))}return r}function v(e,n,r,i){for(let a of n.parameter){let n=r[a.optionKey];if(n===void 0)continue;let o=p(i,a.name);if(o===null)continue;if(o.firstHole!==null)return t(`${e} has no ${o.path}[] row ${o.firstHole} — number ${o.path}[] rows from 0 with no gaps.`);if(a.schemaType!==`array`||o.rowCount<=1||g(a,n)!==null)continue;let s=a.flag.split(` `)[0]??a.name;return t(`${s} fills one ${o.path}[] row's list, so ${e} cannot also build ${o.rowCount} ${o.path}[] rows from direct options — prefix each value with its 0-based ${o.path}[] row index, as 0:value, or pass the rows with --from-file.`)}return null}function y(e){for(let t=0;t<e.length;t+=1)if(e[t]===void 0)return t;return null}function b(e,t){let n=e;for(let e of t){if(!D(n))return;n=n[e]??null}return n}function x(e,t){if(!T(t))return b(e,t.split(`.`))}function S(e,t){return w(e,t.split(`.`))}function C(e,t,n){if(!D(n))return null;let r=new Set(t.parameter.map(({name:e})=>e));for(let i of e)if(i!==t){for(let e of i.parameter)if(!r.has(e.name)&&S(n,e.name))return`${e.name} in --from-file requires --content-type ${i.contentType}.`}return null}function w(e,t){let[n,...r]=t;if(n===void 0)return!0;let i=A(n);if(!D(e)||!Object.hasOwn(e,i.key))return!1;let a=e[i.key]??null;return i.isArray?Array.isArray(a)&&a.every(e=>w(e,r)):w(a,r)}function T(e){return e.split(`.`).some(e=>A(e).isArray)}function E(e,t){return e.parameter.length===0||!D(t)?null:M(t,[],j(e.parameter))}function D(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function O(n,r,i,a=0){let o=r.split(`.`),s=n;for(let[n,c]of o.entries()){let l=A(c),u=n===o.length-1,d=k(s,l,r,u,i,a);if(!d.ok||d.data===null)return t(d.summary,d.warnings);if(u)return e(`Body value assigned`,null);s=d.data}return t(`${r} is not a valid body option path.`)}function k(n,r,i,a,o,s){let c=()=>t(`${i} cannot be combined with another body option at ${r.key}.`),l=n[r.key];if(r.isArray){if(l!==void 0&&!Array.isArray(l))return c();let t=l??[];if(l===void 0&&(n[r.key]=t),a)return t[s]===void 0?(t[s]=o,e(`Body value assigned`,n)):c();let i=t[s];if(i===void 0){let n={};return t[s]=n,e(`Body path created`,n)}return D(i)?e(`Body path stepped`,i):c()}if(a)return l===void 0?(n[r.key]=o,e(`Body value assigned`,n)):c();if(l===void 0){let t={};return n[r.key]=t,e(`Body path created`,t)}return D(l)?e(`Body path stepped`,l):c()}function A(e){let t=e.endsWith(`[]`);return{key:t?e.slice(0,-2):e,isArray:t}}function j(e){let t=new Set,n=new Set;for(let r of e){let e=`${r.name}${r.schemaType===`array`?`[]`:``}`;t.add(e);let i=e.split(`.`);for(let e=1;e<i.length;e+=1)n.add(i.slice(0,e).join(`.`))}return{leaf:t,prefix:n}}function M(e,t,n){if(Array.isArray(e)){if(e.length===0)return null;for(let r of e){let e=M(r,t,n);if(e!==null)return e}return null}if(!D(e))return null;for(let[r,i]of Object.entries(e)){let e=[...t,Array.isArray(i)?`${r}[]`:r],a=e.join(`.`);if(i===null&&N(`${a}[]`,n))continue;if(!N(a,n)){if(!P(e))continue;let r=[...new Set([...n.leaf,...n.prefix])].filter(e=>e.split(`.`).slice(0,-1).join(`.`)===t.join(`.`)),i=r.map(e=>e.split(`.`).at(-1)??``),o=I(e,r);return{path:a,message:`unknown JSON path ${a}. ${o===void 0?`Admitted keys: ${i.join(`, `)||`(none)`}.`:`Use ${o}.`}`}}let o=M(i,e,n);if(o!==null)return o}return null}function N(e,t){return t.prefix.has(e)||t.leaf.has(e)}function P(e){return e.slice(0,-1).some(e=>e.endsWith(`[]`))}var F=4;function I(e,t){let n=e.at(-1)?.replace(/\[\]$/u,``).toLowerCase()??``,r=t.map(e=>({path:e,score:L(n,e.split(`.`).at(-1)??``)})).filter(({score:e})=>e<1/0).toSorted((e,t)=>e.score-t.score||e.path.localeCompare(t.path));return r[0]?.score===r[1]?.score?void 0:r[0]?.path}function L(e,t){let n=t.replace(/\[\]$/u,``).toLowerCase();if(n===e)return 0;if(Math.min(e.length,n.length)<F)return 1/0;let r=e.length<=n.length?e:n,i=e.length<=n.length?n:e;if(i.length-r.length>1)return 1/0;let a=0;for(;a<r.length&&r[a]===i[a];)a+=1;return r.slice(a+ +(r.length===i.length))===i.slice(a+1)?1:1/0}var R=e=>Array.isArray(e)&&!Object.isFrozen(e);function z(e,t){let r=new Map;for(let e of t){let t=e.flag?.split(` `)[0];t!==void 0&&r.set(t,t===`--from-file`?{...e,inputType:`file`}:e)}for(let t of e){let e=t.long===void 0?void 0:r.get(t.long);e!==void 0&&(t.helpGroup(i(e)),t.description=n(t.description,{...e,hasParseDefault:t.defaultValue!==void 0}))}if(!R(e))throw Error(`Commander option list is frozen; generated option help cannot be ordered.`);e.sort((e,t)=>{let n=e.long===void 0?void 0:r.get(e.long),i=t.long===void 0?void 0:r.get(t.long);return n!==void 0&&i!==void 0?q(n,i):n===void 0?i===void 0?0:1:-1})}function B(e){let t=new Map;for(let n of e)for(let e of n.parameter){let r=e.flag.split(` `)[0]??e.flag,i=t.get(r);i===void 0?t.set(r,{variant:[{descriptor:n,parameter:e}]}):t.set(r,{variant:[...i.variant,{descriptor:n,parameter:e}]})}return[...t.values()]}function V(e){let{flag:t}=e.variant[0].parameter;return e.variant.every(({parameter:e})=>e.flag===t)?t:`${t.split(` `)[0]??t} <value>`}function H(e){let t=e.variant.map(({descriptor:e,parameter:t})=>({contentType:e.contentType,text:G(e,t)})),n=t[0];return n===void 0?``:t.every(({text:e})=>e===n.text)?`${n.text===``?``:`${n.text} `}Request content: ${t.map(({contentType:e})=>e).join(`, `)}.`:t.map(({contentType:e,text:t})=>`${e}: ${t}`).join(` `)}function U(e,t){return[...new Set((e.cliConflicts??[]).filter(e=>e.includes(t)).flatMap(e=>e.filter(e=>e!==t)))]}function W(e,t){let n=e.kind===`multipart`?`Read a JSON object keyed by multipart part name from a file, or use - for stdin`:`Read the JSON request body from a file, or use - for stdin`,r=t.filter(e=>!t.some(t=>t.startsWith(`${e}.`)||t.startsWith(`${e}[].`)));return r.length===0?a(n):`${a(n)} Required JSON paths: ${r.join(`, `)}.`}function G(e,t){let n=r(t.description,void 0),i=e.kind!==`multipart`&&T(t.name),a=e.kind!==`multipart`&&t.optionKey!==t.name&&/^\w+$/u.test(t.name);return`${n}${i?` Repeat to add another value.`:``}${a?` --from-file JSON key: ${t.name}.`:``}${K(e,t)}`}function K(e,t){if(e.kind===`multipart`||t.schemaType!==`array`)return``;let n=f(t.name);return n===null?``:` Prefix each value with its 0-based ${n}[] row index, as 0:value, to fill more than one ${n}[] row. A leading digits-and-colon is always read as that index, so name the row of a value that starts the same way, as 0:0:00 for the value 0:00.`}function q(e,t){return o(e)-o(t)||Number(e.required!==!0)-Number(t.required!==!0)}export{E as S,T as _,W as a,l as b,G as c,d,s as f,S as g,c as h,V as i,v as l,C as m,q as n,B as o,_ as p,H as r,U as s,z as t,u,D as v,m as x,g as y};
|
|
@@ -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,p as te,s as ne,u as d}from"./tool-policy-DfLvQfqr.js";import{i as re,t as f}from"./human-text-cap-BcNmIPQA.js";import{n as ie,t as ae}from"./contract-parameter-C7Ead17E.js";var p=2,oe=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,se(n),n),h(e,ce(n),n))}function se(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 ce(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 le(e){return _(e).map(g)}function ue(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&&!oe.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))),...de(n)],i=[t,...e.cliPath].join(` `),a=e.mutates===!0||ee(e.intent),o=te(e),s=n[0];return{operationId:e.operationId,method:e.method,path:e.path,resource:e.resource,intent:e.intent,scope:e.scope,mutates:a,destructive:l(e.method,e.intent),auth:e.auth,cli:{command:i,path:e.cliPath},mcpTool:e.binaryResponse||!u(e.path)||o===null?null:d(o),body:{hasBody:s!==void 0,kind:s?.kind??null,...s!==void 0&&n.length>1?{contentType:s.contentType}:{},required:s?.required??!1,description:s?.description??``,requiredPath:s?.requiredPath??[]},flags:r,errorResponse:e.errorResponse,...e.successResponse===void 0?{}:{successResponse:e.successResponse},...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 de(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 fe=[`-id`,`-slug`,`-url`],pe=[`--id`,`--slug`,`--url`],me=`/v1/lookup`,he=`--from-file "<path>"`;function ge(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 _e(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))}`,...ve(e,t)]}function ve(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===me),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:ye(e)).map(D);return i||(e.body.required||e.body.requiredPath.length>0)&&!a.some(e=>e.location===`body`)?[...o,he]:o}function ye(e){let t=new Set;m(t,e.resource);for(let n of fe)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 pe){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`]),be=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:be.nullish(),excerpt:n(),sourceId:n(),sourceType:A,sourceVersion:n().nullish()}),xe=r({instruction:n(),operationId:n(),planTaskKey:c(n()).optional(),stepKey:n().optional()}),M=r({body:n(),expectation:n(),method:c(n()),override:n(),reject:c(n()),typeCatalog:n()}),Se=r({cliCommand:n(),mcpTool:n().nullish(),step:xe,writeGuidance:M.nullish()}),N=s([`ENTITY`,`TEXT`,`WRITER_BRIEF`]),Ce=Object.assign(t([N,n()]),{enum:N.enum}),we=r({allowedValue:n().nullish(),description:n(),key:n(),required:i().default(!0).optional(),type:Ce}),P=r({catalogRevision:a().optional(),gateId:c(n()).optional(),input:c(we),step:c(Se),taskKey:n().optional()}),F=s([`TASK_PLAN`,`OPERATION_ADVICE`,`CLARIFY`,`ABSTAIN`]),Te=r({candidate:c(j),operationId:n().nullish(),outcome:F,probability:o().nullish(),taskKey:n().nullish(),taskPlan:P.nullish()}),Ee=r({answer:n(),citation:c(j),confidence:O,resolution:Te.nullish()});function I(e){let t=e.requestBody?.[0],n=e.parameter.map(t=>L(t,ie(e,t))),r=(t?.parameter??[]).map(t=>L(t,ae(e,t)));return{selector:n.filter(e=>e.location===`path`||R(e)),pagination:n.filter(z),filter:[...n.filter(B),...r.filter(B)],body:r.filter(e=>!B(e))}}function L(e,t){let{in:n,inputName:r,...i}=e;return{...i,flag:ne(t),location:n,description:e.description||`${e.name} ${e.in} parameter`}}function R(e){return/(^|[A-Z])(id|slug)$/u.test(e.name)}function z(e){return[`page`,`size`,`sort`,`cursor`,`mode`,`projection`].includes(e.name)}function B(e){return e.location!==`path`&&!R(e)&&!z(e)}function V(e){return{operationId:e.operationId,method:e.method,path:e.path,summary:e.summary,cli:e.projection.cliPath.join(` `),intent:e.intent,scope:e.projection.scope,requiredInput:U(e),responseContentType:[...new Set(e.response.filter(({status:e})=>e.startsWith(`2`)).flatMap(({contentType:e})=>e??[]))]}}function H(e,t){let n=e.requestBody?.[0],r=V(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:I(e)}:{...r,optionalInput:ke(e),arrayInput:Ae(e),...i===void 0?{}:{paidPlan:i}}}function De(e){let t=I(e),n=e=>e.filter(e=>e.required);return{...H(e,!1),optionalDetailOmitted:!0,argument:{selector:n(t.selector),pagination:n(t.pagination),filter:n(t.filter),body:n(t.body)}}}function Oe(e){let{cli:t,scope:n,...r}=V(e),i=W(e);return{...r,...i===void 0?{}:{paidPlan:i},optionalDetailOmitted:!0}}function U(e){return[...e.parameter.filter(({required:e})=>e).map(({name:e})=>e),...e.requestBody?.[0]?.requiredPath??[]]}function ke(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 Ae(e){return[...e.parameter,...e.requestBody?.[0]?.parameter??[]].filter(({schemaType:e})=>e===`array`).map(({name:e})=>e)}var G=160,K=`Operation catalog matches`,je=[`whole`,`described`,`requiredDescribed`,`optionalNamed`,`optionalGrouped`],q=e=>`${[K,...e].join(`
|
|
2
|
-
`)}\n`;function Me(e,t=[]){if(!Array.isArray(e)||e.length===0||!e.every(Fe))return null;let n=e,r=e=>re([K,...e,...t]);for(let e of je){let t=[...n.flatMap(t=>X(t,e)),...Y(n,e)];if(r(t))return q(t)}let i=e=>[...n.slice(0,e).flatMap(e=>X(e,`optionalGrouped`)),...Y(n.slice(0,e),`optionalGrouped`),...e>=n.length?[]:[`... ${n.length-e} more operations omitted to fit ${f} UTF-8 bytes: ${n.slice(e).map(({operationId:e})=>e).join(`, `)}; call aventure_help with q=<operationId> and limit=1 to read one.`]];return q(i([...n.keys()].findLast(e=>e>0&&r(i(e)))??1))}var J=`call aventure_help with q=<operationId> and limit=1; inspect structuredContent.data argument and optionalInput for the retained inputs`;function Y(e,t){let n=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[...Ne(e,t),...n]}function Ne(e,t){let n=e.flatMap(e=>`argument`in e?Object.values(e.argument).flat():[]),r=t===`whole`?0:n.filter(e=>e.description.length>G&&(t===`described`||e.required)).length,i=r===0?[]:[`... ${r} argument descriptions shortened; inspect structuredContent.data[].argument for full descriptions.`];if(e.some(e=>`optionalDetailOmitted`in e))return[...i,e.some(e=>`argument`in e)?`... optional argument details omitted: the full list exceeds the result cap; ${J}.`:`... 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 i;let a=t===`requiredDescribed`?`optional argument descriptions`:`optional argument details`,o=n.filter(({required:e})=>!e).length;return[...i,`... ${o} ${a} omitted to fit ${f} UTF-8 bytes; structuredContent carries them, and ${J}.`]}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} (aventure_${e.intent})`,` ${e.summary}`,` required: ${e.requiredInput.length===0?`none`:e.requiredInput.join(`, `)}`,` responseContentType: ${e.responseContentType.length===0?`none`:e.responseContentType.join(`, `)}`,...`optionalInput`in e?Object.entries(e.optionalInput).filter(([,e])=>e.length>0).map(([e,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=>Pe(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 Pe(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 Fe(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.intent),arguments:{operationId:e.operationId,...n===void 0?{}:{pathParams:n},...r===void 0?{}:{query:r},...e.requestBody===void 0?{}:{body:Le(e)}}}}var Ie=4;function Le(e){let t=e.requestBody?.[0];if(t===void 0)return{};if(t.requiredPath.length>0||e.intent!==`lookup`||t.schemaType===`array`)return Re(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>Ie?[]:[[t,`<${i.join(`|`)}>`]]}))}function Re(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(ze,t);r[n.at(-1)??e]=`<${e}>`}return t}function ze(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 Be(e){let t=W(e);return{mcpCall:Q(e),...t===void 0?{}:{paidPlan:t}}}function Ve(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{ue as C,le as D,v as E,m as S,_ as T,ge as _,Me as a,y as b,Oe as c,F as d,P as f,x as g,T as h,Be as i,De as l,O as m,$ as n,Q as o,A as p,Ve as r,H as s,K as t,Ee as u,_e as v,g as w,S as x,w as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{t as logoutCliCredentials}from"./logout-C6gksSro.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as e}from"./env-DSqe8wia.js";import{c as t,r as n}from"./result-envelope-BJO8Am4v.js";import{B as r}from"./tool-policy-DfLvQfqr.js";import{s as i}from"./openapi-call-DObkFneE.js";import{a,n as o,s,t as c}from"./credential-redaction-BbeDpMUf.js";import{a as l,r as u,t as d}from"./api-key-credential-BFOFznef.js";import{n as f}from"./contract-BgjxlOnT.js";import{t as p}from"./openapi-composites-B9JPhVYN.js";import{c as m,f as h,m as g,n as _,r as v}from"./oauth-credential-C2uLXL3z.js";import{t as y}from"./oauth-login-BoWRyiMk.js";var b=f(p,`revoke`);async function x(r){let i;try{i=a(e().host)}catch(e){return n(`auth logout: invalid API host — ${c(e)}`)}let o=await S(i),s=await T(i,r),l=o.state===`failed`?[`OAuth credential could not be removed — ${o.summary}`]:o.state===`forgotten`&&!o.revoked?[`OAuth refresh token was not revoked remotely — ${o.summary??`no revocation endpoint`}`]:[],u={host:i,revoked:!1,forgotten:!1,oauth:o};return s===null?o.state===`missing`?t(`No CLI credential is stored for this API host.`,u):o.state===`failed`?{...n(`auth logout: ${l[0]}`),data:u}:t(o.revoked?`OAuth credential revoked remotely and removed locally.`:`OAuth credential removed locally.`,u,{warnings:l}):{...s,data:{...s.data??u,oauth:o},warnings:[...s.warnings,...l]}}async function S(e){let t=await v(e);if(t.state===`missing`)return{state:`missing`};let n=t.state===`found`?await w(t.stored):{revoked:!1};try{await _(e)}catch(e){return{state:`failed`,summary:c(e)}}return{state:`forgotten`,...n}}async function C(e){let t=Reflect.get(await y(e),`revocation_endpoint`);return typeof t==`string`?g(t,`revocation endpoint`,!0):void 0}async function w(e){let{client:t,tokens:n}=e.credential,r=n.refresh_token??n.access_token;try{let e=await C(t);if(e===void 0)return{revoked:!1};let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:r,client_id:m(t)})});return n.ok?{revoked:!0}:{revoked:!1,summary:`revocation endpoint answered ${n.status}`}}catch(e){return{revoked:!1,summary:c(e,h(n))}}}async function T(e,r){let i;try{i=await u(e)}catch(e){return n(`auth logout: stored credential could not be read — ${c(e)}`)}if(i.state===`unavailable`)return{...n(`auth logout: ${i.summary}`),data:{host:e,revoked:!1,forgotten:!1}};if(i.state===`missing`)return null;let a=i.stored,o=await E(a),s=o.outcome===`revoked`,l=a.activation===`pending`&&o.outcome===`rejected`;if(!s&&!l&&!r.forgetLocal)return{...n(`auth logout: remote revocation was not confirmed; local credential preserved — ${o.summary}`,[`Retry when the API is available. If an earlier response was lost after revocation, the retry can be unauthorized because revoked keys cannot authenticate.`,"Use `--forget-local` only to remove local bytes while accepting that the remote key may remain active."]),data:D(a,!1,!1)};try{await d(a.host)}catch(e){return{...n(`auth logout: local credential removal failed — ${c(e,[a.credential.secret])}`,[s?"The remote key is revoked. Re-run with `--forget-local` to retry local cleanup.":`Remote revocation was not confirmed; inspect auth status before retrying.`]),data:D(a,s,!1)}}return t(s?`API key revoked remotely and removed locally.`:l?`Stale pending CLI credential removed; its remote key can no longer authenticate and unacknowledged keys expire at the authorization deadline.`:`API key removed locally without confirmed remote revocation.`,D(a,s,!0),{ids:[a.credential.apiKey.id],warnings:s||l?[]:[`Remote revocation was not confirmed; the API key may remain active.`]})}async function E(t){let n=s(e());try{let e=await i(n,{method:b.method,path:r(b.path,{},b.operationId),headers:{Authorization:`Bearer ${t.credential.secret}`}},l);return e.ok&&e.redirect?{outcome:`unconfirmed`,summary:`remote key revocation returned unexpected redirect ${e.status}`}:e.ok?e.data.id!==t.credential.apiKey.id||e.data.subject!==t.credential.apiKey.subject?{outcome:`unconfirmed`,summary:`remote response did not match the stored API key identity`}:e.data.status===`REVOKED`?{outcome:`revoked`,summary:`remote key revocation confirmed`}:{outcome:`unconfirmed`,summary:`remote response did not confirm REVOKED status`}:{outcome:e.problem.status===401&&e.problem.type!==`about:blank`?`rejected`:`unconfirmed`,summary:o(e.problem,[t.credential.secret])}}catch(e){return{outcome:`unconfirmed`,summary:c(e,[t.credential.secret])}}}function D(e,t,n){return{host:e.host,apiKeyId:e.credential.apiKey.id,activation:e.activation,revoked:t,forgotten:n}}export{E as n,x as t};
|