@aventurevc/mcp-server 0.8.255 → 0.8.257

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +6 -4
  2. package/dist/chunks/{cli-help-policy-D75ZUdf2.js → cli-help-policy-IY8OyRny.js} +1 -1
  3. package/dist/chunks/{contract-CfjULX4P.js → contract-8m1wnMPD.js} +1 -1
  4. package/dist/chunks/{contract-parameter-C5WL9JLH.js → contract-parameter-YwzdPW2X.js} +1 -1
  5. package/dist/chunks/{detail-DPx3_Ch3.js → detail-DFVJrldR.js} +1 -1
  6. package/dist/chunks/{env-BetWwKnN.js → env-CkgD71uv.js} +1 -1
  7. package/dist/chunks/{env-nHz2oAQs.js → env-DSqe8wia.js} +1 -1
  8. package/dist/chunks/{help-catalog-DZtXa25V.js → help-catalog-B_QWY5by.js} +1 -1
  9. package/dist/chunks/{help-intent-CSl8KDQi.js → help-intent-BCTC0nPh.js} +1 -1
  10. package/dist/chunks/{logging-CIPYkDwy.js → logging-81KzSgWu.js} +1 -1
  11. package/dist/chunks/{logging-CUuXaGTb.js → logging-D2-azwG6.js} +1 -1
  12. package/dist/chunks/mcp-generation-contract-DSzMu-33.js +1 -0
  13. package/dist/chunks/{oauth-discovery-D6CSt_Jn.js → oauth-discovery-Cfslgq0y.js} +1 -1
  14. package/dist/chunks/{openapi-call-DEoVB4wk.js → openapi-call-DHOQt4OJ.js} +2 -2
  15. package/dist/chunks/openapi-snapshot-CdP_759F.js +1 -0
  16. package/dist/chunks/{output-spill-BECjt_Ll.js → output-spill-6X8d6akm.js} +1 -1
  17. package/dist/chunks/package-DEeHDoOT.js +1 -0
  18. package/dist/chunks/{request-replay-D_z6rn-x.js → request-replay-DfZzZsDS.js} +1 -1
  19. package/dist/chunks/{response-problem-DnkS9_OS.js → response-problem-BAThXgJO.js} +1 -1
  20. package/dist/chunks/result-envelope-BJO8Am4v.js +1 -0
  21. package/dist/chunks/runtime-identity-Bbg6Ewkk.js +1 -0
  22. package/dist/chunks/{sentry-BxMj8BIC.js → sentry-9kUFtXCY.js} +1 -1
  23. package/dist/chunks/{sentry-Dc5rOvrg.js → sentry-CDc9A21-.js} +1 -1
  24. package/dist/chunks/{streamable-http-BdgJLbd9.js → streamable-http-BXggxIab.js} +1 -1
  25. package/dist/chunks/{text-response-2T5C2aIF.js → text-response-BpAZ5CH5.js} +1 -1
  26. package/dist/chunks/{tool-policy-k1J17TTM.js → tool-policy-niA3ZXkC.js} +1 -1
  27. package/dist/mcp-server/index.js +2 -2
  28. package/package.json +3 -3
  29. package/dist/chunks/mcp-generation-contract-CoAJ2HRe.js +0 -1
  30. package/dist/chunks/openapi-snapshot-BUZVvD_j.js +0 -1
  31. package/dist/chunks/package-CZBWjlYb.js +0 -1
  32. package/dist/chunks/result-envelope-Z0CGA1XZ.js +0 -1
  33. package/dist/chunks/runtime-identity-Cme_U1eh.js +0 -1
