@aventurevc/aventure-cli 0.8.469 → 0.8.471

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 (77) hide show
  1. package/dist/aventure-cli/index.js +1 -1
  2. package/dist/aventure-cli/unified-operations.json +1 -1
  3. package/dist/chunks/{api-key-bearer-credential-DRcMc_2B.js → api-key-bearer-credential-BL9NY_h2.js} +1 -1
  4. package/dist/chunks/{api-key-bearer-credential-DxxN5nqm.js → api-key-bearer-credential-BLbiarOv.js} +1 -1
  5. package/dist/chunks/{api-key-credential-CXVGBnQR.js → api-key-credential-ChwcRoVO.js} +1 -1
  6. package/dist/chunks/{api-key-credential-BH4-_kdj.js → api-key-credential-DrvODZrB.js} +1 -1
  7. package/dist/chunks/{api-key-credential-verification-1kzeOcsX.js → api-key-credential-verification-Dn8LMHfy.js} +1 -1
  8. package/dist/chunks/{api-key-credential-verification-Cp0fIris.js → api-key-credential-verification-auawXecf.js} +1 -1
  9. package/dist/chunks/{api-key-login-DnAyrV93.js → api-key-login-PTzuyGD5.js} +1 -1
  10. package/dist/chunks/{auth-resolver-BEBbUnvt.js → auth-resolver-1SqKr6sv.js} +1 -1
  11. package/dist/chunks/auth-resolver-2CLsbq6z.js +1 -0
  12. package/dist/chunks/{auth-status-check-9U9ubrFh.js → auth-status-check-DBewXdAU.js} +1 -1
  13. package/dist/chunks/{auth-status-check-DZAJ-Yqr.js → auth-status-check-Di_8sEvf.js} +1 -1
  14. package/dist/chunks/{auth-status-render-D5Id4zjX.js → auth-status-render-C4t0rPKT.js} +1 -1
  15. package/dist/chunks/{aventure-cli-DXNFMseJ.js → aventure-cli-ByZ1Dw5G.js} +5 -5
  16. package/dist/chunks/{batch-io-CDlfXDS1.js → batch-io-BWxtesXN.js} +1 -1
  17. package/dist/chunks/{builtin-auth-DA2vTGRy.js → builtin-auth-D4vNPirO.js} +4 -4
  18. package/dist/chunks/{builtin-run-wait-Cmc5DhTK.js → builtin-run-wait-DqWMcHjR.js} +1 -1
  19. package/dist/chunks/{builtin-update-DyeoH3wp.js → builtin-update-Bw5pLhoO.js} +1 -1
  20. package/dist/chunks/{cli-help-policy-CS54Jza_.js → cli-help-policy-BEnaH89v.js} +1 -1
  21. package/dist/chunks/{completion-Bco7_7u3.js → completion-CIbDYvB7.js} +1 -1
  22. package/dist/chunks/{contract-TJtz3bIR.js → contract-Bp3lW3OR.js} +1 -1
  23. package/dist/chunks/{contract-parameter-VJtI25Ns.js → contract-parameter-V0kQHinO.js} +1 -1
  24. package/dist/chunks/{credential-redaction-CHC72MTO.js → credential-redaction-CcGktg8k.js} +1 -1
  25. package/dist/chunks/{credential-store-Bc4kZCKP.js → credential-store-0RPGLCFR.js} +1 -1
  26. package/dist/chunks/{env-BY2De6pV.js → env-DoAriNfh.js} +1 -1
  27. package/dist/chunks/{generated-option-order-m0ItqG6s.js → generated-option-order-D9HXEhic.js} +1 -1
  28. package/dist/chunks/{help-catalog-BfbV9OSh.js → help-catalog-BExrYg_X.js} +1 -1
  29. package/dist/chunks/{help-intent-CSKtw_rN.js → help-intent-XtdGwTW8.js} +1 -1
  30. package/dist/chunks/{logging-C0sZZwTj.js → logging-DGnKgFda.js} +1 -1
  31. package/dist/chunks/{logging-CQCgjIgk.js → logging-Dm4-IZw0.js} +1 -1
  32. package/dist/chunks/{logout-5k6NjOOd.js → logout-CG_RybON.js} +1 -1
  33. package/dist/chunks/logout-CTl41LxM.js +1 -0
  34. package/dist/chunks/{mcp-generation-contract-BcOcX7O7.js → mcp-generation-contract-D3fOVpi0.js} +1 -1
  35. package/dist/chunks/mcp-generation-contract-lkl5q3AW.js +1 -0
  36. package/dist/chunks/{oauth-bearer-credential-DXJ6uWZe.js → oauth-bearer-credential-C9JhNaFF.js} +1 -1
  37. package/dist/chunks/oauth-bearer-credential-dfTmAcrg.js +1 -0
  38. package/dist/chunks/{oauth-credential-CR95C7v4.js → oauth-credential-C8quXs0J.js} +1 -1
  39. package/dist/chunks/{oauth-credential-BrQzXCKI.js → oauth-credential-vgDwUMoV.js} +1 -1
  40. package/dist/chunks/{oauth-login-CSFbT24j.js → oauth-login-DZLs40sn.js} +1 -1
  41. package/dist/chunks/{oauth-login-CrqImWou.js → oauth-login-EBvLTtWV.js} +1 -1
  42. package/dist/chunks/{openapi-call-CDnXQXkR.js → openapi-call-Cem-PXeZ.js} +1 -1
  43. package/dist/chunks/{openapi-call-DXoCDYtD.js → openapi-call-DnkFMonU.js} +1 -1
  44. package/dist/chunks/{openapi-commands-CQaMSGGI.js → openapi-commands-D2I3uRVo.js} +1 -1
  45. package/dist/chunks/openapi-commands-V7spXAMc.js +1 -0
  46. package/dist/chunks/openapi-snapshot.json +1 -1
  47. package/dist/chunks/{operations-B1Qw-pWe.js → operations-Joblkd1h.js} +2 -2
  48. package/dist/chunks/{operations-catalog-UTjJ1hCd.js → operations-catalog-BD0POrjg.js} +1 -1
  49. package/dist/chunks/operations-catalog-CRvgnGIX.js +1 -0
  50. package/dist/chunks/{operations-metadata-Sxk_Zf34.js → operations-metadata-DG12wjZa.js} +1 -1
  51. package/dist/chunks/{output-Bly860AX.js → output-CT_zO35U.js} +1 -1
  52. package/dist/chunks/{output-CsblJwys.js → output-FLpTR04W.js} +1 -1
  53. package/dist/chunks/output-mode-BCVAiH8W.js +1 -0
  54. package/dist/chunks/{output-mode-DjwCiGl0.js → output-mode-CO-iRvt8.js} +1 -1
  55. package/dist/chunks/{output-spill-DXfWqlHc.js → output-spill-BNCzyHGC.js} +1 -1
  56. package/dist/chunks/{parse-error-hint-CdP-Gmd7.js → parse-error-hint-DiCuXg4J.js} +1 -1
  57. package/dist/chunks/{payload-operand-guard-D9wGHz-6.js → payload-operand-guard-CisvVW-h.js} +1 -1
  58. package/dist/chunks/{private-readback-DdCgYlb7.js → private-readback-CvY3UYHu.js} +1 -1
  59. package/dist/chunks/{request-replay-CrpOi7rB.js → request-replay-Dwrt7IaD.js} +1 -1
  60. package/dist/chunks/{request-replay-BT8uolcy.js → request-replay-PgG2xNDo.js} +1 -1
  61. package/dist/chunks/{response-problem-B-8fNnpP.js → response-problem-BtBbph_9.js} +1 -1
  62. package/dist/chunks/response-problem-DSkVKOEo.js +1 -0
  63. package/dist/chunks/result-envelope-Ds29nFJ0.js +1 -0
  64. package/dist/chunks/{startup-auth-Cnfa3Pvc.js → startup-auth-CGJonU1Q.js} +1 -1
  65. package/dist/chunks/{startup-auth-QC2VfhDV.js → startup-auth-DPK0a2oh.js} +1 -1
  66. package/dist/chunks/{text-response-CsNFgGiy.js → text-response-DtZf5tKu.js} +1 -1
  67. package/dist/chunks/{tool-policy-hEMbpSgK.js → tool-policy-DthqSCty.js} +1 -1
  68. package/package.json +3 -3
  69. package/dist/chunks/auth-resolver-CIpAHGzP.js +0 -1
  70. package/dist/chunks/logout-C7WN7Yeb.js +0 -1
  71. package/dist/chunks/mcp-generation-contract-B_pliucG.js +0 -1
  72. package/dist/chunks/oauth-bearer-credential-ChPwVqzz.js +0 -1
  73. package/dist/chunks/openapi-commands-yL-XiFY9.js +0 -1
  74. package/dist/chunks/operations-catalog-0lnnJFrp.js +0 -1
  75. package/dist/chunks/output-mode-DxifMSLh.js +0 -1
  76. package/dist/chunks/response-problem-D1phOgfy.js +0 -1
  77. package/dist/chunks/result-envelope-DimlVXjk.js +0 -1