@@ -1 +0,0 @@
1
- import{i as e,n as t,r as n,t as r}from"./runtime-identity-Cme_U1eh.js";import{resolve as i}from"node:path";import{existsSync as a}from"node:fs";var o=`@aventurevc/aventure-cli`,s=`@aventurevc/mcp-server`,c=`aventure`,l=`https://registry.npmjs.org/`,u=[o,s,``,``];function d(e){let{entryPath:n,manifest:r,manifestPath:i,packageRoot:a}=t(e);return f(r,i,a,n)}function f(t,r,o,s){let c=Reflect.get(t,`name`);if(!p(c))throw n(`${r} has unsupported package name ${String(c)}`);let l=e(t,`version`,r),u=a(i(o,`aventure-cli`,`index.ts`))?o:null,d=_(Reflect.get(t,`bin`),`${r} bin`);return{bin:v(m(t,r,o,s)??d,r),entryPath:s,name:c,packageRoot:o,registry:y(t,r,u!==null),version:l,workingTreeRoot:u}}function p(e){return u.some(t=>t===e)}function m(e,t,i,a){let o=Reflect.get(e,`aventurePublish`);if(o===void 0)return;if(!r(o))throw n(`${t} aventurePublish must be an object`);let s=Reflect.get(o,`variants`);if(!r(s))throw n(`${t} aventurePublish.variants is required`);let c=new Set(a.slice(i.length).split(/[\\/]/u));for(let e of Object.keys(s)){let n=h(s,e,t),r=Reflect.get(n,`directory`);if(typeof r==`string`&&c.has(r))return g(n,e,t)}return g(h(s,`cli`,t),`cli`,t)}function h(e,t,i){let a=Reflect.get(e,t);if(!r(a))throw n(`${i} aventurePublish.variants.${t} is required`);return a}function g(e,t,r){let i=_(Reflect.get(e,`bin`),`${r} aventurePublish.variants.${t}.bin`);if(i===void 0)throw n(`${r} aventurePublish.variants.${t}.bin is required`);return i}function _(e,t){if(e!==void 0){if(!r(e))throw n(`${t} must be an object`);return Object.entries(e).map(([e,r])=>{if(typeof r!=`string`)throw n(`${t}.${e} must be a string`);return[e,r]})}}function v(e,t){let[r,...i]=(e??[]).map(([e])=>e);if(r===void 0)throw n(`${t} defines no bin`);return[r,...i]}function y(e,t,i){let a=Reflect.get(e,`publishConfig`);if(a===void 0){if(i)return``;throw n(`${t} publishConfig.registry is required outside a working tree`)}if(!r(a))throw n(`${t} publishConfig must be an object`);let o=Reflect.get(a,`registry`);if(o!==``&&o!==`https://registry.npmjs.org/`)throw n(`${t} has unsupported publishConfig.registry ${String(o)}`);return o}export{d as a,l as i,o as n,s as r,c as t};
@@ -1 +0,0 @@
1
- import{C as e,E as t,S as n,_ as r,a as i,b as a,c as o,d as s,g as c,i as l,n as u,p as d,s as f,w as p}from"./iso-l1vOidnb.js";import{t as m}from"./person-owner-BRGa5Dee.js";import{t as h}from"./type-C0VR7LD-.js";import{t as g}from"./allowance-type-COW05L2h.js";import{Buffer as _}from"node:buffer";var v=d(()=>e([n(),c(),o(),i(),f(v),a(n(),v)])),y=l([`URL_DUPLICATE`,`STRICT_URL_LOOKUP`,`DUPLICATE_CREATE_REVIEW`,`CLASSIFICATION_INACTIVE_TAG`,`NEWS_SOURCE_URL`]),b=Object.assign(e([y,n()]),{enum:y.enum}),ee=l([`REACTIVATE`,`ATTACH_INACTIVE`]),x=r({availableOverrides:f(ee),conflictType:b,slug:n(),tagId:s()}),S=r({externalId:n().nullish(),id:s(),publicationScore:s(),reason:f(n()),score:s(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish()}),te=r({externalId:n().nullish(),id:t(),name:n().nullish(),operatingStatus:n().nullish(),publicPath:n().nullish(),reason:f(n()),score:s().optional(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:h.nullish()}),ne=r({candidate:f(te).nullish(),conflictType:b,newsCandidate:f(S).nullish(),overridePath:n().nullish(),threshold:s()}),re=r({conflictingArticleId:s(),conflictingArticleSlug:n(),conflictingArticleTitle:n(),conflictType:b}),ie=r({candidateEntityId:f(t()),candidatePersonId:f(t()),conflictType:b,hint:n(),normalizedUrl:n().nullish(),url:n(),urlType:n().nullish()}),ae=r({owner:m,urlId:s()}),oe=r({conflictType:b,existingJoin:f(ae),fragmentIgnored:o(),guidance:n(),normalizedUrl:n().nullish(),requestedOwner:m,url:n(),urlType:n()}),C=e([oe,ie,ne,x,re]),se=r({acceptedValue:f(n()).nullish(),action:l([`setField`,`setParameter`,`removeParameter`,`useEndpoint`,`reviewCandidates`,`authenticate`]),endpoint:n().nullish(),fieldPath:n().nullish(),parameter:n().nullish(),retryable:o().nullish()}),w=l([`source`,`record`,`disclaimer`,`voice`,`marketing`,`chained`,`structured`,`tense`,`temporal`,`factList`,`mojibake`,`markup`,`unsupported`,`legalSource`,`textContract`]),ce=Object.assign(e([w,n()]),{enum:w.enum}),le=r({overridable:o(),passage:n(),problem:ce,reason:n()}),T=l([`entity`,`person`,`news`,`blog`,`content`]),E=r({deletedAt:u({offset:!0}).nullish(),id:n(),isHidden:o(),nameBrand:n().nullish(),resourceType:T,showOnSitemap:o(),slug:n()}),D=r({newUrl:n().nullish(),oldUrl:n(),targetCurrentSlug:n().nullish(),targetId:n().nullish(),targetResourceType:T.nullish()}),O=r({allowanceType:g.nullish(),circuitBreaker:n().nullish(),code:e([l(`async_lookup_sign_in_required.not_authorized.rateLimited.rate_limited.subscription_required.subscription_canceled.subscription_past_due.subscription_paused.billing_allowance_exhausted.billing_additional_usage_cap_reached.billing_credit_checkout_closed.account_exists.origin_detail_capacity.origin_detail_shutdown.query_deadline_shed.suspectedShellStrip.suspected_shell_strip.prose_rejected.cvc_inherited_headcount.source_grounding_at_capacity.url_surface_misclassification.JOBRUNR_DISABLED.jobrunr_disabled.task_plan_operation_unserved.JOBRUNR_STORAGE_UNAVAILABLE.jobrunr_storage_unavailable.rbac_lookup_unavailable.GEOCODE_PROVIDER_ERROR.geocode_provider_error.sentry_api_error.frontend_cache_epoch_mode_not_targeted.image_blocklist_match.image_monochrome.image_too_small.image_wrong_aspect.image_monogram.image_unreadable.image_processing_error.image_brand_mismatch.image_reference_unavailable.logo_first_party_missing.image_photographic.web_crawl_fetch_failed.source_document_fetch_busy.primary_website_missing.news_rss_feed_fetch_failed.news_rss_article_fetch_failed.callback_connection_refused.callback_timeout.callback_tls_error.callback_http_4xx.callback_http_5xx.callback_challenge_failed.news_subscription_limit.r2_fetch_failed.r2_delete_failed.r2_upload_failed.source_document_body_unavailable.source_document_capture_limit_exceeded.news_similarity_embedding_unavailable.search_provider_not_configured.search_provider_error.search_still_running.lookup_still_running.sec_edgar_fetch_failed.github_fetch_failed.INFERENCE_PROVIDER_ERROR.inference_provider_error.INFERENCE_PROVIDER_RESPONSE_EMPTY.inference_provider_response_empty.INFERENCE_PROVIDER_INVALID_JSON.inference_provider_invalid_json.INFERENCE_PROFILES_MISSING.inference_profiles_missing.INFERENCE_PROFILE_API_KEY_MISSING.inference_profile_api_key_missing`.split(`.`)),n().max(128)]).nullish(),conflictingRecord:E.nullish(),detail:n().optional(),details:C.nullish(),disposition:l([`TRANSIENT`,`TERMINAL`]).nullish(),error:a(n(),n()).nullish(),existingRecordId:n().nullish(),existingRedirect:D.nullish(),feId:n().nullish(),field:n().nullish(),filedRunId:f(t()).nullish(),hammingDistance:c().int().nullish(),hint:n().nullish(),instance:n().optional(),limit:c().int().nullish(),limitType:e([l([`FORM`,`GLOBAL`,`SUBNET`,`IP`,`UNKNOWN`,`RESILIENCE4J`,`WEB_SEARCH`,`AGENT_HELP`,`NATURAL_SEARCH`,`BILLING_ALLOWANCE`,`BILLING_ADDITIONAL_USAGE`,`CLERK_PUBLIC_ADMISSION`,`CLERK_SCRIPT_LOAD`,`ORIGIN_DETAIL`,`INFERENCE_PROVIDER`]),n()]).nullish(),matchedBlocklistKey:n().nullish(),mediaType:n().nullish(),moderationReason:n().nullish(),path:n().nullish(),properties:a(n(),v).optional(),proseViolation:f(le).nullish(),remaining:c().int().nullish(),requiredRole:n().nullish(),resetAt:u({offset:!0}).nullish(),resolution:se.nullish(),retryAfterSeconds:c().int().nullish(),spanId:n().nullish(),status:s().optional(),suggestion:n().nullish(),suggestions:a(n(),n()).nullish(),suspectedFragment:n().nullish(),title:n().optional(),traceId:n().nullish(),type:n().optional(),unknownParameters:f(n()).nullish(),used:c().int().nullish(),validParameters:f(n()).nullish(),value:n().nullish(),windowSeconds:c().int().nullish()}),ue=e=>e>=400&&e<500,de=e=>e>=500&&e<600,fe=1048576,k=300,pe=new Set([`description`,`summary`,`expanded`]),me=[15,10,5],A=e=>Array.isArray(e?.content)?e.content:[];function j(e){return e.ok&&e.operationId===`searchFederated`}function he(e,t=fe){if(!j(e))return;let n=F(e);if(n<=t)return e;let r=v.safeParse(structuredClone(e.data)),i=r.success?P(r.data):void 0,a=P(i?.response);if(i===void 0||a===void 0)return e;let o=P(a.entity),s=P(a.person),c=P(a.news),l=P(o?.result),u=P(s?.result),d=[...e.trimmed??[]],f={...e.counts},p=()=>({...e,data:i,trimmed:[...d],counts:{...f},truncated:d.length>0,truncation:{byteLength:n,maxBytes:t,omitted:[...d],recovery:`Optional search detail was trimmed; the answer and its citations are intact. Save a full CLI response with --data --to-file <path> when more detail is needed.`}}),m=()=>F(p())<=t,h=()=>{f[`entity.kept`]=A(l).length,f[`person.kept`]=A(u).length,f[`news.kept`]=A(c).length};if(h(),Array.isArray(o?.passage))for(let[e,t]of o.passage.entries()){let n=P(t);typeof n?.text==`string`&&n.text.length!==0&&(n.text=``,d.push(`response.entity.passage[${e}].text`))}if(m())return p();for(let[e,t]of[[`entity.result.content`,l?.content],[`entity.subject`,o?.subject],[`entity.peer`,o?.peer],[`entityDetail`,a.entityDetail],[`person.result.content`,u?.content],[`personDetail`,a.personDetail],[`news.content`,c?.content]])t!==void 0&&M(t,`response.${e}`,d);if(m())return p();for(let e of me){let t=new Set;for(let[n,r]of[[`entity.result.content`,l],[`person.result.content`,u],[`news.content`,c]]){let i=r?.content;if(!(r===void 0||!Array.isArray(i)||i.length<=e)){for(let n of i.slice(e)){let e=N(n);e!==void 0&&t.add(e)}r.content=i.slice(0,e),d.push(`response.${n}[${e}..]`)}}for(let e of[`entityDetail`,`personDetail`]){let n=a[e];if(!Array.isArray(n))continue;let r=n.filter(e=>{let n=N(e);return n===void 0||!t.has(n)});r.length!==n.length&&(a[e]=r,d.push(`response.${e}[discarded rows]`))}if(h(),m())return p()}let g=new Set;for(let e of[l,u])for(let t of A(e)){let e=N(t);e!==void 0&&g.add(e)}let _=P(o?.answer)?.paragraph;if(Array.isArray(_)){for(let e of _.map(P))if(Array.isArray(e?.citation))for(let t of e.citation.map(P)){let e=t?.entityId??t?.sourceId;typeof e==`string`&&g.add(e)}}for(let e of[`entityDetail`,`personDetail`]){let t=a[e];if(!Array.isArray(t))continue;let n=t.filter(e=>{let t=N(e);return t!==void 0&&g.has(t)});n.length!==t.length&&(a[e]=n,d.push(`response.${e}[unlisted rows]`))}if(m())return p();let y=p();return m()?y:{...y,warnings:[...y.warnings,`Search exceeds the byte budget after all permitted trims; protected search data was retained.`]}}function M(e,t,n){if(Array.isArray(e)){for(let[r,i]of e.entries())M(i,`${t}[${r}]`,n);return}let r=P(e);if(r!==void 0)for(let[e,i]of Object.entries(r))i!==void 0&&(pe.has(e)&&typeof i==`string`&&i.length>k?(r[e]=i.slice(0,k),n.push(`${t}.${e}`)):M(i,`${t}.${e}`,n))}function N(e){let t=P(e),n=P(t?.core)?.id??t?.id;return typeof n==`string`?n:void 0}var P=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:void 0,F=e=>_.byteLength(JSON.stringify(e),`utf8`),I=e([n(),c(),o()]),L=r({number:c().optional(),size:c().optional(),numberOfElements:c().optional(),totalElements:c().optional(),totalPages:c().optional(),first:o().optional(),last:o().optional(),empty:o().optional()}),R=r({byteLength:c(),maxBytes:c(),omitted:f(n()),recovery:n()}),ge=r({status:c(),title:n(),type:n()}).catchall(v.optional()).and(O),z=r({ok:o(),summary:n(),httpStatus:c().optional(),operationId:n().optional(),method:n().optional(),endpoint:n().optional(),format:l([`json`,`text`]).optional(),count:c().optional(),page:L.optional(),filters:a(n(),e([I,f(I)])).optional(),truncated:o().optional(),trimmed:f(n()).optional(),truncation:R.optional(),omitted:f(n()).default([]),ids:f(n()).default([]),counts:a(n(),c()).default({}),references:f(n()).default([]),warnings:f(n()).default([]),problem:ge.optional(),data:p()}),B=5e4,_e=[50,25,10,5,1],V=320,ve=`data (kept the first row of each list)`,ye=[{arrayLimit:1/0,rowLimit:1/0,stringLimit:24e3},{arrayLimit:1/0,rowLimit:1/0,stringLimit:1e4},..._e.map(e=>({arrayLimit:e,rowLimit:1/0})),{arrayLimit:1,rowLimit:1/0,foldRows:!0}],H=1e3,be=/^(?:bio|biography|body|content|description|evidence|fulltext|notes|snippet|summary|text)$/u,xe=/(?:description|snippet|summary|text)$/u;function Se(e){let t=z.safeParse(e);return t.success?t.data:null}function Ce(e){let t=L.safeParse(e);return t.success&&Object.values(t.data).some(e=>e!==void 0)?t.data:void 0}function we(e,t){if(t?.numberOfElements!==void 0)return t.numberOfElements;if(Array.isArray(e))return e.length;let n=$(e)?e.content:void 0;return Array.isArray(n)?n.length:void 0}function U(e,t,n={}){return{ok:!0,summary:e,...n,omitted:n.omitted??[],ids:n.ids??[],counts:n.counts??{},references:n.references??[],warnings:n.warnings??[],data:t}}function Te(e,t=[],n={}){return{...U(e,null,{...n,warnings:t}),ok:!1}}function Ee(e,t={}){let n=he(e);if(n!==void 0)return n;let r=t.maxBytes??5e4;if(K(e,r))return e;let i={byteLength:_.byteLength(JSON.stringify(e),`utf8`),maxBytes:r},a=e.httpStatus??0;if(t.write===!0&&e.ok&&a>=200&&a<300)return De(e,i,t.exactRecovery);let o=e.ok?Ae:`Refetch a narrower result through read operations using ids/references or filters; do not retry the failed operation.`,s=t.exactRecovery??t.narrowerRead??o,c=v.safeParse(JSON.parse(JSON.stringify(e.data))),l=t=>{let n=c.success?Y(c.data,`data`,i,t):{value:Z(i),omitted:[`data`]};return{...e,truncated:!0,truncation:X(i,n.omitted,s),warnings:[...e.warnings,...t.rowLimit===1/0?[]:[je(t,s)],`response truncated (caps); follow truncation.recovery for the full result`],data:n.value}},u=t.foldRows!==!1,d=e;for(let e of ye.filter(e=>u||e.foldRows!==!0))if(d=l(e),K(d,i.maxBytes))return d;let f=0;for(let t=2**Math.floor(Math.log2(J(e.data)));t>=1;t/=2)K(l({arrayLimit:1,rowLimit:f+t,foldRows:u}),i.maxBytes)&&(f+=t);if(f>0)return l({arrayLimit:1,rowLimit:f,foldRows:u});let p=(e,t=`data`)=>W(e,i,s,`response truncated (caps); metadata named in truncation.omitted was removed; follow truncation.recovery for the full result`,[t]),m=p(l({arrayLimit:1,rowLimit:1,foldRows:u}),ve);if(J(e.data)>0&&K(m,i.maxBytes))return m;let h=Z(i);return p({...d,truncation:X(i,[`data`],s),data:h})}function De(e,t,n=`Read the full result through the GET operation on ${e.endpoint??`this route`}.`){let r={...e.counts},i=(e,n)=>{let a={};for(let[o,s]of Object.entries($(e)?e:{}))Array.isArray(s)?r[`${n}${o}`]=s.length:typeof s==`string`?a[o]=q(s,t,V):typeof s!=`object`||!s?a[o]=s:n===``&&o===`response`&&(a[o]=i(s,`response.`));return a},a={...e,summary:`${e.method} succeeded (HTTP ${e.httpStatus}); response body omitted (${t.byteLength} bytes, over caps); do not retry the write`,truncated:!0,truncation:X(t,[`data`],n),counts:r,data:i(e.data,``)},o=a,s=[`data`],c={};for(let r of[`references`,`ids`,`warnings`]){if(K(o,t.maxBytes))return o;s.push(r),c[r]=[],o={...a,...c,omitted:[...e.omitted,...s.slice(1)],truncation:X(t,s,n)}}return K(o,t.maxBytes)?o:W({...o,data:Z(t),warnings:[`response truncated (caps); do not retry the write`]},t,n,`response truncated (caps); metadata named in truncation.omitted was removed; do not retry the write`)}function W(e,t,n,r,i=[`data`]){if(K(e,t.maxBytes))return e;let a=e.warnings.slice(0,-1),o=e;if(o.problem!==void 0){let e=G(o.problem);if(JSON.stringify(e).length<JSON.stringify(o.problem).length&&(i.push(`problem`),o={...o,problem:e,truncation:X(t,i,n)},K(o,t.maxBytes)))return o}let s=[`filters`,`omitted`,`ids`,`counts`,`references`].filter(t=>Object.keys(e[t]??{}).length>0);if(i.push(...s),o={...o,filters:void 0,truncation:X(t,i,n),omitted:[],ids:[],counts:{},references:[],warnings:s.length===0?e.warnings:[...a,r]},K(o,t.maxBytes))return o;let c=e=>e===void 0?void 0:q(e,t),l={summary:q(o.summary,t),operationId:c(o.operationId),method:c(o.method),endpoint:c(o.endpoint),warnings:o.warnings.map(e=>q(e,t)),problem:o.problem&&G(o.problem,t)},u=new Map(Object.entries(o));for(let[e,t]of Object.entries(l))JSON.stringify(t)!==JSON.stringify(u.get(e))&&i.push(e);if(o={...o,...l,truncation:X(t,i,n)},K(o,t.maxBytes))return o;i.push(`warnings`),o.page!==void 0&&i.push(`page`);let d=q(o.summary,t,V);return d!==o.summary&&i.push(`summary`),{...o,summary:d,page:void 0,truncation:X(t,i,n),warnings:[r]}}function G(e,t){let n=e=>t===void 0?e:q(e,t);return{status:e.status,title:n(e.title),type:n(e.type),...e.detail===void 0?{}:{detail:n(e.detail)},...e.instance===void 0?{}:{instance:n(e.instance)},...e.code===void 0?{}:{code:typeof e.code==`string`?n(e.code):e.code},...e.retryAfterSeconds===void 0?{}:{retryAfterSeconds:e.retryAfterSeconds},...e.disposition==null?{}:{disposition:e.disposition},...e.resetAt===void 0?{}:{resetAt:e.resetAt}}}function K(e,t=B){let n=JSON.stringify(e);return n.length<3e4&&_.byteLength(n,`utf8`)<=t}function q(e,t,n=H){if(_.byteLength(JSON.stringify(e),`utf8`)<=n)return e;let r=Q(t),i=``,a=_.byteLength(JSON.stringify(r),`utf8`);for(let t of e){let e=_.byteLength(JSON.stringify(t),`utf8`)-2;if(a+e>n)break;i+=t,a+=e}return`${i.trimEnd()}${r}`}function J(e){return Array.isArray(e)?e.length:$(e)?Math.max(0,...Object.values(e).map(J)):0}function Y(e,t,n,r){if(typeof e==`string`){let i=ke(Me(t))||e.length>H,a=r.stringLimit??V;return!i||e.length<=a?{value:e,omitted:[]}:{value:`${e.slice(0,a).trimEnd()}${Q(n)}`,omitted:[t]}}if(typeof e!=`object`||!e)return{value:e,omitted:[]};if(Array.isArray(e))return Oe(e,t,n,r);if(t===`data.response.entity.answer`||t===`data.response.answer`)return{value:e,omitted:[]};let i={},a=[],{foldDepth:o}=r;for(let[s,c]of Object.entries(e)){if(c===void 0)continue;let e=typeof c==`object`&&!!c;if(e&&o!==void 0&&(o===0||Array.isArray(c))){a.push(`${t.replaceAll(/\[\d+\]/gu,`[]`)}.${s} (folded)`);continue}let l=e&&o!==void 0?{...r,foldDepth:o-1}:r,u=Y(c,`${t}.${s}`,n,l);i[s]=u.value,a.push(...u.omitted)}return{value:i,omitted:a}}function Oe(e,t,n,r){let i=e.slice(0,r.rowLimit),a=r.foldRows===!0?1:r.foldDepth,o={...r,rowLimit:r.arrayLimit,foldDepth:a},s=i.map((e,r)=>Y(e,`${t}[${r}]`,n,o)),c=s.flatMap(e=>e.omitted),l=`${t}[${i.length}..] (kept ${i.length} of ${e.length})`;return{value:s.map(e=>e.value),omitted:e.length>i.length?[...c,l]:c}}function ke(e){let t=e.toLowerCase();return be.test(t)||xe.test(t)}var Ae=`Save the full response with --to-file <path>, then inspect the needed section; use narrower reads, filters, or pagination only where the operation supports them.`,X=(e,t,n)=>({...e,omitted:t.length===0?[`data`]:[...new Set(t)],recovery:q(n,e)}),Z=e=>({truncated:!0,...e}),Q=e=>`\n[truncated byteLength=${e.byteLength} maxBytes=${e.maxBytes}]`,je=({rowLimit:e,foldRows:t},n)=>`kept the first ${e} ${t===!0?`rows of each list with nested sections folded`:`whole rows of each list`}; ${n}`,Me=e=>(e.split(`.`).at(-1)??e).replace(/\[\d+\]$/,``),$=e=>typeof e==`object`&&!!e&&!Array.isArray(e);export{Ce as a,U as c,de as d,O as f,K as i,j as l,Ee as n,Se as o,v as p,Te as r,we as s,B as t,ue as u};
@@ -1 +0,0 @@
1
- import{fileURLToPath as e}from"node:url";import{dirname as t,resolve as n,sep as r}from"node:path";import{existsSync as i,readFileSync as a,realpathSync as o}from"node:fs";var s=[],c=8,l=e(import.meta.url),u=`aventure-`,d=new Set([``,``]),f,p;function m(){return f??=h(_()),f}function h({manifest:e,manifestPath:t}){return`${g(y(e,`name`,t))}/${y(e,`version`,t)} (${process.platform}; ${process.arch}) Node.js/${process.versions.node}`}function g(e){let t=e.slice(e.lastIndexOf(`/`)+1);return t.startsWith(u)||d.has(e)?t:`${u}${t}`}function _(e=l){if(e===l&&p)return p;let a;try{a=o(e)}catch(t){throw x(`cannot resolve ${e}`,t instanceof Error?t:void 0)}let s=t(a);for(let u=0;u<c;u+=1){let c=n(s,`package.json`);if(i(c)){let t={entryPath:a,manifest:v(c),manifestPath:c,packageRoot:s};return e===l?p=t:!p&&l.startsWith(`${s}${r}`)&&(p={...t,entryPath:o(l)}),t}let u=t(s);if(u===s)break;s=u}throw x(`no package.json found above ${e}`)}function v(e){let t;try{t=JSON.parse(a(e,`utf8`))}catch(t){throw x(`cannot parse ${e}`,t instanceof Error?t:void 0)}if(!b(t))throw x(`${e} must contain a JSON object`);return t}function y(e,t,n){let r=Reflect.get(e,t);if(typeof r!=`string`||r===``||r.trim()!==r)throw x(`${n} ${t} must be a non-empty, unpadded string`);return r}function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x(e,t){return Error(`aventure package metadata: ${e}`,{cause:t})}export{g as a,s as c,y as i,_ as n,m as o,x as r,h as s,b as t};