@@ -1 +0,0 @@
1
- export{s as writeShowResult}from"./operations-catalog-UTjJ1hCd.js";
@@ -1 +0,0 @@
1
- export{n as cliMachineOutputSelected}from"./output-mode-DjwCiGl0.js";
@@ -1 +0,0 @@
1
- export{u as retrySeconds}from"./response-problem-B-8fNnpP.js";
@@ -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,m as u,n as d,p as f,s as p,w as m}from"./iso-DzqMxtky.js";import{t as h}from"./person-owner-BW4xz8uH.js";import{n as g,t as _}from"./allowance-type-BVr12WiL.js";import{Buffer as v}from"node:buffer";var y=f(()=>e([n(),c(),o(),i(),p(y),a(n(),y)])),b=l([`URL_DUPLICATE`,`STRICT_URL_LOOKUP`,`DUPLICATE_CREATE_REVIEW`,`CLASSIFICATION_INACTIVE_TAG`,`NEWS_SOURCE_URL`]),x=Object.assign(e([b,n()]),{enum:b.enum}),S=l([`REACTIVATE`,`ATTACH_INACTIVE`]),C=r({availableOverrides:p(S),conflictType:x,slug:n(),tagId:s()}),ee=r({externalId:n().nullish(),id:s(),publicationScore:s(),reason:p(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:p(n()),score:s().optional(),slug:n().regex(/^[a-z0-9_-]+$/).max(255).nullish(),typeRecord:g.nullish()}),ne=r({candidate:p(te).nullish(),conflictType:x,newsCandidate:p(ee).nullish(),overridePath:n().nullish(),threshold:s()}),re=r({conflictingArticleId:s(),conflictingArticleSlug:n(),conflictingArticleTitle:n(),conflictType:x}),ie=r({candidateEntityId:p(t()),candidatePersonId:p(t()),conflictType:x,hint:n(),normalizedUrl:n().nullish(),url:n(),urlType:n().nullish()}),ae=r({owner:h,urlId:s()}),w=r({conflictType:x,existingJoin:p(ae),fragmentIgnored:o(),guidance:n(),normalizedUrl:n().nullish(),requestedOwner:h,url:n(),urlType:n()}),T=e([w,ie,ne,C,re]),E=l([`NAME_NOT_DECLARED`,`REGISTRY_CONTACT_MISSING`,`REGISTRY_CONTACT_NOT_STATED`,`SITE_UNREADABLE`]),D=Object.assign(e([E,n()]),{enum:E.enum}),oe=r({acceptedValue:p(n()).nullish(),action:l([`setField`,`setParameter`,`removeParameter`,`useEndpoint`,`reviewCandidates`,`authenticate`]),endpoint:n().nullish(),fieldPath:n().nullish(),parameter:n().nullish(),retryable:o().nullish()}),O=l([`source`,`record`,`disclaimer`,`voice`,`marketing`,`chained`,`structured`,`tense`,`temporal`,`factList`,`mojibake`,`markup`,`unsupported`,`legalSource`,`textContract`,`evidenceAuthority`,`internalRepetition`,`analysis`]),se=Object.assign(e([O,n()]),{enum:O.enum}),ce=r({overridable:o(),passage:n(),problem:se,reason:n(),supportedWording:n().nullish(),unsupportedSpan:p(n()).nullish()}),k=l([`entity`,`person`,`news`,`blog`,`content`]),le=r({deletedAt:d({offset:!0}).nullish(),id:n(),isHidden:o(),nameBrand:n().nullish(),resourceType:k,showOnSitemap:o(),slug:n()}),ue=r({newUrl:n().nullish(),oldUrl:n(),targetCurrentSlug:n().nullish(),targetId:n().nullish(),targetResourceType:k.nullish()}),A=r({allowanceType:_.nullish(),campusProofRefusal:D.nullish(),circuitBreaker:n().nullish(),code:e([l(`harness_suppression_unverified.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.billing_plan_change_required.account_exists.origin_detail_capacity.origin_detail_shutdown.query_deadline_shed.primary_read_saturated.suspectedShellStrip.suspected_shell_strip.prose_rejected.prose_evidence_too_large.text_send_limit_reached.entity_name_casing_rejected.fundraise_evidence_unsupported.website_not_own_live_site.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.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.logo_source_dead.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.clerk_m2m_unavailable.clerk_oauth_unavailable.researchly_usage_unavailable.INFERENCE_PROVIDER_ERROR.inference_provider_error.text_write_job_ended.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:le.nullish(),coveringRunId:t().nullish(),detail:n().optional(),details:T.nullish(),disposition:l([`TRANSIENT`,`TERMINAL`]).nullish(),error:a(n(),n()).nullish(),existingRecordId:n().nullish(),existingRedirect:ue.nullish(),feId:n().nullish(),field:n().nullish(),filedRunId:p(t()).nullish(),hammingDistance:c().int().nullish(),hint:n().nullish(),instance:n().optional(),limit:c().int().nullish(),limitType:e([l([`FORM`,`GLOBAL`,`SUBNET`,`IP`,`UNKNOWN`,`WEB_SEARCH`,`AGENT_HELP`,`NATURAL_SEARCH`,`BILLING_ALLOWANCE`,`BILLING_ADDITIONAL_USAGE`]),n()]).nullish(),matchedBlocklistKey:n().nullish(),mediaType:n().nullish(),moderationReason:n().nullish(),mutationNotApplied:o().nullish(),path:n().nullish(),properties:a(n(),y).optional(),proseViolation:p(ce).nullish(),remaining:c().int().nullish(),requiredRole:n().nullish(),resetAt:d({offset:!0}).nullish(),resolution:oe.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:p(n()).nullish(),unmetGateId:p(n()).nullish(),used:c().int().nullish(),validParameters:p(n()).nullish(),value:n().nullish(),windowSeconds:c().int().nullish()}),de=e=>e>=400&&e<500,fe=e=>e>=500&&e<600,pe=1e3,me=/^(?:bio|biography|body|content|description|evidence|fulltext|notes|snippet|summary|text)$/u,he=/(?:description|snippet|summary|text)$/u,j=e=>e===`data.response.entity.answer`||e===`data.response.answer`,M=e=>`\n[truncated byteLength=${e.byteLength} maxBytes=${e.maxBytes}]`;function N(e){return typeof e!=`object`||!e?!1:Array.isArray(e)?e.length>0:Object.values(e).some(N)}function P(e,t,n,r){if(typeof e==`string`){let i=(t.split(`.`).at(-1)??t).replace(/\[\d+\]$/,``).toLowerCase(),a=me.test(i)||he.test(i)||e.length>1e3,o=r.stringLimit??320;return!a||e.length<=o?{value:e,omitted:[]}:{value:`${e.slice(0,o).trimEnd()}${M(n)}`,omitted:[t]}}if(typeof e!=`object`||!e)return{value:e,omitted:[]};if(Array.isArray(e))return F(e,t,n,r);if(j(t))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=P(c,`${t}.${s}`,n,l);i[s]=u.value,a.push(...u.omitted)}return{value:i,omitted:a}}function F(e,t,n,r){let i=e.slice(0,r.prefix?.get(t)??e.length),a=r.foldRows===!0?1:r.foldDepth,o={...r,foldDepth:a},s=i.map((e,r)=>P(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}}var I=()=>({bytes:0,characters:0,omissionBytes:0,omissionCharacters:0,omissions:0}),L=(e,t)=>({bytes:e.bytes+t.bytes,characters:e.characters+t.characters,omissionBytes:e.omissionBytes+t.omissionBytes,omissionCharacters:e.omissionCharacters+t.omissionCharacters,omissions:e.omissions+t.omissions}),R=e=>{let t=JSON.stringify(e);return{...I(),bytes:v.byteLength(t,`utf8`),characters:t.length}},z=e=>{let t=R(e);return{...I(),omissionBytes:t.bytes+1,omissionCharacters:t.characters+1,omissions:1}},ge=(e,t)=>({bytes:e.bytes-t.bytes,characters:e.characters-t.characters,omissionBytes:e.omissionBytes-t.omissionBytes,omissionCharacters:e.omissionCharacters-t.omissionCharacters,omissions:e.omissions-t.omissions}),B=(e,t)=>{let n=I();for(let r=t;r>0;r-=r&-r)n=L(n,e.cost[r]);return n},_e=(e,t,n)=>{for(let r=t+1;r<e.cost.length;r+=r&-r)e.cost[r]=L(e.cost[r],n)};function ve(e,t,n,r,i,a){let o=P(e,`data`,t,{prefix:n}),s=new Map(o.omitted.map(e=>[e.replace(/\[\d+\.\.\] \(kept \d+ of \d+\)$/u,``),e])),c=new Map,l=(e,t,n)=>{let r=s.get(t),i=r===void 0?I():z(r);if(typeof e!=`object`||!e||j(t))return L(R(e),i);if(Array.isArray(e)){let a=[I()],o=I();e.forEach((e,r)=>{let i=l(e,`${t}[${r}]`,{path:t,index:r,parent:n}),s={...i,bytes:i.bytes+1,characters:i.characters+1};a.push(s),o=L(o,s)});for(let e=1;e<a.length;e++){let t=e+(e&-e);t<a.length&&(a[t]=L(a[t],a[e]))}c.set(t,{path:t,length:e.length,originalLength:Number(/ of (\d+)\)$/u.exec(r??``)?.[1]??e.length),parent:n,cost:a,ownOmission:i,revision:0});let s=e.length===0?2:1;return L({...o,bytes:o.bytes+s,characters:o.characters+s},i)}let a=L(R({}),i),o=0;for(let[r,i]of Object.entries(e)){if(i===void 0)continue;let e=R(r),s=l(i,`${t}.${r}`,n),c=o++===0?1:2;a=L(a,L(s,{...e,bytes:e.bytes+c,characters:e.characters+c}))}return a},u=l(o.value,`data`),d=i({prefix:n},o),f=R(d),p=f.bytes,m=f.characters,h=d.truncation?.omitted??[],g=h.length;u.omissions===0&&h.length===1&&h[0]===`data`&&(g=0);let _=R([`data`]).bytes-2,v=e=>e===0?_:-1,y=e=>{let n=L(B(e,e.length),e.ownOmission);return Math.max((n.bytes+n.omissionBytes)/t.maxBytes,(n.characters+n.omissionCharacters)/a)},b=[],x=e=>{if(e.parent!==void 0!==r||e.length===0)return;let t={item:e,pressure:y(e),revision:e.revision},n=b.length;for(b.push(t);n>0;){let e=Math.floor((n-1)/2);if(b[e].pressure>=t.pressure)break;b[n]=b[e],n=e}b[n]=t},S=()=>{let e=b[0],t=b.pop();if(b.length===0||t===void 0)return e;let n=0;for(;n*2+1<b.length;){let e=n*2+1;if(e+1<b.length&&b[e+1].pressure>b[e].pressure&&e++,t.pressure>=b[e].pressure)break;b[n]=b[e],n=e}return b[n]=t,e};for(let e of c.values())x(e);for(;p>t.maxBytes||m>=a;){let e=S();if(e===void 0)break;let r=e.item;if(e.revision!==r.revision)continue;let i=r.parent;for(;i&&i.index<(n.get(i.path)??1/0);)i=i.parent;if(i)continue;let o=B(r,r.length),s=L(o,r.ownOmission),l=e=>{let t=B(r,e),n=z(`${r.path}[${e}..] (kept ${e} of ${r.originalLength})`),i=g-o.omissions+t.omissions-r.ownOmission.omissions+1,a=v(i)-v(g);return{bytes:p-o.bytes+t.bytes+ +(e===0)-o.omissionBytes+t.omissionBytes-r.ownOmission.omissionBytes+n.omissionBytes+a,characters:m-o.characters+t.characters+ +(e===0)-o.omissionCharacters+t.omissionCharacters-r.ownOmission.omissionCharacters+n.omissionCharacters+a,count:i,retained:t,tail:n}},u=r.length===1?0:1,d=r.length-1;for(;u<d;){let e=Math.ceil((u+d)/2),n=l(e);n.bytes<=t.maxBytes&&n.characters<a?u=e:d=e-1}let f=l(u);if(f.bytes>=p&&f.characters>=m)continue;n.set(r.path,u),p=f.bytes,m=f.characters,g=f.count,r.length=u,r.ownOmission=f.tail,r.revision++,x(r);let h=ge(L(f.retained,f.tail),s);for(u===0&&(h.bytes++,h.characters++),i=r.parent;i;){let e=c.get(i.path);_e(e,i.index,h),e.revision++,x(e),i=i.parent}}}var ye=1048576;function V(e){return e.ok&&e.operationId===`searchFederated`}function be(e,t=ye){if(!V(e))return;let n=`Search exceeds the ${t}-byte transport budget; the full result was retained without trimming.`;return e.warnings.includes(n)||v.byteLength(JSON.stringify(e),`utf8`)<=t?e:{...e,warnings:[...e.warnings,n]}}var H=e([n(),c(),o()]),U=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()}),xe=r({byteLength:c(),maxBytes:c(),omitted:p(n()),recovery:n(),spill:r({spilledTo:n().min(1),byteLength:s().nonnegative(),readableView:n().min(1).optional()}).optional()}),Se=r({status:c(),title:n(),type:n()}).catchall(y.optional()).and(A),Ce=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:U.optional(),filters:a(n(),e([H,p(H)])).optional(),truncated:o().optional(),trimmed:p(n()).optional(),truncation:xe.optional(),omitted:p(n()).default([]),ids:p(n()).default([]),counts:a(n(),c()).default({}),references:p(n()).default([]),warnings:p(n()).default([]),problem:Se.optional(),notDispatched:u(!0).optional(),data:m()}),we=160,Te=48,W=5e4,Ee=3e4;function De(e){let t=Ce.safeParse(e);return t.success?t.data:null}function Oe(e){let t=U.safeParse(e);return t.success&&Object.values(t.data).some(e=>e!==void 0)?t.data:void 0}function ke(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 G(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 Ae(e,t=[],n={}){return{...G(e,null,{...n,warnings:t}),ok:!1}}function K(e,t={}){let n=t.savesCappedPayload===!0&&t.foldRows!==!1?void 0:be(e);if(n!==void 0)return n;let r=t.maxBytes??5e4;if(Y(e,r))return e;let i={byteLength:v.byteLength(JSON.stringify(e),`utf8`),maxBytes:r,spill:t.spill??e.truncation?.spill},a=e.httpStatus??0;if(t.write===!0&&e.ok&&a>=200&&a<300)return je(e,i,t.exactRecovery);let o=e.ok?Me:`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=y.safeParse(JSON.parse(JSON.stringify(e.data))),l=`response truncated (caps); metadata named in truncation.omitted was removed; follow truncation.recovery for the full result`,u=e,d=[],f=(e,t)=>{let n=t??(c.success?P(c.data,`data`,i,e):{value:Q(i),omitted:[`data`]});return{...u,truncated:!0,truncation:Z(i,[...n.omitted,...d],s),warnings:[...u.warnings,...e.prefix===void 0?[]:[`kept list prefixes; ${s}`],`response truncated (caps); follow truncation.recovery for the full result`],data:n.value}},p=e;for(let e of[24e3,1e4,320])if(p=f({stringLimit:e}),Y(p,i.maxBytes))return p;if(c.success){let e={...p,data:null};N(c.data)&&!Y(e,i.maxBytes)&&(u=q(e,i,s,l,[]),d=u.truncation?.omitted??[]);let n=new Map;for(let e of[!0,!1])if(ve(c.data,i,n,e,f,Ee),p=f({prefix:n}),Y(p,i.maxBytes))return p;if(t.foldRows!==!1&&(p=f({prefix:n,foldRows:!0}),Y(p,i.maxBytes)))return p}if(p.truncation?.omitted.some(e=>/\[\d+\.\.\]/u.test(e))){let e=q(p,i,s,l,[...p.truncation.omitted]);if(Y(e,i.maxBytes))return e}let m=Q(i);return q({...p,truncation:Z(i,[`data`],s),data:m},i,s,l)}function je(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]=X(s,t,320):typeof s!=`object`||!s?a[o]=s:n===``&&o===`response`?a[o]=i(s,`response.`):o===`core`&&$(s)&&(a[o]={id:s.id});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:Z(t,[`data`],n),counts:r,data:i(e.data,``)},o=[`data`];for(let r of[`references`,`ids`,`warnings`]){if(Y(a,t.maxBytes))return a;o.push(r),Object.assign(a,{[r]:[],omitted:[...e.omitted,...o.slice(1)],truncation:Z(t,o,n)})}return Y(a,t.maxBytes)?a:q({...a,data:Q(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 q(e,t,n,r,i=[`data`]){if(Y(e,t.maxBytes))return e;let a=e.warnings.slice(0,-1),o=e,s=e=>(o={...o,...e,truncation:Z(t,i,n)},Y(o,t.maxBytes));if(o.problem!==void 0){let e=J(o.problem);if(JSON.stringify(e).length<JSON.stringify(o.problem).length&&(i.push(`problem`),s({problem:e})))return o}let c=[`filters`,`omitted`,`ids`,`counts`,`references`].filter(t=>Object.keys(e[t]??{}).length>0);if(i.push(...c),s({filters:void 0,omitted:[],ids:[],counts:{},references:[],warnings:c.length===0?e.warnings:[...a,r]}))return o;let l=e=>e===void 0?void 0:X(e,t),u={summary:X(o.summary,t),operationId:l(o.operationId),method:l(o.method),endpoint:l(o.endpoint),warnings:o.warnings.map(e=>X(e,t)),problem:o.problem&&J(o.problem,t)},d=new Map(Object.entries(o));for(let[e,t]of Object.entries(u))JSON.stringify(t)!==JSON.stringify(d.get(e))&&i.push(e);if(s(u))return o;if(o.problem!==void 0){let e=J(o.problem,t,we,Te);if(JSON.stringify(e).length<JSON.stringify(o.problem).length&&(i.push(`problem.reasons`),s({problem:e})))return o}for(let e of[`error`,`proseViolation`])if(o.problem?.[e]!==void 0&&(i.push(`problem.${e}`),s({problem:{...o.problem,[e]:void 0}})))return o;i.push(`warnings`),o.page!==void 0&&i.push(`page`);let f=X(o.summary,t,320);return f!==o.summary&&i.push(`summary`),{...o,summary:f,page:void 0,truncation:Z(t,i,n),warnings:[r]}}function J(e,t,n=320,r=n){let i=e=>t===void 0?e:X(e,t);return{status:e.status,title:i(e.title),type:i(e.type),...e.detail===void 0?{}:{detail:i(e.detail)},...e.field==null?{}:{field:i(e.field)},...e.hint==null?{}:{hint:i(e.hint)},...e.error==null?{}:{error:Object.fromEntries(Object.entries(e.error).map(([e,r])=>[e,t===void 0?r:X(r,t,n)]))},...e.proseViolation==null?{}:{proseViolation:e.proseViolation.map(e=>({...e,passage:t===void 0?e.passage:X(e.passage,t,r),reason:t===void 0?e.reason:X(e.reason,t,n)}))},...e.instance===void 0?{}:{instance:i(e.instance)},...e.code===void 0?{}:{code:typeof e.code==`string`?i(e.code):e.code},...e.retryAfterSeconds===void 0?{}:{retryAfterSeconds:e.retryAfterSeconds},...e.disposition==null?{}:{disposition:e.disposition},mutationNotApplied:e.mutationNotApplied??void 0,...e.resetAt===void 0?{}:{resetAt:e.resetAt}}}function Y(e,t=W){let n=JSON.stringify(e);return n.length<3e4&&v.byteLength(n,`utf8`)<=t}function X(e,t,n=pe){if(v.byteLength(JSON.stringify(e),`utf8`)<=n)return e;let r=M(t),i=``,a=v.byteLength(JSON.stringify(r),`utf8`);for(let t of e){let e=v.byteLength(JSON.stringify(t),`utf8`)-2;if(a+e>n)break;i+=t,a+=e}return`${i.trimEnd()}${r}`}var Me=`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.`,Z=(e,t,n)=>({...e,omitted:t.length===0?[`data`]:[...new Set(t)],recovery:X(n,e)}),Q=({byteLength:e,maxBytes:t})=>({truncated:!0,byteLength:e,maxBytes:t}),$=e=>typeof e==`object`&&!!e&&!Array.isArray(e);export{Oe as a,G as c,fe as d,A as f,Y as i,V as l,K as n,De as o,y as p,Ae as r,ke as s,W as t,de as u};