@tsuga/cli 1.145.0 → 1.147.0

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 (2) hide show
  1. package/dist/cli.js +3 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -270,7 +270,7 @@ ${or(e,"Wizard cancelled.",kb)}`,RY=(e,t,r,o,i=hl)=>{let a=Qbe(t);return[or(r,e,
270
270
  `)}function ive(e,t){let r=()=>e.reduce((o,i)=>o+i.width,0)+V8.length*(e.length-1);for(;r()>t;){let i=e.filter(a=>(a.column.priority??1)>0&&a.width>nve).sort((a,s)=>(s.column.priority??1)-(a.column.priority??1)||s.width-a.width)[0];if(!i)return;i.width-=1}}function ave(e,t,r){let o=" ".repeat(Math.max(0,t-Jk(e)));return r==="right"?`${o}${e}`:`${e}${o}`}var sve=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function cve(e,t){return Jk(e)<=t?e:`${e.replace(W8,"").slice(0,Math.max(0,t-1))}\u2026`}function Jk(e){return e.replace(W8,"").length}function uve(e,t){let r=typeof t.value=="function"?t.value(e):BE(e,t.value);return t.format?t.format(r):Z8(r)}function Z8(e){if(e==null||e==="")return Kl("-");if(typeof e=="boolean")return e?"yes":"no";if(typeof e=="string")return sve.test(e)?pve(e):e;if(typeof e=="number"||typeof e=="bigint")return String(e);if(Array.isArray(e)){if(e.length===0)return Kl("-");let t=e.slice(0,ove).map(o=>Z8(o)),r=e.length-t.length;return r>0?`${t.join(", ")} ${Kl(`+${r} more`)}`:t.join(", ")}return typeof e=="object"?Kl(`{${Object.keys(e).length} keys}`):Kl("-")}function pve(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:`${`${t.getFullYear()}-${JO(t.getMonth()+1)}-${JO(t.getDate())}`} ${JO(t.getHours())}:${JO(t.getMinutes())}`}function JO(e){return String(e).padStart(2,"0")}var Rf=Ie("common-cli/OutputFields",{defaultValue:()=>{}}),qE=Ie("common-cli/StdoutIsTTY",{defaultValue:()=>process.stdout.isTTY}),e0=Ie("common-cli/IsInteractive",{defaultValue:()=>!process.env.CI&&process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY}),Le=e=>Zr(e),ya=L(function*(e,t){yield*Zr(JSON.stringify(yield*J8(e,t),null,2))}),xe=L(function*(e,t){yield*Zr(JSON.stringify({...e,data:yield*J8(e.data,t)},null,2))}),J8=L(function*(e,t){let r=t??(yield*Rf);if(r===void 0||!jE(e))return e;let o=Array.isArray(e)?e.map(i=>jE(i)?Zk(i,r):i):Zk(e,r);return lve(e,o)?yield*new Cf({message:`--fields ${r.join(",")} selected nothing from the response. Top-level fields: ${dve(e).join(", ")}`,suggestions:["Pick paths from the fields listed above, with dots for nested fields","For any other shape, omit --fields and pipe the JSON to jq"]}):o});function lve(e,t){if(!Array.isArray(e))return Object.keys(t).length===0;let r=t;return e.some(jE)&&r.every(o=>!jE(o)||Object.keys(o).length===0)}function dve(e){let t=Array.isArray(e)?e.find(jE):e;return t===void 0?[]:Object.keys(t).sort()}function jE(e){return e!==null&&typeof e=="object"}var e7=L(function*(e,t){if(e.length===0){yield*Hn("No results.");return}let r=t.fields??(yield*Rf),o={truncate:t.truncate??(yield*qE),width:Y8()};yield*Le(r===void 0&&t.prettyFormat!==void 0?t.prettyFormat(e,o):X8(e,Q8(r??t.defaultFields),o))}),Hn=e=>xy(e);function t0(e,t=r=>{process.exit(r)}){e.on("error",r=>{if(r.code==="EPIPE"){t(process.exitCode);return}throw r})}var B=n.Object({success:n.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",description:"Confirmation that the targeted resource was deleted.",example:{success:!0}});var r0="tsuga-cli";var zl="/v0/oauth",t7=f({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${zl}/authorize`,method:"GET",query:n.Partial(n.Object({response_type:n.String({description:"Must be `code`"}),client_id:n.String({description:"First-party client id or CIMD document URL"}),redirect_uri:n.String({description:"Client redirect URI"}),code_challenge:n.String({description:"PKCE code challenge"}),code_challenge_method:n.String({description:"Must be `S256`"}),state:n.String({description:"Opaque client state, echoed back"}),resource:n.String({description:"RFC 8707 resource indicator"})})),response:n.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),r7=f({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${zl}/token`,method:"POST",body:n.Partial(n.Object({grant_type:n.String({description:"`authorization_code` or `refresh_token`"}),code:n.String({description:"Authorization code being exchanged"}),code_verifier:n.String({description:"PKCE code verifier"}),redirect_uri:n.String({description:"Must match the redirect URI used on /authorize"}),client_id:n.String({description:"Client id, when sent by the client"}),refresh_token:n.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:n.Object({access_token:n.String(),token_type:n.Literal("Bearer"),expires_in:n.Number({description:"Access token lifetime in seconds"}),refresh_token:n.String()})}),Nkt=f({description:"Resolve a signed authorization request handle for the consent page",url:`${zl}/authorization-request`,method:"GET",query:n.Object({handle:n.String()}),response:n.Object({clientId:n.String(),clientName:n.String(),redirectUri:n.String()})}),Lkt=f({description:"Approve or deny an OAuth authorization request from the consent page",url:`${zl}/approve`,method:"POST",body:n.Object({handle:n.String({description:"The signed authorization request handle"}),approve:n.Boolean()}),response:n.Object({redirectTo:n.String({description:"The client's redirect URI carrying either the code or the denial"})})}),kkt=f({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${zl}/introspect`,method:"POST",body:n.Object({token:n.String()}),response:n.Object({active:n.Boolean(),userId:n.Optional(n.String()),orgId:n.Optional(n.String())})}),mve=["pending","active","revoked"],fve=n.Object({id:n.String(),createdAt:w(),clientId:n.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:n.String({description:"Display name derived from the client identity"}),userId:n.String(),status:n.Enum(mve),lastUsedAt:n.Optional(w())}),Mkt=f({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${zl}/grants`,method:"GET",query:n.Object({allUsers:n.Optional(n.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:n.Array(fve)}),Dkt=f({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${zl}/grants/:id`,method:"DELETE",params:n.Object({id:n.String()}),response:B});function n7(e,t,r){let o=new URL(t7.url,t);return o.search=new URLSearchParams({response_type:"code",client_id:e,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),o.href}var gve=un({access_token:St(ye),refresh_token:St(ye),expires_in:St(pc),error:St(ye),error_description:St(ye)}),hve=Lo(gve),o7=L(function*(e){let t=yield*Ol,r=v("oauth.token")(function*(o,i){let a=yield*t.post(new URL(r7.url,o).href,{headers:{Accept:"application/json"},body:yL(i,"application/x-www-form-urlencoded")}).pipe(dt(l=>new ss({message:`OAuth token request failed (${l.message})`,cause:l}))),s=yield*a.json.pipe(H(hve),ti(()=>({})));if(a.status!==200){let l=s.error??`HTTP ${a.status}`;return yield*new If({message:`OAuth token request failed (${l}${s.error_description?`: ${s.error_description}`:""})`,code:l})}if(!s.access_token||!s.refresh_token||s.expires_in===void 0)return yield*new bf({message:"OAuth token response was missing required fields"});let u=yield*sn;return{accessToken:s.access_token,refreshToken:s.refresh_token,expiresAt:new Date(u+s.expires_in*Bl)}});return{exchangeCode:v("oauth.exchangeCode")(function*(o,i){return yield*r(o,{grant_type:"authorization_code",client_id:e,code:i.code,code_verifier:i.verifier,redirect_uri:i.redirectUri})}),refreshTokens:v("oauth.refreshTokens")(function*(o,i){return yield*r(o,{grant_type:"refresh_token",client_id:e,refresh_token:i})})}});function i7(e,t){return n7(r0,e,t)}var Yu=class extends Qe()("cli/OAuth",{make:o7(r0)}){static layer=Po(this,this.make)};var a7=require("node:fs");var eA=L(function*(e,t={}){let r=yield*Ba;return L(function*(o,i){let a=yield*Ri(e,o,{...t.env===void 0?{}:{env:t.env},...i===void 0?{}:{stdin:{stream:kq(new TextEncoder().encode(i))}}}),{stdout:s,stderr:u,status:l}=yield*qs({stdout:a.stdout.pipe(Zp,Jp),stderr:a.stderr.pipe(Zp,Jp),status:a.exitCode},{concurrency:"unbounded"});return{status:Number(l),stdout:s,stderr:u}},Zn,Ii(Ba,r),ti(()=>({status:1,stdout:"",stderr:`${e} did not run`})))});var s7="/usr/bin/security",yve=44;function Eve(e){return e===0||e===yve}function n0(){return process.platform==="darwin"&&o0(s7)}function o0(e){try{return(0,a7.lstatSync)(e).isFile()}catch{return!1}}function Sve(e,t){return["find-generic-password","-s",e,"-a",t,"-w"]}function Tve(e,t){return["delete-generic-password","-s",e,"-a",t]}function _ve(e,t,r){let o=Buffer.from(r,"utf-8").toString("hex");return`add-generic-password -U -s ${e} -a ${t} -X ${o}
271
271
  `}var c7=L(function*(e){let t=yield*eA(s7,{env:{}}),r=L(function*(o){if(!n0())return;let{status:i,stdout:a}=yield*t(Sve(e,o));return i===0&&a.trim()||void 0});return{location:"the macOS Keychain",read:r,save:v("keychain.save")(function*(o,i){return n0()?(yield*t(["-i"],_ve(e,o,i))).status===0:!1}),remove:v("keychain.remove")(function*(o){if(!n0())return!0;let{status:i}=yield*t(Tve(e,o));return Eve(i)?(yield*r(o))===void 0:!1})}});var Di=e=>Oy(e).pipe(fl(t=>t.trim()||void 0),aN(void 0));var u7="/usr/bin/secret-tool",Ive=Pm({DBUS_SESSION_BUS_ADDRESS:Di("DBUS_SESSION_BUS_ADDRESS"),XDG_RUNTIME_DIR:Di("XDG_RUNTIME_DIR")}).pipe(fl(e=>Object.fromEntries(Object.entries(e).flatMap(([t,r])=>r===void 0?[]:[[t,r]]))));function bve(e){return["lookup","service",e.service,"account",e.account]}function xve(e,t){return["store","--label",t,"service",e.service,"account",e.account]}function Ove(e){return["clear","service",e.service,"account",e.account]}function Ave(e){return["search","--all","service",e.service,"account",e.account]}function Cve(e){return e.status===0&&e.stdout.trim()===""}function i0(){return process.platform==="linux"&&o0(u7)}var p7=L(function*({service:e,label:t}){let r=yield*Ive.pipe(ti(()=>({}))),o=yield*eA(u7,{env:r});return{location:"the login keyring",read:L(function*(a){if(!i0())return;let{status:s,stdout:u}=yield*o(bve({service:e,account:a}));return s===0&&u.trim()||void 0}),save:v("secretTool.save")(function*(a,s){return i0()?(yield*o(xve({service:e,account:a},t),s)).status===0:!1}),remove:v("secretTool.remove")(function*(a){return i0()?(yield*o(Ove({service:e,account:a})),Cve(yield*o(Ave({service:e,account:a})))):!0})}});var l7=require("node:os");var It=class extends qe("RequestBodyError"){},Nn=class extends qe("LocalFileError"){},Yl=class extends qe("InvalidLink"){},HE=class extends qe("SessionCorrupted"){},Rve=[ha,xf,Of,Hl,Cf,Yl,Af,Nn,Tc,Ku,zu,If,It,bf,HE,ql,ss,_c],Ar={success:0,failure:1,usage:2,auth:3,api:4,network:5,localState:6},Pve={ApiError:Ar.api,ConfigCorrupted:Ar.localState,ConfigUnreadable:Ar.localState,ExternalCommandError:Ar.failure,FieldsNotFound:Ar.usage,InvalidLink:Ar.usage,KeychainUnwritable:Ar.localState,LocalFileError:Ar.localState,LoginFailed:Ar.auth,NoCredentials:Ar.auth,NonJsonResponse:Ar.network,OAuthTokenError:Ar.auth,RequestBodyError:Ar.usage,ResponseDecodeError:Ar.network,SessionCorrupted:Ar.auth,SessionExpired:Ar.auth,TransportError:Ar.network,UntrustedApiUrl:Ar.usage};function tA(e){return Pve[e._tag]}function rA(e){return 128+l7.constants.signals[e??"SIGINT"]}function nA(e){return Rve.some(t=>e instanceof t)}function oA(e){return Py(e)&&e._tag==="ShowHelp"}var iA=["Sign in with your browser: tsuga auth login","Save an operation API key: tsuga auth operation-key <OPERATION_API_KEY>"];function d7(e){let t=[`Error: ${e.message}`];return e._tag==="ApiError"&&(e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),e.details&&t.push(`Details: ${JSON.stringify(e.details,null,2)}`)),e.suggestions&&e.suggestions.length>0&&t.push("","Suggestions:",...e.suggestions.map(r=>` - ${r}`)),t.join(`
272
272
  `)}var aA=un({accessToken:Rb,accessExpiresAt:Rb,refreshToken:St(ye)}),Uve=Lo(Pi(aA)),m7=e=>Uve(e.trim()).pipe(dt(()=>new HE({message:"The saved session is unreadable.",suggestions:["Sign in again to replace it: tsuga auth login"]}))),wve=5*jl;function a0(e,t){let r=new Date(e.accessExpiresAt).getTime();return Number.isNaN(r)?!0:r<=t+wve}function f7(e){if(e.flagKey)return{kind:"operation-api-key",token:e.flagKey,source:"flag"};if(e.environmentKey)return{kind:"operation-api-key",token:e.environmentKey,source:"environment"};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey,source:"config"};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var g7="tsuga-cli",vve="Tsuga CLI session",Pf=class extends Qe()("SecretStore",{make:pt(function*(){let t=process.platform==="linux"?yield*p7({service:g7,label:vve}):yield*c7(g7);return{location:t.location,read:L(function*(r){let o=yield*t.read(r);return o===void 0?void 0:yield*m7(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Po(this,this.make)};function s0(e){let t=e.trimStart();return/^[=+@-]/.test(t)&&!/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(t)?`'${e}`:e}function h7(e){let t=s0(e);return/[",\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}var y7=["json","tsv","csv","pretty"];function E7(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function S7(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?Lve:kve,a=r.map(u=>i(u)).join(o),s=t.map(u=>r.map(l=>i(BE(u,l))).join(o));return[a,...s].map(u=>e==="csv"&&r.length===1&&u===""?'""':u).join(`
273
- `)}var Nve={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function Lve(e){let t=T7(e);return t===null?"":h7(t)}function kve(e){let t=T7(e);return t===null?"":s0(t).replace(/[\\\t\r\n]/g,r=>Nve[r]??r)}function T7(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var mn=class e extends Qe()("common-cli/OutputFormatter"){static layer=Qi(e)(_7("rows"));static pageLayer=Qi(e)(_7("page"))};function _7(e){return{rows:(t,r)=>pt(function*(){let o=r.fields??(yield*Rf),i=r.output??((yield*qE)?"pretty":"json");if(i==="json")yield*e==="page"?xe({data:t,metadata:r.metadata},o):ya(t,o);else if(i==="pretty")yield*e7(t,{...r,fields:o});else{let a=S7(i,t,o??r.defaultFields);a.length>0&&(yield*Le(a))}})}}var cs=class extends Qe()("GlobalFlags"){},I7=Ie("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var b7="__tsuga_cluster_id__",Mve=n.Object({}),Dve=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function Uf(e=Mve){let t=D("status",[n.Object({...e.properties,status:n.Literal("ok")}),Dve]);return Object.assign(Kx(oi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var Fve=5,Ic=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:Fve,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var x7=n.Object({type:n.Literal("number"),number:n.String()}),$ve=n.Object({type:n.Literal("string"),string:n.String()}),Gve=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),KE=D("type",[x7,$ve,Gve]),Bve=n.Object({by:n.Record(n.String(),KE),computed:n.Record(n.String(),x7)}),jve=n.Object({type:n.Literal("buckets"),buckets:n.Array(Bve),clusterResponses:n.Optional(Uf())}),qve=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),wf=D("type",[jve,qve]);var c0=["all","owning-team-and-public","owning-team-only"],Ea=n.Enum(c0,{description:"`all` allows the resource to query all permitted telemetry, `owning-team-and-public` limits it to the owning team plus public data, and `owning-team-only` limits it to the owning team."});var A7=1456444800,C7=4927737600,Hve=A7*1e3,Kve=C7*1e3,sA=1704067200,cA=sA+3600,R7=sA*1e3,P7=cA*1e3,U7={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:sA,to:cA}]},zve={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:R7,to:P7}]},Vl=(e,t=sA)=>n.Integer({description:e,examples:[t],minimum:A7,maximum:C7,format:"int64"}),O7=(e,t=R7)=>n.Integer({description:e,examples:[t],minimum:Hve,maximum:Kve,format:"int64"}),Cr=n.Object({from:n.Optional(Vl("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(Vl("End of the query window as a Unix timestamp in seconds",cA))},U7),Jr=n.Object({from:Vl("Start of the query window as a Unix timestamp in seconds"),to:Vl("End of the query window as a Unix timestamp in seconds",cA)},U7),Oo=n.Object({from:O7("Start of the query window as a Unix timestamp in milliseconds"),to:O7("End of the query window as a Unix timestamp in milliseconds",P7)},zve);var bc="/v0/logs";var uA=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var zE=0,u0=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0,description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),message:n.Optional(n.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:n.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:n.Enum(uA,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[b7]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),v7=100,Yve="timestamp",Vu=n.Partial(n.Object({...Cr.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:zE,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:zE}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${zE} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Ic,sortBy:p({allowEmpty:!1,default:Yve,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:pe,useCanopy:n.Boolean()})),L0t=f({tags:["logs"],url:`${bc}/count`,method:"GET",query:n.Pick(Vu,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(Uf())})}),YE=n.Object({value:n.String(),priority:n.Number()}),k0t=f({tags:["logs"],url:`${bc}/search`,method:"GET",query:Vu,response:n.Object({logs:n.Optional(n.Array(u0)),attributesToHighlight:n.Optional(n.Array(YE)),clusterResponses:n.Optional(Uf(n.Object({nextStartOffset:n.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),Vve=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),N7=n.Object({id:n.String(),pattern:n.Array(Vve),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),p0=n.Object({...Cr.properties,query:p({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(p({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),M0t=f({tags:["logs"],url:`${bc}/patterns`,method:"GET",query:p0,response:n.Object({patterns:n.Array(N7),sampleSize:n.Number()})}),L7=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(uA)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),D0t=f({tags:["logs"],url:`${bc}/patterns/clusters`,method:"GET",query:p0,response:n.Object({clusters:n.Array(L7),totalVolume:n.Integer()})}),Wve=50,F0t=f({tags:["logs"],url:`${bc}/patterns/details`,method:"POST",body:n.Object({...p0.properties,clusters:n.Array(L7,{maxItems:Wve})}),response:n.Object({patterns:n.Array(N7),sampleSize:n.Number()})}),$0t=f({tags:["logs"],url:`${bc}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(Ic),useCanopy:n.Optional(n.Boolean()),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(Uf())})});var k7="timestamp";var w7=`${k7}_iso`;var Qve=["pending","running","completed","incomplete","failed"],M7=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(Qve,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:n.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:n.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:n.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:n.Optional(n.String({description:"Why the export is incomplete or failed."}))}),G0t=f({tags:["logs"],url:`${bc}/exports`,method:"POST",body:n.Object({...n.Pick(Vu,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(p({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${k7}\` also writes a \`${w7}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:Dl,description:`IANA timezone the \`${w7}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...M7.properties,downloadUrl:n.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),B0t=f({tags:["logs"],url:`${bc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:M7}),j0t=f({tags:["logs"],url:`${bc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:p({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var xc="/v0/metrics",Xve=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(uA)},{additionalProperties:!0}),W0t=f({tags:["metrics"],url:`${xc}/count`,method:"GET",query:n.Pick(Vu,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),Q0t=f({tags:["metrics"],url:`${xc}/search`,method:"GET",query:Vu,response:n.Object({logs:n.Optional(n.Array(Xve)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(YE))},{additionalProperties:!0})}),pA=n.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),lA=n.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),l0=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],D7=n.Enum(l0,{description:"Type and temporality of one variant of a metric. The same metric name can be reported under several kinds, for instance by two services instrumented differently."}),F7=n.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),$7=n.Array(n.String(),{description:"Team values observed on this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no team statistics for the metric yet."}),dA=n.Number({description:"Estimated number of distinct series for this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no statistics for the metric yet."}),Zve=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),Jve=n.Object({capabilities:n.Optional(n.Array(n.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. If this field is omitted or empty, all aggregate types are supported."})),description:n.Optional(n.String({description:"Human-readable description of the metric"})),tags:n.Optional(n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:n.Optional(lA),type:n.Optional(pA),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(F7),teams:n.Optional($7),seriesCardinality:n.Optional(dA),attributeCardinalities:n.Optional(Zve)}),X0t=f({url:`${xc}/metadata`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),kind:n.Optional(D7),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Jve}),Z0t=f({tags:["metrics"],url:xc,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),G7=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:D7,type:pA,temporality:n.Optional(lA),lastSeen:n.Optional(F7),teams:n.Optional($7),seriesCardinality:n.Optional(dA)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),eNe=[{name:"http.server.request.duration",kind:"cumulative-histogram",type:"histogram"},{name:"http.server.request.duration",kind:"delta-histogram",type:"histogram"},{name:"http.server.active_requests",kind:"gauge",type:"gauge"},{name:"http.server.request.count",kind:"delta-counter",type:"counter"}];Object.assign(G7,{examples:[eNe]});var J0t=f({tags:["metrics"],url:`${xc}/names-and-types`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:G7}),VE=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),tNe=["service","env","host","method","status_code"];Object.assign(VE,{examples:[tNe]});var eMt=f({tags:["metrics"],url:`${xc}/attributes`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:VE}),tMt=f({tags:["metrics"],url:`${xc}/attributes/batch`,method:"GET",query:n.Object({...Cr.properties,metricNames:n.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:VE}),d0=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:n.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:n.String({description:"Display name of the referencing dashboard or monitor."}),owner:n.String({description:"Team ID that owns the referencing dashboard or monitor."})},{description:"A dashboard or monitor that queries this metric."}),{description:"Dashboards and monitors that currently query this metric."})}),rMt=f({tags:["metrics"],url:`${xc}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1})}),response:d0}),nMt=f({url:`${xc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:p(),clusterId:n.Optional(p({allowEmpty:!1}))}),response:n.Array(n.String())});var oNe="/v0/aggregation",iNe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),QE=n.Object({parallelism:n.Number(),engine:iNe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),m0=["logs","metrics","traces"];var q7={logs:"Logs",metrics:"Metrics",traces:"Spans"},aNe=[...m0,"connections","log-patterns","spans","rum"];var gMt={...q7,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},us=[...m0,"rum"];var hMt={...q7,rum:"RUM events"};var yMt=n.Enum(aNe,{description:"Data source being queried"}),EMt=n.Enum(m0,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),ci=n.Enum(us,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Wl=n.String({description:"Attribute containing the values to aggregate"}),vf=p({description:"Attribute containing the values to aggregate"}),sNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Wl)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Wl},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Wl},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Wl},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Wl},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Wl},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Wl,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),cNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(p({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:vf},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:vf},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:vf},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:vf},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:vf},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:vf,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),H7=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),K7=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),z7=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),Y7=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),V7=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),W7=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),Q7=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),X7=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),Z7=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),uNe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),pNe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),lNe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),dNe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),mNe=D("type",[H7,K7,z7,Y7,V7,uNe,W7,Q7,X7,lNe,Z7],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),fNe=D("type",[H7,K7,z7,Y7,V7,pNe,W7,Q7,X7,dNe,Z7],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var B7=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),gNe=["linear","log"],WE=n.Enum(gNe,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),hNe=1e3,j7=n.Integer({minimum:1,maximum:hNe}),mA={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},yNe=D("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...mA,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(p()),bucketCount:n.Optional(j7),bounds:n.Optional(B7),boundsScale:n.Optional(WE),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...mA,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(p()),bucketCount:n.Optional(j7),bounds:n.Optional(B7),boundsScale:n.Optional(WE)},{title:"Heatmap",description:"Returns a distribution per time window"})]),fA=15,SMt=128*1024,ENe=["zero","null"],SNe=n.Enum(ENe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),J7=n.Object({mode:n.Object({type:SNe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),TNe=["avg","sum","min","max","last"],eX=n.Enum(TNe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var tX=n.Enum(l0,{description:"Variant of the metric in `aggregate.field` to query, for metric names reported under several kinds (for instance both cumulative and delta). When omitted, Tsuga picks one variant by type and temporality precedence."}),rX={aggregate:sNe,functions:n.Optional(n.Array(mNe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(J7),timeAggregate:n.Optional(eX),metricKind:n.Optional(tX)},nX={aggregate:cNe,functions:n.Optional(n.Array(fNe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(J7),timeAggregate:n.Optional(eX),metricKind:n.Optional(tX)},_Ne={description:"Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order."},oX={minItems:1,maxItems:fA,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},iX=n.Array(n.Object({...rX,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),_Ne),XE=n.Array(n.Object({...nX,filter:n.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),oX),Oc=n.Array(n.Object({...rX,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),Wu=n.Array(n.Object({...nX,filter:p({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{...oX,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),aX=n.Array(n.Omit(Wu.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:fA,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var gA=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Ql=p({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),INe=n.Object({fields:n.Array(n.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:n.Number({description:'Maximum number of distinct values of `fields` returned for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated, not merged into an "other" group.'}),sortOrder:n.Optional(pe),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),bNe=n.Object({fields:n.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:n.Optional(pe),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),sX=7;var Nf=n.Array(INe,{description:"Nested grouping levels applied to the results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values."}),Ac=n.Array(bNe,{maxItems:sX,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var TMt=f({tags:["aggregation"],url:`${oNe}/multi-query`,method:"POST",body:n.Object({timeRange:Oo,queries:XE,groupBy:n.Optional(Ac),returnType:yNe,dataSource:ci,formula:Ql,executionOptions:QE,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1})),clusterIds:n.Optional(Ic),viewAs:n.Optional(n.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Ea}))}),response:wf});var cX=`/${"v1"}/aggregation`,uX=`/${"v2"}/aggregation`,pX=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),lX=n.Object({results:n.Array(n.Object({...pX.properties,value:n.Number({description:"Aggregated value for this query or formula and group, over the full time range."})},{title:"ScalarResult"}),{description:"One aggregated value per query or formula and group."})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."}),xNe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(lX,{examples:[xNe]});var hA=n.Object({series:n.Array(n.Object({...pX.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:n.Number({description:"Aggregated value at this timestamp."})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"One time series per query or formula and group."})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."}),ONe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(hA,{examples:[ONe]});var dX=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),mX="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",fX=n.Object({results:n.Array(n.Object({group:dX,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${mX}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),ANe={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(fX,{examples:[ANe]});var yA=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:dX,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${mX}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),CNe={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(yA,{examples:[CNe]});var RNe=n.Omit(XE.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),PNe=n.Optional(Ac),gX={timeRange:Jr,queries:n.Array(RNe,{maxItems:fA,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'}),groupBy:PNe,dataSource:ci},hX={...gX,formula:n.Optional(Ql)},yX={...gX,timeRange:Oo,formulas:n.Optional(n.Array(p({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},Fi=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),EX=n.Object(hX,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),UNe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(EX,{examples:[UNe]});var SX=n.Object(yX,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),TX={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(SX,{examples:[TX]});var EA=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${cX}/multi-query/scalar`,method:"POST",body:EX,query:Fi,response:lX}),RMt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${uX}/multi-query/scalar`,method:"POST",body:SX,query:Fi,response:fX}),_X=n.String({...mA,maxLength:Mi,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),IX=n.Object({...hX,aggregationWindow:_X},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),wNe={timeRange:{from:1782201500,to:1782203400},aggregationWindow:"1m",dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(IX,{examples:[wNe]});var bX=n.Object({...yX,aggregationWindow:_X},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),vNe={...TX,aggregationWindow:"1m"};Object.assign(bX,{examples:[vNe]});var SA=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${cX}/multi-query/timeseries`,method:"POST",body:IX,query:Fi,response:hA}),PMt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${uX}/multi-query/timeseries`,method:"POST",body:bX,query:Fi,response:yA});var NNe="x-tsuga-session-id",g0="x-tsuga-source",h0="x-tsuga-source-version",y0="x-tsuga-source-commit",E0="x-tsuga-source-date",S0="x-tsuga-rationale",LNe="x-tsuga-dashboard-id",kNe="x-tsuga-widget-id",MNe="x-tsuga-widget-slot",DNe="x-request-id",wMt={[NNe]:"Session identifier for request correlation",[g0]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[h0]:"SDK version",[y0]:"SDK commit hash",[E0]:"SDK commit date",[S0]:"Optional caller-supplied rationale for this request, recorded for telemetry",[LNe]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[kNe]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[MNe]:"Identifies which of a multi-query widget's queries this request is for, such as `col-0` for the first column of a table",[DNe]:"Unique identifier for this API request, useful for debugging and support"};var FNe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],xX=L(function*(e,t,r,o,i){let{body:a,params:s,query:u}=o,l=r.url??(r.buildUrl&&s?r.buildUrl(s):void 0),m=FNe.find(g=>g===r.method);return l===void 0||m===void 0?yield*new ha({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):lx(m)(J5(`${e}${l}`,u),{headers:{Accept:"application/json","User-Agent":$Ne(t),[g0]:t,[h0]:"1.145.0",[y0]:"ee8785c699",[E0]:"2026-11-04T15:00:28.806Z",...i},...a?{body:hL(a)}:{}})});function $Ne(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.145.0 (${process.platform}; node ${process.versions.node})`}var GNe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],BNe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","investigation","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","tag-policy","team","user-data","user-invitation","user-permissions"],T0=["log","metric","trace","rum"],_0=[...BNe,...T0],jNe=[...GNe,..._0];var Qu=["admin","public_editor","public_viewer","teams_only"],_A=[...Qu,"custom"],$i=["admin","editor","viewer"];var Xl="/v0/team-membership",I0="Role granted to the user inside this team. `admin` gives full team control, including managing assets, members, and settings. `editor` can view and update most team assets (dashboards, monitors, etc.) but cannot manage members or settings. `viewer` can view team data but cannot make changes.",ZE=n.Object({id:n.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:n.String({description:"User ID that belongs to the team."}),teamId:n.String({description:"Team ID that contains the user."}),roleKey:n.Enum($i,{description:I0})}),IA=n.Object({userId:p({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:p({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum($i,{description:I0})}),b0=n.Object({userId:p({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:p({allowEmpty:!1,description:"Team ID to remove the user from."})}),qNe=n.Optional(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),jMt=f({tags:["access-control"],url:Xl,method:"GET",query:qNe,response:n.Array(ZE)}),qMt=f({tags:["access-control"],url:Xl,method:"POST",body:IA,response:ZE}),HMt=f({tags:["access-control"],url:Xl,method:"PUT",body:IA,response:ZE}),KMt=f({tags:["access-control"],url:Xl,method:"DELETE",body:b0,response:B}),TA=500,bA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum($i,{description:I0})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:TA,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),HNe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(bA,{examples:[HNe]});var xA=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk add result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),KNe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(xA,{examples:[KNe]});var zMt=f({tags:["access-control"],url:`${Xl}/bulk-add`,method:"POST",body:bA,response:xA}),YMt=f({tags:["access-control"],url:`${Xl}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:TA}),teamId:p({allowEmpty:!1}),role:n.Enum($i)}),response:n.Object({})}),OA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:TA,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:n.Optional(n.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:TA,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}],description:"Bulk team-membership removal request. Provide one target team and either `userIds` or `userEmails`, not both, with no duplicates."}),zNe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(OA,{examples:[zNe]});var AA=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk remove result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),YNe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(AA,{examples:[YNe]});var VMt=f({tags:["access-control"],url:`${Xl}/bulk-remove`,method:"DELETE",body:OA,response:AA});var VNe={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"span-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},"audit-log-stream-destination":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},WNe={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"span-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},QNe={user:VNe,team:WNe};function x0(e){return OX(e,"team")}function O0(e){return OX(e,"user")}function OX(e,t){let r=[],o=QNe[t];for(let[i,a]of Object.entries(o))for(let[s,u]of Object.entries(a))u.includes(e)&&r.push({actionType:s,resourceType:i});return r}var XNe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:O0("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:O0("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:O0("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},eDt=Object.values(XNe).map(e=>({value:e.roleKey,label:e.name,description:e.description})),tDt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:x0("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:x0("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:x0("viewer"),roleKey:"viewer"}};var rDt=new Set(_0);var ZNe={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},JNe=Object.entries(ZNe),nDt=new Map(JNe.flatMap(([e,t])=>t?[[t,e]]:[]));var cDt=[hf,qu,qu.replace(`${oe}.`,"")];var A0=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],C0=["light","dark"];var eLe={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},AX=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var fDt=eLe.light.red.background;var CX=2,RX=2;var PX=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
273
+ `)}var Nve={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function Lve(e){let t=T7(e);return t===null?"":h7(t)}function kve(e){let t=T7(e);return t===null?"":s0(t).replace(/[\\\t\r\n]/g,r=>Nve[r]??r)}function T7(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var mn=class e extends Qe()("common-cli/OutputFormatter"){static layer=Qi(e)(_7("rows"));static pageLayer=Qi(e)(_7("page"))};function _7(e){return{rows:(t,r)=>pt(function*(){let o=r.fields??(yield*Rf),i=r.output??((yield*qE)?"pretty":"json");if(i==="json")yield*e==="page"?xe({data:t,metadata:r.metadata},o):ya(t,o);else if(i==="pretty")yield*e7(t,{...r,fields:o});else{let a=S7(i,t,o??r.defaultFields);a.length>0&&(yield*Le(a))}})}}var cs=class extends Qe()("GlobalFlags"){},I7=Ie("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var b7="__tsuga_cluster_id__",Mve=n.Object({}),Dve=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function Uf(e=Mve){let t=D("status",[n.Object({...e.properties,status:n.Literal("ok")}),Dve]);return Object.assign(Kx(oi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var Fve=5,Ic=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:Fve,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var x7=n.Object({type:n.Literal("number"),number:n.String()}),$ve=n.Object({type:n.Literal("string"),string:n.String()}),Gve=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),KE=D("type",[x7,$ve,Gve]),Bve=n.Object({by:n.Record(n.String(),KE),computed:n.Record(n.String(),x7)}),jve=n.Object({type:n.Literal("buckets"),buckets:n.Array(Bve),clusterResponses:n.Optional(Uf())}),qve=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),wf=D("type",[jve,qve]);var c0=["all","owning-team-and-public","owning-team-only"],Ea=n.Enum(c0,{description:"`all` allows the resource to query all permitted telemetry, `owning-team-and-public` limits it to the owning team plus public data, and `owning-team-only` limits it to the owning team."});var A7=1456444800,C7=4927737600,Hve=A7*1e3,Kve=C7*1e3,sA=1704067200,cA=sA+3600,R7=sA*1e3,P7=cA*1e3,U7={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:sA,to:cA}]},zve={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:R7,to:P7}]},Vl=(e,t=sA)=>n.Integer({description:e,examples:[t],minimum:A7,maximum:C7,format:"int64"}),O7=(e,t=R7)=>n.Integer({description:e,examples:[t],minimum:Hve,maximum:Kve,format:"int64"}),Cr=n.Object({from:n.Optional(Vl("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(Vl("End of the query window as a Unix timestamp in seconds",cA))},U7),Jr=n.Object({from:Vl("Start of the query window as a Unix timestamp in seconds"),to:Vl("End of the query window as a Unix timestamp in seconds",cA)},U7),Oo=n.Object({from:O7("Start of the query window as a Unix timestamp in milliseconds"),to:O7("End of the query window as a Unix timestamp in milliseconds",P7)},zve);var bc="/v0/logs";var uA=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var zE=0,u0=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0,description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),message:n.Optional(n.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:n.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:n.Enum(uA,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[b7]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),v7=100,Yve="timestamp",Vu=n.Partial(n.Object({...Cr.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:zE,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:zE}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${zE} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Ic,sortBy:p({allowEmpty:!1,default:Yve,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:pe,useCanopy:n.Boolean()})),L0t=f({tags:["logs"],url:`${bc}/count`,method:"GET",query:n.Pick(Vu,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(Uf())})}),YE=n.Object({value:n.String(),priority:n.Number()}),k0t=f({tags:["logs"],url:`${bc}/search`,method:"GET",query:Vu,response:n.Object({logs:n.Optional(n.Array(u0)),attributesToHighlight:n.Optional(n.Array(YE)),clusterResponses:n.Optional(Uf(n.Object({nextStartOffset:n.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),Vve=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),N7=n.Object({id:n.String(),pattern:n.Array(Vve),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),p0=n.Object({...Cr.properties,query:p({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(p({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),M0t=f({tags:["logs"],url:`${bc}/patterns`,method:"GET",query:p0,response:n.Object({patterns:n.Array(N7),sampleSize:n.Number()})}),L7=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(uA)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),D0t=f({tags:["logs"],url:`${bc}/patterns/clusters`,method:"GET",query:p0,response:n.Object({clusters:n.Array(L7),totalVolume:n.Integer()})}),Wve=50,F0t=f({tags:["logs"],url:`${bc}/patterns/details`,method:"POST",body:n.Object({...p0.properties,clusters:n.Array(L7,{maxItems:Wve})}),response:n.Object({patterns:n.Array(N7),sampleSize:n.Number()})}),$0t=f({tags:["logs"],url:`${bc}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(Ic),useCanopy:n.Optional(n.Boolean()),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(Uf())})});var k7="timestamp";var w7=`${k7}_iso`;var Qve=["pending","running","completed","incomplete","failed"],M7=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(Qve,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:n.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:n.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:n.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:n.Optional(n.String({description:"Why the export is incomplete or failed."}))}),G0t=f({tags:["logs"],url:`${bc}/exports`,method:"POST",body:n.Object({...n.Pick(Vu,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(p({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${k7}\` also writes a \`${w7}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:Dl,description:`IANA timezone the \`${w7}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...M7.properties,downloadUrl:n.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),B0t=f({tags:["logs"],url:`${bc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:M7}),j0t=f({tags:["logs"],url:`${bc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:p({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var xc="/v0/metrics",Xve=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(uA)},{additionalProperties:!0}),W0t=f({tags:["metrics"],url:`${xc}/count`,method:"GET",query:n.Pick(Vu,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),Q0t=f({tags:["metrics"],url:`${xc}/search`,method:"GET",query:Vu,response:n.Object({logs:n.Optional(n.Array(Xve)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(YE))},{additionalProperties:!0})}),pA=n.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),lA=n.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),l0=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],D7=n.Enum(l0,{description:"Type and temporality of one variant of a metric. The same metric name can be reported under several kinds, for instance by two services instrumented differently."}),F7=n.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),$7=n.Array(n.String(),{description:"Team values observed on this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no team statistics for the metric yet."}),dA=n.Number({description:"Estimated number of distinct series for this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no statistics for the metric yet."}),Zve=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),Jve=n.Object({capabilities:n.Optional(n.Array(n.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. If this field is omitted or empty, all aggregate types are supported."})),description:n.Optional(n.String({description:"Human-readable description of the metric"})),tags:n.Optional(n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:n.Optional(lA),type:n.Optional(pA),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(F7),teams:n.Optional($7),seriesCardinality:n.Optional(dA),attributeCardinalities:n.Optional(Zve)}),X0t=f({url:`${xc}/metadata`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),kind:n.Optional(D7),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Jve}),Z0t=f({tags:["metrics"],url:xc,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),G7=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:D7,type:pA,temporality:n.Optional(lA),lastSeen:n.Optional(F7),teams:n.Optional($7),seriesCardinality:n.Optional(dA)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),eNe=[{name:"http.server.request.duration",kind:"cumulative-histogram",type:"histogram"},{name:"http.server.request.duration",kind:"delta-histogram",type:"histogram"},{name:"http.server.active_requests",kind:"gauge",type:"gauge"},{name:"http.server.request.count",kind:"delta-counter",type:"counter"}];Object.assign(G7,{examples:[eNe]});var J0t=f({tags:["metrics"],url:`${xc}/names-and-types`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:G7}),VE=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),tNe=["service","env","host","method","status_code"];Object.assign(VE,{examples:[tNe]});var eMt=f({tags:["metrics"],url:`${xc}/attributes`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:VE}),tMt=f({tags:["metrics"],url:`${xc}/attributes/batch`,method:"GET",query:n.Object({...Cr.properties,metricNames:n.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:VE}),d0=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:n.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:n.String({description:"Display name of the referencing dashboard or monitor."}),owner:n.String({description:"Team ID that owns the referencing dashboard or monitor."})},{description:"A dashboard or monitor that queries this metric."}),{description:"Dashboards and monitors that currently query this metric."})}),rMt=f({tags:["metrics"],url:`${xc}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1})}),response:d0}),nMt=f({url:`${xc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:p(),clusterId:n.Optional(p({allowEmpty:!1}))}),response:n.Array(n.String())});var oNe="/v0/aggregation",iNe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),QE=n.Object({parallelism:n.Number(),engine:iNe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),m0=["logs","metrics","traces"];var q7={logs:"Logs",metrics:"Metrics",traces:"Spans"},aNe=[...m0,"connections","log-patterns","spans","rum"];var gMt={...q7,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},us=[...m0,"rum"];var hMt={...q7,rum:"RUM events"};var yMt=n.Enum(aNe,{description:"Data source being queried"}),EMt=n.Enum(m0,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),ci=n.Enum(us,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Wl=n.String({description:"Attribute containing the values to aggregate"}),vf=p({description:"Attribute containing the values to aggregate"}),sNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Wl)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Wl},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Wl},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Wl},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Wl},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Wl},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Wl,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),cNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(p({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:vf},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:vf},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:vf},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:vf},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:vf},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:vf,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),H7=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),K7=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),z7=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),Y7=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),V7=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),W7=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),Q7=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),X7=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),Z7=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),uNe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),pNe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),lNe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),dNe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),mNe=D("type",[H7,K7,z7,Y7,V7,uNe,W7,Q7,X7,lNe,Z7],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),fNe=D("type",[H7,K7,z7,Y7,V7,pNe,W7,Q7,X7,dNe,Z7],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var B7=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),gNe=["linear","log"],WE=n.Enum(gNe,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),hNe=1e3,j7=n.Integer({minimum:1,maximum:hNe}),mA={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},yNe=D("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...mA,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(p()),bucketCount:n.Optional(j7),bounds:n.Optional(B7),boundsScale:n.Optional(WE),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...mA,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(p()),bucketCount:n.Optional(j7),bounds:n.Optional(B7),boundsScale:n.Optional(WE)},{title:"Heatmap",description:"Returns a distribution per time window"})]),fA=15,SMt=128*1024,ENe=["zero","null"],SNe=n.Enum(ENe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),J7=n.Object({mode:n.Object({type:SNe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),TNe=["avg","sum","min","max","last"],eX=n.Enum(TNe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var tX=n.Enum(l0,{description:"Variant of the metric in `aggregate.field` to query, for metric names reported under several kinds (for instance both cumulative and delta). When omitted, Tsuga picks one variant by type and temporality precedence."}),rX={aggregate:sNe,functions:n.Optional(n.Array(mNe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(J7),timeAggregate:n.Optional(eX),metricKind:n.Optional(tX)},nX={aggregate:cNe,functions:n.Optional(n.Array(fNe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(J7),timeAggregate:n.Optional(eX),metricKind:n.Optional(tX)},_Ne={description:"Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order."},oX={minItems:1,maxItems:fA,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},iX=n.Array(n.Object({...rX,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),_Ne),XE=n.Array(n.Object({...nX,filter:n.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),oX),Oc=n.Array(n.Object({...rX,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),Wu=n.Array(n.Object({...nX,filter:p({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{...oX,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),aX=n.Array(n.Omit(Wu.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:fA,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var gA=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Ql=p({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),INe=n.Object({fields:n.Array(n.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:n.Number({description:'Maximum number of distinct values of `fields` returned for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated, not merged into an "other" group.'}),sortOrder:n.Optional(pe),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),bNe=n.Object({fields:n.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:n.Optional(pe),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),sX=7;var Nf=n.Array(INe,{description:"Nested grouping levels applied to the results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values."}),Ac=n.Array(bNe,{maxItems:sX,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var TMt=f({tags:["aggregation"],url:`${oNe}/multi-query`,method:"POST",body:n.Object({timeRange:Oo,queries:XE,groupBy:n.Optional(Ac),returnType:yNe,dataSource:ci,formula:Ql,executionOptions:QE,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1})),clusterIds:n.Optional(Ic),viewAs:n.Optional(n.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Ea}))}),response:wf});var cX=`/${"v1"}/aggregation`,uX=`/${"v2"}/aggregation`,pX=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),lX=n.Object({results:n.Array(n.Object({...pX.properties,value:n.Number({description:"Aggregated value for this query or formula and group, over the full time range."})},{title:"ScalarResult"}),{description:"One aggregated value per query or formula and group."})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."}),xNe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(lX,{examples:[xNe]});var hA=n.Object({series:n.Array(n.Object({...pX.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:n.Number({description:"Aggregated value at this timestamp."})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"One time series per query or formula and group."})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."}),ONe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(hA,{examples:[ONe]});var dX=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),mX="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",fX=n.Object({results:n.Array(n.Object({group:dX,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${mX}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),ANe={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(fX,{examples:[ANe]});var yA=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:dX,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${mX}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),CNe={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(yA,{examples:[CNe]});var RNe=n.Omit(XE.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),PNe=n.Optional(Ac),gX={timeRange:Jr,queries:n.Array(RNe,{maxItems:fA,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'}),groupBy:PNe,dataSource:ci},hX={...gX,formula:n.Optional(Ql)},yX={...gX,timeRange:Oo,formulas:n.Optional(n.Array(p({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},Fi=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),EX=n.Object(hX,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),UNe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(EX,{examples:[UNe]});var SX=n.Object(yX,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),TX={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(SX,{examples:[TX]});var EA=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${cX}/multi-query/scalar`,method:"POST",body:EX,query:Fi,response:lX}),RMt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${uX}/multi-query/scalar`,method:"POST",body:SX,query:Fi,response:fX}),_X=n.String({...mA,maxLength:Mi,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),IX=n.Object({...hX,aggregationWindow:_X},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),wNe={timeRange:{from:1782201500,to:1782203400},aggregationWindow:"1m",dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(IX,{examples:[wNe]});var bX=n.Object({...yX,aggregationWindow:_X},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),vNe={...TX,aggregationWindow:"1m"};Object.assign(bX,{examples:[vNe]});var SA=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${cX}/multi-query/timeseries`,method:"POST",body:IX,query:Fi,response:hA}),PMt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${uX}/multi-query/timeseries`,method:"POST",body:bX,query:Fi,response:yA});var NNe="x-tsuga-session-id",g0="x-tsuga-source",h0="x-tsuga-source-version",y0="x-tsuga-source-commit",E0="x-tsuga-source-date",S0="x-tsuga-rationale",LNe="x-tsuga-dashboard-id",kNe="x-tsuga-widget-id",MNe="x-tsuga-widget-slot",DNe="x-request-id",wMt={[NNe]:"Session identifier for request correlation",[g0]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[h0]:"SDK version",[y0]:"SDK commit hash",[E0]:"SDK commit date",[S0]:"Optional caller-supplied rationale for this request, recorded for telemetry",[LNe]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[kNe]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[MNe]:"Identifies which of a multi-query widget's queries this request is for, such as `col-0` for the first column of a table",[DNe]:"Unique identifier for this API request, useful for debugging and support"};var FNe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],xX=L(function*(e,t,r,o,i){let{body:a,params:s,query:u}=o,l=r.url??(r.buildUrl&&s?r.buildUrl(s):void 0),m=FNe.find(g=>g===r.method);return l===void 0||m===void 0?yield*new ha({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):lx(m)(J5(`${e}${l}`,u),{headers:{Accept:"application/json","User-Agent":$Ne(t),[g0]:t,[h0]:"1.147.0",[y0]:"48fe074655",[E0]:"2026-11-04T16:33:29.767Z",...i},...a?{body:hL(a)}:{}})});function $Ne(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.147.0 (${process.platform}; node ${process.versions.node})`}var GNe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],BNe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","investigation","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","tag-policy","team","user-data","user-invitation","user-permissions"],T0=["log","metric","trace","rum"],_0=[...BNe,...T0],jNe=[...GNe,..._0];var Qu=["admin","public_editor","public_viewer","teams_only"],_A=[...Qu,"custom"],$i=["admin","editor","viewer"];var Xl="/v0/team-membership",I0="Role granted to the user inside this team. `admin` gives full team control, including managing assets, members, and settings. `editor` can view and update most team assets (dashboards, monitors, etc.) but cannot manage members or settings. `viewer` can view team data but cannot make changes.",ZE=n.Object({id:n.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:n.String({description:"User ID that belongs to the team."}),teamId:n.String({description:"Team ID that contains the user."}),roleKey:n.Enum($i,{description:I0})}),IA=n.Object({userId:p({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:p({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum($i,{description:I0})}),b0=n.Object({userId:p({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:p({allowEmpty:!1,description:"Team ID to remove the user from."})}),qNe=n.Optional(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),jMt=f({tags:["access-control"],url:Xl,method:"GET",query:qNe,response:n.Array(ZE)}),qMt=f({tags:["access-control"],url:Xl,method:"POST",body:IA,response:ZE}),HMt=f({tags:["access-control"],url:Xl,method:"PUT",body:IA,response:ZE}),KMt=f({tags:["access-control"],url:Xl,method:"DELETE",body:b0,response:B}),TA=500,bA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum($i,{description:I0})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:TA,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),HNe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(bA,{examples:[HNe]});var xA=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk add result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),KNe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(xA,{examples:[KNe]});var zMt=f({tags:["access-control"],url:`${Xl}/bulk-add`,method:"POST",body:bA,response:xA}),YMt=f({tags:["access-control"],url:`${Xl}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:TA}),teamId:p({allowEmpty:!1}),role:n.Enum($i)}),response:n.Object({})}),OA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:TA,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:n.Optional(n.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:TA,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}],description:"Bulk team-membership removal request. Provide one target team and either `userIds` or `userEmails`, not both, with no duplicates."}),zNe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(OA,{examples:[zNe]});var AA=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk remove result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),YNe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(AA,{examples:[YNe]});var VMt=f({tags:["access-control"],url:`${Xl}/bulk-remove`,method:"DELETE",body:OA,response:AA});var VNe={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"span-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},"audit-log-stream-destination":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},WNe={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"span-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},QNe={user:VNe,team:WNe};function x0(e){return OX(e,"team")}function O0(e){return OX(e,"user")}function OX(e,t){let r=[],o=QNe[t];for(let[i,a]of Object.entries(o))for(let[s,u]of Object.entries(a))u.includes(e)&&r.push({actionType:s,resourceType:i});return r}var XNe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:O0("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:O0("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:O0("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},eDt=Object.values(XNe).map(e=>({value:e.roleKey,label:e.name,description:e.description})),tDt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:x0("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:x0("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:x0("viewer"),roleKey:"viewer"}};var rDt=new Set(_0);var ZNe={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},JNe=Object.entries(ZNe),nDt=new Map(JNe.flatMap(([e,t])=>t?[[t,e]]:[]));var cDt=[hf,qu,qu.replace(`${oe}.`,"")];var A0=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],C0=["light","dark"];var eLe={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},AX=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var fDt=eLe.light.red.background;var CX=2,RX=2;var PX=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
274
274
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
275
275
  Ks14IReLcYgADhoXk56ZzXI=
276
276
  -----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],tLe=PX.map(e=>e.key);var _Dt=new Set(tLe),IDt=PX.map(e=>e.key);var rLe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function R0(e){return e.replace(/[&<>"']/g,t=>rLe[t]??t)}var MDt={[FO]:zO,[FO.replace(`${oe}.`,"")]:zO,[$O]:KO,[$O.replace(`${oe}.`,"")]:KO,[qu]:hf,[qu.replace(`${oe}.`,"")]:hf},DDt={[zO]:FO,[KO]:$O,[hf]:qu};function UX(e,t){let r={};for(let[o,i]of Object.entries(e))t.includes(o)||(r[o]=i);return r}function wX(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var nLe=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_pattern_signature","alert_previous_status","alert_priority","alert_start_time","alert_status","alert_tags","alert_timeframe","alert_title","alert_transition","alert_triggered_by","dashboard_url","monitor_url"],oLe=["alert_queries","alert_thresholds","alert_values"],iLe=["alert_event_name","alert_message"],lFt=new Set([...nLe,...iLe]),dFt=new Set(oLe);var P0={aws:"aws",gcp:"gcp",azure:"azure"},Xu=[P0.aws,P0.gcp,P0.azure];var vX=n.Object({id:n.String({description:"Unique Tsuga cluster ID. Tsuga assigns it when the cluster record is created. Use this value as `clusterId` with public API requests that accept `clusterId`."}),name:n.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:n.Optional(n.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:n.Enum(Xu,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:n.String({description:"Cloud region selected for the cluster using the provider region identifier."})},{$id:"Cluster",description:"Tsuga cluster available to the organization. Use its `id` to scope public API requests that accept `clusterId`."}),NX="clusterId must be provided when the organization has multiple clusters",aLe={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(vX,{examples:[aLe]});var CA=f({description:"Lists Tsuga clusters available to the organization. Use cluster IDs with public API requests that accept `clusterId`, such as telemetry, service, Kubernetes Explorer, and quality-report requests.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(vX)});function Lf(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function RA(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString(),refreshToken:e.refreshToken}}var U0=require("node:os"),Zl=require("node:path");var PA=e=>e.reason._tag==="NotFound";var LX=new Set(["api.tsuga.com","api.tsuga-staging.com"]),sLe=new Set(["localhost","127.0.0.1","[::1]"]);function kX(e){let t=e.replace(/\/+$/,"");if(!URL.canParse(t))return F(new _c({message:`TSUGA_API_URL is not a URL: ${t}`}));if(/[\s"'\\]/.test(t))return F(new _c({message:`TSUGA_API_URL holds whitespace, quotes or a backslash: ${JSON.stringify(t)}`}));let r=new URL(t);return r.protocol!=="http:"&&r.protocol!=="https:"?F(new _c({message:`TSUGA_API_URL must use HTTP or HTTPS: ${t}`})):!sLe.has(r.hostname)&&(r.protocol!=="https:"||!LX.has(r.hostname))?F(new _c({message:`Refusing to send credentials to ${t}. Set TSUGA_API_URL to ${[...LX].map(o=>`https://${o}`).join(", ")}, or a localhost URL.`})):A(t)}var JE="https://api.tsuga.com",cLe=un({operationApiKey:St(ye),userAuth:St(aA)}),MX=un({operationApiKey:St(ye),userAuth:St(aA),credentials:St(Ob(ye,cLe)),defaults:St(Ob(ye,ye)),telemetry:St(Vv)}),DX=un({lastUpdateCheck:St(ye)}),uLe=Lo(Pi(MX)),pLe=Lo(Pi(DX)),lLe=dl(Pi(MX,{space:2})),dLe=dl(Pi(DX)),w0=["from","to","query","max-results","cluster"],FX={from:"-30m",to:"now",query:"*","max-results":"100"};function mLe(e){let{operationApiKey:t,userAuth:r,...o}=e;return!t&&!r?e:{...o,credentials:{...e.credentials,[JE]:{...t?{operationApiKey:t}:{},...r?{userAuth:r}:{},...e.credentials?.[JE]}}}}function $X(e,t){let r=[`API URL: ${e.apiUrl}`],{credential:o}=e;if(o){let a=o.kind;switch(a){case"operation-api-key":r.push(`Operation API key: ${o.token.slice(0,12)}...${o.token.slice(-4)}`);break;case"user-session":r.push(`User session: ${Lf(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Pt(a)}}else r.push("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");r.push(`Config: ${t}`),r.push(""),r.push("Defaults (custom overrides marked with *):");let i={...FX,...e.defaults};for(let[a,s]of Object.entries(i)){let u=a in e.defaults?" *":"";r.push(` ${a}: ${s}${u}`)}return`${r.join(`
@@ -280,7 +280,7 @@ Fix its permissions and retry; the CLI will not overwrite a config it cannot rea
280
280
  `,{mode:384})}),E=L(function*(S,_){let I=S.credentials?.[_]??{};if(I.operationApiKey)return I;let b=yield*r.read(_);return b?{...I,userAuth:b}:I}),h=(S,_,I)=>({...S,credentials:{...S.credentials,[I]:_}}),T=v("config.storeUserAuth")(function*(S,_){let I=yield*g,b=yield*l,{operationApiKey:N}=I.credentials?.[b]??{},M=_&&N?{operationApiKey:N}:{};return(yield*r.save(b,S))?(yield*y(h(I,M,b)),r.location):(yield*y(h(I,{...M,userAuth:S},b)),a)});return{configPath:a,resolveApiUrl:l,resolve:L(function*(S){let _=yield*m,I=yield*l,N=S.operationApiKey??o.operationApiKey?{}:yield*E(_,I),M=f7({flagKey:S.operationApiKey,environmentKey:o.operationApiKey,operationApiKey:N.operationApiKey,userAuth:N.userAuth});yield*Qs({[t8]:M===void 0?"none":M.kind==="user-session"?"user_session":`operation_api_key_${M.source}`,[r8]:yield*t.exists(a).pipe(ti(()=>!1))});let R=_.defaults??{},$=S.clusterId?.trim()||o.clusterId||R.cluster?.trim()||void 0;return{apiUrl:I,credential:M,clusterId:$,defaults:R}}),getUserAuth:pt(function*(){let S=yield*m,_=yield*l;return(yield*E(S,_)).userAuth}),saveUserAuth:S=>T(S,!1),saveRefreshedUserAuth:S=>T(S,!0).pipe(Ks),saveOperationApiKey:v("config.saveOperationApiKey")(function*(S){let _=yield*g,I=yield*l;yield*y(h(_,{operationApiKey:S},I))}),clearUserAuth:pt(function*(){let S=yield*l,_=yield*g,{operationApiKey:I}=_.credentials?.[S]??{},b=yield*r.remove(S);if(yield*y(h(_,I?{operationApiKey:I}:{},S)),!b)return yield*new Af({message:`The session is still in ${r.location}. Unlock it and run \`tsuga auth logout\` again.`})}),getDefault:L(function*(S){return((yield*g).defaults??{})[S]??FX[S]}),setDefault:v("config.setDefault")(function*(S,_){let I=yield*g,{[S]:b,...N}=I.defaults??{};yield*y({...I,defaults:_===""?N:{...N,[S]:_}})}),resetDefaults:pt(function*(){let{defaults:S,..._}=yield*g;yield*y(_)}),getTelemetryConsent:te(m,S=>S.telemetry),saveTelemetryConsent:v("config.saveTelemetryConsent")(function*(S){let _=yield*g;yield*y({..._,telemetry:S})}),getLastUpdateCheck:t.readFileString(u).pipe(H(pLe),te(S=>S.lastUpdateCheck),ti(()=>{})),saveLastUpdateCheck:v("config.saveLastUpdateCheck")(function*(S){yield*t.makeDirectory(s,{recursive:!0,mode:448});let _=yield*dLe({lastUpdateCheck:S}).pipe(An);yield*t.writeFileString(u,`${_}
281
281
  `,{mode:384})})}})}){static layer=Po(this,this.make)};var fLe="Your session expired.",gLe="Your session could not be renewed: the refresh token was already used, revoked or expired. A refresh token is single-use, so the server revokes the whole session when one is replayed.",UA=L(function*(e,t){let r=yield*sn;if(!a0(t,r))return t;let o=yield*gt,i=yield*Yu,a=(yield*o.getUserAuth.pipe(ti(()=>{})))??t;if(!a0(a,r))return a;if(!a.refreshToken)return yield*new ql({message:fLe,suggestions:["Sign in again: tsuga auth login"]});let s=yield*i.refreshTokens(e,a.refreshToken).pipe(ei("OAuthTokenError",l=>F(l.code==="invalid_grant"?new ql({message:gLe,suggestions:["Sign in again: tsuga auth login"]}):new ss({message:`Could not renew your session: ${l.message}. Retry the command.`})))),u=RA(s);return yield*o.saveRefreshedUserAuth(u).pipe(So(l=>Hn(`Warning: could not save the renewed session (${l.message}). Run \`tsuga auth login\` before the next command.`))),u});var oS=require("node:crypto");var v0={kind:n.Enum(["doc","api"],{description:"`doc` for documentation pages (guides, references, release notes); `api` for API-reference endpoints indexed from the OpenAPI spec. Use this to decide how to present or follow up on the result."}),path:n.String({description:"Path identifying the result. Documentation pages use a slug path (e.g. `data-collection/guides/how-to-add-resource-attributes`). API-reference results use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:n.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:n.Optional(n.String({description:'For documentation pages: the heading path inside the page that matched (e.g. "Language setup"). For API results: the matched field or parameter breadcrumb (e.g. "Body \u203A queries"). Absent when the match is the page or endpoint intro.'})),tab:n.Optional(n.String({description:'Tab label inside the page that the result matched. Set when the matching content is inside a <Tabs><Tab label="\u2026"> block. Always absent for API results.'})),anchor:n.Optional(n.String({description:"For documentation pages: the slugified heading ID used as the URL fragment (e.g. `language-setup`). For API results: the Scalar deep-link fragment (`tag/<tag>/<METHOD><path>`). The `link` field already has this baked in."})),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the result in the Tsuga app. Documentation pages include the section anchor and tab query parameter when applicable. API results deep-link into the API reference at `/documentation/api#tag/\u2026`."})},hLe=n.Object({...v0,breadcrumb:n.Array(n.String(),{description:'Heading path inside the page that matched, followed by the tab label when the match is inside a <Tabs><Tab label="\u2026"> block. Empty for a page intro or endpoint-level match.'})}),N$t=f({tags:["docs"],url:"/v0/docs/search",method:"GET",query:n.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."}),limit:n.Optional(n.Integer({minimum:1,maximum:50,description:"Maximum number of results to return."}))}),response:n.Array(hLe)});var GX=`/${"v1"}/docs`,BX=n.Object({path:n.String({description:"Path identifying the page. Documentation pages use a slug path (e.g. `getting-started/send-your-first-logs`). API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:n.String({description:'Title of the page (e.g. "Send your first logs" or "POST /v1/aggregation/multi-query/scalar")'}),content:n.String({description:"Raw markdown content of the page"})},{$id:"DocPage",description:"A documentation or API-reference page with its raw markdown content"}),yLe={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
282
282
  ...`};Object.assign(BX,{examples:[yLe]});var jX=n.Object(v0,{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),ELe={kind:"doc",path:"data-collection/guides/how-to-add-resource-attributes",title:"How to Add Resource Attributes",subsection:"Set resource attributes by language",tab:"Python",anchor:"set-resource-attributes-by-language",score:.9,excerpt:"...Python SDK setup should use the default resource detectors...",link:"https://www.app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign(jX,{examples:[ELe]});var qX=f({description:"Retrieve the raw markdown content of a documentation or API-reference page by its path or link. Documentation pages use slug paths (e.g. `getting-started/send-your-first-logs`); API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`).",operationId:"getDocPage",tags:["public","docs"],url:GX,method:"GET",query:n.Object({path:p({allowEmpty:!1,description:"Page to fetch: a doc slug path, `api/<operationId>`, or a docs link with or without its host. A `/documentation/<path>` link returns the whole page, ignoring `?tab=` and `#anchor`; an API-reference link `/documentation/api#tag/<tag>/<METHOD><path>` returns that operation's page."})},{description:"Documentation page lookup query."}),response:BX}),wA=f({description:"Searches public documentation pages and API-reference endpoints. Use this to build help search or route users to Tsuga docs and API reference results. Results are ranked by relevance; an empty array means no page or endpoint matched the query.",operationId:"searchDocs",tags:["public","docs"],url:`${GX}/search`,method:"GET",query:n.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:n.Array(jX)});var eS=`/${"v1"}/logs`,N0=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."}))},{additionalProperties:!0,$id:"LogContext",description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),...n.Pick(u0,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),SLe={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(N0,{examples:[SLe]});var HX=n.Object({query:n.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3,default:v7,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...Jr.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),TLe={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(HX,{examples:[TLe]});var tS=f({description:"Searches logs in a required time range using Tsuga query syntax. Use this endpoint to retrieve raw log events for investigations or automation. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${eS}/search`,method:"GET",query:HX,response:n.Object({logs:n.Array(N0,{description:"Log events matching the query and time range."})})}),_Le=n.Object({pattern:n.String({description:"Clustered log pattern formatted as a readable string."}),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:n.String({description:"Value of the attribute identified by `key`, common to all logs in the pattern."})},{description:"Attribute key-value pair that is constant across every log matching this pattern, e.g. a shared `level` or `context.team`."}))}),KX=n.Object({patterns:n.Array(_Le,{description:"Log patterns clustered from logs matching the query."}),sampleSize:n.Number({description:"Sum of the returned patterns' `size` values. It is not the number of logs matching the query: logs outside the returned patterns are not counted."})},{}),ILe={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:37004};Object.assign(KX,{examples:[ILe]});var zX=f({description:"Clusters matching logs into readable patterns for the requested time range. Use this to summarize common log shapes before drilling into raw events. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${eS}/patterns`,method:"GET",query:n.Object({...Jr.properties,query:p({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:KX}),bLe=n.Object({exampleLog:n.Optional(N0),team:n.String({description:"Team associated with the new error pattern."}),env:n.String({description:"Environment associated with the new error pattern."}),service:n.String({description:"Service associated with the new error pattern."}),firstSeen:n.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:n.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),YX=n.Object({newErrorPatterns:n.Array(bLe,{description:"Error patterns first seen in the requested time range."})},{}),xLe={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:1704067200,lastSeen:1704153600,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(YX,{examples:[xLe]});var VX=f({description:"Finds error patterns first seen in the requested time range, optionally filtered by team, environment, or service. Use this to detect newly appearing failures. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${eS}/patterns/new`,method:"GET",query:n.Object({...Jr.properties,team:n.Optional(p({description:"Team name to restrict pattern detection to."})),env:n.Optional(p({description:"Environment to restrict pattern detection to."})),service:n.Optional(p({description:"Service name to restrict pattern detection to."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:YX}),OLe=n.Object({team:n.String({description:"Team associated with the error pattern. Set from the log context used during pattern analysis. Returned for every pattern increase."}),env:n.String({description:"Environment associated with the error pattern. Set from the log context used during pattern analysis. Returned for every pattern increase."}),pattern:n.String({description:"Readable representation of the grouped error log pattern. Generated by Tsuga from matching log messages and returned for every pattern increase."}),increaseTimestamps:n.Array(n.Number({description:"Unix timestamp in milliseconds of a detected spike in this pattern. Tsuga computes these timestamps during pattern-increase analysis; one entry is returned for each spike in the requested time range."}))}),WX=n.Object({errorPatternIncreases:n.Array(OLe,{description:"Error patterns with increased occurrence in the requested time range."})},{}),ALe={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(WX,{examples:[ALe]});var QX=f({description:"Finds error patterns whose occurrence increased for a team in the requested time range. Use this to identify growing failure modes without retrieving raw log events. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${eS}/patterns/increase`,method:"GET",query:n.Object({...Jr.properties,team:p({allowEmpty:!1,description:"Team name to analyze for pattern increases. Required; match it to the `context.team` value on the logs you want Tsuga to inspect."}),env:n.Optional(p({allowEmpty:!1,description:"Environment to restrict the analysis to. Optional; match it to the `context.env` value on the logs, or omit it to analyze all environments for the team."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:WX}),XX=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),CLe={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(XX,{examples:[CLe]});var RLe=n.Object({...Jr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively, e.g. `k8s` or `http.status`."}))},{description:"Log attribute discovery query. Provide a time range, an optional cluster ID, and an optional search text."}),ZX=f({description:"Lists log attribute dot-paths observed in the requested time range. This endpoint requires a public API credential that can read all relevant teams because attribute discovery is not team-filtered. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${eS}/attributes`,method:"GET",query:RLe,response:XX});var PLe=n.Union([n.Literal("scalar"),n.Literal("timeseries")]),ULe="/v0/promql",vA=n.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:Oo,step:p({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:n.Optional(PLe),executionOptions:QE,shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster to target. Mutually exclusive with `clusterIds`. Defaults to the first cluster created in the organization when both are omitted."})),clusterIds:n.Optional(Ic)}),wLe={query:'rate({"otel.trace.span_processor.spans"}[5m])',timeRange:{from:17822015e5,to:17822034e5},step:"1m",executionOptions:{parallelism:1,engine:"q"},clusterId:"cluster-abc"};Object.assign(vA,{examples:[wLe]});var t1t=f({tags:["promql"],url:ULe,method:"POST",body:vA,response:wf});var vLe=`/${"v1"}/promql`,NLe=`/${"v2"}/promql`,JX=n.Object({...n.Pick(vA,["query","step"]).properties,timeRange:Jr},{description:"PromQL range-query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:1782201500,to:1782203400},step:"1m"}]}),eZ=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to query. Set by the client as the clusterId query parameter, not in the JSON body. Required when the organization has multiple clusters; omit only for single-cluster organizations. Unknown cluster IDs return 404."}))}),NA=f({description:"Runs a PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:vLe,method:"POST",body:JX,query:eZ,response:hA}),LLe=n.Object({...JX.properties,timeRange:Oo},{description:"PromQL range-query request with the time range in milliseconds. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:17822015e5,to:17822034e5},step:"1m"}]}),p1t=f({description:"Runs a PromQL range query over Tsuga metric data and returns one shared time axis in milliseconds with one series per group aligned to it. Same request and authentication as `POST /v1/promql`, with `timeRange` in milliseconds. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromqlV2",tags:["public","promql"],url:NLe,method:"POST",body:LLe,query:eZ,response:yA});var Jl="/v0/traces",y1t=f({tags:["traces"],url:`${Jl}/count`,method:"GET",query:n.Pick(Vu,["from","to","query","clusterId","useCanopy"]),response:n.Object({count:n.Number()})}),kLe=["unset","ok","error"],MLe=n.Enum(kLe),DLe=["unspecified","internal","server","client","producer","consumer"],FLe=n.Enum(DLe),nZ=n.Object({__tsuga_metadata__:n.Optional(n.Object({},{additionalProperties:!0})),context:n.Optional(n.Object({telemetry:n.Optional(n.Object({sdk:n.Optional(n.Object({language:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String())),service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0})),env:n.Optional(n.String())},{additionalProperties:!0})),parent_span_id:n.Optional(n.String()),resource_attributes:n.Object({},{additionalProperties:!0}),span_attributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),duration_ns:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:n.Optional(n.Array(n.Object({},{additionalProperties:!0}))),span_id:n.String(),span:n.Object({kind:FLe,name:n.String()}),status_code:n.Optional(MLe),trace_id:n.String()}),oZ=100;var $Le={...Cr.properties,query:n.Optional(p({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:n.Optional(n.Boolean()),startOffset:n.Optional(n.Number({minimum:zE})),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:n.Optional(p({allowEmpty:!1,description:"Attribute to sort by. Attributes other than `start_time` sort numerically; spans where the attribute is missing or not a number come last."})),sortDirection:n.Optional(pe),useCanopy:n.Optional(n.Boolean())},E1t=f({tags:["traces"],url:`${Jl}/search`,method:"GET",query:n.Object($Le),response:n.Object({spans:n.Optional(n.Array(nZ)),attributesToHighlight:n.Optional(n.Array(YE))})}),GLe=n.Object({groupByAttributes:n.Array(p({allowEmpty:!1}),{description:'Glob patterns of span_attributes keys to use as additional grouping dimensions (e.g. "db.*"). Matches against flattened dotted keys of span_attributes only.'}),minLeafSpansToAggregate:n.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:n.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:n.Array(n.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:n.Boolean({description:"Whether to sort the returned spans by start_time (span_id tie-breaker). Set false when the caller reconstructs the trace tree and does not need ordering. Default true."})}),BLe=n.Object({...Cr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...n.Partial(GLe).properties}),S1t=f({tags:["traces"],url:`${Jl}/summarize`,method:"GET",query:BLe,response:n.Object({spans:n.Array(nZ)})}),T1t=f({tags:["traces"],url:`${Jl}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String())})}),jLe=n.Object({key:n.String({description:"Opaque stable key identifying this contributing service within the response. Tsuga assigns it while building the summary; `ranges[].contributions[].serviceKey` and `serviceTotals[].serviceKey` reference this value."}),name:n.String({description:"Observed service name that contributed leaf-span time to the trace. Comes from trace service context and is returned for every contributing service."}),env:n.Optional(n.String({description:"Observed service environment for this contributing service. Comes from trace service context and is absent when the spans do not carry an environment."})),id:n.Optional(n.String({description:"Service catalog ID for this contributing service. Tsuga sets it when exactly one catalog entry matches the observed service and environment; absent when the service is not cataloged or matches ambiguously."})),namespace:n.Optional(n.String({description:"Service namespace from the matched service catalog entry. Returned only when Tsuga can resolve the contributing service to one catalog entry with a namespace."}))}),qLe=n.Object({fromNs:n.String({description:"Range start time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),toNs:n.String({description:"Range end time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),durationNs:n.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:n.Array(n.Object({serviceKey:n.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:n.Number({description:"Share of this range attributed to the service, from `0` through `1`, computed from active leaf spans in the range. Weights in one range sum to `1`, except on a range merged from shorter ones: each pairwise merge truncates to the microsecond grid, so the loss grows with the number of merges, a few parts in 10,000 on a typical trace but well below `1` after a long run of very short adjacent ranges. `serviceTotals` carries the same loss."}),durationNs:n.String({description:"Estimated duration attributed to this service in the range, computed as `weight` times the range's own `durationNs` and rounded to whole nanoseconds. Use `serviceTotals` as authoritative when rounded range values do not add up exactly."})}),{description:"Services contributing active leaf-span time to this range, with weighted shares for the range duration."}),spanIds:n.Array(n.String(),{description:"Leaf span IDs that produced this range. Tsuga returns IDs from the leaf-only attribution set, including merged sub-ranges after short-range collapsing."})}),HLe=n.Object({serviceKey:n.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:n.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of `weight * durationNs` over every range the service contributes to; authoritative when it disagrees with rounded per-range values. Transmitted as a string to avoid losing precision."}),share:n.Number({description:"Share of total trace duration attributed to this service, `durationNs / totalDurationNs`, from `0` through `1`. Shares sum to less than `1` because time where no span was running is credited to no service, and because of the merge truncation described on `ranges[].contributions[].weight`, which is the whole shortfall on a trace with no gap."})}),L0=n.Optional(n.Number({minimum:0,description:"Minimum range duration in milliseconds. Shorter ranges are collapsed (absorbed into a neighbor or blended with adjacent shorts) to keep the timeline readable. When omitted, the default depends on the trace: max(1ms, 1% of the total trace duration), so e.g. a 10s trace collapses ranges shorter than 100ms. Pass 0 to disable collapsing."})),k0=n.Optional(n.Boolean({default:!0,description:"When false, omits the per-range timeline (returns `ranges: []`) and returns only `services` and `serviceTotals`. Cuts payload size for callers that only need the headline. Defaults to true."})),LA=n.Object({traceId:n.String({description:"Trace ID summarized by the response. Echoes the required `traceId` query parameter."}),startTimeNs:n.String({description:"Earliest `start_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true start. Transmitted as a string to avoid losing precision."}),endTimeNs:n.String({description:"Latest `end_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true end. Transmitted as a string to avoid losing precision."}),totalDurationNs:n.String({description:"Total fetched trace duration in nanoseconds, computed as `endTimeNs - startTimeNs`. Transmitted as a string to avoid losing precision."}),truncated:n.Boolean({description:"Whether the underlying span fetch hit its result cap. When true, the latency summary may be incomplete because not every span in the trace was available."}),services:n.Array(jLe,{description:"Unique services that contributed leaf-span time to the trace, enriched with catalog IDs when Tsuga can resolve them. Referenced by `serviceKey` from `ranges` and `serviceTotals`."}),ranges:n.Array(qLe,{description:"Sequential trace timeline split into ranges wherever the active leaf-span set changes. Empty when the request sets `includeRanges` to false."}),serviceTotals:n.Array(HLe,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),KLe={traceId:"78c99c5bb1e4a30297fa134b9dbec64f",startTimeNs:"1704067200000000000",endTimeNs:"1704067202400000000",totalDurationNs:"2400000000",truncated:!1,services:[{key:'["checkout","prod"]',name:"checkout",env:"prod",id:"123-456-abc",namespace:"default"},{key:'["payments","prod"]',name:"payments",env:"prod",id:"456-789-def",namespace:"default"}],ranges:[{fromNs:"1704067200000000000",toNs:"1704067201200000000",durationNs:"1200000000",contributions:[{serviceKey:'["checkout","prod"]',weight:1,durationNs:"1200000000"}],spanIds:["3df8cc3449378f66"]},{fromNs:"1704067201200000000",toNs:"1704067202400000000",durationNs:"1200000000",contributions:[{serviceKey:'["checkout","prod"]',weight:.5,durationNs:"600000000"},{serviceKey:'["payments","prod"]',weight:.5,durationNs:"600000000"}],spanIds:["187a47da1b2560f8","3df8cc3449378f66"]}],serviceTotals:[{serviceKey:'["checkout","prod"]',durationNs:"1800000000",share:.75},{serviceKey:'["payments","prod"]',durationNs:"600000000",share:.25}]};Object.assign(LA,{examples:[KLe]});var _1t=f({tags:["traces"],url:`${Jl}/latency-summary`,method:"GET",query:n.Object({...Cr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:L0,includeRanges:k0}),response:LA}),zLe=n.Object({traceId:n.String(),spanId:n.String()}),I1t=f({tags:["traces"],url:`${Jl}/span-backlinks`,method:"GET",query:n.Object({...Cr.properties,traceId:p({allowEmpty:!1,description:"Trace ID referenced by span links"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({backlinks:n.Array(n.Object({spanId:n.String(),references:n.Array(zLe)})),truncated:n.Boolean()})}),tZ=n.Object({filter:p({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:Oo}),YLe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number()}),VLe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),WLe=n.Object({attr:n.String(),values:n.Array(VLe),otherValues:n.Array(YLe)}),rZ=n.Object({contrastSets:n.Array(WLe),targetGroupCount:n.Number(),baselineGroupCount:n.Number(),failedAttributeCount:n.Number()}),QLe=D("type",[n.Object({type:n.Literal("snapshot"),response:rZ}),n.Object({type:n.Literal("done"),response:rZ}),n.Object({type:n.Literal("error"),message:n.String()})]),XLe=n.Object({targetGroup:tZ,baselineGroup:tZ,candidateAttrs:n.Optional(n.Array(p({allowEmpty:!1}))),topK:n.Optional(n.Integer({minimum:1,maximum:100})),minLift:n.Optional(n.Number({minimum:1})),minSupport:n.Optional(n.Number({minimum:0,maximum:100})),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),b1t=f({tags:["traces"],url:`${Jl}/contrast-sets/stream`,method:"POST",body:XLe,response:QLe});var kA=`/${"v1"}/traces`,M0=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String({description:"Service name associated with the span."})),version:n.Optional(n.String({description:"Service version associated with the span."}))},{additionalProperties:!0,description:"Service identity associated with the span, from OpenTelemetry service resource attributes."}))},{additionalProperties:!0,description:"OpenTelemetry resource context resolved for the span, holding the identity of the emitting service."})),parent_span_id:n.Optional(n.String({description:"`span_id` of this span's parent within the same trace. Empty or absent for a root span."})),resource_attributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry resource attributes describing the process/host that emitted the span (e.g. `host.name`, `k8s.pod.name`), as a flat key-value map set by the instrumented service or its SDK."}),span_attributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry span attributes describing this operation (e.g. HTTP method, DB statement), as a flat key-value map set by the instrumented code or auto-instrumentation."}),duration:n.Number({description:"Span duration in milliseconds, derived from the nanosecond `start_time` and `end_time` values."}),duration_ns:n.String({description:"Span duration in nanoseconds, encoded as a string to preserve precision."}),start_time:n.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),end_time:n.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:n.Optional(n.Object({message:n.String({description:"OpenTelemetry span status description set by the instrumentation, such as the exception message."})},{description:"OpenTelemetry span status description. `message` is set only when `status_code` is `error` and the instrumentation recorded a description."})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0,description:"Key-value attributes recorded with this event, set by the instrumented code when the event was added to the span (e.g. exception details)."}),event_name:n.String({description:"Name of the span event."}),event_timestamp_nanos:n.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),links:n.Optional(n.Array(n.Object({},{additionalProperties:!0}),{description:"OpenTelemetry span links to related spans, possibly in other traces."})),span_id:n.String({description:"Unique span ID within the trace."}),span:n.Object({kind:n.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:n.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),status_code:n.Optional(n.String({description:"OpenTelemetry span status set by the instrumented code: `unset` (default, no explicit status), `ok`, or `error`. Absent if the source span never set a status."})),trace_id:n.String({description:"Trace ID shared by all spans in the trace."})},{additionalProperties:!0,$id:"SpanEvent",description:"Distributed tracing span including timing, identifiers, OpenTelemetry attributes, events, and status metadata."}),ZLe={context:{service:{name:"my-service",version:"1.0.0"}},parent_span_id:"187a47da1b2560f8",resource_attributes:{},span_attributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,duration_ns:"23995900",start_time:"1770923469995353600",end_time:"1770923470019349500",span_id:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},status_code:"ok",trace_id:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(M0,{examples:[ZLe]});var JLe={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},sZ=n.Object({...Jr.properties,query:n.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4,default:oZ,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Span search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(sZ,{examples:[JLe]});var rS=f({description:"Searches spans in a required time range using Tsuga query syntax. Use this endpoint to retrieve trace spans for investigations or automation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${kA}/search`,method:"GET",query:sZ,response:n.Object({spans:n.Array(M0,{description:"Spans matching the query and time range."})})}),eke={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},cZ=n.Object({...Jr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Glob patterns of span attribute keys to use as additional grouping dimensions. Use this when spans should be summarized separately for matching attributes, such as `db.*`. Matches flattened dotted span attribute keys; omitted by default."})),minLeafSpansToAggregate:n.Optional(n.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before Tsuga replaces them with one synthetic summary span. Use higher values for less aggressive summarization. Optional; defaults to 5 and must be at least 2."})),maxParentDepth:n.Optional(n.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation after leaf spans are summarized. Use this to limit parent-level aggregation. Use `0` to aggregate leaf spans only or `-1` for unlimited depth; defaults to `-1`."})),aggregationHistogramBucketsSeconds:n.Optional(n.Array(n.Number({minimum:0}),{description:"Upper-bound bucket values, in seconds, for the latency histogram recorded on synthetic summary spans. Provide custom buckets when the default latency buckets are not suitable. Pass an empty array to omit histogram attributes; omitted values use Tsuga defaults from 5 ms through 10 s."})),sortSpans:n.Optional(n.Boolean({default:!0,description:"Whether Tsuga sorts returned spans by start time, using span ID as the tie-breaker for identical start times. Defaults to `true`; set to `false` only when reconstructing the trace tree yourself, in which case summary spans are appended after surviving spans."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(cZ,{examples:[eke]});var uZ=f({description:"Summarizes a trace by aggregating groups of similar spans into synthetic summary spans, producing a compact view of large traces. Summary spans are marked with `span_attributes.aggregation.is_summary` and carry span counts, duration statistics, and an optional latency histogram. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${kA}/summarize`,method:"GET",query:cZ,response:n.Object({spans:n.Array(M0,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `span_attributes.aggregation.is_summary`."})})}),tke={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},pZ=n.Object({...Jr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:L0,includeRanges:k0},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(pZ,{examples:[tke]});var lZ=f({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${kA}/latency-summary`,method:"GET",query:pZ,response:LA}),iZ=e=>n.Object({filter:p({type:"tsuga-query",description:`Tsuga query selecting the ${e} spans. Terms are ANDed by whitespace, as in \`context.service.name:checkout status_code:error\`.`}),timeRange:Jr},{description:`The ${e} group: a Tsuga query and the time range it is evaluated over.`}),dZ=n.Object({targetGroup:iZ("target"),baselineGroup:iZ("baseline"),candidateAttrs:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:20,description:"Span attribute dot-paths to test, such as `context.service.name` or `span_attributes.http.route`. Attributes referenced by either group filter, and their known sibling attributes for the same field, are always excluded, so the contrasted condition does not come back as a finding. Omit or pass an empty array to let Tsuga test the attributes among `span_attributes.*`, `context.*`, `span.name`, `span.kind`, `status_code` and `is_root` that take more than one value across samples of both groups, most frequent in the target first; when none varies, `contrastSets` is empty. Span duration (`duration_ns`, even when named here) and discovered numeric attributes with near-unique values never appear in `contrastSets`."})),topK:n.Optional(n.Integer({minimum:1,maximum:100,description:"Maximum number of findings to return, strongest first. A finding is one attribute/value pair, and findings are grouped into one `contrastSets` entry per attribute, so a result carries at most this many `values` rows across possibly fewer entries. Valid values are 1 through 100. Defaults to 10."})),minLift:n.Optional(n.Number({minimum:1,description:"Minimum lift a value must reach to be reported as a finding. Lift is the value's coverage of the target group divided by its coverage of the baseline, so `2` keeps only values at least twice as frequent in the target. Raise it to cut weak findings. Defaults to 1.5."})),minSupport:n.Optional(n.Number({minimum:0,maximum:100,description:"Support floor as a percentage: a value is reported as a finding only when it covers at least this much of the target group or of the baseline group. Valid values are 0 through 100. Raise it to drop findings that explain only a handful of spans. Defaults to 0.5."}))},{description:"Contrast-set request. Provide the target group to explain and the baseline to compare it against, plus optional significance tuning. Send `clusterId` as a query parameter, not in the JSON body."}),rke={targetGroup:{filter:"context.service.name:checkout status_code:error",timeRange:{from:1704067200,to:1704070800}},baselineGroup:{filter:"context.service.name:checkout NOT status_code:error",timeRange:{from:1704067200,to:1704070800}}};Object.assign(dZ,{examples:[rke]});var aZ={value:n.String({description:"The attribute value this row is about."}),targetSupport:n.Number({description:"Percentage of target spans carrying this value, from 0 to 100."}),baselineSupport:n.Number({description:"Percentage of baseline spans carrying this value, from 0 to 100."})},nke=n.Object({attr:n.String({description:"Span attribute dot-path this contrast set is about, such as `context.env`."}),values:n.Array(n.Object({...aZ,lift:n.Optional(n.Number({description:"`targetSupport / baselineSupport`: how many times more frequent the value is in the target group. Absent when the value never appears in the baseline, which makes the lift unbounded."})),pValue:n.Number({description:"Probability that a difference this large would occur if the value were unrelated to the split. Smaller is stronger."})},{title:"ContrastSetValue"}),{description:"Values over-represented in the target group that cleared the lift, support, and significance gates, strongest first. These are the findings."}),otherValues:n.Array(n.Object(aZ,{title:"ContrastSetOtherValue"}),{description:"The attribute's other frequent values in the target group, by target percentage descending, as context for reading `values`. Never overlaps `values`."})},{title:"ContrastSet"}),mZ=n.Object({contrastSets:n.Array(nke,{description:"One entry per attribute that separates the two groups, strongest first. An attribute with the same value strings as a stronger entry is left out, so two boolean attributes appear as one entry. Empty when nothing cleared the gates, which means the target and the baseline look alike on the attributes tested."}),targetGroupCount:n.Number({description:"Number of spans matched by the target group filter over its time range. Not a sample: it is a plain count over the whole group."}),baselineGroupCount:n.Number({description:"Number of spans matched by the baseline group filter over its time range. Not a sample: it is a plain count over the whole group."}),failedAttributeCount:n.Number({description:"Number of candidate attributes Tsuga dropped because a query for them failed. Those attributes were not tested at all, so a high count next to an empty `contrastSets` means the comparison was incomplete, not that the two groups are alike."})}),oke={contrastSets:[{attr:"span_attributes.http.route",values:[{value:"/checkout/pay",targetSupport:82.4,baselineSupport:11.7,lift:7.04,pValue:1e-4}],otherValues:[{value:"/checkout/cart",targetSupport:9.1,baselineSupport:44.2}]}],targetGroupCount:1240,baselineGroupCount:8760,failedAttributeCount:2};Object.assign(mZ,{examples:[oke]});var fZ=f({description:'Compares a target group of spans against a baseline group and returns the attribute values that are over-represented in the target. Use it to answer "what do these spans have in common that the others do not": erroring spans against healthy ones for a service, slow spans against normal-latency ones, or the same spans before and after a deployment. Each group carries its own time range, so a before/after comparison is one call. See [Traces](/documentation/explore/traces).',operationId:"findContrastSets",tags:["public","traces"],url:`${kA}/contrast-sets`,method:"POST",body:dZ,query:Fi,response:mZ});function hZ(e,t){let r=[],o=gZ(t);for(let i=0;i<e.length;i+=1){let a=e[i];if(a===void 0||a==="--")break;if(a.startsWith("-")){a.includes("=")||(i+=1);continue}let s=o.get(a);if(s===void 0)break;r.push(a),o=gZ(s)}return r.join(" ")}function gZ(e){let t=new Map;for(let r of e.subcommands)for(let o of r.commands)t.set(o.name,o);return t}var Cc=(e,t)=>r=>dt(r,o=>new Nn({message:`Could not ${e} ${t}: ${o.message}`})),kf=v("fs.writeAtomic")(function*(e,t){let r=yield*Xr,o=`${e}.tmp.${process.pid}`;yield*r.writeFileString(o,t).pipe(Cc("write",o)),yield*r.rename(o,e).pipe(Cc("write",e))}),Mf=v("fs.readOrUndefined")(function*(e){return yield*(yield*Xr).readFileString(e).pipe(hj(PA,()=>De),aI({onSuccess:r=>r??void 0,onFailure:r=>new Nn({message:`Could not read ${e}: ${r.message}`})}))}),Df=v("fs.backupIfExists")(function*(e,t,r){if(t===void 0)return;let o=yield*Xr,i=`${e}.bak.${r.replaceAll(":","-")}`;return yield*o.writeFileString(i,t).pipe(Cc("back up",e)),i});function ui(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var MA=v("fs.parseJsonObject")(function*(e,t){let r=yield*ike(t).pipe(dt(()=>new Nn({message:`${e} is not valid JSON. Fix or remove it before re-running.`})));return ui(r)?r:yield*new Nn({message:`${e} must contain a JSON object at the top level.`})}),ike=IK(Pi(cc)),DA=v("fs.formatJsonFile")(function*(e){return`${yield*ake(e).pipe(An)}
283
- `}),ake=dl(Pi(cc,{space:2}));var ske=dl(Pi(cc)),iS={traceId:(0,oS.randomBytes)(16).toString("hex"),spanId:(0,oS.randomBytes)(8).toString("hex")};function F0(e,t,r){if(e===wA)return Array.isArray(r)?{[p8]:r.length}:{};let o=e===tS||e===rS,i=e===EA,a=e===NA;if(!(o||i||a||e===SA))return{};let s=t.query??{},u=ui(t.body)?t.body:{},l=ui(r)?r:{},m=o?s:ui(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?l.logs??l.spans:i?l.results:l.series,h=Array.isArray(l.series)?l.series:void 0,T=e===tS?"logs":e===rS?"traces":a?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...T===void 0?{}:{[n8]:T},[o8]:o?"search":i?"scalar":a?"promql":"timeseries",...typeof m.from=="number"&&typeof m.to=="number"?{[i8]:m.to-m.from}:{},...o?{[Mk]:s.query!==void 0&&s.query!=="*"}:{},...o||a?{}:{[Mk]:g.some(S=>ui(S)&&typeof S.filter=="string"&&S.filter.length>0),[a8]:y.reduce((S,_)=>S+(ui(_)&&Array.isArray(_.fields)?_.fields.length:0),0)},...Array.isArray(E)?{[s8]:E.length}:{},...h===void 0?{}:{[c8]:h.length,[u8]:h.reduce((S,_)=>S+(ui(_)&&Array.isArray(_.points)?_.points.length:0),0)}}}var nS=[],D0=class extends ch{get traceId(){return iS.traceId}end(t,r){super.end(t,r),nS.push({name:this.name.slice(0,200),kind:this.kind,[Hu]:this.spanId,[Fl]:En(this.parent,{onNone:()=>iS.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:nu(r)&&!Bs(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let a=Eke(i);return a===void 0?[]:[[o.slice(0,200),a]]}).slice(0,Xk))}),nS.length>Qk&&nS.shift()}},EZ=jP({span:e=>new D0(e)});function cke(e,t,r){if(ho(e))return{...t,[is]:Ar.success};if(Bs(e.cause))return{...t,[is]:rA(r),[$l]:"Interrupted",...r===void 0?{}:{[jO]:r}};let o=tu(e.cause);if(oA(o))return{...t,[is]:Ar.usage,[$l]:"Usage"};if(nA(o)){let i="statusCode"in o?o.statusCode:void 0,a=o._tag==="ApiError"?o.code:void 0;return{...t,[is]:tA(o),[$l]:o._tag,...i===void 0?{}:{[GO]:i},...a===void 0?{}:{[BO]:a}}}return{...t,[is]:Ar.failure,[$l]:"Unhandled"}}var uke=new Set(["-o","--output"]),SZ=[["CLAUDECODE","claude-code"],["CLAUDE_CODE_SESSION_ID","claude-code"],["CODEX_THREAD_ID","codex"],["CODEX_SESSION_ID","codex"],["OPENCODE","opencode"],["GEMINI_CLI","gemini-cli"],["CLINE_ACTIVE","cline"],["AGENT","agent"],["AI_AGENT","agent"]],pke=[...SZ.map(([e])=>e),"CI"],lke=Pm(Object.fromEntries(pke.map(e=>[e,Di(e)]))).pipe(An);function dke(e,t,r){let o=e.findIndex(l=>l.startsWith("-")),i=o===-1?[]:e.slice(o,o+Wk).map(l=>l.slice(0,_f)),a;for(let[l,m]of e.entries()){if(m==="--")break;let[g,y]=m.split("=",2);if(g!==void 0&&uke.has(g)){let E=y??e[l+1];a=Vk.find(h=>h===E)}}let s=SZ.find(([l])=>t[l])?.[1]??(t.CI?"ci":r?"terminal":"script"),u=mke(s,t);return{...i.length>0?{[gf]:i}:{},...a===void 0?{}:{[$E]:a},[GE]:s,...u===void 0?{}:{[qO]:u}}}function mke(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,oS.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var TZ=L(function*(e,t,r,o){let i=yield*sn;return yield*e.pipe(Ws(a=>fke(a,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),fke=v("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*qs([e0,lke,sn]),a=cke(e,{[DE]:hZ(t.argv,t.root),[FE]:i-t.startedAt,...dke(t.argv,o,r)},t.receivedSignal?.());if(!(yield*gke(a)))return;let s=yield*(yield*gt).resolveApiUrl,u={...a,[LE]:"1.145.0",[ME]:process.platform==="win32"?"windows":process.platform,[kE]:process.versions.node,[ju]:iS.traceId,[Hu]:iS.spanId},l=yke(t.startedAt),m=yield*ske(l.length>0?{...u,spans:l}:u).pipe(An),g=yield*Ri(process.execPath,["-e",_ke,`${s}${z8.url}`,Ske(m,u)],{detached:!0,windowsHide:!0,stdin:"ignore",stdout:"ignore",stderr:"ignore"});yield*Ks(g.unref)},e=>e.pipe(Zn,zs)),gke=L(function*(e){let t=yield*$0;if(t!==void 0)return t;let r=yield*gt,o=yield*r.getTelemetryConsent;if(o!==void 0)return o;if(!(yield*e0)||e[is]!==0)return!1;yield*Hn(hke);let i=yield*to(My({message:"Send usage data?"}));return yield*r.saveTelemetryConsent(i),i}),$0=Di("TSUGA_TELEMETRY").pipe(fl(e=>e===void 0?void 0:["1","true"].includes(e.toLowerCase())),An),hke="\nHelp improve the Tsuga CLI by sending usage data.\nChange it later with `tsuga config set telemetry on|off`.";function yke(e){let t=new Set(nS.map(r=>r[Hu]));return nS.map(({startTimeMs:r,...o})=>({...o,[Fl]:t.has(o[Fl])?o[Fl]:iS.spanId,start_offset_ms:Math.max(0,r-e)}))}function Eke(e){if(typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="bigint")return Number(e);if(typeof e=="string")return e.slice(0,_f);try{return JSON.stringify(e)?.slice(0,_f)}catch{return}}var yZ=process.platform==="win32"?15e3:1e5;function Ske(e,t){if(Buffer.byteLength(e)<=yZ)return e;let r=JSON.stringify(t);return Buffer.byteLength(r)<=yZ?r:JSON.stringify({...t,[gf]:void 0})}var Tke=()=>{let[e="",t=""]=process.argv.slice(1);fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:t,signal:AbortSignal.timeout(1e4)}).catch(()=>{})},_ke=`(${Tke.toString()})()`;function _Z(e){return e.message.includes(NX)}var IZ=["Choose a default cluster: tsuga config set default cluster --value <CLUSTER_ID>","Override it for one command: tsuga --cluster <CLUSTER_ID> <COMMAND>","Set an environment override: export TSUGA_CLUSTER_ID=<CLUSTER_ID>"];function bZ(e){let t=e.map(r=>` ${r.id} ${r.friendlyName??r.name}`);return t.length>0?["","Available clusters:",...t].join(`
283
+ `}),ake=dl(Pi(cc,{space:2}));var ske=dl(Pi(cc)),iS={traceId:(0,oS.randomBytes)(16).toString("hex"),spanId:(0,oS.randomBytes)(8).toString("hex")};function F0(e,t,r){if(e===wA)return Array.isArray(r)?{[p8]:r.length}:{};let o=e===tS||e===rS,i=e===EA,a=e===NA;if(!(o||i||a||e===SA))return{};let s=t.query??{},u=ui(t.body)?t.body:{},l=ui(r)?r:{},m=o?s:ui(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?l.logs??l.spans:i?l.results:l.series,h=Array.isArray(l.series)?l.series:void 0,T=e===tS?"logs":e===rS?"traces":a?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...T===void 0?{}:{[n8]:T},[o8]:o?"search":i?"scalar":a?"promql":"timeseries",...typeof m.from=="number"&&typeof m.to=="number"?{[i8]:m.to-m.from}:{},...o?{[Mk]:s.query!==void 0&&s.query!=="*"}:{},...o||a?{}:{[Mk]:g.some(S=>ui(S)&&typeof S.filter=="string"&&S.filter.length>0),[a8]:y.reduce((S,_)=>S+(ui(_)&&Array.isArray(_.fields)?_.fields.length:0),0)},...Array.isArray(E)?{[s8]:E.length}:{},...h===void 0?{}:{[c8]:h.length,[u8]:h.reduce((S,_)=>S+(ui(_)&&Array.isArray(_.points)?_.points.length:0),0)}}}var nS=[],D0=class extends ch{get traceId(){return iS.traceId}end(t,r){super.end(t,r),nS.push({name:this.name.slice(0,200),kind:this.kind,[Hu]:this.spanId,[Fl]:En(this.parent,{onNone:()=>iS.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:nu(r)&&!Bs(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let a=Eke(i);return a===void 0?[]:[[o.slice(0,200),a]]}).slice(0,Xk))}),nS.length>Qk&&nS.shift()}},EZ=jP({span:e=>new D0(e)});function cke(e,t,r){if(ho(e))return{...t,[is]:Ar.success};if(Bs(e.cause))return{...t,[is]:rA(r),[$l]:"Interrupted",...r===void 0?{}:{[jO]:r}};let o=tu(e.cause);if(oA(o))return{...t,[is]:Ar.usage,[$l]:"Usage"};if(nA(o)){let i="statusCode"in o?o.statusCode:void 0,a=o._tag==="ApiError"?o.code:void 0;return{...t,[is]:tA(o),[$l]:o._tag,...i===void 0?{}:{[GO]:i},...a===void 0?{}:{[BO]:a}}}return{...t,[is]:Ar.failure,[$l]:"Unhandled"}}var uke=new Set(["-o","--output"]),SZ=[["CLAUDECODE","claude-code"],["CLAUDE_CODE_SESSION_ID","claude-code"],["CODEX_THREAD_ID","codex"],["CODEX_SESSION_ID","codex"],["OPENCODE","opencode"],["GEMINI_CLI","gemini-cli"],["CLINE_ACTIVE","cline"],["AGENT","agent"],["AI_AGENT","agent"]],pke=[...SZ.map(([e])=>e),"CI"],lke=Pm(Object.fromEntries(pke.map(e=>[e,Di(e)]))).pipe(An);function dke(e,t,r){let o=e.findIndex(l=>l.startsWith("-")),i=o===-1?[]:e.slice(o,o+Wk).map(l=>l.slice(0,_f)),a;for(let[l,m]of e.entries()){if(m==="--")break;let[g,y]=m.split("=",2);if(g!==void 0&&uke.has(g)){let E=y??e[l+1];a=Vk.find(h=>h===E)}}let s=SZ.find(([l])=>t[l])?.[1]??(t.CI?"ci":r?"terminal":"script"),u=mke(s,t);return{...i.length>0?{[gf]:i}:{},...a===void 0?{}:{[$E]:a},[GE]:s,...u===void 0?{}:{[qO]:u}}}function mke(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,oS.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var TZ=L(function*(e,t,r,o){let i=yield*sn;return yield*e.pipe(Ws(a=>fke(a,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),fke=v("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*qs([e0,lke,sn]),a=cke(e,{[DE]:hZ(t.argv,t.root),[FE]:i-t.startedAt,...dke(t.argv,o,r)},t.receivedSignal?.());if(!(yield*gke(a)))return;let s=yield*(yield*gt).resolveApiUrl,u={...a,[LE]:"1.147.0",[ME]:process.platform==="win32"?"windows":process.platform,[kE]:process.versions.node,[ju]:iS.traceId,[Hu]:iS.spanId},l=yke(t.startedAt),m=yield*ske(l.length>0?{...u,spans:l}:u).pipe(An),g=yield*Ri(process.execPath,["-e",_ke,`${s}${z8.url}`,Ske(m,u)],{detached:!0,windowsHide:!0,stdin:"ignore",stdout:"ignore",stderr:"ignore"});yield*Ks(g.unref)},e=>e.pipe(Zn,zs)),gke=L(function*(e){let t=yield*$0;if(t!==void 0)return t;let r=yield*gt,o=yield*r.getTelemetryConsent;if(o!==void 0)return o;if(!(yield*e0)||e[is]!==0)return!1;yield*Hn(hke);let i=yield*to(My({message:"Send usage data?"}));return yield*r.saveTelemetryConsent(i),i}),$0=Di("TSUGA_TELEMETRY").pipe(fl(e=>e===void 0?void 0:["1","true"].includes(e.toLowerCase())),An),hke="\nHelp improve the Tsuga CLI by sending usage data.\nChange it later with `tsuga config set telemetry on|off`.";function yke(e){let t=new Set(nS.map(r=>r[Hu]));return nS.map(({startTimeMs:r,...o})=>({...o,[Fl]:t.has(o[Fl])?o[Fl]:iS.spanId,start_offset_ms:Math.max(0,r-e)}))}function Eke(e){if(typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="bigint")return Number(e);if(typeof e=="string")return e.slice(0,_f);try{return JSON.stringify(e)?.slice(0,_f)}catch{return}}var yZ=process.platform==="win32"?15e3:1e5;function Ske(e,t){if(Buffer.byteLength(e)<=yZ)return e;let r=JSON.stringify(t);return Buffer.byteLength(r)<=yZ?r:JSON.stringify({...t,[gf]:void 0})}var Tke=()=>{let[e="",t=""]=process.argv.slice(1);fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:t,signal:AbortSignal.timeout(1e4)}).catch(()=>{})},_ke=`(${Tke.toString()})()`;function _Z(e){return e.message.includes(NX)}var IZ=["Choose a default cluster: tsuga config set default cluster --value <CLUSTER_ID>","Override it for one command: tsuga --cluster <CLUSTER_ID> <COMMAND>","Set an environment override: export TSUGA_CLUSTER_ID=<CLUSTER_ID>"];function bZ(e){let t=e.map(r=>` ${r.id} ${r.friendlyName??r.name}`);return t.length>0?["","Available clusters:",...t].join(`
284
284
  `):""}var xZ={CLUSTER_AGGREGATION_STRUCTURE:["Compare the body with a generated one: tsuga aggregation <scalar|timeseries> --generate-skeleton"],TAG_POLICY_ALREADY_EXISTS_ERROR:["Find the existing policy ID with tsuga tag-policies list, then run tsuga tag-policies update <ID> -f policy.json"],URL_NOT_FOUND:["Update the CLI: tsuga self-update"]};function OZ(e){return e!==void 0&&Object.hasOwn(xZ,e)?xZ[e]??[]:[]}function Ike(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function bke({body:e,query:t}){let r=t?.offset??e?.offset,o=typeof r=="string"?Number(r):r;return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?o:0}var xke=un({data:St(cc),requestId:St(ye),error:St(un({message:ye,statusCode:St(pc),code:St(ye),details:St(cc),hint:St(ye),docUrl:St(ye)})),metadata:St(un({pagination:St(un({totalCount:pc,pageCount:St(pc)}))}))}),Oke=Lo(xke);function Ake(e,t,r){let o=e.metadata?.pagination,i=o===void 0?void 0:CZ(e.data);if(o===void 0||i===void 0)return;let a=t+i.length;if(!(a>=o.totalCount))return`Showing ${i.length} of ${o.totalCount} (offset ${t}). Next page: ${Cke(r,i.length,a)}`}function CZ(e){if(Array.isArray(e))return e;let t=e!==null&&typeof e=="object"?Object.values(e):[],[r]=t;return t.length===1&&Array.isArray(r)?r:void 0}function Cke(e,t,r){let o=[];for(let i=0;i<e.length;i++){let a=e[i]??"";if(a==="--operation-api-key"){o.push(a,"<OPERATION_API_KEY>"),i++;continue}if(a.startsWith("--operation-api-key=")){o.push("--operation-api-key=<OPERATION_API_KEY>");continue}if(a==="--limit"||a==="--offset"){i++;continue}a.startsWith("--limit=")||a.startsWith("--offset=")||o.push(a)}return["tsuga",...o,"--limit",String(t),"--offset",String(r)].map(Rke).join(" ")}function Rke(e){return/^[\w./:=@%+,-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Pke(e,t){let r=Math.round(t/Bl);switch(e){case 504:return new zu({message:`The API gave up on the request after ${r}s (HTTP 504): it ran longer than the gateway allows.`,statusCode:e,suggestions:["Narrow the time range or add filters to the query","Ask for fewer results"]});case 502:case 503:return new zu({message:`The API gateway could not reach the server (HTTP ${e}).`,statusCode:e,suggestions:["Retry in a few seconds"]});default:return new zu({message:`Server returned a non-JSON response (HTTP ${e}).`,statusCode:e})}}var AZ=v("api.endpoint")(function*(e,t={}){yield*Qs(F0(e,t,void 0));let{data:r,metadata:o}=t.allPages?yield*Uke(e,t):yield*RZ(e,t).pipe(ka(i=>pt(function*(){let a=Ake(i,bke(t),yield*I7);a!==void 0&&(yield*Hn(a))})));return yield*Qs(F0(e,t,r)),{data:r,metadata:o}}),Uke=L(function*(e,t){if(wke(t))return yield*new It({message:"--all cannot be combined with --limit or --offset"});let r=[];for(;;){let o=yield*RZ(e,vke(e,t,r.length)),i=CZ(o.data),a=o.metadata?.pagination?.totalCount;if(i===void 0||a===void 0)return o;if(r.push(...i),i.length===0||r.length>=a)return{data:Nke(o.data,r),metadata:{pagination:{totalCount:r.length,pageCount:1}}}}});function wke({body:e,query:t}){let r=e??{};return[t?.limit,t?.offset,r.limit,r.offset].some(o=>o!==void 0)}function vke(e,t,r){let o={limit:Bu,offset:r};return e.body!==void 0&&n.IsObject(e.body)&&"offset"in e.body.properties?{...t,body:{...t.body,...o}}:{...t,query:{...t.query,...o}}}function Nke(e,t){if(Array.isArray(e))return t;let[r]=Object.keys(e);return{[r??"data"]:t}}var RZ=L(function*(e,t){let r=yield*cs,o=yield*gt,i=yield*Ol,a=yield*o.resolve({operationApiKey:r.operationApiKey,clusterId:r.cluster}),{credential:s}=a;if(s===void 0)return yield*new Ku({message:"No credentials.",suggestions:iA});let u=s.kind==="operation-api-key"?s.token:(yield*UA(a.apiUrl,s.userAuth)).accessToken,l=r.rationale?Ike(r.rationale):"",m=yield*xX(a.apiUrl,"cli",e,a.clusterId===void 0?t:kke(e,t,a.clusterId),{Authorization:`Bearer ${u}`,...l?{[S0]:l}:{}}),g=yield*sn,y=yield*i.execute(m).pipe(dt(T=>new ss({message:`Could not reach ${a.apiUrl}`,cause:T}))),E=(yield*sn)-g,h=yield*y.json.pipe(H(Oke),dt(()=>Pke(y.status,E)));if(yield*Aj("API response").pipe(Cj({method:m.method,url:m.url,status:y.status,requestId:h.requestId})),h.error){let T=h.error.statusCode??y.status,S;T===401?S=[`Replace the rejected credential: ${s.kind==="operation-api-key"?Lke[s.source]:"tsuga auth login"}`]:T===403?S=[`Inspect your identity and permissions: ${r.operationApiKey?"tsuga --operation-api-key <OPERATION_API_KEY> auth whoami":"tsuga auth whoami"}`]:S=OZ(h.error.code);let{hint:_,docUrl:I}=h.error,b=[...S,..._?[_]:[],...I?[`See ${I}`]:[]];return yield*ha.fromErrorResponse({...h.error,...b.length>0?{suggestions:b}:{}},h.requestId)}return h}),Lke={flag:"tsuga --operation-api-key <OPERATION_API_KEY> <COMMAND>",environment:"export TSUGA_OPERATION_API_KEY=<OPERATION_API_KEY>",config:"tsuga auth operation-key <OPERATION_API_KEY>"},Qt=L(function*(e,t={}){return(yield*tt(e,t)).data}),tt=L(function*(e,t={}){return yield*AZ(e,t).pipe(ei("ApiError",r=>pt(function*(){if(!_Z(r))return yield*r;let o=yield*AZ(CA).pipe(te(i=>i.data),ti(()=>[]));return yield*ha.fromErrorResponse({message:`${r.message}${bZ(o)}`,statusCode:r.statusCode,code:r.code,details:r.details,suggestions:IZ},r.requestId)})))});function kke(e,t,r){return e.body!==void 0&&n.IsObject(e.body)&&"clusterId"in e.body.properties?{...t,body:{clusterId:r,...t.body}}:{...t,query:{clusterId:r,...t.query}}}var Mke="Provide a request body with -f <FILE_PATH> or -d <JSON>. Use --generate-skeleton to get a template.",G0=(e,t)=>lt({try:()=>JSON.parse(t),catch:r=>new It({message:`${e} is not valid JSON: ${r instanceof Error?r.message:String(r)}`})}),ed=L(function*(e){if(At(e.file)&&At(e.data))return yield*new It({message:"-f and -d cannot be combined. Provide the request body with one of them."});let t=ne(e.file);if(t!==void 0){if(t==="-"){let a=yield*bm,s=yield*Zp(a.stdin).pipe(Jp,dt(u=>new It({message:`Could not read stdin: ${u.message}`})));return yield*G0("stdin",s)}let i=yield*(yield*Xr).readFileString(t).pipe(dt(a=>new It({message:`Could not read ${t}: ${a.message}`})));return yield*G0(t,i)}let r=ne(e.data);return r!==void 0?yield*G0("--data",r):yield*new It({message:Mke})});function FA(e){return c.HasPropertyKey(e,"~refine")&&c.IsArray(e["~refine"])&&c.Every(e["~refine"],0,t=>c.IsObject(t)&&c.HasPropertyKey(t,"check")&&c.HasPropertyKey(t,"error")&&c.IsFunction(t.check)&&c.IsFunction(t.error))}function Ao(e){return c.IsObject(e)&&!c.IsArray(e)}function td(e){return c.IsBoolean(e)}function Ae(e){return Ao(e)||td(e)}function $A(e){return c.HasPropertyKey(e,"additionalItems")&&Ae(e.additionalItems)}function ps(e){return c.HasPropertyKey(e,"additionalProperties")&&Ae(e.additionalProperties)}function GA(e){return c.HasPropertyKey(e,"allOf")&&c.IsArray(e.allOf)&&e.allOf.every(t=>Ae(t))}function PZ(e){return c.HasPropertyKey(e,"$anchor")&&c.IsString(e.$anchor)}function BA(e){return c.HasPropertyKey(e,"anyOf")&&c.IsArray(e.anyOf)&&e.anyOf.every(t=>Ae(t))}function B0(e){return c.HasPropertyKey(e,"const")}function Zu(e){return c.HasPropertyKey(e,"contains")&&Ae(e.contains)}function pi(e){return c.HasPropertyKey(e,"default")}function j0(e){return c.HasPropertyKey(e,"dependencies")&&c.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>Ae(t)||c.IsArray(t)&&t.every(r=>c.IsString(r)))}function q0(e){return c.HasPropertyKey(e,"dependentRequired")&&c.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>c.IsArray(t)&&t.every(r=>c.IsString(r)))}function jA(e){return c.HasPropertyKey(e,"dependentSchemas")&&c.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>Ae(t))}function Ju(e){return c.HasPropertyKey(e,"$dynamicAnchor")&&c.IsString(e.$dynamicAnchor)}function qA(e){return c.HasPropertyKey(e,"$dynamicRef")&&c.IsString(e.$dynamicRef)}function HA(e){return c.HasPropertyKey(e,"else")&&Ae(e.else)}function H0(e){return c.HasPropertyKey(e,"enum")&&c.IsArray(e.enum)}function K0(e){return c.HasPropertyKey(e,"exclusiveMaximum")&&(c.IsNumber(e.exclusiveMaximum)||c.IsBigInt(e.exclusiveMaximum))}function Rc(e){return c.HasPropertyKey(e,"exclusiveMinimum")&&(c.IsNumber(e.exclusiveMinimum)||c.IsBigInt(e.exclusiveMinimum))}function aS(e){return c.HasPropertyKey(e,"format")&&c.IsString(e.format)}function so(e){return c.HasPropertyKey(e,"$id")&&c.IsString(e.$id)}function KA(e){return c.HasPropertyKey(e,"if")&&Ae(e.if)}function rd(e){return c.HasPropertyKey(e,"items")&&(Ae(e.items)||c.IsArray(e.items)&&e.items.every(t=>Ae(t)))}function zA(e){return rd(e)&&c.IsArray(e.items)}function z0(e){return c.HasPropertyKey(e,"maximum")&&(c.IsNumber(e.maximum)||c.IsBigInt(e.maximum))}function Y0(e){return c.HasPropertyKey(e,"maxContains")&&c.IsNumber(e.maxContains)}function YA(e){return c.HasPropertyKey(e,"maxItems")&&c.IsNumber(e.maxItems)}function V0(e){return c.HasPropertyKey(e,"maxLength")&&c.IsNumber(e.maxLength)}function W0(e){return c.HasPropertyKey(e,"maxProperties")&&c.IsNumber(e.maxProperties)}function Pc(e){return c.HasPropertyKey(e,"minimum")&&(c.IsNumber(e.minimum)||c.IsBigInt(e.minimum))}function nd(e){return c.HasPropertyKey(e,"minContains")&&c.IsNumber(e.minContains)}function Ff(e){return c.HasPropertyKey(e,"minItems")&&c.IsNumber(e.minItems)}function sS(e){return c.HasPropertyKey(e,"minLength")&&c.IsNumber(e.minLength)}function cS(e){return c.HasPropertyKey(e,"minProperties")&&c.IsNumber(e.minProperties)}function Q0(e){return c.HasPropertyKey(e,"multipleOf")&&(c.IsNumber(e.multipleOf)||c.IsBigInt(e.multipleOf))}function VA(e){return c.HasPropertyKey(e,"not")&&Ae(e.not)}function WA(e){return c.HasPropertyKey(e,"oneOf")&&c.IsArray(e.oneOf)&&e.oneOf.every(t=>Ae(t))}function uS(e){return c.HasPropertyKey(e,"pattern")&&(c.IsString(e.pattern)||e.pattern instanceof RegExp)}function $f(e){return c.HasPropertyKey(e,"patternProperties")&&c.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>Ae(t))}function od(e){return c.HasPropertyKey(e,"prefixItems")&&c.IsArray(e.prefixItems)&&e.prefixItems.every(t=>Ae(t))}function Gf(e){return c.HasPropertyKey(e,"properties")&&c.IsObject(e.properties)&&Object.values(e.properties).every(t=>Ae(t))}function QA(e){return c.HasPropertyKey(e,"propertyNames")&&(c.IsObject(e.propertyNames)||Ae(e.propertyNames))}function Dke(e){return c.HasPropertyKey(e,"$recursiveAnchor")&&c.IsBoolean(e.$recursiveAnchor)}function pS(e){return Dke(e)&&c.IsEqual(e.$recursiveAnchor,!0)}function XA(e){return c.HasPropertyKey(e,"$recursiveRef")&&c.IsString(e.$recursiveRef)}function ZA(e){return c.HasPropertyKey(e,"$ref")&&c.IsString(e.$ref)}function id(e){return c.HasPropertyKey(e,"required")&&c.IsArray(e.required)&&e.required.every(t=>c.IsString(t))}function JA(e){return c.HasPropertyKey(e,"then")&&Ae(e.then)}function X0(e){return c.HasPropertyKey(e,"type")&&(c.IsString(e.type)||c.IsArray(e.type)&&e.type.every(t=>c.IsString(t)))}function Bf(e){return c.HasPropertyKey(e,"uniqueItems")&&c.IsBoolean(e.uniqueItems)}function lS(e){return c.HasPropertyKey(e,"unevaluatedItems")&&Ae(e.unevaluatedItems)}function dS(e){return c.HasPropertyKey(e,"unevaluatedProperties")&&Ae(e.unevaluatedProperties)}var co=class{constructor(){let t=new Set,r=new Set;this.stack=[{indices:t,keys:r}]}Push(){let t=new Set,r=new Set;return this.stack.push({indices:t,keys:r}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(let r of t)r.GetIndices().forEach(o=>this.GetIndices().add(o)),r.GetKeys().forEach(o=>this.GetKeys().add(o));return!0}},Ln=class extends co{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=Gr.Get().maxErrors}AddError(t,r,o,i){return this.AddErrorObject({keyword:t,schemaPath:r,instancePath:o,params:i})}AddErrors(t){return t.forEach(r=>this.AddErrorObject(r)),!1}GetErrors(){return this.errors}AddErrorObject(t){return this.AtCapacity()||this.errors.push(t),!1}};function UZ(e,t,r,o){return c.Every(r["~refine"],0,(i,a)=>i.check(o))}function wZ(e,t,r,o,i,a){return c.EveryAll(i["~refine"],0,(s,u)=>s.check(a)||t.AddError("~refine",r,o,{index:u,message:s.error(a)}))}var mS="urn:typebox:root";function Uc(e,t){return URL.canParse(e,t)?new URL(e,t):c.IsEqual(t,mS)?new URL(`${t}:${e}`):new URL(`${t.slice(0,t.lastIndexOf(":"))}:${e}`)}function qf(e,t){let r=Ao(t)&&so(t)?Uc(t.$id,mS).href:mS;return{context:e,schema:t,lexicalSchema:t,lexicalBase:r,resourceBase:r,referenceBase:r,ids:[],useResourceBaseForReference:!0,recursiveAnchor:void 0,dynamicAnchors:[],resourceEntries:new Map,pendingResource:!0,enteredResource:!1}}function Z0(e,t,r=!0){if(td(t))return e;if(Array.isArray(t))return t.reduce((i,a)=>Z0(i,a,!1),e);if(!Ao(t)||!r&&so(t))return e;let o=!r&&Ju(t)?[...e,t]:e;return Object.keys(t).reduce((i,a)=>Z0(i,t[a],!1),o)}function fS(e,t){return e.resourceEntries.get(t)}function vZ(e,t){return e.enteredResource||fS(e,t)!==void 0}function Fke(e){return!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)}function $ke(e,t){return so(t)?[...e.ids,t]:e.ids}function Gke(e,t){return e.recursiveAnchor??(pS(t)?t:void 0)}function Bke(e,t){let r=so(t)?Z0(e.dynamicAnchors,t):e.dynamicAnchors;return Ju(t)?[...r,t]:r}function jke(e,t){return so(t)?!1:e.pendingResource}function NZ(e,t){let r=fS(e,t);return r?r.base:so(t)?Uc(t.$id,e.lexicalBase).href:e.lexicalBase}function LZ(e,t){let r=fS(e,t);return r?r.base:so(t)&&e.pendingResource?Uc(t.$id,e.resourceBase).href:e.resourceBase}function kZ(e,t){return so(t)?!Fke(t):e.useResourceBaseForReference}function qke(e,t){let r=vZ(e,t),o=kZ(e,t);return r||o?LZ(e,t):NZ(e,t)}function Hke(e,t){let r=fS(e,t);return r?r.root:so(t)?t:e.lexicalSchema}function Kke(e,t){return Ao(t)&&(so(t)||Ju(t)||c.IsUndefined(e.recursiveAnchor)&&pS(t)||!c.IsUndefined(fS(e,t)))}function Hf(e,t){return Kke(e,t)?{...e,ids:$ke(e,t),dynamicAnchors:Bke(e,t),recursiveAnchor:Gke(e,t),pendingResource:jke(e,t),lexicalBase:NZ(e,t),resourceBase:LZ(e,t),useResourceBaseForReference:kZ(e,t),referenceBase:qke(e,t),lexicalSchema:Hke(e,t),enteredResource:vZ(e,t)}:e}function MZ(e){return rd(e)&&c.IsArray(e.items)}function DZ(e,t,r,o){return MZ(r)?c.Every(o,0,(a,s)=>c.IsLessThan(s,r.items.length)||li(e,t,r.additionalItems,a)&&t.AddIndex(s)):!0}function FZ(e,t,r,o,i,a){return MZ(i)?c.Every(a,0,(u,l)=>{let m=`${r}/additionalItems`,g=`${o}/${l}`;return c.IsLessThan(l,i.items.length)||di(e,t,m,g,i.additionalItems,u)&&t.AddIndex(l)}):!0}function jo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ep(e){return new RegExp(e,"u")}function zke(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function $Z(e){let t=[];return $f(e)&&t.push(...c.Keys(e.patternProperties)),Gf(e)&&t.push(...c.Keys(e.properties).map(zke)),c.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function GZ(e,t,r,o){let i=ep($Z(r));return c.Every(c.Keys(o),0,(s,u)=>i.test(s)||li(e,t,r.additionalProperties,o[s])&&t.AddKey(s))}function BZ(e,t,r,o,i,a){let s=ep($Z(i)),u=[];return c.EveryAll(c.Keys(a),0,(m,g)=>{let y=`${r}/additionalProperties`,E=`${o}/${jo(m)}`,h=s.test(m)||di(e,t,y,E,i.additionalProperties,a[m])&&t.AddKey(m);return h||u.push(m),h})||t.AddError("additionalProperties",r,o,{additionalProperties:u})}function jZ(e,t,r,o){let i=r.allOf.reduce((a,s)=>{let u=new co;return it(e,u,s,o)?[...a,u]:a},[]);return c.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function qZ(e,t,r,o,i,a){let s=[],u=i.allOf.reduce((m,g,y)=>{let E=`${r}/allOf/${y}`,h=new Ln,T=Mt(e,h,E,o,g,a);return T||s.push(h),T?[...m,h]:m},[]),l=c.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||s.forEach(m=>t.AddErrors(m.GetErrors())),l}function HZ(e,t,r,o){let i=r.anyOf.reduce((a,s)=>{let u=new co;return it(e,u,s,o)?[...a,u]:a},[]);return c.IsGreaterThan(i.length,0)&&t.Merge(i)}function KZ(e,t,r,o,i,a){let s=[],u=i.anyOf.reduce((m,g,y)=>{let E=new Ln,h=`${r}/anyOf/${y}`,T=Mt(e,E,h,o,g,a);return T||s.push(E),T?[...m,E]:m},[]),l=c.IsGreaterThan(u.length,0)&&t.Merge(u);return l||s.forEach(m=>t.AddErrors(m.GetErrors())),l||t.AddError("anyOf",r,o,{})}function tM(e,t,r,o){return r}function zZ(e,t,r,o,i,a){return tM(e,t,i,a)||t.AddError("boolean",r,o,{})}function rM(e,t,r,o){return c.IsValueLike(r.const)?c.IsEqual(o,r.const):c.IsDeepEqual(o,r.const)}function YZ(e,t,r,o,i,a){return rM(e,t,i,a)||t.AddError("const",r,o,{allowedValue:i.const})}function Yke(e){return!(nd(e)&&c.IsEqual(e.minContains,0))}function nM(e,t,r,o){return Yke(r)?!c.IsEqual(o.length,0)&&c.SomeAll(o,(i,a)=>it(e,t,r.contains,i)&&t.AddIndex(a)):!0}function VZ(e,t,r,o,i,a){return nM(e,t,i,a)||t.AddError("contains",r,o,{minContains:1})}function WZ(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),a=c.Every(c.Entries(r.dependencies),0,([s,u])=>!c.HasPropertyKey(o,s)||(c.IsArray(u)?u.every(l=>c.HasPropertyKey(o,l)):it(e,t,u,o)));return i||a}function QZ(e,t,r,o,i,a){let s=c.IsEqual(c.Keys(a).length,0),u=c.EveryAll(c.Entries(i.dependencies),0,([l,m])=>{let g=`${r}/dependencies/${jo(l)}`;return!c.HasPropertyKey(a,l)||(c.IsArray(m)?m.every(y=>c.HasPropertyKey(a,y)||t.AddError("dependencies",r,o,{property:l,dependencies:m})):Mt(e,t,g,o,m,a))});return s||u}function XZ(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),a=c.Every(c.Entries(r.dependentRequired),0,([s,u])=>!c.HasPropertyKey(o,s)||u.every(l=>c.HasPropertyKey(o,l)));return i||a}function ZZ(e,t,r,o,i,a){let s=c.IsEqual(c.Keys(a).length,0),u=c.EveryAll(c.Entries(i.dependentRequired),0,([l,m])=>!c.HasPropertyKey(a,l)||c.EveryAll(m,0,g=>c.HasPropertyKey(a,g)||t.AddError("dependentRequired",r,o,{property:l,dependencies:m})));return s||u}function JZ(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),a=c.Every(c.Entries(r.dependentSchemas),0,([s,u])=>!c.HasPropertyKey(o,s)||it(e,t,u,o));return i||a}function eJ(e,t,r,o,i,a){let s=c.IsEqual(c.Keys(a).length,0),u=c.EveryAll(c.Entries(i.dependentSchemas),0,([l,m])=>{let g=`${r}/dependentSchemas/${jo(l)}`;return!c.HasPropertyKey(a,l)||Mt(e,t,g,o,m,a)});return s||u}var Gi={};gi(Gi,{DynamicRef:()=>x0e,RecursiveRef:()=>_0e,Ref:()=>S0e});var zf={};gi(zf,{Delete:()=>Xke,Get:()=>Wke,Has:()=>Vke,Indices:()=>hS,Set:()=>Qke});function rJ(e){throw Error(e)}function tJ(){rJ("Pointer contains unsafe property key")}function oM(){rJ("Cannot set value")}function hS(e){let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t[0]===""?t.slice(1):t}function Vke(e,t){let r=e;for(let o of hS(t)){if(!c.IsObject(r)||!c.HasPropertyKey(r,o))return!1;r=r[o]}return!0}function Wke(e,t){let r=e;for(let o of hS(t)){if(!c.IsObject(r)||c.IsUnsafePropertyKey(o))return;r=r[o]}return r}function nJ(e,t,r){let o=e;for(let i of t)c.IsUnsafePropertyKey(i)&&tJ(),o=c.IsObject(o)?o[i]:void 0;return c.IsUnsafePropertyKey(r)&&tJ(),c.IsObject(o)||oM(),o}function Qke(e,t,r){let o=hS(t),i=o.pop();return c.IsUndefined(i)&&oM(),nJ(e,o,i)[i]=r,e}function Xke(e,t){let r=hS(t),o=r.pop();c.IsUndefined(o)&&oM();let i=nJ(e,r,o);return c.IsArray(i)&&/^(0|[1-9]\d*)$/.test(o)?i.splice(Number(o),1):delete i[o],e}function sM(e,t){return Ao(e)&&so(e)?Uc(e.$id,t.href):t}function cM(e){return Uc(e,mS)}function iM(e){return e.href.split("#")[0]}function Zke(e,t,r){return aM(e,cM(t),r)}function Jke(e,t){return t.$ref.startsWith("#")||e.enteredResource?e.lexicalSchema:e.schema}function e0e(e){return e.startsWith("#/")}function oJ(e,t){if(c.IsObject(e)&&Ju(e)&&c.IsEqual(e.$dynamicAnchor,t))return e;if(c.IsObject(e))for(let r of c.Keys(e)){let o=oJ(e[r],t);if(o)return o}}function aM(e,t,r){if(c.IsEqual(e,r))return t.href;let o=sM(e,t);if(c.IsArray(e))for(let i of e){let a=aM(i,o,r);if(!c.IsUndefined(a))return a}else if(c.IsObject(e))for(let i of c.Keys(e)){let a=aM(e[i],o,r);if(!c.IsUndefined(a))return a}}function iJ(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;let r=decodeURIComponent(t.hash.slice(1));if(r.startsWith("/"))return zf.Get(e,r)}function t0e(e,t,r){if(!so(e))return;if(c.IsEqual(e.$id,r.hash))return e;let o=new URL(r.href,t.href);if(c.IsEqual(t.pathname,o.pathname))return r.hash.startsWith("#")?iJ(e,r):e}function r0e(e,t,r){if(!PZ(e))return;let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function n0e(e,t,r){if(!Ju(e))return;let o=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function o0e(e,t,r){if(Ao(e))return t0e(e,t,r)??r0e(e,t,r)??n0e(e,t,r)??iJ(e,r)}function i0e(e,t,r){if(c.IsArray(e))return e.reduce((o,i)=>{let a=eC(i,t,r);return c.IsUndefined(a)?o:a},void 0)}function a0e(e,t,r){if(c.IsObject(e))return c.Keys(e).reduce((o,i)=>{if(c.IsEqual(i,"const")||c.IsEqual(i,"enum"))return o;let a=eC(e[i],t,r);return c.IsUndefined(a)?o:a},void 0)}function eC(e,t,r){let o=sM(e,t);return o0e(e,o,r)??i0e(e,o,r)??a0e(e,o,r)}function s0e(e,t,r,o){let i=tC(e,t,r,o);return Ao(i)&&so(i)?i:void 0}function c0e(e,t,r){if(!t.$ref.startsWith("#")||!Ao(e.schema)||c.HasPropertyKey(e.schema,"$schema"))return;let o=Zke(e.lexicalSchema,e.referenceBase,r);if(!(c.IsUndefined(o)||c.IsEqual(o,e.referenceBase)))return{target:r,base:o,root:e.lexicalSchema}}function u0e(e,t,r){let o=e.context[t];if(Ao(o))return{target:r,base:t,root:o}}function p0e(e,t,r,o,i){let a=i?u0e(e,o,r):void 0;return c.IsUndefined(a)?c0e(e,t,r):a}function l0e(e,t,r){if(so(r))return;let o=s0e(e.context,e.schema,e.referenceBase,t);if(!(!o||e.ids.includes(o)))return{resource:o}}function d0e(e,t){return c.HasPropertyKey(e,t)?e[t]:void 0}function m0e(e,t,r){return eC(e,t,r)}function f0e(e,t,r){let o=iM(r);if(!c.HasPropertyKey(e,o)||c.IsEqual(o,iM(t)))return;let i=e[o],a=sM(i,new URL(o));return c.IsEqual(r.hash,"")?i:eC(i,a,r)}function tC(e,t,r,o){let i=cM(r),a=Uc(o,i.href);return d0e(e,o)??m0e(t,i,a)??f0e(e,i,a)}function g0e(e,t){if(!t)return e;let r=new Map(e.resourceEntries);return r.set(t.target,{base:t.base,root:t.root}),{...e,resourceEntries:r}}function h0e(e,t){return t?Hf(e,t.resource):e}function aJ(e,t,r,o){let i=g0e({...e,pendingResource:t},r);return h0e(i,o)}function y0e(e,t,r){let o=iM(Uc(t.$ref,e.referenceBase)),i=!c.IsEqual(o,e.resourceBase),a=p0e(e,t,r,o,i),s=i?l0e(e,o,r):void 0;return{schema:r,stack:aJ(e,!0,a,s)}}function E0e(e,t){return{schema:t,stack:aJ(e,!c.IsUndefined(t))}}function S0e(e,t){let r=tC(e.context,Jke(e,t),e.referenceBase,t.$ref);return Ao(r)?y0e(e,t,r):E0e(e,r)}function T0e(e){return Ao(e.lexicalSchema)&&pS(e.lexicalSchema)}function _0e(e,t){let r=T0e(e)?e.recursiveAnchor:e.lexicalSchema;return tC(e.context,r,e.lexicalBase,t.$recursiveRef)}function sJ(e,t){return Uc(t.$dynamicRef,cM(e.lexicalBase).href).hash}function cJ(e,t){return e.dynamicAnchors.find(r=>c.IsEqual(r.$dynamicAnchor,t))??oJ(e.schema,t)}function I0e(e,t,r){if(!Ao(r)||!Ju(r))return r;let o=sJ(e,t);return e0e(o)?r:cJ(e,r.$dynamicAnchor)}function b0e(e,t){let r=sJ(e,t);return cJ(e,decodeURIComponent(r.slice(1)))}function x0e(e,t){let r=t.$dynamicRef.startsWith("#")?e.lexicalSchema:e.schema,o=tC(e.context,r,e.lexicalBase,t.$dynamicRef);return c.IsUndefined(o)?b0e(e,t):I0e(e,t,o)}function uJ(e,t,r,o){let i=Gi.DynamicRef(e,r)??!1,a=i?{...e,pendingResource:!0}:e;return Ae(i)&&it(a,t,i,o)}function pJ(e,t,r,o,i,a){let s=Gi.DynamicRef(e,i)??!1,u=s?{...e,pendingResource:!0}:e;return Ae(s)&&Mt(u,t,r,o,s,a)}function lM(e,t,r,o){return c.Some(r.enum,i=>c.IsValueLike(i)?c.IsEqual(o,i):c.IsDeepEqual(o,i))}function lJ(e,t,r,o,i,a){return lM(e,t,i,a)||t.AddError("enum",r,o,{allowedValues:i.enum})}function dM(e,t,r,o){return c.IsLessThan(o,r.exclusiveMaximum)}function dJ(e,t,r,o,i,a){return dM(e,t,i,a)||t.AddError("exclusiveMaximum",r,o,{comparison:"<",limit:i.exclusiveMaximum})}function mM(e,t,r,o){return c.IsGreaterThan(o,r.exclusiveMinimum)}function mJ(e,t,r,o,i,a){return mM(e,t,i,a)||t.AddError("exclusiveMinimum",r,o,{comparison:">",limit:i.exclusiveMinimum})}var TS={};gi(TS,{Clear:()=>GJ,Entries:()=>mMe,Get:()=>hMe,Has:()=>gMe,IsDate:()=>Yf,IsDateTime:()=>rC,IsDuration:()=>nC,IsEmail:()=>oC,IsHostname:()=>dC,IsIPv4:()=>gC,IsIPv6:()=>hC,IsIdnEmail:()=>mC,IsIdnHostname:()=>fC,IsIri:()=>EC,IsIriReference:()=>yC,IsJsonPointer:()=>TC,IsJsonPointerUriFragment:()=>SC,IsRegex:()=>_C,IsRelativeJsonPointer:()=>IC,IsTime:()=>Vf,IsUri:()=>OC,IsUriReference:()=>bC,IsUriTemplate:()=>xC,IsUrl:()=>AC,IsUuid:()=>CC,Reset:()=>BJ,Set:()=>fMe,Test:()=>yMe});var O0e=[0,31,28,31,30,31,30,31,31,30,31,30,31],A0e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function C0e(e){return e%4===0&&(e%100!==0||e%400===0)}function Yf(e){let t=A0e.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&C0e(r)?29:O0e[o])}var R0e=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Vf(e,t=!0){let r=R0e.exec(e);if(!r||t&&!r[4]&&!r[5])return!1;let o=+r[1],i=+r[2],a=+r[3];if(o>23||i>59||a>60)return!1;if(r[5]){let g=+r[6],y=+r[7];if(g>23||y>59)return!1}if(a<60)return!0;let s=r[5]==="-"?-1:1,u=+(r[6]||0),l=+(r[7]||0);return((o*60+i-s*(u*60+l))%1440+1440)%1440===1439}var P0e=/^(?:\[!?(?:(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13}(?:\/(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13})*|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])\](?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*|(?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*)$/;function rC(e){let t=e.indexOf("["),r=t===-1?e:e.slice(0,t);if(t!==-1&&!P0e.test(e.slice(t)))return!1;let o=r.split(/T/i);return o.length===2&&Yf(o[0])&&Vf(o[1])}var U0e=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function nC(e){return U0e.test(e)}var w0e=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function oC(e){return w0e.test(e)}var fJ=/^(?!-).*(?<!-)$/,gJ=/^(?!..--)/,hJ=/^[a-zA-Z0-9-]*$/,$2t=new RegExp("^\\p{ASCII}*$","u"),Wf=/[^\p{ASCII}]/u;var v0e=/[0-9]/,yJ=/[\u{0660}-\u{0669}]/u,N0e=/[\u{06f0}-\u{06f9}]/u,L0e=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,k0e=/[\u{002d}\u{002b}]/u,fM=new RegExp("\\p{Mn}","u"),M0e=new RegExp("\\p{Mc}","u"),G2t=new RegExp("\\p{Me}","u"),EJ=/[\p{Mn}\p{Mc}\p{Me}]/u,gM=new RegExp("\\p{L}","u"),D0e=new RegExp("\\p{Nd}","u"),SJ=new RegExp("\\p{Script=Greek}","u"),iC=new RegExp("\\p{Script=Hebrew}","u"),TJ=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,_J=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,hM=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,IJ=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,F0e=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,$0e=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,bJ=new RegExp([v0e,N0e].map(e=>e.source).join("|"),"u"),xJ=new RegExp([gM,k0e,L0e,D0e,fM,M0e,F0e,$0e].map(e=>e.source).join("|"),"u");function OJ(e){return fJ.test(e)&&gJ.test(e)&&hJ.test(e)}var Ta=36,ES=1,SS=26,B0e=38,j0e=700,CJ=72,RJ=128;function yM(){throw null}function aC(e){return e.toLowerCase().startsWith("xn--")}function PJ(e,t,r){e=r?Math.floor(e/j0e):e>>1,e+=Math.floor(e/t);let o=0;for(;e>(Ta-ES)*SS>>1;)e=Math.floor(e/(Ta-ES)),o+=Ta;return o+Math.floor((Ta-ES+1)*e/(e+B0e))}function sC(e){let t=[],r=RJ,o=0,i=CJ,a=e.lastIndexOf("-");if(a>0)for(let u=0;u<a;u++){let l=e.charCodeAt(u);l>=128&&yM(),t.push(l)}let s=a<0?0:a+1;for(;s<e.length;){let u=o,l=1,m=Ta;for(;;){s>=e.length&&yM();let y=e.charCodeAt(s++),E;y>=97&&y<=122?E=y-97:y>=48&&y<=57?E=y-48+26:yM(),o+=E*l;let h=m<=i?ES:m>=i+SS?SS:m-i;if(E<h)break;l*=Ta-h,m+=Ta}let g=t.length+1;i=PJ(o-u,g,u===0),r+=Math.floor(o/g),o%=g,t.splice(o,0,r),o++}return String.fromCodePoint(...t)}function AJ(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var q0e=new RegExp(Wf.source,"gu");function UJ(e){let t=e.replace(q0e,""),r=t.length,o=r>0?[t,"-"]:[],i=Array.from(e,m=>m.codePointAt(0)),a=RJ,s=0,u=CJ,l=r;for(;l<i.length;){let m=1/0;for(let g of i)g>=a&&g<m&&(m=g);s+=(m-a)*(l+1),a=m;for(let g of i)if(g<a&&s++,g===a){let y=s;for(let E=Ta;;E+=Ta){let h=E<=u?ES:E>=u+SS?SS:E-u;if(y<h)break;let T=h+(y-h)%(Ta-h);o.push(AJ(T)),y=Math.floor((y-h)/(Ta-h))}o.push(AJ(y)),u=PJ(s,l+1,l===r),s=0,l++}s++,a++}return o.join("")}var H0e=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,wJ=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,K0e=/^(?:R|AL|AN)$/;function vJ(e){if(aC(e))try{return cC(sC(e.slice(4).toLowerCase()))}catch{return!1}return cC(e)}function NJ(e){let t=String.fromCodePoint(e);return bJ.test(t)?"EN":yJ.test(t)?"AN":fM.test(t)?"NSM":iC.test(t)?"R":_J.test(t)?"AL":gM.test(t)?"L":"ON"}function cC(e){for(let t of e)if(K0e.test(NJ(t.codePointAt(0))))return!0;return!1}function uC(e){let t=!1,r=wJ,o=!1,i=!1,a=!0;for(let s of e){let u=NJ(s.codePointAt(0));if(a){if(u!=="L"&&u!=="R"&&u!=="AL")return!1;t=u==="R"||u==="AL",r=t?H0e:wJ,a=!1}if(!r.test(u))return!1;u==="EN"?o=!0:u==="AN"&&(i=!0)}return!(t&&o&&i)}function z0e(e){return Wf.test(e)&&UJ(e).length+4>63}function Y0e(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function pC(e){if(z0e(e)||cC(e)&&!uC(e))return!1;let t=[...e],r=t.map(a=>a.codePointAt(0)),o=r.length;if(Y0e(t)||EJ.test(t[0]))return!1;let i=!1;for(let a=0;a<o;a++){let s=r[a],u=t[a];if(IJ.test(u)||!xJ.test(u))return!1;TJ.test(u)&&(i=!0);let l=r[a-1],m=r[a+1];switch(s){case 183:if(l!==108||m!==108)return!1;break;case 885:if(!m||!SJ.test(t[a+1]))return!1;break;case 1523:case 1524:if(!l||!iC.test(t[a-1]))return!1;break;case 8204:if(!l||l<128&&!hM.test(t[a-1]))return!1;break;case 8205:if(!l||!hM.test(t[a-1]))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!i)}function lC(e){if(!aC(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let r=sC(t);return Wf.test(r)?pC(r):!1}catch{return!1}}function V0e(e){return e.length>0&&e.length<=63}function W0e(e){return V0e(e)&&(lC(e)||OJ(e))}function DJ(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>W0e(t))}function Q0e(e){return e.length>0&&e.length<=63}function X0e(e){return Q0e(e)&&(lC(e)||pC(e))}function Z0e(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function FJ(e){if(e.length===0||e.includes(" "))return!1;let t=Z0e(e);if(t.length>253)return!1;let r=t.split("."),o=r.some(i=>vJ(i));return r.every(i=>X0e(i)&&(!o||uC(i)))}function dC(e){return DJ(e)}var J0e=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function mC(e){return J0e.test(e.normalize("NFC"))}function fC(e){return FJ(e)}var eMe=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function gC(e){return eMe.test(e)}var tMe=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function hC(e){return tMe.test(e)}var rMe=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,nMe=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function yC(e){return!rMe.test(e)&&!nMe.test(e)&&URL.canParse(e,"http://example.com")}var oMe=/[\x00-\x20<>\^`{|}\\]/,iMe=/%(?![0-9a-fA-F]{2})/;function EC(e){return oMe.test(e)||iMe.test(e)?!1:URL.canParse(e)}var aMe=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function SC(e){return aMe.test(e)}var sMe=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function TC(e){return sMe.test(e)}function _C(e){try{return new RegExp(e,"u"),!0}catch{return!1}}var cMe=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function IC(e){return cMe.test(e)}var uMe=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function bC(e){return uMe.test(e)}var pMe=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function xC(e){return pMe.test(e)}var lMe=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function OC(e){return lMe.test(e)}function AC(e){return URL.canParse(e)}var dMe=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function CC(e){return dMe.test(e)}var Xt=new Map;function GJ(){Xt.clear()}function mMe(){return[...Xt.entries()]}function fMe(e,t){Xt.set(e,t)}function gMe(e){return Xt.has(e)}function hMe(e){return Xt.get(e)}function yMe(e,t){return Xt.get(e)?.(t)??!0}function BJ(){GJ(),Xt.set("date-time",rC),Xt.set("date",Yf),Xt.set("duration",nC),Xt.set("email",oC),Xt.set("hostname",dC),Xt.set("idn-email",mC),Xt.set("idn-hostname",fC),Xt.set("ipv4",gC),Xt.set("ipv6",hC),Xt.set("iri-reference",yC),Xt.set("iri",EC),Xt.set("json-pointer-uri-fragment",SC),Xt.set("json-pointer",TC),Xt.set("regex",_C),Xt.set("relative-json-pointer",IC),Xt.set("time",Vf),Xt.set("uri-reference",bC),Xt.set("uri-template",xC),Xt.set("uri",OC),Xt.set("url",AC),Xt.set("uuid",CC)}BJ();function SM(e,t,r,o){return TS.Test(r.format,o)}function jJ(e,t,r,o,i,a){return SM(e,t,i,a)||t.AddError("format",r,o,{format:i.format})}function qJ(e,t,r,o){let i=JA(r)?r.then:!0,a=HA(r)?r.else:!0;return it(e,t,r.if,o)?it(e,t,i,o):it(e,t,a,o)}function HJ(e,t,r,o,i,a){let s=JA(i)?i.then:!0,u=HA(i)?i.else:!0,l=new Ln,m=Mt(e,l,`${r}/if`,o,i.if,a)?Mt(e,l,`${r}/then`,o,s,a)||t.AddError("if",r,o,{failingKeyword:"then"}):Mt(e,t,`${r}/else`,o,u,a)||t.AddError("if",r,o,{failingKeyword:"else"});return m&&t.Merge([l]),m}function EMe(e,t,r,o){return c.Every(r.items,0,(i,a)=>c.IsLessEqualThan(o.length,a)||li(e,t,i,o[a])&&t.AddIndex(a))}function SMe(e,t,r,o,i,a){return c.EveryAll(i.items,0,(s,u)=>{let l=`${r}/items/${u}`,m=`${o}/${u}`;return c.IsLessEqualThan(a.length,u)||di(e,t,l,m,s,a[u])&&t.AddIndex(u)})}function TMe(e,t,r,o){let i=od(r)?r.prefixItems.length:0;return c.Every(o,i,(a,s)=>li(e,t,r.items,a)&&t.AddIndex(s))}function _Me(e,t,r,o,i,a){let s=od(i)?i.prefixItems.length:0;return c.EveryAll(a,s,(u,l)=>{let m=`${r}/items`,g=`${o}/${l}`;return di(e,t,m,g,i.items,u)&&t.AddIndex(l)})}function KJ(e,t,r,o){return zA(r)?EMe(e,t,r,o):TMe(e,t,r,o)}function zJ(e,t,r,o,i,a){return zA(i)?SMe(e,t,r,o,i,a):_Me(e,t,r,o,i,a)}function IMe(e){return Zu(e)}function TM(e,t,r,o){if(!IMe(r))return!0;let i=c.Counted(o,a=>it(e,t,r.contains,a));return c.IsLessEqualThan(i,r.maxContains)}function YJ(e,t,r,o,i,a){let s=nd(i)?i.minContains:1;return TM(e,t,i,a)||t.AddError("contains",r,o,{minContains:s,maxContains:i.maxContains})}function _M(e,t,r,o){return c.IsLessEqualThan(o,r.maximum)}function VJ(e,t,r,o,i,a){return _M(e,t,i,a)||t.AddError("maximum",r,o,{comparison:"<=",limit:i.maximum})}function IM(e,t,r,o){return c.IsLessEqualThan(o.length,r.maxItems)}function WJ(e,t,r,o,i,a){return IM(e,t,i,a)||t.AddError("maxItems",r,o,{limit:i.maxItems})}function bM(e,t,r,o){return c.IsMaxLength(o,r.maxLength)}function QJ(e,t,r,o,i,a){return bM(e,t,i,a)||t.AddError("maxLength",r,o,{limit:i.maxLength})}function xM(e,t,r,o){return c.IsLessEqualThan(c.Keys(o).length,r.maxProperties)}function XJ(e,t,r,o,i,a){return xM(e,t,i,a)||t.AddError("maxProperties",r,o,{limit:i.maxProperties})}function bMe(e){return Zu(e)}function OM(e,t,r,o){if(!bMe(r))return!0;let i=c.Counted(o,(a,s)=>it(e,t,r.contains,a)&&t.AddIndex(s));return c.IsGreaterEqualThan(i,r.minContains)}function ZJ(e,t,r,o,i,a){return OM(e,t,i,a)||t.AddError("contains",r,o,{minContains:i.minContains})}function AM(e,t,r,o){return c.IsGreaterEqualThan(o,r.minimum)}function JJ(e,t,r,o,i,a){return AM(e,t,i,a)||t.AddError("minimum",r,o,{comparison:">=",limit:i.minimum})}function CM(e,t,r,o){return c.IsGreaterEqualThan(o.length,r.minItems)}function eee(e,t,r,o,i,a){return CM(e,t,i,a)||t.AddError("minItems",r,o,{limit:i.minItems})}function RM(e,t,r,o){return c.IsMinLength(o,r.minLength)}function tee(e,t,r,o,i,a){return RM(e,t,i,a)||t.AddError("minLength",r,o,{limit:i.minLength})}function PM(e,t,r,o){return c.IsGreaterEqualThan(c.Keys(o).length,r.minProperties)}function ree(e,t,r,o,i,a){return PM(e,t,i,a)||t.AddError("minProperties",r,o,{limit:i.minProperties})}function UM(e,t,r,o){return c.IsMultipleOf(o,r.multipleOf)}function nee(e,t,r,o,i,a){return UM(e,t,i,a)||t.AddError("multipleOf",r,o,{multipleOf:i.multipleOf})}function wM(e,t,r,o){let i=new co;return!it(e,i,r.not,o)&&t.Merge([i])}function oee(e,t,r,o,i,a){return wM(e,t,i,a)||t.AddError("not",r,o,{})}function iee(e,t,r,o){let i=r.oneOf.reduce((a,s)=>{let u=new co;return it(e,u,s,o)?[...a,u]:a},[]);return c.IsEqual(i.length,1)&&t.Merge(i)}function aee(e,t,r,o,i,a){let s=[],u=[],l=i.oneOf.reduce((g,y,E)=>{let h=new Ln,T=`${r}/oneOf/${E}`,S=Mt(e,h,T,o,y,a);return S&&u.push(E),S||s.push(h),S?[...g,h]:g},[]),m=c.IsEqual(l.length,1)&&t.Merge(l);return!m&&c.IsEqual(u.length,0)&&s.forEach(g=>t.AddErrors(g.GetErrors())),m||t.AddError("oneOf",r,o,{passingSchemas:u})}function vM(e,t,r,o){return(c.IsString(r.pattern)?ep(r.pattern):r.pattern).test(o)}function see(e,t,r,o,i,a){return vM(e,t,i,a)||t.AddError("pattern",r,o,{pattern:i.pattern})}function cee(e,t,r,o){return c.Every(c.Entries(r.patternProperties),0,([i,a])=>{let s=ep(i);return c.Every(c.Entries(o),0,([u,l])=>!s.test(u)||li(e,t,a,l)&&t.AddKey(u))})}function uee(e,t,r,o,i,a){return c.EveryAll(c.Entries(i.patternProperties),0,([s,u])=>{let l=`${r}/patternProperties/${jo(s)}`,m=ep(s);return c.EveryAll(c.Entries(a),0,([g,y])=>{let E=`${o}/${jo(g)}`;return!m.test(g)||di(e,t,l,E,u,y)&&t.AddKey(g)})})}function pee(e,t,r,o){return c.IsEqual(o.length,0)||c.Every(r.prefixItems,0,(i,a)=>c.IsLessEqualThan(o.length,a)||li(e,t,i,o[a])&&t.AddIndex(a))}function lee(e,t,r,o,i,a){return c.IsEqual(a.length,0)||c.EveryAll(i.prefixItems,0,(s,u)=>{let l=`${r}/prefixItems/${u}`,m=`${o}/${u}`;return c.IsLessEqualThan(a.length,u)||di(e,t,l,m,s,a[u])&&t.AddIndex(u)})}function NM(e,t){return e.includes(t)||Gr.Get().exactOptionalPropertyTypes}function LM(e,t){return c.IsUndefined(e[t])}function dee(e,t,r,o){let i=id(r)?r.required:[];return c.Every(c.Entries(r.properties),0,([s,u])=>{let l=!c.HasPropertyKey(o,s)||li(e,t,u,o[s])&&t.AddKey(s);return NM(i,s)?l:LM(o,s)||l})}function mee(e,t,r,o,i,a){let s=id(i)?i.required:[];return c.EveryAll(c.Entries(i.properties),0,([l,m])=>{let g=`${r}/properties/${jo(l)}`,y=`${o}/${jo(l)}`,E=()=>!c.HasPropertyKey(a,l)||di(e,t,g,y,m,a[l])&&t.AddKey(l);return NM(s,l)?E():LM(a,l)||E()})}function fee(e,t,r,o){return c.Every(c.Keys(o),0,(i,a)=>it(e,t,r.propertyNames,i))}function gee(e,t,r,o,i,a){let s=[];return c.EveryAll(c.Keys(a),0,(l,m)=>{let g=`${o}/${jo(l)}`,y=`${r}/propertyNames`,E=Mt(e,t,y,g,i.propertyNames,l);return E||s.push(l),E})||t.AddError("propertyNames",r,o,{propertyNames:s})}function hee(e,t,r,o){let i=Gi.RecursiveRef(e,r)??!1,a=i?{...e,pendingResource:!0}:e;return Ae(i)&&it(a,t,i,o)}function yee(e,t,r,o,i,a){let s=Gi.RecursiveRef(e,i)??!1,u=s?{...e,pendingResource:!0}:e;return Ae(s)&&Mt(u,t,r,o,s,a)}function Eee(e,t,r,o){let i=Gi.Ref(e,r),a=i.schema??!1,s=new co,u=Ae(a)&&it(i.stack,s,a,o);return u&&t.Merge([s]),u}function See(e,t,r,o,i,a){let s=Gi.Ref(e,i),u=s.schema??!1,l=new Ln,m=Ae(u)&&Mt(s.stack,l,r,o,u,a);return m&&t.Merge([l]),m||t.AddErrors(l.GetErrors()),m}function Tee(e,t,r,o){return c.Every(r.required,0,i=>c.HasPropertyKey(o,i))}function _ee(e,t,r,o,i,a){let s=[];return c.EveryAll(i.required,0,l=>{let m=c.HasPropertyKey(a,l);return m||s.push(l),m})||t.AddError("required",r,o,{requiredProperties:s})}function kM(e,t,r,o,i){return c.IsEqual(r,"object")?c.IsObjectNotArray(i):c.IsEqual(r,"array")?c.IsArray(i):c.IsEqual(r,"boolean")?c.IsBoolean(i):c.IsEqual(r,"integer")?c.IsInteger(i):c.IsEqual(r,"number")?c.IsNumber(i):c.IsEqual(r,"null")?c.IsNull(i):c.IsEqual(r,"string")?c.IsString(i):c.IsEqual(r,"bigint")?c.IsBigInt(i):c.IsEqual(r,"constructor")?c.IsConstructor(i):c.IsEqual(r,"function")?c.IsFunction(i):c.IsEqual(r,"symbol")?c.IsSymbol(i):c.IsEqual(r,"undefined")?c.IsUndefined(i):c.IsEqual(r,"void")?c.IsUndefined(i):!0}function Iee(e,t,r,o,i){return c.Some(r,a=>kM(e,t,a,o,i))}function bee(e,t,r,o){return c.IsArray(r.type)?Iee(e,t,r.type,r,o):kM(e,t,r.type,r,o)}function xee(e,t,r,o,i,a){return(c.IsArray(i.type)?Iee(e,t,i.type,i,a):kM(e,t,i.type,i,a))||t.AddError("type",r,o,{type:i.type})}function Oee(e,t,r,o){let i=t.GetIndices();return c.Every(o,0,(a,s)=>(i.has(s)||it(e,t,r.unevaluatedItems,a))&&t.AddIndex(s))}function Aee(e,t,r,o,i,a){let s=t.GetIndices(),u=[];return c.EveryAll(a,0,(m,g)=>{let y=new Ln,E=(s.has(g)||Mt(e,y,r,o,i.unevaluatedItems,m))&&t.AddIndex(g);return E||u.push(g),E})||t.AddError("unevaluatedItems",r,o,{unevaluatedItems:u})}function Cee(e,t,r,o){let i=t.GetKeys();return c.Every(c.Entries(o),0,([a,s])=>i.has(a)||it(e,t,r.unevaluatedProperties,s)&&t.AddKey(a))}function Ree(e,t,r,o,i,a){let s=t.GetKeys(),u=[];return c.EveryAll(c.Entries(a),0,([m,g])=>{let y=new Ln,E=s.has(m)||Mt(e,y,r,o,i.unevaluatedProperties,g)&&t.AddKey(m);return E||u.push(m),E})||t.AddError("unevaluatedProperties",r,o,{unevaluatedProperties:u})}function Pee(e){return!c.IsEqual(e.uniqueItems,!1)}function Uee(e,t,r,o){if(!Pee(r))return!0;let i=new Set(o.map(wu.Hash)).size,a=o.length;return c.IsEqual(i,a)}function wee(e,t,r,o,i,a){if(!Pee(i))return!0;let s=new Set,u=a.reduce((m,g,y)=>{let E=wu.Hash(g);return s.has(E)?[...m,y]:(s.add(E),m)},[]);return c.IsEqual(u.length,0)||t.AddError("uniqueItems",r,o,{duplicateItems:u})}function li(e,t,r,o){return t.Push()&&it(e,t,r,o)&&t.Pop()}function it(e,t,r,o){let i=Hf(e,r);return td(r)?tM(i,t,r,o):(!X0(r)||bee(i,t,r,o))&&(!(c.IsObject(o)&&!c.IsArray(o))||(!id(r)||Tee(i,t,r,o))&&(!ps(r)||GZ(i,t,r,o))&&(!j0(r)||WZ(i,t,r,o))&&(!q0(r)||XZ(i,t,r,o))&&(!jA(r)||JZ(i,t,r,o))&&(!$f(r)||cee(i,t,r,o))&&(!Gf(r)||dee(i,t,r,o))&&(!QA(r)||fee(i,t,r,o))&&(!cS(r)||PM(i,t,r,o))&&(!W0(r)||xM(i,t,r,o)))&&(!c.IsArray(o)||(!$A(r)||DZ(i,t,r,o))&&(!Zu(r)||nM(i,t,r,o))&&(!rd(r)||KJ(i,t,r,o))&&(!nd(r)||OM(i,t,r,o))&&(!Y0(r)||TM(i,t,r,o))&&(!Ff(r)||CM(i,t,r,o))&&(!YA(r)||IM(i,t,r,o))&&(!od(r)||pee(i,t,r,o))&&(!Bf(r)||Uee(i,t,r,o)))&&(!c.IsString(o)||(!sS(r)||RM(i,t,r,o))&&(!V0(r)||bM(i,t,r,o))&&(!aS(r)||SM(i,t,r,o))&&(!uS(r)||vM(i,t,r,o)))&&(!(c.IsNumber(o)||c.IsBigInt(o))||(!Rc(r)||mM(i,t,r,o))&&(!K0(r)||dM(i,t,r,o))&&(!Pc(r)||AM(i,t,r,o))&&(!z0(r)||_M(i,t,r,o))&&(!Q0(r)||UM(i,t,r,o)))&&(!ZA(r)||Eee(i,t,r,o))&&(!XA(r)||hee(i,t,r,o))&&(!qA(r)||uJ(i,t,r,o))&&(!B0(r)||rM(i,t,r,o))&&(!H0(r)||lM(i,t,r,o))&&(!KA(r)||qJ(i,t,r,o))&&(!VA(r)||wM(i,t,r,o))&&(!GA(r)||jZ(i,t,r,o))&&(!BA(r)||HZ(i,t,r,o))&&(!WA(r)||iee(i,t,r,o))&&(!lS(r)||!c.IsArray(o)||Oee(i,t,r,o))&&(!dS(r)||!c.IsObject(o)||Cee(i,t,r,o))&&(!FA(r)||UZ(i,t,r,o))}function di(e,t,r,o,i,a){return t.Push()&&Mt(e,t,r,o,i,a)&&t.Pop()}function Mt(e,t,r,o,i,a){if(t.AtCapacity())return!1;let s=Hf(e,i);return td(i)?zZ(s,t,r,o,i,a):!!(+(!X0(i)||xee(s,t,r,o,i,a))&+(!(c.IsObject(a)&&!c.IsArray(a))||!!(+(!id(i)||_ee(s,t,r,o,i,a))&+(!ps(i)||BZ(s,t,r,o,i,a))&+(!j0(i)||QZ(s,t,r,o,i,a))&+(!q0(i)||ZZ(s,t,r,o,i,a))&+(!jA(i)||eJ(s,t,r,o,i,a))&+(!$f(i)||uee(s,t,r,o,i,a))&+(!Gf(i)||mee(s,t,r,o,i,a))&+(!QA(i)||gee(s,t,r,o,i,a))&+(!cS(i)||ree(s,t,r,o,i,a))&+(!W0(i)||XJ(s,t,r,o,i,a))))&+(!c.IsArray(a)||!!(+(!$A(i)||FZ(s,t,r,o,i,a))&+(!Zu(i)||VZ(s,t,r,o,i,a))&+(!rd(i)||zJ(s,t,r,o,i,a))&+(!nd(i)||ZJ(s,t,r,o,i,a))&+(!Y0(i)||YJ(s,t,r,o,i,a))&+(!Ff(i)||eee(s,t,r,o,i,a))&+(!YA(i)||WJ(s,t,r,o,i,a))&+(!od(i)||lee(s,t,r,o,i,a))&+(!Bf(i)||wee(s,t,r,o,i,a))))&+(!c.IsString(a)||!!(+(!sS(i)||tee(s,t,r,o,i,a))&+(!V0(i)||QJ(s,t,r,o,i,a))&+(!aS(i)||jJ(s,t,r,o,i,a))&+(!uS(i)||see(s,t,r,o,i,a))))&+(!(c.IsNumber(a)||c.IsBigInt(a))||!!(+(!Rc(i)||mJ(s,t,r,o,i,a))&+(!K0(i)||dJ(s,t,r,o,i,a))&+(!Pc(i)||JJ(s,t,r,o,i,a))&+(!z0(i)||VJ(s,t,r,o,i,a))&+(!Q0(i)||nee(s,t,r,o,i,a))))&+(!ZA(i)||See(s,t,r,o,i,a))&+(!XA(i)||yee(s,t,r,o,i,a))&+(!qA(i)||pJ(s,t,r,o,i,a))&+(!B0(i)||YZ(s,t,r,o,i,a))&+(!H0(i)||lJ(s,t,r,o,i,a))&+(!KA(i)||HJ(s,t,r,o,i,a))&+(!VA(i)||oee(s,t,r,o,i,a))&+(!GA(i)||qZ(s,t,r,o,i,a))&+(!BA(i)||KZ(s,t,r,o,i,a))&+(!WA(i)||aee(s,t,r,o,i,a))&+(!lS(i)||!c.IsArray(a)||Aee(s,t,r,o,i,a))&+(!dS(i)||!c.IsObject(a)||Ree(s,t,r,o,i,a)))&&(!FA(i)||wZ(s,t,r,o,i,a))}function RC(...e){let[t,r,o]=nt.Match(e,{3:(g,y,E)=>[g,y,E],2:(g,y)=>[{},g,y]}),i=qf(t,r),a=new Ln,s=Mt(i,a,"#","",r,o),u=a.GetErrors(),l=HV(),m=u.map(g=>({...g,message:l(g)}));return[s,m]}var vee=0;function DM(){let e=_x();vee=e.maxErrors,e.maxErrors=e.maxParseErrors}function FM(){let e=_x();e.maxErrors=vee}function $M(...e){let[t,r,o]=nt.Match(e,{3:(s,u,l)=>[s,u,l],2:(s,u)=>[{},s,u]}),i=qf(t,r),a=new co;return it(i,a,r,o)}function bt(...e){let[t,r,o]=nt.Match(e,{3:(i,a,s)=>[i,a,s],2:(i,a)=>[{},i,a]});return $M(t,r,o)}function ds(...e){let[t,r,o]=nt.Match(e,{3:(s,u,l)=>[s,u,l],2:(s,u)=>[{},s,u]}),[i,a]=RC(t,r,o);return a}var tp=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function Nee(e,t,r){return c.IsArray(r)?r.map(o=>fn(e,t.items,o)):r}function Lee(e,t,r){return fn({...e,...t.$defs},pn(t.$ref),r)}function AMe(e,t){let r=c.HasPropertyKey(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},o=Li(e,t),i=vn(o);return Se(i)?NO(i,r):i}function kee(e,t,r){let o=AMe(e,t);return fn(e,o,r)}function PC(e){return c.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function Mee(e,t,r){if(!c.IsObject(r)||c.IsArray(r))return r;let o=PC(t);for(let i of c.Keys(r)){if(c.HasPropertyKey(t.properties,i)&&ar(t.properties[i])){r[i]=fn(e,t.properties[i],r[i]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||ar(o)&&bt(e,o,r[i])){r[i]=fn(e,o,r[i]);continue}delete r[i]}return r}function Dee(e,t,r){if(!c.IsObject(r))return r;let o=PC(t),[i,a]=[new RegExp(qr(t)),Wt(t)];for(let s of c.Keys(r)){if(i.test(s)){r[s]=fn(e,a,r[s]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||ar(o)&&bt(e,o,r[s])){r[s]=fn(e,o,r[s]);continue}delete r[s]}return r}function Fee(e,t,r){return c.HasPropertyKey(e,t.$ref)?fn(e,e[t.$ref],r):r}function $ee(e,t,r){if(!c.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=fn(e,t.items[i],r[i]);return c.IsGreaterThan(r.length,o)?r.slice(0,o):r}function CMe(e){return c.HasPropertyKey(e,"~kind")||c.HasPropertyKey(e,"~unsafe")}function RMe(e){let t={};for(let r of c.Keys(e)){if(c.IsUnsafePropertyKey(r))continue;let o=Object.getOwnPropertyDescriptor(e,r);o.value=cd(o.value),c.IsEqual(o.enumerable,!0)?t[r]=o.value:Object.defineProperty(t,r,o)}return t}function PMe(e){let t={};for(let r of c.Keys(e))c.IsUnsafePropertyKey(r)||(t[r]=cd(e[r]));for(let r of c.Symbols(e))t[r]=cd(e[r]);return t}function UMe(e){return c.IsClassInstance(e)?e:CMe(e)?RMe(e):PMe(e)}function wMe(e){return e.map(t=>cd(t))}function vMe(e){return e.slice()}function NMe(e){return new RegExp(e.source,e.flags)}function LMe(e){return new Map(cd([...e.entries()]))}function kMe(e){return new Set(cd([...e.values()]))}function cd(e){return no.IsTypeArray(e)?vMe(e):no.IsRegExp(e)?NMe(e):no.IsMap(e)?LMe(e):no.IsSet(e)?kMe(e):c.IsArray(e)?wMe(e):c.IsObject(e)?UMe(e):e}function Gee(e){return cd(e)}function Rr(e){return Gee(e)}function Bee(e,t,r){for(let o of t.anyOf){let i=fn(e,o,Rr(r));if(bt(e,o,i))return i}return r}function fn(e,t,r){return Xe(t)?Nee(e,t,r):Lt(t)?Lee(e,t,r):ge(t)?kee(e,t,r):Se(t)?Mee(e,t,r):_t(t)?Dee(e,t,r):ht(t)?Fee(e,t,r):Ge(t)?$ee(e,t,r):z(t)?Bee(e,t,r):r}function MMe(e,t){return O.Assign(e,t)}function DMe(e){let t={};for(let r of EV.Keys(e))t[r]=_S(e[r]);return t}function FMe(e){return Un({pattern:qr(e)})}function $Me(e){return GM(D5(e))}function GM(e){return e.map(t=>_S(t))}function _S(e){let t=Xe(e)?_o(_S(e.items),zm(e)):ge(e)?jn(GM(e.allOf)):z(e)?Pe($Me(e.anyOf)):Se(e)?me(DMe(e.properties)):_t(e)?tf(FMe(e),_S(Wt(e))):Ge(e)?Ir(GM(e.items)):e;return MMe(e,t)}function Qf(e){return _S(e)}function ms(...e){let[t,r,o]=nt.Match(e,{3:(a,s,u)=>[a,s,u],2:(a,s)=>[{},a,s]}),i=Gr.Get().unionPrioritySort?Qf(r):r;return fn(t,i,o)}var st={};gi(st,{Fail:()=>ud,IsOk:()=>BM,Ok:()=>se,TryArray:()=>GMe,TryBigInt:()=>jM,TryBoolean:()=>ZMe,TryNull:()=>nDe,TryNumber:()=>sDe,TryString:()=>cDe,TryUndefined:()=>mDe});function BM(e){return c.IsObject(e)&&c.HasPropertyKey(e,"value")}function se(e){return{value:e}}function ud(){}function GMe(e){return c.IsArray(e)?se(e):se([e])}function BMe(e){return c.IsEqual(e,!0)?se(BigInt(1)):se(BigInt(0))}var jMe=/^-?(0|[1-9]\d*)n$/,qMe=/^-?(0|[1-9]\d*)\.\d+$/,HMe=/^-?(0|[1-9]\d*)$/;function KMe(e){return jMe.test(e)}function zMe(e){return qMe.test(e)}function YMe(e){return HMe.test(e)}function VMe(e){let t=e.toLowerCase();return KMe(e)?se(BigInt(e.slice(0,e.length-1))):zMe(e)?se(BigInt(e.split(".")[0])):YMe(e)?se(BigInt(e)):c.IsEqual(t,"false")?se(BigInt(0)):c.IsEqual(t,"true")?se(BigInt(1)):void 0}function jM(e){return c.IsBigInt(e)?se(e):c.IsBoolean(e)?BMe(e):c.IsNumber(e)?se(BigInt(Math.trunc(e))):c.IsNull(e)?se(BigInt(0)):c.IsString(e)?VMe(e):c.IsUndefined(e)?se(BigInt(0)):void 0}function WMe(e){return c.IsEqual(e,BigInt(0))?se(!1):c.IsEqual(e,BigInt(1))?se(!0):void 0}function QMe(e){return c.IsEqual(e,0)?se(!1):c.IsEqual(e,1)?se(!0):void 0}function XMe(e){return c.IsEqual(e.toLowerCase(),"false")?se(!1):c.IsEqual(e.toLowerCase(),"true")?se(!0):c.IsEqual(e,"0")?se(!1):c.IsEqual(e,"1")?se(!0):void 0}function ZMe(e){return c.IsBigInt(e)?WMe(e):c.IsBoolean(e)?se(e):c.IsNumber(e)?QMe(e):c.IsNull(e)?se(!1):c.IsString(e)?XMe(e):c.IsUndefined(e)?se(!1):void 0}function JMe(e){return c.IsEqual(e,BigInt(0))?se(null):void 0}function eDe(e){return c.IsEqual(e,!1)?se(null):void 0}function tDe(e){return c.IsEqual(e,0)?se(null):void 0}function rDe(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?se(null):void 0}function nDe(e){return c.IsBigInt(e)?JMe(e):c.IsBoolean(e)?eDe(e):c.IsNumber(e)?tDe(e):c.IsNull(e)?se(null):c.IsString(e)?rDe(e):c.IsUndefined(e)?se(null):void 0}var jee=BigInt(Number.MAX_SAFE_INTEGER),qee=BigInt(Number.MIN_SAFE_INTEGER);function oDe(e){return e<=jee&&e>=qee?se(Number(e)):void 0}function iDe(e){return se(e?1:0)}function aDe(e){let t=+e;if(c.IsNumber(t))return se(t);let r=e.toLowerCase();if(c.IsEqual(r,"false"))return se(0);if(c.IsEqual(r,"true"))return se(1);let o=jM(e);return BM(o)?o.value<=jee&&o.value>=qee?se(Number(o.value)):void 0:void 0}function sDe(e){return c.IsBigInt(e)?oDe(e):c.IsBoolean(e)?iDe(e):c.IsNumber(e)?se(e):c.IsNull(e)?se(0):c.IsString(e)?aDe(e):c.IsUndefined(e)?se(0):void 0}function cDe(e){return c.IsBigInt(e)?se(e.toString()):c.IsBoolean(e)?se(e.toString()):c.IsNumber(e)?se(e.toString()):c.IsNull(e)?se("null"):c.IsString(e)?se(e):c.IsUndefined(e)?se(""):void 0}function uDe(e){return c.IsEqual(e,BigInt(0))?se(void 0):void 0}function pDe(e){return c.IsEqual(e,!1)?se(void 0):void 0}function lDe(e){return c.IsEqual(e,0)?se(void 0):void 0}function dDe(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?se(void 0):void 0}function mDe(e){return c.IsBigInt(e)?uDe(e):c.IsBoolean(e)?pDe(e):c.IsNumber(e)?lDe(e):c.IsNull(e)?se(void 0):c.IsString(e)?dDe(e):c.IsUndefined(e)?se(e):void 0}function Hee(e,t,r){return st.TryArray(r).value.map(i=>Pr(e,t.items,i))}function Kee(e,t,r){let o=st.TryBigInt(r);return st.IsOk(o)?o.value:r}function zee(e,t,r){let o=st.TryBoolean(r);return st.IsOk(o)?o.value:r}function Yee(e,t,r){return Pr({...e,...t.$defs},pn(t.$ref),r)}function Vee(e,t,r){return Pr(e,vn(t),r)}function Wee(e,t,r){let o=st.TryNumber(r);return st.IsOk(o)?Math.trunc(o.value):r}function Qee(e,t,r){let o=Li(e,t),i=vn(o);return Pr(e,i,r)}function fDe(e,t,r){let o=st.TryBigInt(r);return st.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function gDe(e,t,r){let o=st.TryBoolean(r);return st.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function hDe(e,t,r){let o=st.TryNumber(r);return st.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function yDe(e,t,r){let o=st.TryString(r);return st.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function Xee(e,t,r){return c.IsEqual(t.const,r)?r:JV(t)?fDe(e,t,r):e4(t)?gDe(e,t,r):Mx(t)?hDe(e,t,r):Dx(t)?yDe(e,t,r):_r()}function Zee(e,t,r){let o=st.TryNull(r);return st.IsOk(o)?o.value:r}function Jee(e,t,r){let o=st.TryNumber(r);return st.IsOk(o)?o.value:r}function UC(e,t,r,o){let i=c.Keys(o);for(let[a,s]of t)for(let u of i)a.test(u)||(o[u]=Pr(e,r,o[u]));return o}function IS(e,t,r){return Nr(e)&&c.IsUndefined(r[t])}function EDe(e,t,r){let o=c.EntriesRegExp(t.properties),i=c.Keys(r);for(let[a,s]of o)for(let u of i)!a.test(u)||IS(s,u,r)||(r[u]=Pr(e,s,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?UC(e,o,t.additionalProperties,r):r}function ete(e,t,r){return c.IsObjectNotArray(r)?EDe(e,t,r):r}function SDe(e,t,r){let o=c.EntriesRegExp(t.patternProperties),i=c.Keys(r);for(let[a,s]of o)for(let u of i)a.test(u)&&(r[u]=Pr(e,s,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?UC(e,o,t.additionalProperties,r):r}function tte(e,t,r){return c.IsObjectNotArray(r)?SDe(e,t,r):r}function rte(e,t,r){return c.HasPropertyKey(e,t.$ref)?Pr(e,e[t.$ref],r):r}function nte(e,t,r){let o=st.TryString(r);return st.IsOk(o)?o.value:r}function ote(e,t,r){return Pr(e,vn(t),r)}function ite(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Pr(e,t.items[o],r[o]);return r}function ate(e,t,r){let o=st.TryUndefined(r);return st.IsOk(o)?o.value:r}function ste(e,t,r){if(t.anyOf.some(s=>bt(e,s,r)))return r;let a=t.anyOf.map(s=>Pr(e,s,Rr(r))).find(s=>bt(e,t,s));return c.IsUndefined(a)?r:a}function cte(e,t,r){let o=st.TryUndefined(r);return st.IsOk(o)?void 0:r}function Pr(e,t,r){return Xe(t)?Hee(e,t,r):Fo(t)?Kee(e,t,r):oo(t)?zee(e,t,r):Lt(t)?Yee(e,t,r):Mr(t)?Vee(e,t,r):dn(t)?Wee(e,t,r):ge(t)?Qee(e,t,r):Ke(t)?Xee(e,t,r):Za(t)?Zee(e,t,r):sr(t)?Jee(e,t,r):Se(t)?ete(e,t,r):_t(t)?tte(e,t,r):ht(t)?rte(e,t,r):jr(t)?nte(e,t,r):kt(t)?ote(e,t,r):Ge(t)?ite(e,t,r):fa(t)?ate(e,t,r):z(t)?ste(e,t,r):Go(t)?cte(e,t,r):r}function rp(...e){let[t,r,o]=nt.Match(e,{3:(i,a,s)=>[i,a,s],2:(i,a)=>[{},i,a]});return Pr(t,r,o)}function ute(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=gn(e,t.items,r[o]);return r}function pte(e,t,r){return gn({...e,...t.$defs},pn(t.$ref),r)}function lte(e,t){return c.IsUndefined(t)?c.IsFunction(e.default)?e.default():Rr(e.default):t}function dte(e,t,r){let o=Li(e,t),i=vn(o);return gn(e,i,r)}function mte(e,t,r){if(!c.IsObject(r))return r;let o=c.Keys(t.properties);for(let i of o){let a=gn(e,t.properties[i],r[i]);c.IsUndefined(a)&&(Nr(t.properties[i])||!c.HasPropertyKey(t.properties[i],"default"))||(r[i]=a)}if(!ps(t)||c.IsBoolean(t.additionalProperties))return r;for(let i of c.Keys(r))o.includes(i)||(r[i]=gn(e,t.additionalProperties,r[i]));return r}function fte(e,t,r){if(!c.IsObject(r))return r;let[o,i]=[new RegExp(qr(t)),Wt(t)];for(let a of c.Keys(r))o.test(a)&&pi(i)&&(r[a]=gn(e,i,r[a]));if(!ps(t))return r;for(let a of c.Keys(r))o.test(a)||(r[a]=gn(e,t.additionalProperties,r[a]));return r}function gte(e,t,r){return c.HasPropertyKey(e,t.$ref)?gn(e,e[t.$ref],r):r}function hte(e,t,r){if(!c.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let a=0;a<i;a++)a<o.length&&(r[a]=gn(e,o[a],r[a]));return r}function yte(e,t,r){for(let o of t.anyOf){let i=gn(e,o,Rr(r));if(bt(e,o,i))return i}return r}function gn(e,t,r){let o=pi(t)?lte(t,r):r;return Xe(t)?ute(e,t,o):Lt(t)?pte(e,t,o):ge(t)?dte(e,t,o):Se(t)?mte(e,t,o):_t(t)?fte(e,t,o):ht(t)?gte(e,t,o):Ge(t)?hte(e,t,o):z(t)?yte(e,t,o):o}function pd(...e){let[t,r,o]=nt.Match(e,{3:(i,a,s)=>[i,a,s],2:(i,a)=>[{},i,a]});return gn(t,r,o)}function Xf(e){return(...t)=>{let[r,o,i]=nt.Match(t,{3:(a,s,u)=>[a,s,u],2:(a,s)=>[{},a,s]});return e.reduce((a,s)=>s(r,o,a),i)}}function TDe(e,t,r){return t["~codec"].decode(r)}function _De(e,t,r){return t["~codec"].encode(r)}function Zt(e,t,r,o){return Cl(r)?c.IsEqual(e,"Decode")?TDe(t,r,o):_De(t,r,o):o}function IDe(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<o.length;i++)o[i]=cr(e,t,r.items,o[i]);return Zt(e,t,r,o)}function bDe(e,t,r,o){let i=Zt(e,t,r,o);if(!c.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=cr(e,t,r.items,i[a]);return i}function Ete(e,t,r,o){return c.IsEqual(e,"Decode")?IDe(e,t,r,o):bDe(e,t,r,o)}function Ste(e,t,r,o){return o=cr(e,{...t,...r.$defs},pn(r.$ref),o),Zt(e,t,r,o)}function Tte(e){return e.reduce((t,r)=>({...t,...r}),{})}function _te(e,t){for(let r of t)if(!c.IsDeepEqual(e,r))return r;return e}function xDe(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return Zt(e,t,r,o);let i=r.allOf.map(u=>cr(e,t,u,ms(u,Rr(o)))),s=i.every(u=>c.IsObject(u))?Tte(i):_te(o,i);return Zt(e,t,r,s)}function ODe(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return Zt(e,t,r,o);let i=Zt(e,t,r,o),a=r.allOf.map(u=>cr(e,t,u,ms(u,Rr(i))));return a.every(u=>c.IsObject(u))?Tte(a):_te(i,a)}function Ite(e,t,r,o){return c.IsEqual(e,"Decode")?xDe(e,t,r,o):ODe(e,t,r,o)}function ADe(e,t,r,o){if(!c.IsObjectNotArray(o))return o;for(let i of c.Keys(r.properties))!c.HasPropertyKey(o,i)||IS(r.properties[i],i,o)||(o[i]=cr(e,t,r.properties[i],o[i]));return Zt(e,t,r,o)}function CDe(e,t,r,o){let i=Zt(e,t,r,o);if(!c.IsObjectNotArray(i))return i;for(let a of c.Keys(r.properties))!c.HasPropertyKey(i,a)||IS(r.properties[a],a,i)||(i[a]=cr(e,t,r.properties[a],i[a]));return i}function bte(e,t,r,o){return c.IsEqual(e,"Decode")?ADe(e,t,r,o):CDe(e,t,r,o)}function RDe(e,t,r,o){if(!c.IsObjectNotArray(o))return o;let i=new RegExp(qr(r));for(let a of c.Keys(o))i.test(a)&&(o[a]=cr(e,t,Wt(r),o[a]));return Zt(e,t,r,o)}function PDe(e,t,r,o){let i=Zt(e,t,r,o);if(!c.IsObjectNotArray(i))return i;let a=new RegExp(qr(r));for(let s of c.Keys(i))a.test(s)&&(i[s]=cr(e,t,Wt(r),i[s]));return i}function xte(e,t,r,o){return c.IsEqual(e,"Decode")?RDe(e,t,r,o):PDe(e,t,r,o)}function Ote(e,t,r,o){return c.HasPropertyKey(t,r.$ref)?cr(e,t,t[r.$ref],o):o}function Ate(e,t,r,o){return c.IsEqual(e,"Decode")?Zt(e,t,r,Ote(e,t,r,o)):Ote(e,t,r,Zt(e,t,r,o))}function UDe(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=cr(e,t,r.items[i],o[i]);return Zt(e,t,r,o)}function wDe(e,t,r,o){let i=Zt(e,t,r,o);if(!c.IsArray(i))return o;for(let a=0;a<Math.min(r.items.length,i.length);a++)i[a]=cr(e,t,r.items[a],i[a]);return i}function Cte(e,t,r,o){return c.IsEqual(e,"Decode")?UDe(e,t,r,o):wDe(e,t,r,o)}function vDe(e,t,r,o){for(let i of r.anyOf){if(!bt(t,i,o))continue;let a=cr(e,t,i,o);return Zt(e,t,r,a)}return o}function NDe(e,t,r,o){let i=Zt(e,t,r,o);for(let a of r.anyOf){let s=cr(e,t,a,Rr(i));if(bt(t,a,s))return s}return i}function Rte(e,t,r,o){return c.IsEqual(e,"Decode")?vDe(e,t,r,o):NDe(e,t,r,o)}function cr(e,t,r,o){return Xe(r)?Ete(e,t,r,o):Lt(r)?Ste(e,t,r,o):ge(r)?Ite(e,t,r,o):Se(r)?bte(e,t,r,o):_t(r)?xte(e,t,r,o):ht(r)?Ate(e,t,r,o):Ge(r)?Cte(e,t,r,o):z(r)?Rte(e,t,r,o):Zt(e,t,r,o)}var qM=class extends tp{constructor(t,r){super("Decode",t,r)}};function LDe(e,t,r){if(!bt(e,t,r))throw new qM(r,ds(e,t,r));return r}function kDe(e,t,r){let o=Gr.Get().unionPrioritySort?Qf(t):t;return cr("Decode",e,o,r)}var A8t=Xf([(e,t,r)=>Rr(r),(e,t,r)=>pd(e,t,r),(e,t,r)=>rp(e,t,r),(e,t,r)=>ms(e,t,r),(e,t,r)=>LDe(e,t,r),(e,t,r)=>kDe(e,t,r)]);var HM=class extends tp{constructor(t,r){super("Encode",t,r)}};function MDe(e,t,r){if(!bt(e,t,r))throw new HM(r,ds(e,t,r));return r}function DDe(e,t,r){let o=Gr.Get().unionPrioritySort?Qf(t):t;return cr("Encode",e,o,r)}var $8t=Xf([(e,t,r)=>Rr(r),(e,t,r)=>DDe(e,t,r),(e,t,r)=>pd(e,t,r),(e,t,r)=>rp(e,t,r),(e,t,r)=>ms(e,t,r),(e,t,r)=>MDe(e,t,r)]);var Bi=class extends Error{constructor(t,r){super(r),this.type=t}};function Pte(e,t){return c.IsFunction(t.default)?t.default(t):c.IsObject(t.default)?Rr(t.default):t.default}function Ute(e,t){if(Bf(t)&&!pi(t))throw new Bi(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=Ff(t)?t.minItems:0;return Array.from({length:r},()=>Ur(e,t.items))}function wte(e,t){return Rc(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Pc(t)?BigInt(t.minimum):BigInt(0)}function vte(e,t){return!1}function Nte(e,t){let r=Ur(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function Lte(e,t){return Ur({...e,...t.$defs},pn(t.$ref))}function kte(e,t){return Ur(e,vn(t))}function Mte(e,t){let r=Ur(e,t.returnType);return()=>r}function Dte(e,t){return Rc(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Pc(t)?t.minimum:0}function Fte(e,t){let r=Li(e,t),o=vn(r);return Ur(e,o)}function $te(e,t){return t.const}function Gte(e,t){throw new Bi(t,"Cannot create TNever types")}function Bte(e,t){return null}function jte(e,t){return Rc(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Pc(t)?t.minimum:0}function qte(e,t){return(c.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:Ur(e,t.properties[i])}),{})}function Hte(e,t){if(cS(t)&&!pi(t))throw new Bi(t,"Record with the minProperties constraint must have a default annotation");return{}}function Kte(e,t){return c.HasPropertyKey(e,t.$ref)?Ur(e,e[t.$ref]):(()=>{throw new Bi(t,"Unable to deref Ref")})()}function zte(e,t){if((uS(t)||aS(t))&&!pi(t))throw Error("Strings with format or pattern constraints must specify default");let o=sS(t)?t.minLength:0;return"".padEnd(o)}function Yte(e,t){return Symbol()}function Vte(e,t){let r=cE(t.pattern);if(jr(r))throw new Bi(t,"Unable to create TemplateLiteral due to infinite type expansion");return Ur(e,r)}function Wte(e,t){return Array.from({length:t.minItems},(r,o)=>Ur(e,t.items[o]))}function Qte(e,t){if(c.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Ur(e,t.anyOf[0])}function Ur(e,t){return pi(t)?Pte(e,t):Xe(t)?Ute(e,t):Fo(t)?wte(e,t):oo(t)?vte(e,t):wr(t)?Nte(e,t):Lt(t)?Lte(e,t):Mr(t)?kte(e,t):vr(t)?Mte(e,t):dn(t)?Dte(e,t):ge(t)?Fte(e,t):Ke(t)?$te(e,t):Mo(t)?Gte(e,t):Za(t)?Bte(e,t):sr(t)?jte(e,t):Se(t)?qte(e,t):_t(t)?Hte(e,t):ht(t)?Kte(e,t):jr(t)?zte(e,t):Ja(t)?Yte(e,t):kt(t)?Vte(e,t):Ge(t)?Wte(e,t):fa(t)?void 0:z(t)?Qte(e,t):Go(t)?void 0:void 0}function fs(...e){let[t,r]=nt.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Ur(t,r)}var KM=class extends tp{constructor(t,r){super("Parse",t,r)}};function FDe(e,t,r){DM();let o=ds(e,t,r);if(FM(),!bt(e,t,r))throw new KM(r,o);return r}var aZt=Xf([(e,t,r)=>Rr(r),(e,t,r)=>pd(e,t,r),(e,t,r)=>rp(e,t,r),(e,t,r)=>ms(e,t,r),(e,t,r)=>FDe(e,t,r)]);var GDe=me({type:$e("insert"),path:Un(),value:Br()}),BDe=Object({type:$e("update"),path:Un(),value:Br()}),jDe=me({type:$e("delete"),path:Un()}),mZt=Pe([GDe,BDe,jDe]);var ld=L(function*(e){if(!e.body)return yield*new It({message:"This command does not accept a request body"});let t=e.body;return t.examples?.length?t.examples[0]:fs(t)});var Jte=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)",Zf=Fe("file").pipe(vi("f"),Z("Read body from file (use - for stdin)"),Ee("FILE_PATH"),Je),dd=Fe("data").pipe(vi("d"),Z("Inline JSON body"),Ee("JSON"),Je),md=ro("generate-skeleton").pipe(Z("Print a JSON skeleton for the request body and exit"),_n(!1)),Kt={from:Fe("from").pipe(Z(`Start of time range${Jte}. Start narrow and widen step by step only when the result is empty`),Ee("TIMESTAMP"),Je),to:Fe("to").pipe(Z(`End of time range${Jte}`),Ee("TIMESTAMP"),Je)},np=Fe("query").pipe(Z("Tsuga query to filter results"),Ee("TSUGA_QUERY"),Je),Jf=Fm("max-results").pipe(Ou(e=>Number.isSafeInteger(e)&&e>0,()=>"--max-results must be a positive safe integer"),Z("Maximum number of results"),Ee("COUNT"),Je),op={limit:Fm("limit").pipe(Ou(e=>Number.isSafeInteger(e)&&e>=1&&e<=Bu,()=>`--limit must be an integer from 1 to ${Bu}`),Z(`Maximum number of items to return, up to ${Bu} (default: ${Gu})`),Ee("N"),Je),offset:Fm("offset").pipe(Ou(e=>Number.isSafeInteger(e)&&e>=0,()=>"--offset must be a non-negative safe integer"),Z("Number of items to skip, to request a later page"),Ee("N"),Je),all:ro("all").pipe(Z("Follow every page and print all items as one page; cannot be combined with --limit or --offset"),_n(!1))},Kr=L(function*(e){return{from:yield*wC("from",e.from),to:yield*wC("to",e.to)}}),wC=L(function*(e,t){let r=yield*gt,o=ne(t)??(yield*r.getDefault(e));if(!o)return yield*new It({message:`--${e} is required`});let i=Math.floor((yield*sn)/Bl),a=yield*lt({try:()=>XO(o,i),catch:s=>new It({message:s instanceof Error?s.message:String(s)})});return Number.isSafeInteger(a)?a:yield*new It({message:`Invalid time value: ${o}. Unix seconds must be a safe integer.`})}),fd=L(function*(e,t){let r=yield*gt;return ne(t)??(yield*r.getDefault(e))});function ere(e){if(e===null||typeof e!="object"||!("properties"in e))return{};let{properties:t}=e;if(t===null||typeof t!="object")return{};let r={};for(let o of Object.keys(t)){let i=Reflect.get(t,o),a=i!==null&&typeof i=="object"&&"description"in i?Reflect.get(i,"description"):void 0;r[o]=typeof a=="string"?{description:a}:{}}return r}function tre(e,t){let r=e[t];return typeof r=="string"?r:th(r)&&At(r)&&typeof r.value=="string"?r.value:void 0}function hn(e){let t={};for(let[r,o]of Object.entries(e))o!==void 0&&(t[r]=o);return t}var kn=(e,t,r)=>P(e,{file:Zf,data:dd,generateSkeleton:md},v(`cli.${e}`)(function*(o){if(o.generateSkeleton){yield*ya(yield*ld(r));return}yield*xe(yield*tt(r,{body:yield*ed(o)}))})).pipe(U(t));var rre=kn("scalar","Run aggregation queries and return scalar results",EA);var nre=kn("timeseries","Run aggregation queries and return timeseries results",SA);var ore=P("aggregation").pipe(U("Run aggregation queries"),_e([rre,nre]));var lre=require("node:crypto");var bS=require("node:crypto");function KDe(e){return(0,bS.createHash)("sha256").update(e).digest("base64url")}function ire(){let e=(0,bS.randomBytes)(32).toString("base64url");return{verifier:e,challenge:KDe(e)}}var cre=require("node:http"),VM=require("node:os");var zDe=[":root{color-scheme:light dark;--bg:#f9fafb;--card:#fff;--fg:#1f2937;--fg-muted:#6b7280;","--logo-1:#08cb00;--logo-2:#008200;--brand:#08cb00;--bloom:#e5e7eb}","@media(prefers-color-scheme:dark){:root{--bg:#18181b;--card:#202023;--fg:#e4e4e7;","--fg-muted:#a1a1aa;--logo-1:#fff;--logo-2:#fff;--bloom:#52525b}}","*{box-sizing:border-box}","body{margin:0;min-height:100vh;display:flex;align-items:flex-start;justify-content:center;","padding:24px;padding-top:14vh;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;","color:var(--fg);background-color:var(--bg);background-image:","radial-gradient(72% 78% at 104% 112%,var(--brand) -20%,transparent 64%),","radial-gradient(46% 46% at 94% -4%,var(--brand) -20%,transparent 64%),","radial-gradient(48% 58% at -8% 68%,var(--bloom) -20%,transparent 64%)}","main{display:flex;flex-direction:column;align-items:center;text-align:center;gap:24px;","width:100%;max-width:480px;padding:32px;border-radius:8px;backdrop-filter:blur(8px);","background-color:color-mix(in srgb,var(--card) 55%,transparent);","box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)}",".tile{display:flex;padding:6px;border-radius:6px;background-color:var(--card);","box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}",".tile svg{display:block;width:32px;height:32px}",".copy{display:flex;flex-direction:column;gap:8px}","h1{margin:0;font-size:29px;font-weight:600;line-height:1.2}","p{margin:0;font-size:14px;line-height:20px;color:var(--fg-muted)}"].join(""),YDe=['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 111.94 133.41" aria-hidden="true">','<path fill="var(--logo-2)" d="M40.66,54.06c-11.32,8.54-25.39,13.61-40.66,13.61v-23.36c17.9,0,','33.3-10.6,40.29-25.87v28.28c0,2.48.13,4.93.37,7.34Z"/>','<path fill="var(--logo-2)" d="M67.65,103.01v30.4h-23.36v-35.58c-11.87,10.29-27.34,16.54-44.29,','16.54v-23.36c19.33,0,35.76-12.37,41.8-29.63,3.5,16.76,12.87,31.39,25.85,41.63Z"/>','<rect fill="var(--logo-1)" x="44.29" width="23.36" height=".02"/>','<path fill="var(--logo-1)" d="M111.94,67.67c-16.83,0-32.21-6.14-44.05-16.3,2.32,22.28,21.16,',"39.64,44.05,39.64v23.36c-37.36,0-67.65-30.29-67.65-67.65V.02h23.36c0,24.47,19.83,44.29,44.29,",'44.29v23.36Z"/></svg>'].join("");function zM(e,t){let r=R0(e);return['<!doctype html><html lang="en"><head><meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',`<title>${r}</title><style>${zDe}</style></head><body><main>`,`<span class="tile">${YDe}</span>`,`<div class="copy"><h1>${r}</h1><p>${R0(t)}</p></div>`,"</main></body></html>"].join("")}var ure="/oauth/callback",WDe=5*jl,QDe=zM("Login complete","You can close this tab and return to the terminal."),are=zM("Login failed","Return to the terminal for details."),{$match:XDe,Code:ZDe,Failed:YM,NotACallback:sre}=g_();function JDe(e){return(0,VM.platform)()==="darwin"?["open",[e]]:(0,VM.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}var eFe=(e,t,r)=>Be(()=>{let o,i=X(()=>{o!==void 0&&(e.off("request",o),o=void 0)});return Sn(a=>{let s=(u,l,m)=>{u.writeHead(l,{"Content-Type":"text/html"}),u.end(m)};o=(u,l)=>{XDe({NotACallback:()=>s(l,404,are),Failed:({message:m})=>{s(l,400,are),a(F(new Tc({message:m})))},Code:({code:m})=>{s(l,200,QDe),a(A(m))}})(rFe(u.url??"/",r,t))},e.on("request",o)}).pipe(No(i),Sj({duration:WDe,orElse:()=>new Tc({message:"Timed out waiting for the browser to complete login (5 minutes)."})}))}),tFe=v("auth.openBrowser")(function*(e){let[t,r]=JDe(e);return yield*Zn(H(Ri(t,r,{stdin:"ignore",stdout:{stream:"ignore"},stderr:{stream:"ignore"}}),o=>Xn(o.unref,o.exitCode))).pipe(Hp({onSuccess:o=>Number(o)===0,onFailure:()=>!1}))});function rFe(e,t,r){let o;try{o=new URL(e,t)}catch{return sre()}if(o.pathname!==ure)return sre();let i=o.searchParams.get("error");if(i){let s=o.searchParams.get("error_description")??"";return YM({message:`Authorization failed: ${i}${s?` (${s})`:""}`})}if(o.searchParams.get("state")!==r)return YM({message:"State mismatch on OAuth callback; aborting for safety."});let a=o.searchParams.get("code");return a?ZDe({code:a}):YM({message:"OAuth callback did not include an authorization code."})}var pre=v("auth.captureAuthorizationCode")(function*(e){let t=yield*vo(X(()=>{let l=(0,cre.createServer)();return l.on("connection",m=>m.unref()),l}),l=>X(()=>l.close())),o=`http://127.0.0.1:${yield*Sn(l=>{let m=g=>{l(new Tc({message:`Could not open a loopback port: ${g.message}`}))};t.once("error",m),t.listen(0,"127.0.0.1",()=>{t.off("error",m);let g=t.address();l(g===null||typeof g=="string"?new Tc({message:"Loopback server did not report a usable address."}):A(g.port))})})}`,i=`${o}${ure}`,a=yield*cu(eFe(t,e.state,o),{startImmediately:!0}),s=e.buildAuthorizeUrl(i);return yield*cu(pt(function*(){(yield*tFe(s))?(yield*Hn("Opening your browser to complete login..."),yield*Hn("If it does not open, visit this URL:")):yield*Hn("Visit this URL in your browser to complete login:"),yield*Hn(` ${s}`)}),{startImmediately:!0}),{code:yield*Dh(a),redirectUri:i}},Zn);var dre=P("login",{},v("cli.auth.login")(function*(){let e=yield*gt,t=yield*Yu,r=yield*e.resolveApiUrl,{verifier:o,challenge:i}=ire(),a=(0,lre.randomBytes)(16).toString("base64url"),{code:s,redirectUri:u}=yield*pre({state:a,buildAuthorizeUrl:g=>i7(r,{redirectUri:g,challenge:i,state:a})}),l=yield*t.exchangeCode(r,{code:s,verifier:o,redirectUri:u}),m=yield*e.saveUserAuth(RA(l));yield*Le(`Logged in. Session token ${Lf(l.accessToken)} saved to ${m}`)})).pipe(U("Log in as a user with a browser authorization flow and save the session (replaces any saved operation API key)"));var mre=P("logout",{},v("cli.auth.logout")(function*(){yield*(yield*gt).clearUserAuth,yield*Le("Local user session cleared.")})).pipe(U("Clear the saved user session"));var zr=e=>Gb(Tl,e);var fre=(e,t)=>Bb(Tl,e,t);var ur=x(2,(e,t)=>jb(e,t));var gre=x(e=>$b(e[0]),(e,t)=>$N(e,t)),hre=x(2,(e,t)=>Dm(e,t));var yre=(e,t)=>Fy(Tl,e,t);var Ere=x(3,(e,t,r)=>Kb(e,t,r));var Sre=P("operation-key",{key:zr("OPERATION_API_KEY").pipe(ur("The operation API key to save"),hre(e=>e.trim()),Ere(e=>e.length>0,()=>"OPERATION_API_KEY must not be empty or whitespace-only"))},v("cli.auth.operationKey")(function*({key:e}){let t=yield*gt;yield*t.saveOperationApiKey(e),yield*Le(`Operation API key saved to ${t.configPath}`)})).pipe(U("Save an operation API key to the config file (replaces any saved user session)"));function Tre(e,t){let r=Lf(e.accessToken),o=new Date(e.accessExpiresAt),i=!!e.refreshToken;return Number.isNaN(o.getTime())?`Logged in as a user (token ${r}, expires ${e.accessExpiresAt}).`:o<=t?i?`Logged in as a user (token ${r}). Access token expired ${vC(o,t)} ago, on ${e.accessExpiresAt}; the next command renews it automatically.`:`Logged in as a user (token ${r}). Session expired ${vC(o,t)} ago, on ${e.accessExpiresAt}. Run \`tsuga auth login\` to sign in again.`:i?`Logged in as a user (token ${r}). Access token expires in ${vC(t,o)}, on ${e.accessExpiresAt}; the session renews automatically.`:`Logged in as a user (token ${r}). Session expires in ${vC(t,o)}, on ${e.accessExpiresAt}.`}function vC(e,t){let r=G8(B8({start:e,end:t}),{format:["years","months","days","hours","minutes"]});return r===""?"less than a minute":r}var _re=P("status",{},v("cli.auth.status")(function*(){let e=yield*cs,t=yield*gt,{credential:r}=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});if(!r){yield*Le("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}let o=r.kind;switch(o){case"user-session":{let i=new Date(yield*sn);yield*Le(Tre(r.userAuth,i));return}case"operation-api-key":yield*Le("Authenticated with an operation API key.");return;default:Pt(o)}})).pipe(U("Show the current authentication method"));var Ire=P("token",{},v("cli.auth.token")(function*(){let e=yield*gt,t=yield*e.resolveApiUrl,r=yield*e.getUserAuth;if(!r){let i=t===JE?"":` for ${t}`;return yield*new Ku({message:`No user session${i}.`,suggestions:["Sign in with your browser: tsuga auth login"]})}let o=yield*UA(t,r);yield*Le(o.accessToken)})).pipe(U("Print the saved user access token to stdout"));var gd="/v0/admin-center";var nFe="^\\S(.*\\S)?$",oFe=50,iFe=128,aFe=256,sFe=n.Object({key:n.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:n.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),cFe=n.Object({key:n.String({maxLength:iFe,description:"Tag key to attach to the resource."}),value:n.String({maxLength:aFe,pattern:nFe,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Yr=n.Array(sFe,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),en=n.Array(cFe,{title:"Tags",maxItems:oFe,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),Ut=n.Optional(Yr),Dt=n.Optional(en);var ip="/v0/teams",kC=["public","private"],NC={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},uFe=n.Enum([NC.NAME,NC.CREATED_AT,NC.MEMBER_COUNT,NC.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),MC=n.Object({color:n.Enum(A0,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:n.Enum(C0,{description:"Avatar rendering mode selected for the team."}),iconName:n.Enum(AX,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),eg=n.Object({color:n.Enum(A0),mode:n.Enum(C0)}),pFe=100,lFe=250,bre=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum($i),joinedTeamAt:w(),orgRole:n.Enum(_A),avatar:n.Optional(eg)}),WM=3,QM=n.Pick(bre,["id","name","avatar"]),ap=n.Object({id:n.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:n.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:n.Optional(n.String({description:"Optional free-text description of the team."})),visibility:n.Enum(kC,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Ut,createdAt:w({description:"Timestamp when Tsuga created the team."}),updatedAt:w({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),memberPreview:n.Optional(n.Array(QM,{description:`First ${WM} members of the team, sorted by name.`})),avatar:n.Optional(MC)}),DC=n.Object({name:n.String({minLength:1,maxLength:pFe,format:ki,description:"Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization."}),description:ze(n.String({maxLength:lFe}),{description:"Team description."}),visibility:n.Enum(kC,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Dt,avatar:ze(MC)}),xre=n.Object({searchQuery:n.Optional(p({description:"Substring matched against team names, descriptions, and IDs."})),visibility:n.Optional(n.Enum(kC,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:n.Optional(n.Boolean({description:"If true, return only teams that include the authenticated user."}))}),XM=n.Optional(p({allowEmpty:!1,description:"Exact team name to look up. Returns at most one team, since team names are unique."})),mrr=f({tags:["teams"],url:ip,method:"GET",paginated:!0,response:n.Array(ap),query:n.Object({...fe,includeMemberPreview:n.Optional(n.Boolean({description:"Adds `memberCount` and `memberPreview` to every returned team."})),...xre.properties,name:XM,sortBy:n.Optional(uFe),sortDirection:n.Optional(pe)})}),frr=f({tags:["teams"],url:`${ip}/:id`,method:"GET",params:n.Object({id:p()}),response:ap}),LC={NAME:"name",ROLE:"role",ORG_ROLE:"orgRole",JOINED_TEAM_AT:"joinedTeamAt"},dFe=n.Enum([LC.NAME,LC.ROLE,LC.ORG_ROLE,LC.JOINED_TEAM_AT]),grr=f({tags:["teams"],url:`${ip}/:id/members`,method:"GET",paginated:!0,params:n.Object({id:p()}),query:n.Object({...fe,searchQuery:n.Optional(p({description:"Substring matched against member names, emails, and IDs."})),teamRole:n.Optional(n.Array(n.Enum($i),{maxItems:$i.length,uniqueItems:!0,description:"Restrict results to members with one of these team roles."})),sortBy:n.Optional(dFe),sortDirection:n.Optional(pe)}),response:n.Array(bre)}),hrr=f({tags:["teams"],url:`${ip}/:id/assets`,method:"GET",params:n.Object({id:p()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number(),sloCount:n.Number()})}),yrr=f({tags:["teams"],url:ip,method:"POST",body:DC,response:ap}),Err=f({tags:["teams"],url:`${ip}/:id`,method:"PUT",params:n.Object({id:p()}),body:DC,response:ap}),mFe=D("type",[n.Object({type:n.Literal("ids"),teamIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:100})}),n.Object({type:n.Literal("all"),filters:n.Optional(xre)})]),Srr=f({tags:["teams"],url:`${ip}/bulk-update`,method:"POST",body:n.Object({selection:mFe,config:n.Object({visibility:n.Enum(kC)})}),response:n.Object({})}),Trr=f({tags:["teams"],url:`${ip}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B});var fFe=n.Enum(["agent","cli","mcp-codemode","mcp-server","tadmin","terraform-provider","web-frontend"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),Te=D("type",[n.Object({type:n.Literal("user",{description:"The resource was created or updated by a user."}),id:n.String({description:"Unique identifier of the user actor."}),name:n.String({description:"Display name of the user actor at the time of response."}),avatar:n.Optional(eg)}),n.Object({type:n.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:n.String({description:"Unique identifier of the operation API key actor."}),name:n.String({description:"Display name of the operation API key actor."}),source:n.Optional(fFe)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var OS=`${gd}/custom-roles`,gFe=50,hFe=3,yFe=20,EFe=["read","write"],xS=n.Enum(["read"],{description:"Access granted on this resource type."}),at=n.Enum(EFe,{description:"Access granted on this resource type. `write` implies `read`."});var Cre="Teams the role grants its asset permissions on. `all` covers every team, `public` covers public teams only, `specific` covers the listed teams, and `all-except` covers every team but the listed ones.",Rre="Team IDs the scope applies to.",Ore=n.Array(n.String(),{description:Rre}),SFe=D("type",[n.Object({type:n.Literal("all")},{title:"CustomRoleAllTeams"}),n.Object({type:n.Literal("public")},{title:"CustomRolePublicTeams"}),n.Object({type:n.Literal("specific"),teamIds:Ore},{title:"CustomRoleSpecificTeams"}),n.Object({type:n.Literal("all-except"),teamIds:Ore},{title:"CustomRoleAllTeamsExcept"})],{description:Cre}),Are=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:gFe,uniqueItems:!0,description:Rre}),TFe=D("type",[n.Object({type:n.Literal("all")}),n.Object({type:n.Literal("public")}),n.Object({type:n.Literal("specific"),teamIds:Are}),n.Object({type:n.Literal("all-except"),teamIds:Are})],{description:Cre}),_Fe=n.Object({database:xS,inventory:xS,queue:xS,service:xS,"audit-log":xS}),IFe=n.Object({"allowed-domains":at,"audit-log-stream-destination":at,"cluster-integration-config":at,"custom-usage-tag":at,"databricks-connection":at,"github-connection":at,"llm-provider":at,"retention-policy":at,"saml-config":at,"sensitive-data-scanner-rule":at,"service-target":at,"team-remap-config":at,"adaptive-notification-rule":at,"cloud-account":at,"dashboard-folder":at,"monitor-folder":at,"dashboard-report":at,"dashboard-share":at,dashboard:at,"ingestion-api-key":at,investigation:at,"log-route":at,"metric-route":at,"span-route":at,monitor:at,notebook:at,"notification-integration":at,"notification-rule":at,"notification-silence":at,"operation-api-key":at,"quality-report":at,"rum-public-token":at,"sandbox-configuration":at,slo:at,"synthetic-test":at,"tag-policy":at,"user-invitation":at}),Pre=n.Object({...n.Partial(n.Object({..._Fe.properties,...IFe.properties})).properties,team:at},{description:"Access level granted per resource type, within the role team scope. An omitted resource type grants no access."});var Ure=n.Array(n.Enum(T0),{description:"Telemetry signals the role can read. An empty array grants no telemetry access."}),ZM="Additional restriction applied cluster-side to every telemetry query the role holder runs. Each entry keeps only the data points whose `key` matches one of `values`, and entries are combined with AND.",wre="Attribute key matched against telemetry data points, such as `env` or `service.name`.",vre="Values the attribute must equal for a data point to be kept. A data point matching any of them is kept.",bFe=n.Array(n.Object({key:n.String({description:wre}),values:n.Array(n.String(),{description:vre})}),{description:ZM}),xFe=n.Array(n.Object({key:p({allowEmpty:!1,description:wre}),values:n.Array(n.String({minLength:1,maxLength:Mi,pattern:"^(?!\\*$)",errorMessage:{pattern:"Must not be '*'."}}),{minItems:1,maxItems:yFe,description:vre})}),{maxItems:hFe,description:ZM}),hd=n.Object({id:n.String({description:"Tsuga-generated custom role ID assigned at creation."}),name:n.String({description:"Human-readable custom role name, unique across the account."}),description:n.Optional(n.String({description:"Free-form description of the custom role. Absent when not set."})),teamScope:SFe,assets:Pre,telemetry:Ure,telemetryQuery:n.Optional(bFe),creator:n.Optional(Te),updater:n.Optional(Te),createdAt:w({description:"Timestamp when Tsuga created the custom role."}),updatedAt:w({description:"Timestamp when Tsuga last updated the custom role."})}),Nre=n.Pick(hd,["teamScope","assets","telemetry","telemetryQuery"],{description:"What the custom role grants its holder."}),OFe=100,FC=n.Object({name:n.String({minLength:1,maxLength:OFe,format:ki,description:"Human-readable custom role name, unique across the account."}),description:ze(p({type:"short"}),{description:"Free-form description of the custom role. Omit on update to keep the current description, or pass null to remove it."}),teamScope:TFe,assets:Pre,telemetry:Ure,telemetryQuery:ze(xFe,{description:`${ZM} Omit on update to keep the current restriction, or pass null to remove it.`})}),krr=f({tags:["custom-roles"],url:OS,method:"GET",response:n.Array(hd)}),Mrr=f({tags:["custom-roles"],url:`${OS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:hd}),Drr=f({tags:["custom-roles"],url:OS,method:"POST",body:FC,response:hd}),Frr=f({tags:["custom-roles"],url:`${OS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1})}),body:FC,response:hd}),$rr=f({tags:["custom-roles"],url:`${OS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1})}),response:B});var AFe={"ai-sandboxes":"AI tasks",analytics:"Analytics","browser-views":"RUM Browser views","dashboard-reports":"Dashboard reports",dashboards:"Dashboards",databases:"Databases",ecs:"ECS","inventory-all-resources":"All cloud resources","inventory-overview":"Cloud resources overview","inventory-settings":"Cloud resources settings",inventory:"Cloud resources",investigations:"Investigations",kubernetes:"Kubernetes","log-routes":"Log routes",logs:"Logs","metric-routes":"Metric routes",metrics:"Metrics",mobile:"RUM Mobile",monitor:"Monitors",notebooks:"Notebooks","notification-integrations":"Notification integrations","notification-rules-list":"Notification rules","notification-rules":"Notifications","notification-silences":"Notification silences","ongoing-alerts":"Ongoing alerts",queues:"Queues",routes:"Routes",rum:"RUM views","sensitive-data-scanner":"Sensitive data scanner",serverless:"Serverless",services:"Services",sessions:"Sessions",slo:"SLOs","span-routes":"Span routes",synthetics:"Synthetics","team-map":"Service map",traces:"Traces"},CFe=Object.keys(AFe),JM=n.Enum(CFe,{description:"Stable nav item key within a main sidebar category."}),Lre="Nav item keys shown in the primary sidebar for this category, in display order.",kre="Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none.",Mre=e=>D("type",[n.Object({type:n.Literal("dashboard"),id:e("Tsuga-generated ID of the dashboard the item opens.")}),n.Object({type:n.Literal("service"),serviceName:e("OpenTelemetry service name of the service whose page the item opens."),serviceNamespace:n.Optional(e("OpenTelemetry service namespace of that service. Omitted for a service without one."))}),n.Object({type:n.Literal("browser-view"),pageId:e("View name identifying the page the item opens."),app:e("Application the view belongs to."),env:e("Environment the view was observed in.")})],{description:"Page the user added to their personal sidebar."}),RFe=Mre(e=>n.String({description:e})),PFe=Mre(e=>p({allowEmpty:!1,description:e}));var UFe=50,Dre=`Items shown in the primary sidebar for this category, in display order: nav item keys, and pages the user added to their personal sidebar (at most ${UFe} across all categories).`,wFe=n.Array(n.String(),{description:Lre}),vFe=n.Optional(n.Array(n.String(),{description:kre})),NFe=n.Array(JM,{description:Lre}),LFe=n.Optional(n.Array(JM,{description:kre})),Fre="Stable category id. Unknown or renamed ids are ignored by the client catalog.",$re="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",Gre=e=>n.Object({categories:n.Array(n.Object({id:n.String({description:Fre}),visible:e,folded:vFe}),{description:$re})}),Bre=e=>n.Object({categories:n.Array(n.Object({id:p({allowEmpty:!1,description:Fre}),visible:e,folded:LFe}),{description:$re})}),Hrr=Gre(wFe),Krr=Bre(NFe),jre=Gre(n.Array(n.Union([n.String(),RFe]),{description:Dre})),qre=Bre(n.Array(n.Union([JM,PFe]),{description:Dre}));var zre=["YYYY-MM-DD","DD-MM-YYYY","MM-DD-YYYY"],Yre=["12h","24h"],MFe=n.Union([n.Object({type:n.Literal("home")}),n.Object({type:n.Literal("explorer")}),n.Object({type:n.Literal("metrics")}),n.Object({type:n.Literal("traces")}),n.Object({type:n.Literal("analytics")}),n.Object({type:n.Literal("dashboards"),id:n.String()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")}),n.Null()]),DFe=n.Union([D("type",[n.Object({type:n.Literal("home")}),n.Object({type:n.Literal("explorer")}),n.Object({type:n.Literal("metrics")}),n.Object({type:n.Literal("traces")}),n.Object({type:n.Literal("analytics")}),n.Object({type:n.Literal("dashboards"),id:p()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")})]),n.Null()]),tD=p({allowEmpty:!1,description:"Identifier of the custom role to assign. Use the `id` returned by the custom role endpoints."}),Vre=D("type",[n.Object({type:n.Enum(Qu,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"Assigns the custom role `customRoleId`."}),customRoleId:tD})],{description:"Organization role to assign: a built-in role `type`, or `custom` with the `customRoleId` of a custom role."}),FFe=D("type",[n.Object({type:n.Enum(Qu,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"The user holds a custom role."}),customRoleId:n.String({description:"Identifier of the custom role. Use it with the custom role endpoints to read what the role grants."})})]),vc=n.Object({email:n.String({description:"Lowercase email address for the user. Use this for display and invitation matching, not as a stable identifier."}),id:n.String({description:"Unique identifier of the user. Generated by Tsuga and stable for the user lifetime."}),name:n.String({description:"Display name of the user."}),role:n.Union([n.Enum(_A,{description:"Organization role for the user: `admin`, `public_editor`, `public_viewer`, `teams_only`, or `custom` when the user holds a custom role."}),FFe],{description:"Organization role for the user, either as a role key or as an object with the role `type` and, for a custom role, its `customRoleId`. Handle both forms: the object form replaces the role key."}),customRoleId:n.Optional(n.String({description:"Identifier of the custom role held by the user, when `role` is the `custom` key. The object form of `role` carries it instead. Use it with the custom role endpoints to read what the role grants."})),orgId:n.String({description:"Identifier of the Tsuga organization the user belongs to."}),orgName:n.Optional(n.String({description:"Display name of the Tsuga organization the user belongs to. Absent when the organization record cannot be resolved."})),avatar:n.Optional(eg),defaultView:n.Optional(MFe),timezone:n.Optional(n.Union([n.String(),n.Null()],{description:"IANA timezone used to display dates and times (e.g. `Europe/Paris`). Absent or `null` means the timezone is auto-detected from the browser."})),dateFormat:n.Optional(n.Union([n.Enum(zre),n.Null()],{description:"Preferred format for displaying dates: `YYYY-MM-DD`, `DD-MM-YYYY`, or `MM-DD-YYYY`. Absent or `null` means the Tsuga default format."})),hourFormat:n.Optional(n.Union([n.Enum(Yre),n.Null()],{description:"Preferred format for displaying times: `12h` (AM/PM) or `24h`. Absent or `null` means the Tsuga default format."})),favoriteDashboards:n.Optional(n.Array(n.String(),{description:"Dashboard IDs the user marked as favorites. Not pruned when a dashboard is deleted, so an ID may no longer resolve."})),favoriteFolders:n.Optional(n.Array(n.String(),{description:"Dashboard folder IDs the user marked as favorites. Not pruned when a folder is deleted, so an ID may no longer resolve."})),filterDataByTeams:n.Optional(n.Boolean({description:"Whether the user wants data across the application filtered to the teams they belong to. Set by the user in their profile settings."})),sidebarNavLayout:n.Optional(jre),fromSso:n.Boolean({description:"Whether the user account was provisioned or authenticated through SSO."}),createdAt:w({description:"Timestamp when Tsuga created the user."}),updatedAt:w({description:"Timestamp when Tsuga last updated the user."}),teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs the user currently belongs to."}))}),{role:nnr,customRoleId:onr,...Hre}=vc.properties,rD=D("role",[n.Object({...Hre,role:n.Enum(Qu,{description:"Organization role for the user: `admin`, `public_editor`, `public_viewer` or `teams_only`."})}),n.Object({...Hre,role:n.Literal("custom",{description:"The user holds a custom role."}),customRole:Nre})]),Wre=n.Intersect([ap,n.Object({userRole:n.Enum($i)})]),Qre=n.Object({status:n.Literal("authenticated"),token:n.String(),user:rD}),Xre=D("status",[Qre,n.Object({status:n.Literal("mfa-required"),mfaToken:n.String({description:"Short-lived token accepted only by the TOTP login endpoints; it grants no other access."}),totpEnrolled:n.Boolean({description:"False when the user still has to set up an authenticator app."})})]),inr=f({tags:["users"],url:"/v0/login",method:"POST",body:n.Object({email:p({type:"email"}),password:p({type:"long"})}),response:Xre}),Zre="/v0/login/totp",anr=f({tags:["users"],url:`${Zre}/setup`,method:"POST",body:n.Object({mfaToken:p({type:"long"})}),response:n.Object({mfaToken:n.String({description:"Replaces the login MFA token; pass it when verifying the first code."}),secret:n.String({description:"Base32 secret for manual entry in the authenticator app."})})}),snr=f({tags:["users"],url:Zre,method:"POST",body:n.Object({mfaToken:p({type:"long"}),code:n.String({pattern:`^[0-9]{${6}}$`,description:"The 6-digit code shown by the authenticator app."})}),response:Qre}),cnr=f({tags:["users"],url:"/v0/forgot-password",method:"POST",body:n.Object({email:p({type:"email"})}),response:n.Object({})}),unr=f({tags:["users"],url:"/v0/reset-password",method:"POST",body:n.Object({resetToken:p(),password:p({type:"user-password"})}),response:n.Object({})}),$Fe=["active","expired"],pnr=f({tags:["users"],url:"/v0/reset-password-status/:resetToken",method:"GET",params:n.Object({resetToken:p()}),response:n.Object({status:n.Enum($Fe)})}),lnr=f({tags:["users"],url:"/v0/change-password",method:"POST",body:n.Object({currentPassword:p({type:"long"}),newPassword:p({type:"user-password"})}),response:n.Object({})}),sp="/v0/users",nD="/v0/current-user",dnr=f({tags:["users"],url:nD,method:"GET",response:rD}),mnr=f({tags:["users"],url:`${nD}/teams`,method:"GET",response:n.Array(Wre)}),fnr=f({tags:["users"],url:"/v0/logout",method:"POST",response:n.Object({})}),gnr=f({tags:["users"],method:"PATCH",url:nD,body:n.Partial(n.Object({avatar:n.Union([eg,n.Null()]),defaultView:DFe,timezone:n.Union([n.String({format:Dl}),n.Null()]),dateFormat:n.Union([n.Enum(zre),n.Null()]),hourFormat:n.Union([n.Enum(Yre),n.Null()]),favoriteDashboards:n.Array(p({allowEmpty:!1})),favoriteFolders:n.Array(p({allowEmpty:!1})),filterDataByTeams:n.Boolean(),sidebarNavLayout:n.Union([qre,n.Null()]),name:p()}),{minProperties:1}),response:rD}),hnr=f({tags:["users"],url:sp,method:"GET",response:n.Array(vc),query:n.Optional(n.Object({includeTeamIds:n.Optional(n.Boolean())}))}),Kre={count:n.Integer({description:"Number of members holding the role."}),preview:n.Array(QM,{description:`First ${WM} members holding the role, sorted by name.`})},GFe=D("role",[n.Object({role:n.Enum(Qu),...Kre}),n.Object({role:n.Literal("custom"),customRoleId:n.String(),...Kre})]),ynr=f({tags:["users"],url:`${sp}/role-members`,method:"GET",response:n.Array(GFe,{description:"Member count and preview of every role held by at least one member."})}),AS={NAME:"name",ROLE:"role",LOGIN_METHOD:"fromSso",TEAMS:"teams",CREATED_AT:"createdAt"},Jre=n.Partial(n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring to match against the member name, email, or ID."})},{description:"Substring matched against the member name, email, or ID"})},{description:"Optional filters applied to narrow the returned members"})),BFe=n.Partial(n.Object({...fe,includeTeamIds:n.Boolean({description:"When true, include the IDs of the teams each member belongs to."}),filters:Jre,sort:n.Object({by:n.Enum([AS.NAME,AS.ROLE,AS.LOGIN_METHOD,AS.TEAMS,AS.CREATED_AT],{description:"Field to sort the returned members by"}),direction:pe},{description:"Optional sorting applied to the returned members"})})),Enr=f({tags:["users"],url:`${sp}/query`,method:"POST",paginated:!0,response:n.Array(vc),body:BFe}),{teamIds:Snr,...jFe}=vc.properties,qFe=n.Object({...jFe,teams:n.Optional(n.Array(Wre))}),Tnr=f({tags:["users"],url:`${sp}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),query:n.Optional(n.Object({includeTeamRoles:n.Optional(n.Boolean())})),response:qFe}),eD=si(Jre),_nr=f({tags:["users"],method:"PUT",url:`${sp}/bulk-update-role`,body:n.Union([D("role",[n.Object({role:n.Enum(Qu),selection:eD}),n.Object({role:n.Literal("custom"),selection:eD,customRoleId:tD})]),n.Object({selection:eD,role:Vre})]),response:n.Object({})}),Inr=f({tags:["users"],url:`${sp}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),bnr=f({tags:["users"],url:`${sp}/:id/totp`,method:"DELETE",params:n.Object({id:p()}),response:B}),xnr=f({tags:["users"],url:`${sp}/all-emails`,method:"GET",response:n.Array(n.String())}),ene=["pending","accepted","expired","revoked"],HFe=n.Enum(ene),yd="/v0/invitations",KFe=10,oD={email:p({type:"email",description:"Lowercase email address to invite into the organization."}),teamId:p({description:"Team ID to add the invited user to after acceptance."}),teamRole:n.Enum($i,{description:"Role the invited user receives in the target team once accepted: `admin`, `editor`, or `viewer`."})},zFe=n.Object({...oD,userRole:n.Enum(Qu,{description:"Organization role the invited user receives after acceptance: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),YFe=n.Object({...oD,userRole:n.Literal("custom",{description:"Assigns the custom role identified by `customRoleId` after acceptance."}),customRoleId:tD}),VFe=n.Object({...oD,userRole:Vre}),WFe=n.Union([D("userRole",[zFe,YFe]),VFe]),Onr=f({tags:["invitations"],url:`${yd}/create`,method:"POST",body:n.Array(WFe,{maxItems:KFe}),response:n.Object({success:n.Boolean(),message:n.String()})}),Anr=f({tags:["invitations"],url:`${yd}/resend/:id`,params:n.Object({id:p()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),tne=n.Partial(n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring to match against the invitation email, team name, or status."})},{description:"Substring matched against the invitation email, team name, or status"})},{description:"Optional filters applied to narrow the returned invitations"})),QFe=si(tne),Cnr=f({tags:["invitations"],url:`${yd}/bulk-resend`,method:"POST",body:n.Object({selection:QFe}),response:n.Object({success:n.Boolean(),message:n.String()})}),Rnr=f({tags:["invitations"],url:yd,method:"POST",body:n.Object({secret:p()}),response:n.Object({status:HFe,email:n.String(),teamName:n.Optional(n.String()),avatar:n.Optional(MC)})}),Pnr=f({tags:["invitations"],url:`${yd}/accept`,method:"POST",body:n.Object({name:p({type:"short"}),password:p({type:"user-password"}),secret:p()}),response:Xre}),Unr=f({tags:["invitations"],url:`${yd}/revoke/:id`,params:n.Object({id:p()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),XFe=n.Object({id:n.String({description:"Unique identifier of the invitation. Generated by Tsuga."}),email:n.String({description:"Email address invited to join the organization."}),teamId:n.Optional(n.String({description:"Team ID assigned when the invitation is accepted."})),teamRole:n.Optional(n.Enum($i,{description:"Team role assigned when the invitation is accepted: `admin`, `editor`, or `viewer`."})),createdBy:n.Optional(n.String({description:"User ID that created the invitation."})),status:n.Enum(ene,{description:"Invitation lifecycle status: `pending`, `accepted`, `expired`, or `revoked`. `expired` can be computed from `expiresAt` when invitations are listed."}),expiresAt:w({description:"Timestamp when the invitation expires if not accepted."}),createdAt:w({description:"Timestamp when Tsuga created the invitation."}),updatedAt:w({description:"Timestamp when Tsuga last updated the invitation."})}),$C={EMAIL:"email",TEAM:"team",STATUS:"status",CREATED_AT:"createdAt"},ZFe=n.Partial(n.Object({...fe,filters:tne,sort:n.Object({by:n.Enum([$C.EMAIL,$C.TEAM,$C.STATUS,$C.CREATED_AT],{description:"Field to sort the returned invitations by"}),direction:pe},{description:"Optional sorting applied to the returned invitations"})})),wnr=f({tags:["invitations"],url:`${yd}/query`,method:"POST",paginated:!0,response:n.Array(XFe),body:ZFe});var tg="/v0/operation-api-keys",rne="tsuga_op",nne="v1";var JFe=100,one=n.Enum(c0,{description:"Team-access boundary for the operation API key. Set when the key is created or updated. `all` can reach all teams, `owning-team-and-public` can reach the owning team and public teams, and `owning-team-only` can reach only the owning team."}),_a=e=>n.Literal("read",{description:e}),Jt=e=>n.Enum(["read","write"],{description:e}),CS=n.Partial(n.Object({investigations:Jt("Investigations, the records collecting the timeline and findings of an incident analysis."),dashboard:Jt("Dashboards and the graphs they contain."),"dashboard-folder":Jt("Folders organizing dashboards."),"monitor-folder":Jt("Folders organizing monitors."),documentation:_a("Tsuga documentation and API reference pages, which are public content rather than account data."),"ingestion-api-key":Jt("Ingestion API keys, used to send telemetry data to Tsuga."),"rum-public-token":Jt("RUM public tokens, embedded in web and mobile applications to send real user monitoring telemetry."),"operation-api-key":Jt("Operation API keys, used to authenticate API, Terraform, MCP, and Tsuga CLI clients."),inventory:_a("Cloud resources discovered by inventory scans."),"cloud-account":Jt("Cloud accounts Tsuga scans to discover resources."),"custom-role":Jt("Custom global roles, which define what their holders can access across the organization."),"data-deletion-request":Jt("Data deletion requests, which delete the telemetry events matching a query on a cluster."),logs:_a("Ingested log events, through search and aggregation endpoints."),"log-route":Jt("Log routes, which select newly ingested logs and apply processors to them."),metrics:_a("Ingested metrics, through query and aggregation endpoints."),"metric-route":Jt("Metric routes, which select newly ingested metrics by name and apply processors to them."),"span-route":Jt("Span routes, which select newly ingested spans and apply processors to them."),monitor:Jt("Monitors, the alert definitions evaluated against telemetry."),"allowed-domains":Jt("Email domains whose users are allowed to join the organization."),queue:_a("Message queues of the catalog, inferred from telemetry."),"quality-report":_a("Telemetry quality reports."),billing:_a("Ingested data volume billed to the organization."),service:_a("Services of the catalog, inferred from telemetry."),"service-target":Jt("Notification targets attached to a service."),slo:Jt("Service level objectives and the alerts attached to them."),"notification-rule":Jt("Notification rules, which route alert transitions to notification targets."),"adaptive-notification-rule":Jt("Adaptive notification rules, which page the owners of the failing service when one of their monitors or SLOs fires."),"notification-integration":Jt("Notification integrations, containing the credentials Tsuga uses when sending notifications."),"notification-silence":Jt("Notification silences, which suppress matching notification delivery."),"custom-usage-tag":Jt("Custom usage tags, the telemetry tag keys tracked as usage dimensions."),"retention-policy":Jt("Retention policies applied to logs, metrics, and traces."),"sandbox-configuration":_a("Sandbox agent configurations of the key's teams, and the sandbox agent runs launched with them."),"tag-policy":Jt("Tag policies, which enforce tag requirements on Tsuga-managed assets and telemetry data."),team:Jt("Teams, their settings and their memberships."),traces:_a("Ingested spans, through search and aggregation endpoints."),rum:_a("Ingested RUM events, through search and aggregation endpoints."),user:Jt("User accounts of the organization."),"user-invitation":Jt("Invitations for people who do not belong to the organization yet.")}),{description:"Resource types the key can act on, each mapped to `read` or `write`. `write` also grants read access. A resource type absent from the map is not accessible to the key at all."}),rg=n.Object({id:n.String({description:"Unique identifier of the operation API key. Generated by Tsuga when the key is created. Use this as the stable key identifier when correlating API calls with audit logs or key-management records."}),name:n.String({description:"Display name of the operation API key. Set by the user who created or last updated the key. Returned for every operation-key-authenticated request so clients can show which saved key is active."}),owner:n.String({description:"Identifier of the team that owns the operation API key. Set when the key is created or updated. Combined with `scope`, it determines which team-owned resources the key can reach."}),tags:Ut,scope:one,permissions:CS,keyLastCharacters:n.String({description:"Last characters of the operation API key secret. Set by Tsuga from the generated secret and returned because the full secret is only shown once at creation. Use this to distinguish saved keys without exposing the secret."}),updatedAt:w(),createdAt:w(),creator:n.Optional(Te),updater:n.Optional(Te),expiresAt:n.Optional(w({description:"Timestamp after which the operation API key stops authenticating. Set when the key is created or updated. Returned only for keys that have an expiration date."})),lastUsedAt:n.Optional(w())}),GC=n.Object({name:n.String({format:ki,minLength:1,maxLength:JFe,description:"Kebab-case name for the operation API key."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the operation API key. When the caller is an operation API key, the team must be within the caller's scope."}),tags:Dt,scope:one,permissions:CS,expiresAt:ze(p({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. Send null for a key that never expires. On update, leave it out to keep the current expiration. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."}))}),Bnr=f({tags:["operation-api-keys"],url:tg,method:"POST",body:GC,response:n.Object({...rg.properties,key:n.String()})}),jnr=f({tags:["operation-api-keys"],url:tg,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(rg)}),qnr=f({tags:["operation-api-keys"],url:`${tg}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:rg}),Hnr=f({tags:["operation-api-keys"],url:`${tg}/:id`,method:"PUT",params:n.Object({id:p()}),body:GC,response:rg}),Knr=f({tags:["operation-api-keys"],url:`${tg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),znr=f({tags:["operation-api-keys"],url:`${tg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var RS=`/${"v1"}/operation-api-keys`,Ed=n.Pick(rg,["id","name","owner","tags","scope","permissions","keyLastCharacters","expiresAt"],{$id:"OperationApiKey",description:"Operation API key used to authenticate API, Terraform, MCP, and Tsuga CLI clients. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),ine={id:"123-456-abc",name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},keyLastCharacters:"x7Qm"};Object.assign(Ed,{examples:[ine]});var ane={...n.Pick(GC,["name","owner","tags","scope","permissions"]).properties,expiresAt:p({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."})},sne=n.Object(ane,{$id:"CreateOperationApiKeyRequest",description:"Operation API key creation request. Provide a kebab-case name, owner team, scope, permissions, expiration date, and optionally tags."}),cne=n.Object(ane,{$id:"UpdateOperationApiKeyRequest",description:"Operation API key update request. Provide the full definition, including name, owner team, scope, permissions, and expiration date."}),une={name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},expiresAt:"2027-01-01T00:00:00.000Z"};Object.assign(sne,{examples:[une]});Object.assign(cne,{examples:[une]});var e$e={...ine,key:`${rne}:${nne}:abc123xyx7Qm`},pne="When the caller is an operation API key, the resulting key cannot have a wider scope than the caller, cannot have a higher permission level than the caller on any resource, must have an expiration in the future, and cannot expire later than the caller's own expiration.",eor=f({description:"Lists operation API keys visible to the caller. Use this to inventory machine clients, with their owners, scopes, and permissions. Pagination fields limit the returned page.",operationId:"listOperationApiKeys",tags:["operation-api-keys"],url:RS,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Ed)}),tor=f({description:"Retrieves one operation API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getOperationApiKey",tags:["operation-api-keys"],url:`${RS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to retrieve. Use the `id` returned by operation API key list or create responses."})}),response:Ed}),t$e=n.Object({...Ed.properties,key:n.String({description:"Full operation API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})},{title:"OperationApiKeyCreated",example:e$e}),ror=f({description:`Creates an operation API key. Store the returned \`key\` immediately because Tsuga returns the full secret only in this response. ${pne}`,operationId:"createOperationApiKey",tags:["operation-api-keys"],url:RS,method:"POST",body:sne,response:t$e}),nor=f({description:`Updates an operation API key by ID, including name, owner, tags, scope, permissions, and expiration. The secret key value is not rotated by this operation. ${pne} The key to update must also belong to a team within the scope of the caller.`,operationId:"updateOperationApiKey",tags:["operation-api-keys"],url:`${RS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to update. Use the `id` returned by operation API key list, get, or create responses."})}),body:cne,response:Ed}),oor=f({description:"Deletes an operation API key by ID. Clients using the deleted key can no longer authenticate with it. When the caller is an operation API key, the key must belong to a team within the scope of the caller.",operationId:"deleteOperationApiKey",tags:["operation-api-keys"],url:`${RS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to delete. Use the `id` returned by operation API key list, get, or create responses."})}),response:B});var r$e=`/${"v1"}/me`,lne=n.Object({type:n.Literal("operation-api-key",{description:"Credential type for this response variant. Set by Tsuga from the bearer token used on the request. Returned as `operation-api-key` when the request authenticated with an operation API key."}),...n.Pick(Ed,["id","name","owner","scope","permissions","keyLastCharacters","expiresAt"]).properties},{$id:"OperationApiKeyIdentity",description:"Identity and effective access for the operation API key used on the request. Returned when the bearer token is an operation API key. See [API keys](/documentation/account-and-settings/api-keys)."}),n$e={type:"operation-api-key",id:"key-123-abc",name:"ci-deploy",owner:"team-123-abc",scope:"owning-team-and-public",permissions:{dashboard:"write",logs:"read",monitor:"read"},keyLastCharacters:"a9f2",expiresAt:"2026-12-01T00:00:00.000Z"};Object.assign(lne,{examples:[n$e]});var dne=n.Object({type:n.Literal("user",{description:"Credential type for this response variant. Set by Tsuga from the bearer token used on the request. Returned as `user` when the request authenticated with a user OAuth access token."}),...n.Pick(vc,["id","email","name","role","orgId","orgName"]).properties,...n.Required(n.Pick(vc,["favoriteDashboards","favoriteFolders"])).properties},{$id:"UserIdentity",description:"Identity for the user OAuth access token used on the request. Returned when the bearer token is a user access token. Access follows the user organization role rather than an operation-key permission map. See [Members](/documentation/account-and-settings/members)."}),o$e={type:"user",id:"user-123-abc",email:"john@tsuga.com",name:"John Doe",role:"public_viewer",orgId:"org-123-abc",orgName:"Acme Inc.",favoriteDashboards:["dashboard-123-abc"],favoriteFolders:["folder-123-abc"]};Object.assign(dne,{examples:[o$e]});var i$e=D("type",[lne,dne],{description:"Identity and access for the credential used on the request. Returned for any valid public API credential and discriminated by `type` because the API accepts both operation API keys and user OAuth access tokens."}),mne=f({description:"Retrieves the identity and access of the credential the request authenticated with. Use this to check which scope and permissions an operation API key carries before calling other endpoints, or to confirm which user an OAuth access token belongs to. Any valid public API credential can call this endpoint without additional resource permissions.",operationId:"getMe",tags:["public","authentication"],url:r$e,method:"GET",response:i$e});var a$e={all:"all permitted telemetry","owning-team-and-public":"owning team plus public data","owning-team-only":"owning team only"};function s$e(e){switch(e.type){case"operation-api-key":return["Authenticated as an operation API key.",...iD([["Name",e.name],["Key",`\u2022\u2022\u2022\u2022${e.keyLastCharacters}`],["ID",e.id],["Owning team",e.owner],["Data scope",`${e.scope} (${a$e[e.scope]})`],["Expires",e.expiresAt??"never"]]),"",...c$e(e.permissions)].join(`
285
285
  `);case"user":return["Authenticated as a user.",...iD([["Name",e.name],["Email",e.email],["ID",e.id],["Role",typeof e.role=="string"?e.role:e.role.type]]),"","Access follows the organization role, not a per-resource permission map."].join(`
286
286
  `);default:Pt(e)}}function c$e(e){let t=Object.entries(e).sort(([o],[i])=>o.localeCompare(i)),r=["write","read"].map(o=>[o,t.filter(([,i])=>i===o).map(([i])=>i).sort().join(", ")]).filter(([,o])=>o!=="");return r.length===0?["Permissions: none. This key cannot reach any resource."]:["Permissions:",...iD(r)]}function iD(e){let t=Math.max(...e.map(([r])=>r.length));return e.map(([r,o])=>` ${r.padEnd(t)} ${o}`)}var fne=P("whoami",{output:$m("output",["text","json"]).pipe(vi("o"),Z("Output format: text | json"),_n("text"))},v("cli.auth.whoami")(function*({output:e}){let t=yield*Qt(mne);if(e==="json"){yield*xe({data:t});return}yield*Le(s$e(t))})).pipe(U("Ask Tsuga which credential this CLI authenticates as, and print its scope and permissions"));var gne=P("auth").pipe(U("Manage authentication: user login (OAuth) or operation API key"),_e([dre,mre,Ire,Sre,_re,fne]));var u$e="/v0/billing/focus",aD="1.4",Sd=31,BC=e=>n.String({description:`${e} UTC, formatted as ISO 8601.`}),PS=n.Object({BilledCost:n.Literal(0,{description:"Always 0 for now."}),BillingAccountId:n.String({description:"Identifier of the organization."}),BillingAccountName:n.String({description:"Name of the organization."}),BillingCurrency:n.Literal("USD",{description:"Currency of the cost columns."}),BillingPeriodEnd:BC("Exclusive end of the calendar month holding the charge,"),BillingPeriodStart:BC("Inclusive start of the calendar month holding the charge,"),ChargeCategory:n.Literal("Usage",{description:"Charge category."}),ChargeClass:n.Null({default:null,description:"Represents corrections to the charge, if any."}),ChargeDescription:n.String({description:"Human-readable summary of the charge."}),ChargeFrequency:n.Literal("Usage-Based",{description:"Charge frequency."}),ChargePeriodEnd:BC("Exclusive end of the day the data was ingested,"),ChargePeriodStart:BC("Inclusive start of the day the data was ingested,"),ConsumedQuantity:n.Number({description:"Uncompressed ingested volume, in gigabytes."}),ConsumedUnit:n.Literal("GB",{description:"Unit of `ConsumedQuantity`."}),ContractedCost:n.Literal(0,{description:"Always 0 for now."}),EffectiveCost:n.Literal(0,{description:"Always 0 for now."}),HostProviderName:n.Literal("Tsuga",{description:"Entity hosting the infrastructure the service runs on."}),InvoiceIssuerName:n.Literal("Tsuga",{description:"Entity issuing the invoice."}),ListCost:n.Literal(0,{description:"Always 0 for now."}),PricingQuantity:n.Number({description:"Billable volume, in gigabytes."}),PricingUnit:n.Literal("GB",{description:"Unit of `PricingQuantity`."}),ServiceCategory:n.Literal("Management and Governance",{description:"FOCUS service category."}),ServiceName:n.String({description:"Tsuga product the data was ingested into: `Tsuga Logs`, `Tsuga Metrics`, `Tsuga Traces`, `Tsuga RUM`, or `Tsuga Profiling`."}),ServiceProviderName:n.Literal("Tsuga",{description:"Entity providing the service."}),ServiceSubcategory:n.Literal("Observability",{description:"FOCUS service subcategory."})}),sD=n.Object(Jr.properties,{description:`Time range to export. It is widened to whole UTC days and must span at most ${Sd} days.`}),Por=f({tags:["billing"],url:u$e,method:"GET",query:sD,response:n.Array(PS)});var hne=n.Object(PS.properties,{$id:"FocusBillingRow",description:`One FOCUS ${aD} cost and usage row: the volume of one telemetry kind ingested on one UTC day.`}),p$e={BilledCost:0,BillingAccountId:"org-123",BillingAccountName:"Acme",BillingCurrency:"USD",BillingPeriodEnd:"2026-10-01T00:00:00Z",BillingPeriodStart:"2026-09-01T00:00:00Z",ChargeCategory:"Usage",ChargeClass:null,ChargeDescription:"Tsuga Logs data ingested",ChargeFrequency:"Usage-Based",ChargePeriodEnd:"2026-09-23T00:00:00Z",ChargePeriodStart:"2026-09-22T00:00:00Z",ConsumedQuantity:12.5,ConsumedUnit:"GB",ContractedCost:0,EffectiveCost:0,HostProviderName:"Tsuga",InvoiceIssuerName:"Tsuga",ListCost:0,PricingQuantity:12.5,PricingUnit:"GB",ServiceCategory:"Management and Governance",ServiceName:"Tsuga Logs",ServiceProviderName:"Tsuga",ServiceSubcategory:"Observability"};Object.assign(hne,{examples:[p$e]});var yne=f({description:`Exports the ingested data volume of the organization as FOCUS ${aD} cost and usage rows (https://focus.finops.org), one per UTC day and telemetry kind. The time range is widened to whole UTC days and must span at most ${Sd} days. Cost columns are 0 until Tsuga exposes prices. See [Usage overview](/documentation/account-and-settings/usage-overview).`,operationId:"exportFocusBillingData",tags:["billing"],url:`/${"v1"}/billing/focus`,method:"GET",query:sD,response:n.Array(hne)});var l$e=$m("output",y7).pipe(vi("o")),uo=l$e.pipe(Z("Output format"),_n("json")),Ene=Fe("fields").pipe(Z("Comma-separated dot-paths to select from JSON objects or each row of a JSON array; also selects CSV/TSV columns. Text and binary output are unchanged."),Ee("FIELDS"),Ha(E7),Ou(e=>e.length>0,()=>"--fields must contain at least one field name"),Je,Ha(ne));var d$e=Object.keys(PS.properties),Sne=P("export",{...Kt,output:uo},v("cli.billing.export")(function*(e){let t=yield*mn,{from:r,to:o}=yield*Kr(e),i=Math.ceil(o/QO)-Math.floor(r/QO);if(i>Sd)return yield*new It({message:`--from/--to span ${i} days; a FOCUS export covers at most ${Sd} days. Export one shorter range at a time.`});let a=yield*Qt(yne,{query:{from:r,to:o}});yield*t.rows(a,{...e,defaultFields:d$e})})).pipe(U(`Export ingested data volume as FOCUS cost and usage rows, at most ${Sd} days per call`));var Tne=P("billing").pipe(U("Export billing cost and usage data"),_e([Sne]));var _ne=P("list",{},v("cli.clusters.list")(function*(){yield*xe(yield*tt(CA))})).pipe(U("List all Tsuga clusters available to the operation API key"));var Ine=P("clusters").pipe(U("Manage Tsuga cluster selection"),_e([_ne]));var bne=P("defaults",{},v("cli.config.resetDefaults")(function*(){yield*(yield*gt).resetDefaults,yield*Le("Custom defaults cleared")})).pipe(U("Clear all custom defaults"));var xne=P("reset").pipe(U("Reset configuration values"),_e([bne]));var One=P("default",{key:fre("FLAG_NAME",w0).pipe(ur(`The flag to set a default for. One of: ${w0.join(" | ")}`)),value:Fe("value").pipe(Z("The default value. Use --value=-1h for dash-prefixed values; an empty value clears the default"),Ee("VALUE"),Ha(e=>e.trim()))},v("cli.config.setDefault")(function*({key:e,value:t}){let r=yield*gt;if(t===""){yield*r.setDefault(e,t),yield*Le(`Default cleared: ${e}`);return}yield*m$e(e,t),yield*r.setDefault(e,t),yield*Le(`Default set: ${e} = ${t}`)})).pipe(U("Set a custom default value for a command flag"),rx([{description:"Widen the default log search window",command:"config set default from --value=-1h"},{description:"Go back to the built-in default",command:"config set default from --value ''"}]));function m$e(e,t){switch(e){case"from":case"to":return Ks(wC(e,ue(t)));case"max-results":{let r=Number(t);return Number.isSafeInteger(r)&&r>0?De:new It({message:`The default for max-results must be a positive safe integer (got: ${t})`})}case"query":case"cluster":return De;default:return Pt(e)}}var Ane=P("telemetry",{consent:yre("STATE",[["on",!0],["off",!1]]).pipe(ur("Whether to send usage data"))},v("cli.config.setTelemetry")(function*({consent:e}){yield*(yield*gt).saveTelemetryConsent(e);let t=(yield*$0)===void 0?"":" (TSUGA_TELEMETRY overrides it)";yield*Le(`Usage data: ${e?"on":"off"}${t}`)})).pipe(U("Turn sending anonymous usage data on or off"),rx([{description:"Stop sending usage data",command:"config set telemetry off"}]));var Cne=P("set").pipe(U("Set a configuration value"),_e([One,Ane]));var Rne=v("cli.config.show")(function*(){let e=yield*cs,t=yield*gt,r=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});yield*Le($X(r,t.configPath).trimEnd())});var Pne=P("config",{},Rne).pipe(U("Show or manage configuration"),_e([Cne,xne]));var Une=P("get",{path:zr("DOC_PATH").pipe(ur("Path or link of the page to fetch"))},v("cli.docs.get")(function*({path:e}){yield*Qs({[l8]:e}),yield*xe(yield*tt(qX,{query:{path:e}}))})).pipe(U("Get a documentation or API-reference page by path or link (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')"));var wne=P("search",{query:zr("SEARCH_TEXT").pipe(ur("Text to search for"))},v("cli.docs.search")(function*({query:e}){yield*Qs({[d8]:e}),yield*xe(yield*tt(wA,{query:{query:e}}))})).pipe(U("Search Tsuga documentation and the full API reference, ranked by relevance"));var vne=P("docs").pipe(U("Search and fetch Tsuga documentation and API-reference pages"),_e([Une,wne]));var US="/v0/sandbox-runs",f$e=["running","completed","failed","cancelled"],g$e=n.Enum(f$e,{description:"Lifecycle status of the sandbox agent run"}),h$e="^[A-Za-z0-9][A-Za-z0-9._-]*\\.md$",y$e=50,E$e=25e3,S$e=1e5,Nne=`Claude Code auto memory files kept across runs of a sandbox configuration, keyed by file name: a MEMORY.md index plus the topic files it links, at most ${S$e} characters in total. Runs rewrite them, so review them like any agent output.`,cD=n.Record(n.String(),n.String(),{description:Nne}),uD=n.Record(n.String({pattern:h$e}),n.String({maxLength:E$e}),{additionalProperties:!1,minProperties:1,maxProperties:y$e,description:Nne,examples:[{"MEMORY.md":"- [Topic](topic.md) - one-line summary"}]}),Lne=30,T$e=D("type",[n.Object({type:n.Literal("quality-report-auto-fix"),ruleKey:n.String({description:"Quality-report rule the run tried to fix."}),teamId:n.Optional(n.String({description:"Team the rule failed for."})),teamName:n.Optional(n.String({description:"Name of that team."})),configurationId:n.Optional(n.String({description:"Sandbox configuration the run used."})),configurationName:n.Optional(n.String({description:"Name of that configuration."}))}),n.Object({type:n.Literal("scheduled"),scheduledRunId:n.String({description:"Scheduled run that launched the run."}),scheduledRunName:n.String({description:"Name of that scheduled run."}),configurationId:n.String({description:"Sandbox configuration the run used."}),configurationName:n.Optional(n.String({description:"Name of that configuration. Missing when the launch failed before the configuration was read."}))})],{description:"What launched the run."}),kne=n.Object({costUsd:n.Number({description:"Estimated cost in USD, computed by Claude Code from Anthropic list prices."}),inputTokens:n.Number({description:"Input tokens sent to the model."}),outputTokens:n.Number({description:"Output tokens generated by the model."}),cacheReadTokens:n.Number({description:"Input tokens served from the prompt cache."}),turns:n.Number({description:"Agent turns taken."}),agentDurationMs:n.Number({description:"Wall-clock time of the agent session."}),modelDurationMs:n.Number({description:"Time spent waiting on model responses."}),sessionId:n.String({description:"Claude Code session ID."})},{description:"Usage reported by the agent's final result event."}),Mne=200,wS=n.Object({id:n.String({description:"Tsuga-generated sandbox run ID."}),status:g$e,trigger:T$e,clusterId:n.String({description:"Cluster the agent queried."}),error:n.Optional(n.String({description:"Why the run failed or stopped."})),usage:n.Optional(kne),prompt:n.Optional(n.String({description:"Prompt the agent ran with. Returned by the get endpoint only."})),output:n.Optional(n.String({description:"The agent's final output, once the run finished. Returned by the get endpoint only."})),creator:n.Optional(Te),createdAt:w({description:"When the run started."}),completedAt:n.Optional(w({description:"When the run finished."}))}),Hir=f({tags:["sandbox-runs"],url:US,method:"GET",response:n.Array(wS)}),Kir=f({tags:["sandbox-runs"],url:`${US}/:id`,method:"GET",params:n.Object({id:p()}),response:wS}),zir=f({tags:["sandbox-runs"],url:`${US}/validate`,method:"POST",body:n.Object({runId:p({allowEmpty:!1,description:"Active sandbox run whose ID identifies the container."}),clusterId:p({allowEmpty:!1,description:"Cluster the run targets; must belong to the operation key's organization."})}),response:n.Object({authorized:n.Boolean({description:"True when the key may execute this sandbox run."})})}),Yir=f({tags:["sandbox-runs"],url:`${US}/:id/cancel`,method:"POST",params:n.Object({id:p()}),response:n.Object({})}),Vir=f({tags:["sandbox-runs"],url:`${US}/:id/complete`,method:"POST",params:n.Object({id:p({description:"Sandbox run the agent finished."})}),body:n.Object({status:n.Enum(["completed","failed"],{description:"Completed when the agent exited successfully, failed otherwise."}),output:n.Optional(n.String({description:"The agent's final output."})),error:n.Optional(n.String({description:"Why the run failed."})),usage:n.Optional(kne),memory:n.Optional(uD)}),response:n.Object({})});var cp="/v0/sandbox-configurations",_$e=100,I$e=60,Dne="Full names of the repositories (e.g. `org/repo`) the sandbox agent may work in. An empty array means the agent can reach every repository the GitHub App connection is installed on.",Fne=`Maximum minutes the sandbox agent may run before it is stopped. Defaults to ${Lne} when unset.`,$ne="Slack channel told when a run of this configuration finishes, through a Slack notification integration. Omit it to notify no one.",b$e=n.Object({type:n.Literal("slack"),integrationId:n.String({description:"Slack notification integration to post with."}),channel:n.String({description:"Slack channel or user that receives the message."})},{description:$ne}),x$e=n.Object({type:n.Literal("slack"),integrationId:p({allowEmpty:!1,description:"Slack notification integration to post with."}),channel:p({allowEmpty:!1,description:"Slack channel or user that receives the message."})},{description:$ne}),ng=n.Object({id:n.String({description:"Tsuga-generated sandbox configuration ID."}),name:n.String({description:"Human-readable name of the sandbox configuration."}),owner:n.String({description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(n.String(),{description:Dne}),scope:Ea,permissions:CS,systemPrompt:n.Optional(n.String({description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({description:Fne})),memory:n.Optional(cD),notification:n.Optional(b$e),creator:n.Optional(Te),updater:n.Optional(Te),createdAt:w(),updatedAt:w()}),Gne=n.Object({name:n.String({minLength:1,maxLength:_$e,description:"Human-readable name of the sandbox configuration."}),owner:p({allowEmpty:!1,description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(p({allowEmpty:!1}),{default:[],description:Dne}),scope:Ea,permissions:CS,systemPrompt:n.Optional(p({type:"long",description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({minimum:1,maximum:I$e,description:Fne})),notification:n.Optional(x$e)}),oar=f({tags:["sandbox-configurations"],url:cp,method:"GET",response:n.Array(ng)}),iar=f({tags:["sandbox-configurations"],url:`${cp}/:id`,method:"GET",params:n.Object({id:p()}),response:ng}),aar=f({tags:["sandbox-configurations"],url:cp,method:"POST",body:Gne,response:ng}),sar=f({tags:["sandbox-configurations"],url:`${cp}/:id`,method:"PUT",params:n.Object({id:p()}),body:Gne,response:ng}),car=f({tags:["sandbox-configurations"],url:`${cp}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),vS=n.Object({memory:n.Optional(cD)}),pD=n.Object({memory:uD}),uar=f({tags:["sandbox-configurations"],url:`${cp}/:id/memory`,method:"GET",params:n.Object({id:p()}),response:vS}),par=f({tags:["sandbox-configurations"],url:`${cp}/:id/memory`,method:"PUT",params:n.Object({id:p()}),body:pD,response:ng}),lar=f({tags:["sandbox-configurations"],url:`${cp}/:id/memory`,method:"DELETE",params:n.Object({id:p()}),response:ng});var Bne=`/${"v1"}/sandbox-runs`,lD=`/${"v1"}/sandbox-configurations/:id/memory`,jne="Admin users see every run; other users and operation API keys see only the runs their user started.",dD=n.Object({id:p({allowEmpty:!1,description:"ID of the sandbox configuration."})}),qne=f({description:`Lists the latest ${Mne} sandbox agent runs, newest first, without their prompt and output. ${jne}`,tags:["private"],url:Bne,method:"GET",response:n.Array(wS)}),Hne=f({description:`Gets a sandbox agent run with its prompt and output. ${jne}`,tags:["private"],url:`${Bne}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"ID of the sandbox run."})}),response:wS}),Kne=f({description:"Gets the memory sandbox agent runs keep for a sandbox configuration.",tags:["private"],url:lD,method:"GET",params:dD,response:vS}),mD=f({description:"Replaces the memory of a sandbox configuration.",tags:["private"],url:lD,method:"PUT",params:dD,body:pD,response:vS}),zne=f({description:"Clears the memory of a sandbox configuration.",tags:["private"],url:lD,method:"DELETE",params:dD,response:vS});var og=zr("CONFIGURATION_ID").pipe(ur("The sandbox configuration ID"));var Yne=P("clear",{id:og},v("cli.sandbox-memory.clear")(function*({id:e}){yield*xe(yield*tt(zne,{params:{id:e}}))})).pipe(U("Clear the memory of a sandbox configuration"));var Vne=P("get",{id:og},v("cli.sandbox-memory.get")(function*({id:e}){yield*xe(yield*tt(Kne,{params:{id:e}}))})).pipe(U("Get the memory of a sandbox configuration"));var Wne=P("set",{id:og,file:Zf,data:dd,generateSkeleton:md},v("cli.sandbox-memory.set")(function*(e){if(e.generateSkeleton){yield*ya(yield*ld(mD));return}yield*xe(yield*tt(mD,{params:{id:e.id},body:yield*ed(e)}))})).pipe(U("Replace the memory of a sandbox configuration"));var Qne=P("sandbox-memory").pipe(U("Read and edit the memory that sandbox agent runs keep per configuration"),_e([Vne,Wne,Yne]));function Xne(e){let t={};function r(o,i,a,s){if(n.IsObject(o)){for(let[u,l]of Object.entries(o.properties)){if(i.length===0&&["limit","offset","clusterId"].includes(u))continue;let m=u.replace(/([A-Z])/g,"-$1").toLowerCase(),g=u==="filters"||u==="value"||u==="values"?a:u==="exclude"?`exclude-${a}`:a?`${a}-${m}`:m,y="description"in l&&typeof l.description=="string"?l.description:"";r(l,[...i,u],g,u==="value"||u==="values"?`${s} ${y}`.trim():y||s)}return}t[a]={path:i,flag:O$e(a,o,s)}}return e&&r(e,[],"",""),{flags:Object.fromEntries(Object.entries(t).map(([o,{flag:i}])=>[o,i])),apply:L(function*(o,i={},a={}){if(i===null||typeof i!="object"||Array.isArray(i))return yield*new It({message:"The list request body must be a JSON object"});let s={...i,...a};for(let[l,{path:m}]of Object.entries(t)){let g=o[l];if(!th(g)||on(g))continue;let y=s;for(let[E,h]of m.entries())if(E===m.length-1)y[h]=g.value;else{let T=y[h],S=T!==null&&typeof T=="object"&&!Array.isArray(T)?{...T}:{};y[h]=S,y=S}}let u=e?ds(e,s):[];return u.length>0?yield*new It({message:`Invalid list request: ${JSON.stringify(u)}`}):s})}}function O$e(e,t,r){let o;if(n.IsString(t))o=Fe(e);else if(n.IsBoolean(t))o=ro(e);else if(n.IsEnum(t))o=jy(e,t.enum.map(i=>[String(i),i]));else if(n.IsArray(t)&&(n.IsString(t.items)||n.IsNumber(t.items)||n.IsInteger(t.items)||n.IsEnum(t.items))){let i=n.IsNumber(t.items)||n.IsInteger(t.items)||n.IsEnum(t.items)&&t.items.enum.every(a=>typeof a=="number");o=Fe(e).pipe(Ee("VALUE,..."),Ha(a=>a.split(",").map(s=>{let u=s.trim();return i&&u!==""?Number(u):u}))),r+=" Pass comma-separated values."}else n.IsUnion(t)&&t.anyOf.some(n.IsNull)&&t.anyOf.every(i=>n.IsString(i)||n.IsNull(i))?(o=Fe(e).pipe(Ha(i=>i==="null"?null:i)),r+=" Use null to select resources without a folder."):(o=Fe(e).pipe(Ee("JSON"),tY(i=>JSON.parse(i),()=>`--${e} must be valid JSON`)),r+=n.IsArray(t)?" Pass a JSON array.":" Pass JSON.");return o.pipe(Z(r),Je)}function Ue(e){let t=e.singularOverride??wX(e.commandName).replace(/-/g," "),r=e.pluralOverride??e.commandName.replace(/-/g," "),o=A$e(t),{get:i,create:a,update:s,delete:u}=e.endpoints,l=[C$e(e,r),...i?[P("get",{id:fD},v("cli.resource.get")(function*({id:m}){yield*xe(yield*tt(i,{params:{[gD(i)]:m}}))})).pipe(U(`Get ${o} ${t} by ID`))]:[],...a?[kn("create",`Create a new ${t}`,a)]:[],...s?[P("update",{id:fD,file:Zf,data:dd,generateSkeleton:md},v("cli.resource.update")(function*(m){if(m.generateSkeleton){yield*ya(yield*ld(s));return}yield*xe(yield*tt(s,{params:{[gD(s)]:m.id},body:yield*ed(m)}))})).pipe(U(`Update ${o} ${t} by ID`))]:[],...u?[P("delete",{id:fD},v("cli.resource.delete")(function*({id:m}){yield*xe(yield*tt(u,{params:{[gD(u)]:m}}))})).pipe(U(`Delete ${o} ${t} by ID`))]:[],...e.extraSubcommands??[]];return P(e.commandName).pipe(U(e.description),_e(l))}function A$e(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}var fD=zr("ID").pipe(ur("The resource ID"));function C$e(e,t){let r=e.listDescription??`List all ${t}`,o=Xne(e.enableListBody?e.endpoints.list.body:e.endpoints.list.query),i=e.endpoints.list.paginated===!0?{limit:op.limit,offset:op.offset,all:op.all}:{};return e.enableListBody?P("list",{...o.flags,...i,data:dd,generateSkeleton:md},v("cli.resource.list")(function*(a){if(a.generateSkeleton){yield*ya(yield*ld(e.endpoints.list));return}let s=At(a.data)?yield*ed({file:K(),data:a.data}):{};yield*xe(yield*tt(e.endpoints.list,{body:yield*o.apply(a,s,Zne(a)),allPages:a.all===!0}))})).pipe(U(r)):P("list",{...o.flags,...i},v("cli.resource.list")(function*(a){let s=yield*o.apply(a,{},Zne(a));yield*xe(yield*tt(e.endpoints.list,{query:s,allPages:a.all===!0}))})).pipe(U(r))}function Zne(e){return hn({limit:e.limit&&ne(e.limit),offset:e.offset&&ne(e.offset)})}function gD(e){let t=e.params;if(t!==null&&typeof t=="object"&&"properties"in t){let{properties:r}=t;if(r!==null&&typeof r=="object"){let o=Object.keys(r);if(o.length===1&&o[0])return o[0]}}return"id"}var Jne=Ue({commandName:"sandbox-runs",description:"Read the history of sandbox agent runs",endpoints:{list:qne,get:Hne}});var eoe=P("experimental").pipe(U("Experimental commands that may change or be removed without notice"),_e([Jne,Qne]));var R$e=`/${"v1"}/feedback`,toe=n.Object({id:n.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),P$e={id:"request-123-abc"};Object.assign(toe,{examples:[P$e]});var roe=n.Object({content:p({allowEmpty:!1,type:"long",description:"Free-text feedback content, e.g. what went wrong, what was confusing, or a suggestion. Required and must be non-empty."})}),U$e={content:"The traces command times out for large services."};Object.assign(roe,{examples:[U$e]});var noe=f({description:"Submit free-text feedback about Tsuga tools or APIs, e.g. a tool that failed, returned unusable output, or was confusing to use. Feedback is recorded for the Tsuga team to review and improve tooling.",operationId:"createFeedback",tags:["public","feedback"],url:R$e,method:"POST",body:roe,response:toe});var ooe=P("feedback",{message:zr("MESSAGE").pipe(ur("The feedback to send"),gre({min:1}))},v("cli.feedback")(function*({message:e}){yield*xe(yield*tt(noe,{body:{content:e.join(" ")}}))})).pipe(U("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)"));var w$e=`/${"v1"}/grok`,v$e=25,N$e=100,ioe=n.Object({rules:n.Array(p({allowEmpty:!1,type:"long",description:"Grok parsing rule to preview against each sample. The rule uses the same Grok syntax as the log route **Grok parser** processor, for example `pod:%{DATA:namespace}/%{DATA:name}`."}),{minItems:1,maxItems:v$e,description:"Ordered Grok parsing rules to preview. For each sample, Tsuga tries the rules in order and returns the first successful match, matching route Grok processor semantics."}),samples:n.Array(p({allowEmpty:!1,type:"long",description:"Raw log line to parse with the provided Grok rules. The value is parsed as preview input only; this endpoint does not ingest or store the sample."}),{minItems:1,maxItems:N$e,description:"Sample log lines to run against the rules. Results are returned in the same order as this array."})},{description:"Grok rules and sample log lines to preview extraction before saving a route processor. The endpoint uses the same parser as the route builder preview and does not create or update routes."}),L$e={rules:['pod:%{DATA:pod_namespace}/%{DATA:pod_name}\\] "%{DATA:request}" HTTP/%{POSINT:status}'],samples:['[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200']};Object.assign(ioe,{examples:[L$e]});var aoe=n.Object({results:n.Array(n.Object({sample:n.String({description:"Echo of the submitted log line, so results can be matched to the samples in the request."}),matched:n.Boolean({description:"Whether any submitted rule matched this sample. `true` means `extracted` contains the captured fields; `false` means no rule matched."}),extracted:n.Union([n.Record(n.String(),n.Unknown()),n.Null()],{description:"Fields extracted from the first matching Grok rule when `matched` is `true`; dotted capture names are expanded into nested objects. `null` when no rule matched."})}),{description:"Preview result for each submitted sample, in the same order as the request `samples` array."})},{description:"Grok extraction preview results from applying the ordered rules to each submitted sample."}),k$e={results:[{sample:'[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200',matched:!0,extracted:{pod_namespace:"tsuga-events",pod_name:"tsuga-events-searcher-0",request:"/token",status:"200"}}]};Object.assign(aoe,{examples:[k$e]});var soe=f({url:`${w$e}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:ioe,response:aoe,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});var coe=kn("parse","Parse sample log lines with grok rules and return the extracted fields",soe);var uoe=P("grok").pipe(U("Test and preview grok parsing rules"),_e([coe]));var moe=require("node:os"),LS=require("node:path");var hD,poe=()=>{hD?.release(),hD=void 0},loe=(e,t)=>{let r=[],o=e.write.bind(e),i=!0;e.write=u=>i?(r.push(u),!0):o(u);let a=()=>i?(i=!1,e.write=o,r.splice(0)):[],s={release:()=>{for(let u of a())o(u)},divert:()=>{for(let u of a())t.write(u)}};return hD=s,s},doe=e=>t=>t.pipe(sI(r=>r._tag==="ShowHelp"?X(e.divert):De),No(X(e.release)));function M$e(e){return process.platform==="win32"?`${e}.cmd`:e}var up=v("external.run")(function*(e,t){yield*Le(` $ ${e} ${t.join(" ")}`),yield*X(poe);let r=yield*Zn(H(Ri(M$e(e),t,{stdin:{stream:"ignore"},stdout:{stream:"inherit"},stderr:{stream:"inherit"}}),o=>o.exitCode)).pipe(dt(o=>new Hl({message:`Could not run \`${e}\`: ${o.message}. Is it installed and on your PATH?`})));if(Number(r)!==0)return yield*new Hl({message:`${e} ${t.join(" ")} exited ${r}`})});var NS="tsuga-dev/agent-plugins",ig="tsuga";var D$e=v("cli.installPlugin.autoUpdate")(function*(e){let t=yield*Xr,r=(0,LS.join)(e,".claude","settings.json");yield*Le(`Claude Code \u2192 ${r} (autoUpdate)`),yield*t.makeDirectory((0,LS.dirname)(r),{recursive:!0}).pipe(Cc("create",(0,LS.dirname)(r)));let o=yield*Mf(r),i=yield*MA(r,o??"{}"),a=i.extraKnownMarketplaces??{};if(!ui(a))return yield*new Nn({message:`${r} "extraKnownMarketplaces" must be a JSON object`});let s=a[ig],u=ui(s)?s:{},l={...i,extraKnownMarketplaces:{...a,[ig]:{source:{source:"github",repo:NS},...u,autoUpdate:!0}}},m=new Date(yield*sn).toISOString(),g=yield*Df(r,o,m);yield*kf(r,yield*DA(l)),yield*Le(g===void 0?" created":` patched (backup: ${g})`)}),F$e=v("cli.installPlugin.claude")(function*(e,t){yield*Le("Claude Code \u2192 installing Tsuga plugin"),yield*up("claude",["plugin","marketplace","add",NS]),yield*up("claude",["plugin","install",`tsuga@${ig}`]),t&&(yield*D$e(e))}),foe=P("claude-code",{autoUpdate:ro("auto-update").pipe(Z("Patch ~/.claude/settings.json with autoUpdate=true; --no-auto-update skips it"),_n(!0))},v("cli.installPlugin.claudeCode")(function*({autoUpdate:e}){yield*F$e((0,moe.homedir)(),e),yield*Le("Restart your claude session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)"));var $$e=v("cli.installPlugin.codex")(function*(){yield*Le("Codex \u2192 installing Tsuga plugin"),yield*up("codex",["plugin","marketplace","add",NS]),yield*up("codex",["plugin","add",`tsuga@${ig}`])}),goe=P("codex",{},v("cli.installPlugin.codexCli")(function*(){yield*$$e(),yield*Le("Restart your codex session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)"));var hoe=P("plugin").pipe(U("Install the Tsuga plugin into a specific LLM CLI"),_e([foe,goe]));var yoe=P("install").pipe(U("Install Tsuga plugins into local LLM CLIs"),_e([hoe]));var G$e=10,B$e=n.Object({key:p({allowEmpty:!1,description:"Telemetry attribute key to scope the ranking by: a service, environment, team, route, or other positive equality term in the population you want fields for. Use dot-path keys such as `context.service.name`."}),value:n.Optional(p({allowEmpty:!1,description:"Attribute value the scoped telemetry should match, when the scope is a specific service, environment, team, route, or other known value. When omitted, artifacts that reference the key match this entry at full weight regardless of value."})),valueMustMatch:n.Optional(n.Boolean({description:"When true, this entry is a hard filter rather than a weight: any widget or monitor that does not match it exactly (key = value) contributes no fields at all, instead of contributing at a reduced weight. Other widgets of the same dashboard still contribute if they match. Requires `value`."}))}),yD=n.Object({field:n.String({description:"Field name to use in queries. For `kind: attribute`, this is an attribute dot path. For `kind: metric`, this is either a metric name or a `metricName.context.attribute` path when the metric query used a metric attribute."}),kind:n.Enum(["attribute","metric"],{description:"Whether the field is a telemetry attribute or a metric name. `metric` appears only in the metrics bucket, for fields referenced as the aggregated field of a metrics-source query."}),inferredType:n.Enum(["numeric","categorical","unknown"],{description:"Value type inferred from how the field is used: `numeric` when aggregated with sum/average/percentile, referenced by numeric or range filters, or a metric name; `categorical` when only grouped by or matched with equality/text filters; `unknown` otherwise. Evidence-based \u2014 a numeric field used only in equality filters reads as categorical."}),score:n.Number({description:"Relative relevance score computed by Tsuga from how strongly readable dashboards and monitors use this field for the requested scope, discounted when the field is common across the whole organization. Higher values mean stronger evidence that the field is useful for this scope. Scores are intended for ranking, not for comparison across unrelated scopes."}),artifacts:n.Number({description:"Number of distinct readable dashboards and monitors that reference this field and match the requested scope. Tsuga counts an artifact once per field even if it uses the field in multiple widgets or queries."}),globalArtifacts:n.Number({description:"Number of organization-wide dashboards and monitors that reference this field, regardless of the requested scope or caller permissions. Tsuga uses this anonymous baseline to down-rank fields that are common everywhere."}),usage:n.Object({groupBy:n.Number({description:"Number of distinct readable matching artifacts that use this field as a group-by or split dimension."}),filter:n.Number({description:"Number of distinct readable matching artifacts that filter on this field in widget queries, monitor queries, or dashboard-wide filters."}),measure:n.Number({description:"Number of distinct readable matching artifacts that aggregate this field as `aggregate.field`."}),column:n.Number({description:"Number of distinct readable matching artifacts that pin this field as a list-widget column."})},{description:"Distinct-artifact counts by usage kind, explaining why the field ranked where it did; a dashboard referencing the field the same way in many widgets counts once for that usage kind."})}),ED=n.Object({logs:n.Array(yD,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:n.Array(yD,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:n.Array(yD,{description:"Top metric names and metric-attribute fields for the requested scope, ranked by score and mined from readable metrics-sourced dashboards and monitors."}),dashboardsMatched:n.Number({description:"Number of dashboards that matched the requested scope and that the caller can read. Dashboards the caller cannot read are removed before field rankings are returned."}),monitorsMatched:n.Number({description:"Number of monitors that matched the requested scope and that the caller can read. Monitors the caller cannot read are removed before field rankings are returned."})}),SD=n.Object({scope:n.Array(B$e,{minItems:1,maxItems:G$e,description:"Scope entries that define the population to rank fields for, drawn from positive equality pairs in a TQL query, such as service and environment. Tsuga matches entries softly by default: an artifact's contribution is weighted by the fraction of entries it matches."})}),Zsr=f({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:SD,response:ED});var j$e=`/${"v1"}/interesting-fields`,q$e={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},H$e=n.Object(SD.properties,{description:"The scope to rank fields for, as attribute key/value pairs such as a service name and an environment. Entries are matched softly by default: a widget contributes in proportion to how many entries it matches, so a broader scope returns a broader ranking. Set `valueMustMatch` on an entry to make it a hard filter instead: a widget that does not match it exactly contributes nothing, even when other entries match.",examples:[q$e]}),Eoe=f({url:j$e,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:H$e,response:ED,description:"Ranks the telemetry fields most relevant to a scope, mined from how the org already uses them in dashboards and monitors, bucketed by logs, traces, and metrics. Use this before guessing a field or metric name: a field that many scope-matching dashboards group or filter on is the one an operator would reach for. Ranking is TF-IDF style, so a field used everywhere in the org scores below one that is distinctive to the scope. Dashboards and monitors the caller cannot read never contribute field names, only the anonymous frequency baseline. The operation requires public API read access to dashboards and monitors."});var Soe=kn("list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",Eoe);var Toe=P("interesting-fields").pipe(U("Discover the telemetry fields an org already uses for a scope"),_e([Soe]));var Ko="/v0/kubernetes-explorer",K$e="^[a-z0-9.-]+$",z$e="^[A-Za-z0-9._-]+$",_oe=256,Ioe=n.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}));var Ho=e=>n.Optional(n.Array(p({allowEmpty:!1}),{description:e})),TD=["clusters","namespaces","teams","envs"],kS="Names of other filter fields in this query whose values exclude rather than include. Set this to a field name to keep only the resources matching none of that field's values; fields left out keep the resources matching any of their values.",_D={clusterId:Ioe,search:n.Optional(n.String({pattern:K$e,minLength:1,maxLength:_oe,description:"Substring matched against the resource name. Kubernetes names are lowercase RFC 1123, so only lowercase letters, digits, `.` and `-` are accepted; uppercase and other characters are rejected. Wildcard and other query-syntax characters are treated literally."}))},boe={clusterId:Ioe,search:n.Optional(n.String({pattern:z$e,minLength:1,maxLength:_oe,description:"Substring matched against the Kubernetes cluster name. Unlike Kubernetes resource names this is a collector-assigned identifier, so uppercase letters, digits, `.`, `-` and `_` are accepted. Wildcard and other query-syntax characters are treated literally."}))},xoe=n.Object(_D),Ooe=n.Object(boe),ag={..._D,includeInternalNamespaces:n.Optional(n.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded, even when `namespaces` names them."})),clusters:Ho("Restrict results to these Kubernetes cluster names."),namespaces:Ho("Restrict results to these namespaces."),teams:Ho("Restrict results to these team names."),envs:Ho("Restrict results to these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(TD),{description:kS})),...fe},Y$e=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],V$e=[...TD,"nodes","deployments","statefulsets","daemonsets","podStatus"],W$e={...ag,nodes:Ho("Restrict results to pods scheduled on these nodes."),deployments:Ho("Restrict results to pods owned by these Deployments."),statefulsets:Ho("Restrict results to pods owned by these StatefulSets."),daemonsets:Ho("Restrict results to pods owned by these DaemonSets."),podStatus:Ho("Restrict results to pods whose resolved status matches any of these values. Typical values are the five Kubernetes phases plus Tsuga-derived CrashLoopBackOff and Error. Applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute. When exclusiveFilters includes podStatus, keep pods whose status matches none of these values instead."),exclusiveFilters:n.Optional(n.Array(n.Enum(V$e),{description:`${kS} Excluding podStatus is applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute.`}))},Q$e=["deployment","statefulset","daemonset"],Aoe=n.Object({kind:n.Enum(Q$e,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:n.String({description:"Name of the workload associated with the pod. Derived from workload attributes in pod telemetry."})},{description:"Kubernetes workload controller that owns the pod. Present when workload attributes are observed in pod telemetry."}),Coe=n.Object({podName:n.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:n.Optional(n.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:n.Enum(Y$e,{description:"Current or most recently observed pod status. From pod status and container state telemetry. Values include the Kubernetes phases Pending, Running, Succeeded, Failed, and Unknown, plus Tsuga-derived CrashLoopBackOff and Error values."}),readyContainers:n.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:n.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:n.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:n.Optional(w({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),ID=n.Object({...Coe.properties,workload:n.Optional(Aoe),cpuUsageMilli:n.Optional(n.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:n.Optional(n.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),cpuRequestMilli:n.Optional(n.Number({description:"Configured pod CPU request in millicores, summed across observed containers. Present when a CPU request is configured and observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:n.Optional(n.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),memoryRequestBytes:n.Optional(n.Number({description:"Configured pod memory request in bytes, summed across observed containers. Present when a memory request is configured and observed."})),cpuUtilization:n.Optional(n.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:n.Optional(n.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."})),cpuRequestUtilization:n.Optional(n.Number({description:"Recent CPU usage divided by the configured CPU request. Present when both usage and request are observed."})),memoryRequestUtilization:n.Optional(n.Number({description:"Recent memory usage divided by the configured memory request. Present when both usage and request are observed."}))}),bD=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],fcr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/pods`,query:n.Object({...W$e,sortBy:n.Optional(n.Enum(bD,{description:"Field to sort pods by."})),sortDirection:n.Optional(pe)}),paginated:!0,response:n.Array(ID)}),X$e=["teams","envs"],xD=n.Object({cluster:n.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:n.Optional(n.Array(n.String(),{description:"Team metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when team labels or mappings are observed."})),envs:n.Optional(n.Array(n.String(),{description:"Environment metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when environment labels or mappings are observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Aggregate recent CPU usage for observed pods in the cluster, excluding default Kubernetes namespaces, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Aggregate recent memory usage for observed pods in the cluster, excluding default Kubernetes namespaces, in bytes. Present when memory usage telemetry is observed."})),readyNodes:n.Optional(n.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:n.Optional(n.Object({Pending:n.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:n.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:n.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:n.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:n.Integer({description:"Number of observed pods currently in the Unknown phase."})},{description:"Counts of observed pods by Kubernetes phase, excluding default Kubernetes namespaces. Present when pod phase telemetry is observed."}))}),Z$e=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],gcr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/clusters`,query:n.Object({...boe,teams:Ho("Restrict to clusters that host workloads from these team names."),envs:Ho("Restrict to clusters that host workloads in these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(X$e),{description:kS})),sortBy:n.Optional(n.Enum(Z$e,{description:"Field to sort clusters by."})),sortDirection:n.Optional(pe),...fe}),paginated:!0,response:n.Array(xD)}),J$e=["clusters"],e1e=["Ready","NotReady","Unknown"],OD=n.Object({node:n.String({description:"Kubernetes node name from node telemetry."}),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the node. Present when cluster telemetry is observed."})),status:n.Optional(n.Enum(e1e,{description:"Readiness of the node, derived from its Ready condition. Present when node condition telemetry is observed."})),instanceType:n.Optional(n.String({description:"Cloud instance type backing the node (for example `r7g.2xlarge`). Present when host telemetry is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods scheduled on the node, including pods in internal namespaces since they occupy node capacity. Present when pod telemetry is observed."})),allocatablePods:n.Optional(n.Integer({description:"Maximum number of pods the node can run. Present when node allocatable telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent CPU usage for the node, in millicores. Reported by the kubelet, so it is absent on nodes that only report cluster-level telemetry."})),cpuAllocatableMilli:n.Optional(n.Number({description:"CPU available to pods on the node, in millicores. Present when node allocatable telemetry is observed."})),cpuUtilization:n.Optional(n.Number({description:"Node CPU usage divided by allocatable CPU. Present when both usage and allocatable telemetry are observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent memory usage for the node, in bytes. Reported by the kubelet, so it is absent on nodes that only report cluster-level telemetry."})),memoryAllocatableBytes:n.Optional(n.Number({description:"Memory available to pods on the node, in bytes. Present when node allocatable telemetry is observed."})),memoryUtilization:n.Optional(n.Number({description:"Node memory usage divided by allocatable memory. Present when both usage and allocatable telemetry are observed."}))}),AD=["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],hcr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/nodes`,query:n.Object({..._D,clusters:Ho("Restrict results to these Kubernetes cluster names."),exclusiveFilters:n.Optional(n.Array(n.Enum(J$e),{description:kS})),sortBy:n.Optional(n.Enum(AD,{description:"Field to sort nodes by."})),sortDirection:n.Optional(pe),...fe}),paginated:!0,response:n.Array(OD)}),CD=n.Object({namespace:n.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:n.Optional(n.Array(n.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:n.Optional(n.Array(n.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Aggregate recent memory usage for observed pods in the namespace, in bytes. Present when memory usage telemetry is observed."}))}),RD=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],ycr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/namespaces`,query:n.Object({...ag,sortBy:n.Optional(n.Enum(RD,{description:"Field to sort namespaces by."})),sortDirection:n.Optional(pe)}),paginated:!0,response:n.Array(CD)}),PD=n.Object({deployment:n.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:n.Optional(n.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:n.Optional(n.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),UD=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],Ecr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/deployments`,query:n.Object({...ag,sortBy:n.Optional(n.Enum(UD,{description:"Field to sort deployments by."})),sortDirection:n.Optional(pe)}),paginated:!0,response:n.Array(PD)}),wD=n.Object({statefulSet:n.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),vD=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],Scr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/statefulsets`,query:n.Object({...ag,sortBy:n.Optional(n.Enum(vD,{description:"Field to sort StatefulSets by."})),sortDirection:n.Optional(pe)}),paginated:!0,response:n.Array(wD)}),ND=n.Object({daemonSet:n.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:n.Optional(n.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:n.Optional(n.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),LD=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],Tcr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/daemonsets`,query:n.Object({...ag,sortBy:n.Optional(n.Enum(LD,{description:"Field to sort DaemonSets by."})),sortDirection:n.Optional(pe)}),paginated:!0,response:n.Array(ND)}),kD=n.Object({overview:n.Object({...Coe.properties,workload:n.Optional(Aoe)},{description:"Pod identity, status, and owning workload, derived from recent pod metrics."}),healthMetrics:n.Object({cpu:n.Object({usage:n.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:n.String({description:"Metric name callers can use to query configured container CPU limits for the pod. This is not the current CPU limit value."}),request:n.String({description:"Metric name callers can use to query configured container CPU requests for the pod. This is not the current CPU request value."})},{description:"Metric names for pod CPU usage and for configured container CPU limits and requests."}),memory:n.Object({usage:n.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:n.String({description:"Metric name callers can use to query configured container memory limits for the pod. This is not the current memory limit value."}),request:n.String({description:"Metric name callers can use to query configured container memory requests for the pod. This is not the current memory request value."})},{description:"Metric names for pod memory usage and for configured container memory limits and requests."})},{description:"Metric names callers can use to query pod CPU and memory telemetry. These are fixed metric identifiers, not current values."}),searchFilters:n.Object({logs:n.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:n.String({description:"TQL trace search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."})},{description:"TQL filters scoped to this pod, ready to use as the query for log and trace search."})}),Roe=n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),_cr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/pod-details`,query:Roe,response:kD}),MD=n.Object({configuration:n.Optional(n.Object({spec:n.Record(n.String(),n.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:w({description:"Timestamp when Tsuga last observed the pod manifest used for configuration."})},{description:"Pod configuration from the latest observed pod manifest. Present when a pod manifest log is found for the pod."})),labels:n.Record(n.String(),n.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:n.Record(n.String(),n.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:n.Optional(w({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),Icr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/pod-manifest`,query:Roe,response:MD}),DD=n.Object({podName:n.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:n.Optional(n.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent memory usage for the pod replica, in bytes. Present when memory usage telemetry is observed."}))},{description:"A single pod instance with recent CPU or memory telemetry for the workload, resolved from pod usage telemetry and workload attributes."}),FD=n.Object({overview:n.Object({deploymentName:n.String({description:"Kubernetes Deployment name for this detail response."}),namespace:n.Optional(n.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:n.Optional(n.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:n.Optional(n.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:n.Optional(n.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:n.Optional(n.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:n.Optional(w({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:n.Array(DD,{description:"Pod instances with recent CPU or memory telemetry for the Deployment. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:n.Array(n.Object({replicaSetName:n.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:n.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:n.Optional(w({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),faultyReasons:n.Optional(n.Array(n.String(),{description:"Container status reasons the Kubernetes faulty deployment monitor reported for this revision within the revisions lookback. Present only when the revision was flagged as faulty."})),logsSearchFilter:n.String({description:"TQL log search filter scoped to this ReplicaSet revision. Built from cluster, namespace, and ReplicaSet identifiers."})}),{description:"Deployment rollout revisions from recent ReplicaSet object telemetry. Includes the latest observed event per ReplicaSet, excludes ReplicaSets whose latest observed spec.replicas is 0, and returns up to 8 revisions sorted by revision number descending."})}),bcr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/deployment-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),deploymentName:p({allowEmpty:!1})}),response:FD}),t1e=n.Object({overview:n.Object({statefulSetName:n.String(),namespace:n.Optional(n.String()),cluster:n.Optional(n.String()),team:n.Optional(n.String()),env:n.Optional(n.String()),readyReplicas:n.Optional(n.Integer()),desiredReplicas:n.Optional(n.Integer()),latestRevisionAt:n.Optional(w())}),podReplicas:n.Array(DD,{description:"Pod instances with recent CPU or memory telemetry for the StatefulSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:n.Array(n.Object({revisionName:n.String(),firstSeen:n.Optional(w()),faultyReasons:n.Optional(n.Array(n.String()))}))}),xcr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/statefulset-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),statefulSetName:p({allowEmpty:!1})}),response:t1e}),r1e=n.Object({overview:n.Object({daemonSetName:n.String(),namespace:n.Optional(n.String()),cluster:n.Optional(n.String()),team:n.Optional(n.String()),env:n.Optional(n.String()),readyNodes:n.Optional(n.Integer()),desiredNodes:n.Optional(n.Integer()),latestRevisionAt:n.Optional(w())}),podReplicas:n.Array(DD,{description:"Pod instances with recent CPU or memory telemetry for the DaemonSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:n.Array(n.Object({observedGeneration:n.Integer(),firstSeen:n.Optional(w()),faultyReasons:n.Optional(n.Array(n.String()))}))}),Ocr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/daemonset-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),daemonSetName:p({allowEmpty:!1})}),response:r1e}),jC=1e3,Poe=as,qC=n.Object({id:n.String({description:"Identifier of the event, unique across clusters and namespaces."}),name:n.Optional(n.String({description:"Name of the Kubernetes Event object, unique within its namespace."})),timestamp:n.Number({description:"Last time the event was observed, in milliseconds since the Unix epoch."}),type:n.Optional(n.String({description:"Event type, `Normal` or `Warning`."})),reason:n.Optional(n.String({description:"Short, machine-readable reason for the event, such as `BackOff` or `FailedScheduling`."})),message:n.Optional(n.String({description:"Human-readable description of the event."})),resourceName:n.Optional(n.String({description:"Name of the Kubernetes resource the event is about."})),resourceKind:n.Optional(n.String({description:"Kind of the Kubernetes resource the event is about, such as `Pod` or `Node`."})),namespace:n.Optional(n.String({description:"Kubernetes namespace the event was recorded in."})),cluster:n.Optional(n.String({description:"Name of the Kubernetes cluster that emitted the event."})),count:n.Optional(n.Integer({description:"Number of times the event occurred."}))}),n1e=["timestamp","type","reason","resourceName","resourceKind","namespace","cluster","count"],o1e=[...TD,"resourceKinds","resourceNames"],$D=n.Object({...ag,resourceKinds:Ho("Restrict results to events about these resource kinds (Pod, Node, Deployment...)."),resourceNames:Ho("Restrict results to events about these resource names."),types:n.Optional(n.Array(n.Enum(["Normal","Warning"]),{description:"Restrict results to events of these types."})),exclusiveFilters:n.Optional(n.Array(n.Enum(o1e),{description:kS})),sortBy:n.Optional(n.Enum(n1e)),sortDirection:n.Optional(pe)}),Acr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/events`,query:$D,paginated:!0,response:n.Array(qC)}),i1e=n.Object({...qC.properties,firstSeen:n.Optional(n.Number({description:"First time the event was observed, in milliseconds since the Unix epoch."})),resourceFieldPath:n.Optional(n.String({description:"Part of the resource the event is about, such as `spec.containers{app}` for one container."})),reportingComponent:n.Optional(n.String({description:"Component that reported the event, such as `kubelet`."})),reportingInstance:n.Optional(n.String({description:"Instance of the reporting component, such as the node name."})),team:n.Optional(n.String()),logsQuery:n.String({description:"TQL log search filter matching every update of the event."})}),Ccr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Ko}/event-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),eventName:p({allowEmpty:!1})}),response:i1e});var Ia=`/${"v1"}/kubernetes-explorer`,woe=n.Pick(ID,["podName","namespace","cluster","team","env","node","phase","readyContainers","totalContainers","restarts","createdAt","workload","cpuUsageMilli","cpuLimitMilli","memoryUsageBytes","memoryLimitBytes","cpuUtilization","memoryUtilization"],{description:"A Kubernetes pod with its current phase, owning workload, and resource usage."}),a1e={podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"},cpuUsageMilli:125,cpuLimitMilli:500,memoryUsageBytes:134217728,memoryLimitBytes:536870912,cpuUtilization:.25,memoryUtilization:.25};Object.assign(woe,{examples:[a1e]});var voe=n.Pick(xD,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),s1e={cluster:"prod-us-east",teams:["platform","payments"],envs:["production"],cpuUsageMilli:4200,memoryUsageBytes:8589934592,readyNodes:6,podPhaseCounts:{Pending:1,Running:42,Succeeded:3,Failed:0,Unknown:0}};Object.assign(voe,{examples:[s1e]});var Noe=n.Pick(CD,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),c1e={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(Noe,{examples:[c1e]});var Loe=n.Pick(OD,["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],{description:"A Kubernetes node with its readiness, instance type, and usage against what it can allocate to pods."}),u1e={node:"ip-10-0-1-23.ec2.internal",cluster:"prod-us-east",status:"Ready",instanceType:"r7g.2xlarge",pods:25,allocatablePods:234,cpuUsageMilli:4e3,cpuAllocatableMilli:8e3,cpuUtilization:.5,memoryUsageBytes:4e9,memoryAllocatableBytes:16e9,memoryUtilization:.25};Object.assign(Loe,{examples:[u1e]});var koe=n.Pick(PD,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),p1e={deployment:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,availableReplicas:3,desiredReplicas:3,cpuUsageMilli:375,memoryUsageBytes:402653184};Object.assign(koe,{examples:[p1e]});var Moe=n.Pick(wD,["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),l1e={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(Moe,{examples:[l1e]});var Doe=n.Pick(ND,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),d1e={daemonSet:"otel-collector",namespace:"observability",cluster:"prod-us-east",team:"platform",env:"production",pods:6,readyNodes:6,desiredNodes:6,cpuUsageMilli:300,memoryUsageBytes:805306368};Object.assign(Doe,{examples:[d1e]});var Foe=n.Pick(kD,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),m1e={overview:{podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"}},healthMetrics:{cpu:{usage:"k8s.pod.cpu.usage",limit:"k8s.container.cpu_limit",request:"k8s.container.cpu_request"},memory:{usage:"k8s.pod.memory.working_set",limit:"k8s.container.memory_limit",request:"k8s.container.memory_request"}},searchFilters:{logs:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"',traces:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"'}};Object.assign(Foe,{examples:[m1e]});var $oe=n.Pick(MD,["configuration","labels","annotations","deletedAt"],{description:"Manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest."}),f1e={configuration:{spec:{restartPolicy:"Always",serviceAccountName:"api-gateway"},lastObservedAt:"2024-01-15T12:30:00.000Z"},labels:{app:"api-gateway","pod-template-hash":"7d9f8c6b5"},annotations:{"prometheus.io/scrape":"true"}};Object.assign($oe,{examples:[f1e]});var Goe=n.Pick(FD,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),g1e={overview:{deploymentName:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",availableReplicas:3,desiredReplicas:3,latestRevisionAt:"2024-01-15T12:00:00.000Z"},podReplicas:[{podName:"api-gateway-7d9f8c6b5-2xk4p",podUid:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",cpuUsageMilli:125,memoryUsageBytes:134217728}],revisions:[{replicaSetName:"api-gateway-7d9f8c6b5",revision:7,firstSeen:"2024-01-15T12:00:00.000Z",logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(Goe,{examples:[g1e]});var Boe=n.Pick(qC,["timestamp","type","reason","message","resourceName","resourceKind","namespace","cluster","count"],{description:"A Kubernetes event with its type, reason, message, and the resource it is about. `timestamp` is the last occurrence in epoch milliseconds and `count` the number of occurrences."}),h1e={timestamp:17897328e5,type:"Warning",reason:"BackOff",message:"Back-off restarting failed container api in pod api-gateway-7d9f8c6b5-2xk4p_production",resourceName:"api-gateway-7d9f8c6b5-2xk4p",resourceKind:"Pod",namespace:"production",cluster:"prod-us-east",count:3};Object.assign(Boe,{examples:[h1e]});var joe=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}))}),qoe=n.Pick(xoe,["clusterId","search"]);function sg(e){return n.Object({...qoe.properties,sortBy:n.Optional(n.Enum(e,{description:"Field to sort results by."})),sortDirection:n.Optional(pe),...je})}var cg=`Results are paged, ${Gu} per page by default; when \`totalCount\` exceeds the page, narrow them with \`search\` or page through them with \`limit\` and \`offset\`, and set \`sortBy\` so the order stays the same across pages.`,y1e=n.Pick(Ooe,["clusterId","search"]),Hoe=f({description:`Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage. ${cg}`,operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/pods`,paginated:!0,query:sg(bD),response:n.Array(woe)}),Koe=f({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/clusters`,query:y1e,response:n.Array(voe)}),zoe=f({description:`Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage. ${cg}`,operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/namespaces`,paginated:!0,query:sg(RD),response:n.Array(Noe)}),Yoe=f({description:`Lists Kubernetes nodes observed across the organization with their readiness, instance type, and resource usage against allocatable capacity. ${cg}`,operationId:"listKubernetesNodes",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/nodes`,paginated:!0,query:sg(AD),response:n.Array(Loe)}),Voe=f({description:`Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage. ${cg}`,operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/deployments`,paginated:!0,query:sg(UD),response:n.Array(koe)}),Woe=f({description:`Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage. ${cg}`,operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/statefulsets`,paginated:!0,query:sg(vD),response:n.Array(Moe)}),Qoe=f({description:`Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage. ${cg}`,operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/daemonsets`,paginated:!0,query:sg(LD),response:n.Array(Doe)}),Uoe=100,E1e=n.Object({...qoe.properties,...n.Pick($D,["clusters","namespaces","resourceKinds","types","includeInternalNamespaces"]).properties,limit:n.Optional(n.Integer({minimum:1,maximum:jC,default:Uoe,description:`Maximum number of events to return, newest first. Defaults to ${Uoe}. Valid values are 1 through ${jC}.`}))}),Xoe=f({description:`Lists the most recent Kubernetes events of the last ${Poe/Kk} hours (from the latest ${jC} event observations), newest first, with their type, reason, message, and the resource they are about. \`search\` matches the name of the resource the event is about.`,operationId:"listKubernetesEvents",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/events`,query:E1e,response:n.Array(Boe)}),Zoe=n.Object({...joe.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the pod. From cluster telemetry. Required to identify the pod because pod names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the pod. From pod metadata. Required to identify the pod because pod names are only unique within a namespace and cluster."}),podName:p({allowEmpty:!1,description:"Kubernetes pod name to retrieve. Set when the pod is created. Required to fetch pod details for the selected cluster and namespace."})}),Joe=f({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/pod-details`,query:Zoe,response:Foe}),eie=f({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/pod-manifest`,query:Zoe,response:$oe}),tie=f({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ia}/deployment-details`,query:n.Object({...joe.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the Deployment. From cluster telemetry. Required to identify the Deployment because names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the Deployment. From workload metadata. Required to identify the Deployment because names are only unique within a namespace and cluster."}),deploymentName:p({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:Goe});var S1e="clusterId";function fr(e,t,r){let o=T1e(t,r);return P(e,o,v(`cli.${t.operationId??e}`)(function*(i){let a=i,s={};for(let u of Object.keys(o)){let l=tre(a,u);l!==void 0&&(s[u]=l)}yield*xe(yield*tt(t,Object.keys(s).length>0?{query:s}:void 0))})).pipe(U(t.description??e))}function T1e(e,t){let r=ere(e.query),o={};for(let i of Object.keys(r)){if(i===S1e)continue;let a=i.replace(/([A-Z])/g,"-$1").toLowerCase(),s=a.replace(/-/g,"_").toUpperCase(),u=Fe(a).pipe(Z(r[i]?.description??""),Ee(s));o[i]=t?u:u.pipe(Je)}return o}var rie=fr("clusters",Koe,!1);var nie=fr("daemonsets",Qoe,!1);var oie=fr("deployment-details",tie,!0);var iie=fr("deployments",Voe,!1);var aie=fr("events",Xoe,!1);var sie=fr("namespaces",zoe,!1);var cie=fr("nodes",Yoe,!1);var uie=fr("pod-details",Joe,!0);var pie=fr("pod-manifest",eie,!0);var lie=fr("pods",Hoe,!1);var die=fr("statefulsets",Woe,!1);var mie=P("kubernetes").pipe(U("Explore Kubernetes resources observed across the organization"),_e([lie,rie,sie,cie,iie,die,nie,aie,uie,pie,oie]));var fie=P("attributes",{...Kt,search:Fe("search").pipe(Z("Only list dot-paths containing this text, case-insensitively (e.g. k8s or http.status)"),Ee("TEXT"),Je)},v("cli.logs.attributes")(function*(e){let{attributes:t}=yield*Qt(ZX,{query:hn({...yield*Kr(e),search:ne(e.search)})});yield*xe({data:t})})).pipe(U("List log attribute dot-paths observed in the time range"));var HC=Fe("env").pipe(Z("Filter by environment"),Ee("ENV_NAME"),Je);var _1e=["team","env","pattern"],gie=P("error-pattern-increases",{...Kt,team:Fe("team").pipe(Z("Team to query"),Ee("TEAM_NAME")),env:HC,output:uo},v("cli.logs.errorPatternIncreases")(function*(e){let t=yield*mn,{errorPatternIncreases:r}=yield*Qt(QX,{query:hn({...yield*Kr(e),team:e.team,env:ne(e.env)})});yield*t.rows(r,{...e,defaultFields:_1e})})).pipe(U("List error pattern increases for a given team"));var I1e=["team","env","service","firstSeen","lastSeen"],b1e=Fe("team").pipe(Z("Filter by team"),Ee("TEAM_NAME"),Je),hie=P("new-error-patterns",{...Kt,team:b1e,env:HC,service:Fe("service").pipe(Z("Filter by service"),Ee("SERVICE_NAME"),Je),output:uo},v("cli.logs.newErrorPatterns")(function*(e){let t=yield*mn,{newErrorPatterns:r}=yield*Qt(VX,{query:hn({...yield*Kr(e),team:ne(e.team),env:ne(e.env),service:ne(e.service)})});yield*t.rows(r,{...e,defaultFields:I1e})})).pipe(U("List error patterns first seen in this time range"));var x1e=["count","ratio","team","level","pattern"];function O1e(e,t){let r={count:e.size,sampleSize:t,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)r[o==="context.team"?"team":o]=i;return r}var yie=P("patterns",{...Kt,query:np.pipe(Z("Tsuga query to filter logs before clustering into patterns")),output:uo},v("cli.logs.patterns")(function*(e){let t=yield*mn,r=yield*Qt(zX,{query:hn({...yield*Kr(e),query:yield*fd("query",e.query)})}),{patterns:o,sampleSize:i}=r,a=o.map(s=>O1e(s,i));yield*t.rows(a,{...e,defaultFields:x1e})})).pipe(U("List log patterns"));var A1e=L(function*(e){if(e===void 0)return;let t=ne(e);if(t!==void 0)return t;let r=yield*fd("max-results",K());if(r===void 0)return;let o=Number(r);return!Number.isSafeInteger(o)||o<=0?yield*new It({message:`The saved default for max-results must be a positive safe integer (got: ${r}). Fix it with \`tsuga config set default max-results --value <N>\`.`}):o}),ug=L(function*(e){let t=e.query===void 0?void 0:yield*fd("query",e.query),r=yield*A1e(e.maxResults);return hn({...yield*Kr(e),query:t,maxResults:r})});var C1e=["timestamp","level","message"],Eie=P("search",{...Kt,query:np,maxResults:Jf,output:uo},v("cli.logs.search")(function*(e){let t=yield*mn,r=yield*Qt(tS,{query:yield*ug(e)}),{logs:o}=r;yield*t.rows(o,{...e,defaultFields:C1e})})).pipe(U("Search logs"));var Sie=P("logs").pipe(U("Search and analyze logs"),_e([Eie,fie,yie,hie,gie]));var GD=`/${"v1"}/metrics`,BD=n.Object({name:n.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:pA,description:n.Optional(n.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:n.Optional(lA),capabilities:n.Optional(n.Array(n.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. An empty or omitted array means all aggregate types are supported."})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."})),seriesCardinality:n.Optional(dA),attributeCardinalities:n.Optional(n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `attributes`. Omitted when the catalog has no statistics for the metric yet."}))}),Tie={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"],seriesCardinality:1250,attributeCardinalities:{"context.team":4,"context.environment":3,"context.region":12}};Object.assign(BD,{examples:[Tie]});var _ie=n.Omit(BD,["attributes","attributeCardinalities"]);Object.assign(_ie,{examples:[UX(Tie,["attributes","attributeCardinalities"])]});var Iie=n.Object({from:Vl("Unix timestamp in seconds. Required, but does not scope the result."),to:Vl("Unix timestamp in seconds. Required, but does not scope the result."),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. The time range is required but does not scope the result, which comes from a cluster-wide catalog of metric names. Optionally takes a cluster ID."}),bie=f({description:`Lists metric names with metadata such as type, unit, temporality, capabilities, and estimated series cardinality. Use this to discover metric names before querying or graphing them, then get one metric for its attributes and their cardinalities. Results are sorted by name and paged, ${Gu} per page by default; when \`totalCount\` exceeds the page, narrow them with \`search\` or page through them with \`limit\` and \`offset\`. This reads a cluster-wide catalog of names rather than the window: \`from\` and \`to\` are required but do not scope the result, and a name stays listed after the metric stops reporting. To find out whether a metric has data in a window, run a \`count\` aggregation over it. See [Metrics](/documentation/explore/metrics/index).`,operationId:"listMetrics",tags:["public","metrics"],url:GD,method:"GET",paginated:!0,query:n.Object({...Iie.properties,...je,search:n.Optional(p({allowEmpty:!1,description:"Keep only metric names containing this value, matched case-insensitively."}))}),response:n.Array(_ie)}),xie=f({description:"Retrieves metadata for one metric name. Use this to inspect available dimensions, supported query behavior, and the estimated series and per-attribute cardinalities for a metric. The cardinalities are the periodically refreshed estimates shown in Metric details, not counts over the window. Like the list endpoint, this answers from a cluster-wide catalog rather than the window: `from` and `to` are required but do not scope the result. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${GD}/:name`,method:"GET",params:n.Object({name:p({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:Iie,response:BD}),R1e=["service","env","host","method","status_code"];Object.assign(VE,{examples:[R1e]});var Oie=n.Pick(d0,["assets"]),P1e={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"team-123-abc"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"team-123-abc"}]};Object.assign(Oie,{examples:[P1e]});var Aie=f({description:"Lists the dashboards and monitors whose queries reference a metric. Use this before renaming or dropping a metric. An empty result does not prove the metric is unused: PromQL widgets, SLOs and assets you cannot read are not covered. It tells which assets use the metric, not how: read the aggregation from the dashboard or monitor itself. See [How to find which assets use a metric](/documentation/explore/guides/how-to-find-which-assets-use-a-metric).",operationId:"getMetricAssetsUsage",tags:["public","metrics"],url:`${GD}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1,description:"Metric name to look up, for example `http.server.request.duration`."})}),response:Oie});var Cie=P("assets-usage",{name:zr("METRIC_NAME").pipe(ur("The metric to look up"))},v("cli.metrics.assetsUsage")(function*({name:e}){yield*xe(yield*tt(Aie,{query:{metricName:e}}))})).pipe(U("List dashboards and monitors that use a specific metric"));var Rie=P("get",{name:zr("METRIC_NAME").pipe(ur("The metric to retrieve")),...Kt},v("cli.metrics.get")(function*(e){yield*xe(yield*tt(xie,{params:{name:e.name},query:yield*Kr(e)}))})).pipe(U("Retrieve a metric by name with its metadata"));var Pie=P("list",{...Kt,...op,search:Fe("search").pipe(Z("Keep only metric names containing this text (case-insensitive)"),Ee("TEXT"),Je)},v("cli.metrics.list")(function*(e){let t=hn({limit:ne(e.limit),offset:ne(e.offset),search:ne(e.search),...yield*Kr(e)});yield*xe(yield*tt(bie,{query:t,allPages:e.all}))})).pipe(U("List metrics with their metadata, sorted by name and paged"));var Uie=P("metrics").pipe(U("List and inspect metrics"),_e([Pie,Rie,Cie]));var U1e="/v0/profiles",w1e=["cpu","samples","sample","wall","offcpu","space","inuse_space","objects","inuse_objects","alloc_space","alloc_objects","goroutine"],v1e=20,MS={service:p({allowEmpty:!1,description:"Service the profiles belong to, as it appears in `profile.{type}.{service}`."}),type:n.Enum(w1e,{description:"pprof sample type."}),filter:n.Optional(p({type:"tsuga-query",description:"TQL over the profile labels. Only label equality, negation and wildcards are accepted."})),groupBy:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Labels to split the flamegraph by. The stack itself cannot be a group-by."})),limit:n.Optional(n.Integer({minimum:1,default:v1e,description:"Maximum number of groups, ranked by total value."})),minFraction:n.Optional(n.Number({minimum:0,maximum:1,description:"Nodes below this share of the root total fold into their parent."}))},Qpr=f({tags:["profiles"],url:`${U1e}/query`,method:"POST",body:n.Object({...MS,timeRange:Oo,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),response:wf});var wie=`/${"v1"}/profiles`,vie=n.Object({...MS,timeRange:Jr},{description:"Profile query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{service:"api",type:"cpu",timeRange:{from:1782201500,to:1782203400},filter:"context.env:prod"}]}),N1e=n.Object({stacks:n.Array(n.Object({stack:n.String({description:"Frames from the root to the leaf, joined with `;` (folded stack format)."}),group:n.Record(n.String(),n.String(),{description:"Group-by label values for this stack. Empty when no group-by is requested."}),value:n.Number({description:"Total sample value of this stack, in the unit of the profile type."})}),{description:"One entry per distinct leaf stack, after folding nodes below minFraction."})},{examples:[{stacks:[{stack:"main;handleRequest;encodeJson",group:{},value:125e7},{stack:"main;handleRequest;queryDb",group:{},value:8e8}]}]}),KC=f({description:"Aggregates continuous profiling samples for a service into folded stacks, optionally split by profile labels.",tags:["private"],url:`${wie}/query`,method:"POST",body:vie,query:Fi,response:N1e}),L1e=n.Object({pprof:n.String({description:"Merged pprof profile, base64-encoded (standard alphabet, padded)."})}),Nie=f({description:"Merges continuous profiling samples for a service into a single pprof profile.",tags:["private"],url:`${wie}/pprof`,method:"POST",body:vie,query:Fi,response:L1e});var Lie=v("output.printBytes")(function*(e){let t=yield*bm;yield*qh(Lq(e),t.stdout()).pipe(dt(r=>new Nn({message:`Could not write stdout: ${r.message}`})))});var zC={service:Fe("service").pipe(Z("Service the profiles belong to"),Ee("SERVICE_NAME")),type:$m("type",MS.type.enum).pipe(Z("Profile type"),Ee("PROFILE_TYPE")),...Kt,filter:Fe("filter").pipe(Z("Tsuga query over profile labels (equality, negation, wildcards)"),Ee("TSUGA_QUERY"),Je)},YC=L(function*(e){let t=ne(e.filter);return{service:e.service,type:e.type,timeRange:yield*Kr(e),...t===void 0?{}:{filter:t}}});var kie=P("pprof",{...zC,outputFile:Fe("output-file").pipe(vi("O"),Z("Write the profile to this file instead of stdout"),Ee("FILE_PATH"),Je)},v("cli.profiles.pprof")(function*(e){let t=ne(e.outputFile);if(t===void 0&&(yield*qE))return yield*new It({message:"Refusing to write a binary profile to the terminal. Use --output-file <FILE_PATH> or pipe stdout."});let r=yield*Qt(Nie,{body:yield*YC(e)}),o=Buffer.from(r.pprof,"base64");if(t===void 0){yield*Lie(o);return}yield*(yield*Xr).writeFile(t,o).pipe(dt(a=>new Nn({message:`Could not write ${t}: ${a.message}`})))})).pipe(U("Download a merged pprof profile (raw protobuf, not gzipped)"));var Mie=kn("query","Run a raw profile query and print the folded stacks",KC);var k1e=30,M1e=["flat","flatPercent","cum","cumPercent","function"],Die=P("top",{...zC,limit:Fm("limit").pipe(Z("Maximum number of functions to print"),Ee("COUNT"),_n(k1e)),output:uo},v("cli.profiles.top")(function*(e){let t=yield*mn;if(e.limit<1)return yield*new It({message:`--limit must be a positive integer (got: ${e.limit})`});let r=yield*Qt(KC,{body:yield*YC(e)}),{total:o,functions:i}=D1e(r.stacks),a=i.slice(0,e.limit).map(s=>({...s,total:o}));yield*t.rows(a,{...e,defaultFields:M1e})})).pipe(U("Rank functions by self (flat) and inclusive (cum) sample value, like pprof -top"));function D1e(e){let t=new Map,r=new Map,o=0;for(let{stack:s,value:u}of e){let l=s.split(";"),m=l[l.length-1];if(m!==void 0){o+=u,t.set(m,(t.get(m)??0)+u);for(let g of new Set(l))r.set(g,(r.get(g)??0)+u)}}let i=s=>o===0?0:Math.round(s/o*1e4)/100,a=[...r.entries()].map(([s,u])=>{let l=t.get(s)??0;return{function:s,flat:l,flatPercent:i(l),cum:u,cumPercent:i(u)}}).sort((s,u)=>u.flat-s.flat||u.cum-s.cum||s.function.localeCompare(u.function));return{total:o,functions:a}}var Fie=P("profiles").pipe(U("Query continuous profiling data"),_e([Die,kie,Mie]));var $ie=kn("query","Run a PromQL range query over metric data",NA);var Gie=P("promql").pipe(U("Run PromQL queries over metric data"),_e([$ie]));var po="/v0/monitors",pg=["alert","resolve","keep_last_status","consider_zero"],lg=["alert","resolve","keep_last_status"];var jie=["no_aggregation","all","any","each","proportion"],qie=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var F1e=n.Object({formula:n.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(qie,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),$1e=n.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(qie,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),G1e=5,jD=n.Array(F1e,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),qD=n.Array($1e,{minItems:1,maxItems:G1e,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),HD=n.Object({formula:n.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type Tsuga uses to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), `general` flags both directions, and `to_be_set` is a placeholder Tsuga replaces by inferring the model type from the monitor query when the monitor is created or updated."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),KD=n.Object({formula:p({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), and `general` flags both directions. Use `to_be_set` to let Tsuga infer the model type from the monitor query during create or update."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),yn=[1,2,3,4,5];var B1e=4;var VC={timeframe:n.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(pe),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration."}),aggregationAlertLogic:n.Optional(n.Enum(jie,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`."})),proportionAlertThreshold:n.Optional(n.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},WC={timeframe:n.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:n.Array(n.Object({fields:n.Array(p(),{maxItems:B1e,description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty or omitted means the monitor evaluates a single ungrouped series."}),limit:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(pe),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration."}),aggregationAlertLogic:n.Optional(n.Enum(jie,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`. With `groupByFields`, send `each` so every group opens and resolves its own alert, as the app does by default; `all`, `any`, and `proportion` raise one alert for the whole monitor. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},zD={...VC,timeframe:n.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},YD={...WC,timeframe:n.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},j1e=10,q1e=4320,Hie=`Number of consecutive \`timeframe\`-minute windows, ending at evaluation time, that must all meet the conditions before the monitor alerts, per group for grouped monitors. 1 or omitted checks a single window. A window that does not meet the conditions breaks the run. An empty window, such as a query with \`fill.mode.type\` \`null\` returning nothing, breaks the run under \`noDataBehavior\` \`alert\` or \`resolve\`, takes the previous window's result under \`keep_last_status\`, and counts as 0 under \`consider_zero\`. A query without \`fill\` counts an empty window as 0. When every window is empty (with \`keep_last_status\`, when the oldest is empty and none breaks the run), \`noDataBehavior\` applies as for a single window. Above 1, \`consecutiveWindows\` \xD7 \`timeframe\` must not exceed ${q1e} minutes (3 days).`,VD=n.Optional(n.Integer({description:Hie})),WD=n.Optional(n.Integer({minimum:1,maximum:j1e,description:Hie})),Kie=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:jD,noDataBehavior:n.Enum(pg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,consecutiveWindows:VD,queries:Oc},{$id:"MonitorConfigurationMetric"}),H1e=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:qD,noDataBehavior:n.Enum(pg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...WC,consecutiveWindows:WD,queries:Wu},{$id:"InputMonitorConfigurationMetric"}),zie=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:jD,noDataBehavior:n.Enum(pg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,consecutiveWindows:VD,queries:Oc},{$id:"MonitorConfigurationLog"}),K1e=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:qD,noDataBehavior:n.Enum(pg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...WC,consecutiveWindows:WD,queries:Wu},{$id:"InputMonitorConfigurationLog"}),Yie=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:jD,noDataBehavior:n.Enum(pg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,consecutiveWindows:VD,queries:Oc},{$id:"MonitorConfigurationTrace"}),z1e=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:qD,noDataBehavior:n.Enum(pg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...WC,consecutiveWindows:WD,queries:Wu},{$id:"InputMonitorConfigurationTrace"}),Vie=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:HD,noDataBehavior:n.Enum(lg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...zD,queries:Oc},{$id:"MonitorConfigurationAnomalyLog"}),Y1e=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:KD,noDataBehavior:n.Enum(lg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...YD,queries:Wu},{$id:"InputMonitorConfigurationAnomalyLog"}),Wie=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:HD,noDataBehavior:n.Enum(lg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...zD,queries:Oc},{$id:"MonitorConfigurationAnomalyMetric"}),V1e=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:KD,noDataBehavior:n.Enum(lg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...YD,queries:Wu},{$id:"InputMonitorConfigurationAnomalyMetric"}),Qie=n.Object({type:n.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values."}),condition:HD,noDataBehavior:n.Enum(lg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...zD,queries:Oc},{$id:"MonitorConfigurationAnomalyTrace"}),W1e=n.Object({type:n.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values."}),condition:KD,noDataBehavior:n.Enum(lg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...YD,queries:Wu},{$id:"InputMonitorConfigurationAnomalyTrace"}),Xie=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:n.Optional(n.Array(n.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),Q1e=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),Zie="When `true`, every new error pattern alerts on the next evaluation, even if it appeared in a single log. When `false` or omitted, a new pattern alerts only once it has lasted at least 5 minutes and matched at least 20 logs, which filters out one-off errors.",X1e=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."})),env:n.String({description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(n.String(),{description:"Service names whose logs are searched for new error patterns."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:Zie}))},{$id:"MonitorConfigurationLogErrorPattern"}),Z1e=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets.",minItems:1})),env:p({allowEmpty:!1,description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Service names whose logs are searched for new error patterns.",minItems:1}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:Zie}))},{$id:"InputMonitorConfigurationLogErrorPattern"}),Jie=n.Object({type:n.Literal("log-error-pattern-increase",{description:"Monitor that alerts when the volume of an existing log error pattern increases sharply for the configured teams and environment."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern increase monitors. Each pattern whose volume increased is evaluated as its own alert group."}),noDataBehavior:n.Literal("resolve",{description:"Fixed no-data behavior for log error pattern increase monitors. A pattern group resolves once its volume stops increasing."}),filter:n.Object({teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs whose error logs are watched for volume increases. Tsuga resolves these team IDs to team names when exporting monitor assets. Omit to watch every team, in which case a service scope is required."})),env:n.String({description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(n.String(),{description:"Service names whose error logs are watched for volume increases. Omit to watch every service matching the team and environment scope."}))},{description:"Log selection used for error pattern increase detection. All configured fields must match for logs to be included."})},{$id:"MonitorConfigurationLogErrorPatternIncrease"}),J1e=n.Object({type:n.Literal("log-error-pattern-increase",{description:"Monitor that alerts when the volume of an existing log error pattern increases sharply for the configured teams and environment."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern increase monitors. Each pattern whose volume increased is evaluated as its own alert group."}),noDataBehavior:n.Literal("resolve",{description:"Fixed no-data behavior for log error pattern increase monitors. A pattern group resolves once its volume stops increasing."}),filter:n.Object({teamIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Team IDs whose error logs are watched for volume increases. Tsuga resolves these team IDs to team names when exporting monitor assets. Omit to watch every team, in which case `services` is required."})),env:p({allowEmpty:!1,description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Service names whose error logs are watched for volume increases. Omit to watch every service matching the team and environment scope."}))},{description:"Log selection used for error pattern increase detection. All configured fields must match for logs to be included."})},{$id:"InputMonitorConfigurationLogErrorPatternIncrease"}),eae={type:n.Literal("k8s-faulty-deployment",{description:"Monitor that alerts when a Kubernetes workload (Deployment, StatefulSet, or DaemonSet) keeps failing right after a rollout."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for Kubernetes faulty deployment monitors. Each faulty workload revision is evaluated as its own alert group."})},eGe=["replicaSet","statefulSet","daemonSet"],tae=n.Enum(eGe,{description:"Kubernetes workload type: `replicaSet` (Deployment rollouts), `statefulSet`, or `daemonSet`."}),rae=n.Object({...eae,filter:n.Object({clusterNames:n.Optional(n.Array(n.String(),{description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(n.String(),{description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(tae,{description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched."})},{$id:"MonitorConfigurationK8sFaultyDeployment"}),tGe=n.Object({...eae,filter:n.Object({clusterNames:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(tae,{minItems:1,uniqueItems:!0,description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched. Send an empty object to watch every workload."})},{$id:"InputMonitorConfigurationK8sFaultyDeployment"}),nae={type:n.Literal("faulty-deployment",{description:"Monitor that alerts when Tsuga faulty deployment detection flags a newly deployed service version as faulty."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for faulty deployment monitors. Each faulty service version in an environment is evaluated as its own alert group."})},oae=n.Object({...nae,filter:n.Object({services:n.Optional(n.Array(n.String(),{description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched."})},{$id:"MonitorConfigurationFaultyDeployment"}),rGe=n.Object({...nae,filter:n.Object({services:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched. Send an empty object to watch every deployment."})},{$id:"InputMonitorConfigurationFaultyDeployment"}),nGe=D("type",[Kie,zie,Yie,Vie,Wie,X1e,Jie,Qie,Xie,rae,oae],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),oGe=D("type",[H1e,K1e,z1e,Y1e,V1e,W1e,Z1e,J1e,Q1e,tGe,rGe],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var lp=n.Object({id:n.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:n.String({description:"Display name of the monitor and alert source."}),owner:n.String({description:"Team ID that owns and manages the monitor."}),message:n.Optional(n.String({description:"Caller-supplied message included in notifications triggered by this monitor. Omitted when the monitor was created or last updated without one."})),tags:Ut,configuration:nGe,priority:n.Enum(yn,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:Ea,dashboardId:n.Optional(n.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),folderId:n.Optional(n.String({description:"ID of the monitor folder containing this monitor. Omitted for unfiled monitors."})),pauseUntil:n.Optional(w({description:"Timestamp until which the monitor is snoozed. Omitted when the monitor is not snoozed."})),creator:n.Optional(Te),updater:n.Optional(Te),createdAt:w({description:"Timestamp when Tsuga created the monitor."}),updatedAt:w({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:w({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:n.Array(n.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),QD=D("type",[Kie,zie,Yie,Vie,Wie,Qie,Xie,Jie,rae,oae]),Ylr=n.Object({...lp.properties,configuration:QD},{title:"Monitor"}),DS=n.Object({name:p({description:"Display name of the monitor and alert source."}),message:ze(p({type:"long"}),{description:"Message included in notifications triggered by this monitor. Optional on create."}),tags:Dt,configuration:oGe,priority:n.Enum(yn,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:ze(p({allowEmpty:!1}),{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."}),folderId:ze(p({allowEmpty:!1}),{description:"Folder to organize this monitor in. Omit on create or send null to leave it unfiled; omit on update to keep its folder, or send null to remove it. A non-null ID must name a readable monitor folder. Assignment does not change ownership, data access, or evaluation state."}),pauseUntil:ze(p({allowEmpty:!1,type:"date-time"}),{description:"ISO timestamp until which the monitor is snoozed. Must be in the future and at most one month from now. On create: omit or send `null` to leave the monitor active. On update: omit to keep the current snooze, send `null` to clear it."}),permissions:Ea,clusterIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),Bie=["threshold","certificate-expiry","anomaly-detection","log-error-pattern","log-error-pattern-increase","k8s-faulty-deployment","faulty-deployment"],pp={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var XD=n.Object({folderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Return monitors directly assigned to this folder ID, or unfiled monitors when null. Omit to return all monitors."}),owners:he(p({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:xo({description:"Search query filter for monitors.",valueDescription:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),tags:he(en.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:he(n.Enum(yn),{description:"Restrict results to monitors with one of these priorities",maxItems:yn.length}),types:he(n.Enum(Bie),{description:"Restrict results to monitors with these types",maxItems:Bie.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:he(p({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),QC=n.Partial(XD),ZD=n.Partial(n.Object({...fe,filters:QC,sort:n.Object({by:n.Enum([pp.PRIORITY,pp.TYPE,pp.NAME,pp.OWNER,pp.TAGS,pp.CLUSTER_IDS,pp.PAUSE_UNTIL,pp.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by. For `priority`, `desc` returns highest-priority monitors first because priority 1 is highest."}),direction:pe},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),Vlr=f({tags:["monitors"],url:`${po}/query`,method:"POST",paginated:!0,response:n.Array(lp),body:ZD}),Wlr=f({tags:["monitors"],url:`${po}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(XD,["tags"])))}),response:Yr}),Qlr=f({tags:["monitors"],url:`${po}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(XD,["activity"])))}),response:n.Object({all:n.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:n.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:n.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),Xlr=f({tags:["monitors"],url:`${po}/:id`,method:"GET",params:n.Object({id:p()}),response:lp}),Zlr=f({tags:["monitors"],url:po,method:"POST",body:DS,response:lp}),Jlr=f({tags:["monitors"],url:`${po}/:id`,method:"PUT",params:n.Object({id:p()}),body:DS,response:lp}),iGe=100,aGe=si(QC,{maxIds:iGe}),edr=f({tags:["monitors"],url:`${po}/bulk-update`,method:"PUT",body:n.Object({selection:aGe,owner:n.Optional(p({allowEmpty:!1,description:"Owning team to apply to every selected monitor. Omit to keep current ownership."})),folderId:ze(p({allowEmpty:!1}),{description:"Folder to assign every selected monitor to. Omit to keep their folders, or send null to make them unfiled. Assignment preserves ownership, data access, and evaluation state."})}),response:n.Object({})}),tdr=f({tags:["monitors"],url:`${po}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),sGe=si(QC),rdr=f({tags:["monitors"],url:`${po}/bulk-delete`,method:"DELETE",body:n.Object({selection:sGe}),response:n.Object({})}),ndr=f({tags:["monitors"],url:`${po}/:id/snooze`,method:"POST",params:n.Object({id:p()}),body:n.Object({pauseUntil:n.Union([n.Null(),p({allowEmpty:!1,type:"date-time"})])}),response:lp}),cGe=si(QC,{maxIds:100}),odr=f({tags:["monitors"],url:`${po}/bulk-snooze`,method:"POST",body:n.Object({selection:cGe,pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:n.Object({})}),uGe=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],pGe=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],lGe=[...uGe,...pGe],Td=n.Enum(lGe),dGe=D("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([Td,n.Null()]),lastChangedAt:w()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(Td)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(Td)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(Td)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(Td)})]),mGe=n.Object({monitorId:n.String(),currentState:dGe,lastChangedAt:n.Optional(w())}),idr=f({tags:["monitors"],url:`${po}/states/:id`,method:"GET",params:n.Object({id:p()}),response:mGe}),adr=f({tags:["monitors"],url:`${po}/:id/transitions`,method:"GET",params:n.Object({id:p()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:w(),fromState:n.Optional(Td),toState:n.Optional(Td),dimension:n.Optional(n.String())}))}),fGe=["unprocessed","processed","failed-to-process"],sdr=f({tags:["monitors"],url:`${po}/:id/results`,method:"GET",params:n.Object({id:p()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:w(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),KE),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:w(),status:n.Enum(fGe)}))})});var iae=D("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),aae=D("type",[n.Object({type:n.Literal("bearer"),token:p({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:p({allowEmpty:!1}),value:p({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),sae=D("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(p({allowEmpty:!1})),password:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(p({allowEmpty:!1})),value:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})]);var Id="/v0/notifications",ys=`${Id}/rules`,cae=`${Id}/slack/setup`,dg=`${Id}/integrations`,_d=["triggered","resolved","no-data"],gGe=["sent","stale","pending","rate-limited","failed","silenced"],hGe=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:n.Integer({description:"Length of the rate-limiting window, in minutes."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."})),JD=n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of notifications this target can send during the rate-limiting window. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window, in minutes. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."}),yGe=n.Optional(JD),gs=n.Optional(n.Object({mode:n.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),hs=n.Optional(n.Object({mode:n.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),FS=n.Object({id:n.String({description:"Identifier of the notification target within this rule, used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:hGe,config:D("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"}),renotifyConfig:gs},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"}),renotifyConfig:gs},{$id:"RuleTargetConfigSquadcast"}),n.Object({type:n.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:n.String({description:"Identifier of the Jira integration to use"}),integrationName:n.String({description:"Human readable name of the Jira integration"}),projectKey:n.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:n.String({description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(n.String({description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:n.Optional(n.String({description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetConfigJira"})],{description:"Destination that received the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses, and every other type routes through the named integration referenced by `integrationId`."})}),mg=n.Object({id:p({description:"Identifier of the notification target within this rule. Choose a stable ID that is unique among this rule's targets; Tsuga uses it with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:yGe,config:D("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:p({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:p({allowEmpty:!1,description:"Slack workspace ID that receives the notification"}),renotifyConfig:hs},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the incident.io integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:n.Array(p({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:hs},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:hs},{$id:"RuleTargetInputSquadcast"}),n.Object({type:n.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:p({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:p({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(p({allowEmpty:!1,description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:n.Optional(p({allowEmpty:!1,description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetInputJira"})],{description:"Destination that should receive the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses and needs no integration; every other type routes through the integration identified by `integrationId`, which must already exist (create it first with the notification integration endpoints)."})}),eF=D("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(n.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),tF=D("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(p(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),bd=n.Object({id:n.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:n.String({description:"Display name of the notification rule."}),queryString:n.Optional(n.String({description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:eF,prioritiesFilter:n.Array(n.Enum(yn),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(_d),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that must match for this rule to fire. An empty array matches every cluster, as does a transition that has no cluster ID."}),owner:n.String({description:"Team ID that owns and manages the rule."}),createdAt:w({description:"Timestamp when Tsuga created the rule."}),updatedAt:w({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:Ut,targets:n.Array(FS,{description:"Destinations that receive a notification whenever this rule matches an alert transition. Every target in the list is notified independently, subject to its own rate limit and renotification settings."}),creator:n.Optional(Te),updater:n.Optional(Te)}),$S=n.Object({name:p({description:"Display name of the notification rule."}),queryString:ze(p({type:"tags-query"}),{description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."}),teamsFilter:tF,prioritiesFilter:n.Array(n.Enum(yn),{maxItems:yn.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(_d),{maxItems:_d.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Dt,isActive:n.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:n.Array(mg,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),xd=n.Object({id:n.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:n.String({description:"Display name of the adaptive notification rule."}),owner:n.String({description:"Team ID that owns and manages the rule."}),createdAt:w({description:"Timestamp when Tsuga created the rule."}),updatedAt:w({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),shouldCreateInvestigation:n.Boolean({description:"Whether each page records an investigation holding the sampled traces and the call graph the destination was resolved from, linked from the notification body."}),tags:Ut,monitorIds:n.Array(n.String(),{description:"Monitors this rule reacts to."}),sloIds:n.Array(n.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:FS,creator:n.Optional(Te),updater:n.Optional(Te)}),XC=n.Object({name:p({description:"Display name of the adaptive notification rule."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Dt,isActive:n.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),shouldCreateInvestigation:n.Optional(n.Boolean({description:"Set to true to record an investigation for each page, holding the sampled traces and the call graph the destination was resolved from, and to link it from the notification body. Defaults to false."})),monitorIds:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. On update, omitting this field keeps the current monitors; send an empty array to remove them. Send at least one monitor or SLO."})),sloIds:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. On update, omitting this field keeps the current SLOs; send an empty array to remove them. Send at least one monitor or SLO."})),fallbackTarget:mg}),EGe=["active","inactive"],SGe=["name","isActive","owner","tags","clusterIdsFilter","targets","type","updatedAt"],uae=n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to rules owned by any of these team IDs.",maxItems:50}),searchQuery:xo({description:"Search query filter for notification rules.",valueDescription:"Case-insensitive substring matched against rule name and ID."}),tags:he(en.items,{description:"Restrict results to rules that have at least one of the listed key/value tags.",maxItems:50}),destinations:he(p({allowEmpty:!1}),{description:"Restrict results to rules that route to any of these email addresses or integration IDs.",maxItems:50}),clusterIds:he(p({allowEmpty:!1}),{description:"Restrict results to rules that run on any of these cluster IDs. Rules with no cluster restriction are treated as running on every cluster, including the requested ones.",maxItems:50}),status:n.Enum(EGe,{description:"Restrict results to active or inactive rules."})}),TGe=n.Partial(n.Object({...fe,filters:n.Partial(uae),sort:n.Object({by:n.Enum(SGe,{description:"Field to sort the returned notification rules by."}),direction:pe})})),_Ge=n.Object({type:n.Literal("standard",{description:"Standard notification rule matched by query, tags, and destinations."}),...bd.properties}),IGe=n.Object({type:n.Literal("adaptive",{description:"Adaptive notification rule matched by selected monitors or SLOs."}),...xd.properties}),bGe=D("type",[_Ge,IGe]),xGe=n.Object({value:n.String({description:"Email address or integration ID used when filtering destinations."}),label:n.String({description:"Display name of the destination."}),type:n.String({description:"Destination type, such as email or slack."})}),OGe=n.Object({tags:Yr,destinations:n.Array(xGe,{description:"Destination filter options from the matching rules."}),activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching rules regardless of whether they are active."}),active:n.Integer({description:"Number of matching rules that are active."}),inactive:n.Integer({description:"Number of matching rules that are inactive."})})}),AGe=n.Object({filters:n.Optional(n.Partial(uae,{description:"Filters applied before collecting tag, destination, and active-count options."}))}),Tdr=f({tags:["notification-rules"],url:`${ys}/query`,method:"POST",paginated:!0,body:TGe,response:n.Array(bGe,{description:"Matching standard and adaptive notification rules after they are merged, sorted, and paginated."})}),_dr=f({tags:["notification-rules"],url:`${ys}/options/query`,method:"POST",body:AGe,response:OGe}),Idr=f({tags:["notification-rules"],url:ys,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(bd)}),bdr=f({tags:["notification-rules"],url:`${ys}/:id`,params:n.Object({id:p()}),method:"GET",response:bd}),xdr=f({tags:["notification-rules"],url:ys,method:"POST",body:$S,response:bd}),Odr=f({tags:["notification-rules"],url:`${ys}/:id`,method:"PUT",params:n.Object({id:p()}),body:$S,response:bd}),Adr=f({tags:["notification-rules"],url:`${ys}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),Cdr=f({tags:["notification-rules"],url:`${ys}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p(),{uniqueItems:!0})}),response:n.Object({})}),fg=`${Id}/adaptive-rules`,Rdr=f({tags:["notification-rules"],url:fg,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(xd)}),Pdr=f({tags:["notification-rules"],url:`${fg}/:id`,params:n.Object({id:p()}),method:"GET",response:xd}),Udr=f({tags:["notification-rules"],url:fg,method:"POST",body:XC,response:xd}),wdr=f({tags:["notification-rules"],url:`${fg}/:id`,method:"PUT",params:n.Object({id:p()}),body:XC,response:xd}),vdr=f({tags:["notification-rules"],url:`${fg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),Ndr=f({tags:["notification-rules"],url:`${fg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p(),{uniqueItems:!0})}),response:n.Object({})}),Ldr=f({tags:["notification-integrations"],url:`${cae}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),CGe=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],pae=n.Object({id:n.String(),name:n.String(),type:n.Enum(CGe),createdAt:w(),ruleCount:n.Number(),creator:n.Optional(Te),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."}))}),RGe=["name","type","ruleCount","createdAt"],PGe=n.Object({searchQuery:xo({description:"Search query filter for notification integrations.",valueDescription:"Case-insensitive substring matched against integration name and ID."})}),UGe=n.Partial(n.Object({...fe,filters:n.Partial(PGe),sort:n.Object({by:n.Enum(RGe,{description:"Field to sort the returned notification integrations by."}),direction:pe})})),kdr=f({tags:["notification-integrations"],url:`${dg}/query`,method:"POST",paginated:!0,body:UGe,response:n.Array(pae,{description:"Matching notification integrations after they are filtered, sorted, and paginated."})}),Mdr=f({tags:["notification-integrations"],url:`${ys}/integrations`,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(pae)}),Ddr=f({tags:["notification-integrations"],url:`${cae}/callback`,method:"GET",query:n.Object({code:p()}),response:n.Object({success:n.Boolean()})}),wGe={data:"notification_view_data",source:"notification_view_source",dashboard:"notification_view_dashboard",service:"notification_view_service"},Fdr=n.Object({type:n.Literal("block_actions"),actions:n.Array(n.Object({type:n.Literal("button"),action_id:n.Enum(Object.values(wGe))}),{minItems:1})}),$dr=f({tags:["notification-integrations"],url:`${Id}/slack/interactivity`,method:"POST",body:n.String(),response:n.Literal("")}),rF=["POST","PUT"],vGe=n.Record(n.String(),n.String()),NGe=n.Record(n.String(),n.Unknown()),LGe=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),kGe=D("type",[n.Object({type:n.Literal("json"),value:NGe}),n.Object({type:n.Literal("form"),value:LGe})]),MGe=n.Object({ok:n.String(),alert:n.String()}),GS=n.Object({id:n.String(),name:n.String(),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."})),setting:D("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(rF),authentication:iae,customHeaders:n.Optional(vGe),payloadTemplate:kGe,eventNameMapping:n.Optional(MGe)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("jira"),siteUrl:n.String(),email:n.String(),apiTokenLastChars:n.String()})]),tags:Ut}),DGe=n.Object({type:n.Literal("webhook"),url:p({type:"uri"}),method:n.Enum(rF),authentication:aae,customHeaders:n.Record(p({allowEmpty:!1}),p()),payloadTemplate:D("type",[n.Object({type:n.Literal("json"),value:n.Record(p({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(p({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:p({allowEmpty:!1}),alert:p({allowEmpty:!1})}))}),lae=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),dae=n.Object({type:n.Literal("grafana-irm"),url:p({type:"uri"})}),mae=n.Object({type:n.Literal("pagerduty"),integrationKey:p()}),fae=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),FGe=n.Object({type:n.Literal("servicenow"),instanceName:p({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),$Ge=n.Object({type:n.Literal("google-chat"),webhookUrl:p({type:"uri"})}),GGe=n.Object({type:n.Literal("squadcast"),webhookUrl:p({type:"uri"})}),BGe=n.Object({type:n.Literal("jira"),siteUrl:p({type:"uri",allowEmpty:!1,description:'Base URL of the Jira Cloud site, like "https://your-company.atlassian.net". Tsuga files issues against this site.'}),email:p({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:p({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),gae=p({allowEmpty:!1,description:"ID of the team that will own the integration, determining which team members can view and manage it. Only an org admin or an admin of this team may set it."}),nF=n.Object({name:p(),owner:gae,setting:D("type",[lae,dae,mae,fae,DGe,FGe,$Ge,GGe,BGe]),tags:Dt}),jGe=n.Object({type:n.Literal("webhook"),url:n.Optional(p({type:"uri"})),method:n.Optional(n.Enum(rF)),authentication:n.Optional(sae),customHeaders:n.Optional(n.Record(p({allowEmpty:!1}),p())),payloadTemplate:n.Optional(D("type",[n.Object({type:n.Literal("json"),value:n.Record(p({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(p({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:ze(n.Object({ok:n.Optional(p({allowEmpty:!1})),alert:n.Optional(p({allowEmpty:!1}))}))}),qGe=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(p({allowEmpty:!1})),username:n.Optional(p({allowEmpty:!1})),password:n.Optional(p({allowEmpty:!1}))}),HGe=n.Object({type:n.Literal("jira"),siteUrl:n.Optional(p({type:"uri",allowEmpty:!1})),email:n.Optional(p({allowEmpty:!1})),apiToken:n.Optional(p({allowEmpty:!1}))}),KGe=n.Object({type:n.Literal("google-chat"),webhookUrl:p({type:"uri"})}),zGe=n.Object({type:n.Literal("squadcast"),webhookUrl:p({type:"uri"})}),oF=n.Object({name:n.Optional(p()),owner:gae,tags:Dt,setting:n.Optional(D("type",[lae,dae,mae,fae,jGe,qGe,KGe,zGe,HGe]))}),Gdr=f({tags:["notification-integrations"],url:dg,method:"POST",body:nF,response:GS}),Bdr=f({tags:["notification-integrations"],url:`${dg}/:id`,method:"GET",params:n.Object({id:p()}),response:GS}),jdr=f({tags:["notification-integrations"],url:`${dg}/:id`,method:"PATCH",params:n.Object({id:p()}),body:oF,response:GS}),qdr=f({tags:["notification-integrations"],url:`${dg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),YGe=D("status",[n.Object({status:n.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:n.Array(n.Object({key:n.String({description:'Jira project key, like "OPS".'}),name:n.String({description:"Human readable Jira project name."}),issueTypes:n.Array(n.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:n.Optional(n.Array(n.String(),{description:"Status names an issue in this project can be transitioned to. Omitted when Jira refused the status lookup for this project."}))}),{description:"Projects the connected Jira account can file issues into."})},{title:"JiraMetadataOk"}),n.Object({status:n.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:n.String({description:"Human readable reason the Jira metadata could not be loaded."})},{title:"JiraMetadataError"})],{description:"Result of probing Jira for the projects, issue types and statuses reachable with a stored integration. Returns a typed error instead of failing so the rule editor can fall back to free-text entry."}),Hdr=f({tags:["notification-integrations"],url:`${dg}/:id/jira-metadata`,method:"GET",params:n.Object({id:p()}),response:YGe}),Kdr=f({tags:["notification-rules"],url:`${po}/:id/notifications`,method:"GET",params:n.Object({id:p()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(gGe),tryCount:n.Number(),nextTryAt:w(),createdAt:w(),updatedAt:w(),sentAt:n.Optional(w())})),isTruncated:n.Boolean()})}),VGe=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],zdr=f({tags:["notification-rules"],url:`${ys}/test`,method:"POST",body:n.Object({notificationRule:$S,targetIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10})),monitorId:n.Optional(p({allowEmpty:!1,description:"Monitor to simulate: the test notification is built like a real alert of this monitor (message, tags, group by values). When omitted, a generic test notification is sent."}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(VGe,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var WGe=["healthy","breached","no_data"],dp=n.Enum(WGe,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),gg=n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:xo({description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs.",valueDescription:"Substring matched case-insensitively against the SLO name or SLO ID."}),tags:he(en.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:he(p({allowEmpty:!1}),{description:"Restrict results to SLOs that run against any of these cluster IDs (SLOs with no cluster restriction are always included)",maxItems:50}),statuses:he(dp,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"});var ba="/v0/service-catalog",QGe=n.Object({team:n.String({description:"Team name observed on telemetry for this service. The emitting service sets it through telemetry attributes. Returned when Tsuga has observed a team value for the service; metadata refreshes weekly or when a new service version appears. For a service the service catalog has not recorded yet, it comes from the trace span metrics of the queried window."})},{description:"A team name observed on telemetry for this service."}),XGe=n.Object({ingestionApiKey:n.String({description:"Ingestion API key name or identifier observed on telemetry for this service. Tsuga sets it from the key used to ingest matching telemetry. Returned when key metadata is available for the service."}),lastSeenAt:w({description:"Most recent time this ingestion key was observed for the service. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),ZGe=n.Object({version:n.String({description:"Service version value observed in telemetry. The emitting service sets it through `context.service.version`. Returned when Tsuga has observed a version for the service."}),firstSeenAt:w({description:"First time this version was observed for the service. Tsuga sets it from telemetry timestamps and refreshes observed versions on each service catalog pass."}),lastSeenAt:w({description:"Most recent time this version was observed for the service. Tsuga sets it from telemetry timestamps and refreshes observed versions on each service catalog pass."}),faulty:n.Optional(n.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),faultyLatency:n.Optional(n.Boolean({description:"Whether the faulty behavior Tsuga detected for this version is a latency degradation. Only set by faulty deployment detection when it reports on latency; absent when the detection did not evaluate latency."})),detectionTriggered:n.Optional(n.Boolean({description:"Whether faulty deployment detection has already been triggered for this version. Set when the detection job is launched to avoid re-triggering it. Absent on versions predating this field."}))},{description:"A service version observed in telemetry, with first and last seen timestamps and faulty deployment detection results."}),JGe=n.Object({language:n.String({description:"Programming language observed for this service. The OpenTelemetry SDK sets it through telemetry metadata. Returned when language metadata is available for the service."}),lastSeenAt:w({description:"Most recent time this language was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A programming language observed for this service, with the last time it was seen."}),eBe=n.Object({protocol:n.String({description:"Observed API protocol, such as `http`, `grpc`, or `graphql`. Tsuga infers it from span metadata. Returned when protocol metadata is available for the service."}),lastSeenAt:w({description:"Most recent time this protocol was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An API protocol observed for this service, with the last time it was seen."}),tBe=n.Object({framework:n.String({description:"Observed application framework, such as `express`, `fastify`, `django`, or `rails`. Tsuga detects it from OpenTelemetry instrumentation scope. Returned when framework metadata is available for the service."}),lastSeenAt:w({description:"Most recent time this framework was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),rBe=n.Object({platform:n.String({description:"Observed cloud or orchestration platform. Tsuga reads the `cloud.platform` resource attribute, such as `aws_eks` or `aws_lambda`, and adds `kubernetes` when spans carry `k8s.cluster.name` and `aws_ecs` when they carry `aws.ecs.task.arn`. The emitting service or collector sets these resource attributes."}),lastSeenAt:w({description:"Most recent time this platform was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),nBe=n.Object({provider:n.String({description:"Observed cloud provider, read from the `cloud.provider` resource attribute, such as `aws`, `gcp`, or `azure`. The emitting service or collector sets it."}),lastSeenAt:w({description:"Most recent time this provider was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A cloud provider this service runs on, with the last time it was seen."}),hg=n.Object({id:n.String({description:"Tsuga-generated identifier of this service notification target. Tsuga returns it when the target is created or listed, and clients use it to update or delete the target. It is unique across service targets."}),serviceId:n.String({description:"Identifier of the service catalog entry this target is attached to. Tsuga sets it from the service path parameter and returns it on read and write responses."}),config:FS.properties.config,rateLimit:FS.properties.rateLimit,createdAt:w({description:"Timestamp when the service notification target was created. Tsuga sets this value and returns it on private service-catalog responses."}),updatedAt:w({description:"Timestamp when the service notification target was last updated. Tsuga sets this value and returns it on private service-catalog responses."})}),iF=n.Object({config:mg.properties.config,rateLimit:mg.properties.rateLimit},{description:"Service notification target create request. The caller provides the destination configuration and optional rate limit; Tsuga attaches the target to the service in the path."}),aF=n.Object({config:mg.properties.config,rateLimit:n.Union([JD,n.Null()],{description:"Per-target rate limit to apply when sending notifications. Set it to `null` to drop the current limit and fall back to the default of 1000 notifications every 10 minutes."})},{description:"Service notification target update request. The caller provides the replacement destination configuration and rate limit; omitted fields are not supported by this schema."}),ZC=n.Object({id:n.Optional(n.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints. Absent until the hourly service catalog task records the service."})),serviceName:n.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:n.Optional(n.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:n.String({description:"Environment value observed for this service."}),teams:n.Array(QGe,{description:"Team names observed on telemetry for this service."}),ingestionApiKeys:n.Array(XGe,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:n.Array(ZGe,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:n.Array(JGe,{description:"Programming languages observed for this service."}),serverProtocols:n.Array(eBe,{description:"API protocols this service exposes (from server-kind spans)"}),frameworks:n.Array(tBe,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:n.Optional(n.Array(rBe,{description:"Cloud platforms this service is running on. Absent or empty when Tsuga has not observed platform metadata for the service; treat both the same."})),cloudProviders:n.Optional(n.Array(nBe,{description:"Cloud providers this service is running on. Absent or empty when Tsuga has not observed provider metadata for the service; treat both the same."})),lastSeenAt:n.Optional(w({description:"Most recent time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),firstSeenAt:n.Optional(w({description:"First time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),traceRequestRate:n.Optional(n.Number({description:"Requests per second observed for this service over the queried window, counting calls of its primary span kind. The primary span kind is the busiest of `SPAN_KIND_SERVER`, `SPAN_KIND_PRODUCER`, and `SPAN_KIND_CONSUMER` in the service\u2019s busiest env, or `SPAN_KIND_INTERNAL` when the service has none of those; `SPAN_KIND_CLIENT` never counts. Every env of the service uses that same span kind. Omitted when the trace query failed, which is distinct from `0` (the service is quiet)."})),traceErrorRate:n.Optional(n.Number({description:"Percentage of this service\u2019s primary-span-kind calls (see `traceRequestRate`) over the queried window that ended with error status. Omitted when the trace query failed."})),notificationTargets:n.Array(hg,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:n.Optional(w({description:"Timestamp when Tsuga created this service catalog entry."})),updatedAt:n.Optional(w({description:"Timestamp when Tsuga last updated this service catalog entry."}))}),oBe=n.Object({spanKind:n.Enum(e8),count:n.Number()});var hae=n.Object({...ZC.properties,spanKindCounts:n.Array(oBe),envs:n.Array(n.String())}),iBe=["serviceName","env","lastDeploy","traceErrorRate","traceRequestRate","teams","api","frameworks","languages","pagingDestination"],aBe=n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:he(p({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:he(p({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:he(p({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:he(p({allowEmpty:!1}),{description:"Restrict results to services written in any of these languages",maxItems:50}),hasRecentData:n.Boolean({description:"When true, only return services whose request rate over the queried window is non-zero"})}),BS=["1h","4h","24h"];var sF=n.Partial(n.Object({...fe,clusterId:p(),filters:n.Partial(aBe,{description:"Optional filters applied to narrow the returned services"}),sort:n.Object({by:n.Enum(iBe,{description:"Field to sort the returned services by"}),direction:pe},{description:"Optional sorting applied to the returned services"}),statsWindow:n.Enum(BS,{description:"Lookback used to select the services returned, which are those with trace span metrics in it, and to compute the trace request rate and trace error rate fields and the span-call totals that pick each service's primary environment. Defaults to `1h`."})})),smr=f({tags:["service-catalog"],url:`${ba}/v2/services/query`,method:"POST",paginated:!0,body:sF,response:n.Array(hae)}),cmr=f({tags:["service-catalog"],query:n.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:n.Optional(p({allowEmpty:!1})),env:p({allowEmpty:!1}),clusterId:n.Optional(p())}),method:"GET",url:`${ba}/v2/service`,response:hae}),umr=f({tags:["service-catalog"],query:n.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:n.Optional(p({allowEmpty:!1})),clusterId:n.Optional(p())}),method:"GET",url:`${ba}/v2/service/envs`,response:n.Array(n.Object({env:n.String({description:"Environment the service was observed in."}),ingestedBytes:n.Number({description:"Trace bytes ingested for the service in this environment over the lookback."})}),{description:"Environments the service was observed in, busiest first."})}),pmr=f({tags:["service-catalog"],method:"GET",url:`${ba}/services/:serviceId`,params:n.Object({serviceId:p()}),response:ZC}),lmr=f({tags:["service-catalog"],method:"GET",url:`${ba}/services/:serviceId/targets`,params:n.Object({serviceId:p()}),response:n.Array(hg)}),dmr=f({tags:["service-catalog"],method:"POST",url:`${ba}/services/:serviceId/targets`,params:n.Object({serviceId:p()}),body:iF,response:hg}),mmr=f({tags:["service-catalog"],method:"PUT",url:`${ba}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:p(),targetId:p()}),body:aF,response:hg}),fmr=f({tags:["service-catalog"],method:"DELETE",url:`${ba}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:p(),targetId:p()}),response:B}),sBe=["http","rpc","messaging","genai","object_store"],yae={name:n.String({description:"Service or inferred dependency name shown in the graph."}),env:n.Optional(n.String({description:"Environment observed from spans."}))},cF=n.Object({...yae,nodeType:n.Literal("observed",{description:"Discriminator for this node variant. Always `observed` for a graph node matched to a service catalog entry by name and env."}),id:n.Union([n.String(),n.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:n.Optional(n.Number({description:"Ratio of entry requests with at least one error to total entry requests observed on this service. Omitted when no entry requests were observed. Computed from the raw sampled counts, so trace sampling does not affect it."})),entryErrorRequestCount:n.Number({description:"Estimated number of entry requests on this service where at least one entry span had error status, projected from the sampled traces onto the full population."}),entryRequestCount:n.Number({description:"Estimated number of entry requests on this service, projected from the sampled traces onto the full population. Observed as unique trace IDs that have at least one entry span on this service. An entry span is a consumer-kind span, a root span (no parent), or any span whose parent belongs to a different service."})}),Eae={...yae,endpoint:n.Optional(n.String({description:"Inferred service endpoint address"})),resourceName:n.Optional(n.String({description:"Inferred resource name, e.g. table or queue name"}))},uF=n.Object({...Eae,nodeType:n.Literal("inferred_db",{description:"Discriminator for this node variant. Always `inferred_db` for a database dependency detected from client-span attributes that could not be matched to a service catalog entry."}),serviceType:n.Literal("db",{description:"Inferred dependency type. Always `db` for this node variant."}),databaseName:n.Optional(n.String({description:"Database name from span_attributes db.namespace. Matches the database catalog `name`."})),databaseSystem:n.String({description:"Database system from span_attributes db.system.name (falling back to legacy db.system). Matches the database catalog `databaseSystem`."})}),pF=n.Object({...Eae,nodeType:n.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a non-database dependency detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),serviceType:n.Enum(sBe,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),cBe=D("nodeType",[cF,uF,pF]),lF=n.Object({from:n.Object({env:n.Optional(n.String({description:"Environment of the source node"})),name:n.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:n.Object({env:n.Optional(n.String({description:"Environment of the target node"})),name:n.String({description:"Name of the target node"}),databaseSystem:n.Optional(n.String({description:"Database system of the target when it is an inferred database node (`inferred_db`). Together with `name` and `env` it identifies the target node, distinguishing a database from a same-named service or a same-named database on another system."}))},{description:"Reference to the callee node, i.e. the service or dependency that received the request."}),count:n.Number({description:"Estimated number of cross-service transitions on this directed edge in the graph query window. The graph is built from a uniform sample of traces, so this is projected onto the full population rather than counted directly."}),errorRate:n.Optional(n.Number({description:"Ratio of errored client spans to total client spans observed on this edge. Omitted when no client spans were observed. For edges to inferred services, the originating span is treated as the client span regardless of its kind. Computed from the raw sampled counts, so trace sampling does not affect it."})),errorCount:n.Number({description:"Estimated number of client spans with error status on this edge, projected from the sampled traces onto the full population."}),clientSpanCount:n.Number({description:"Estimated number of client spans on this edge, projected from the sampled traces onto the full population."})},{description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`) in the service graph, with call-volume and error counts observed over the query window."}),gmr=f({tags:["service-catalog"],url:`${ba}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:p()}),query:n.Object({...Cr.properties,query:n.Optional(p({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(cBe),edges:n.Array(lF)})}),uBe=n.Object({monitors:n.Array(n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns the monitor"}),priority:n.Enum(yn,{description:"Priority of the monitor"})})),slos:n.Array(n.Object({id:n.String({description:"Identifier of the SLO"}),name:n.String({description:"Display name of the SLO"}),owner:n.String({description:"Team ID that owns the SLO"}),statusCount:n.Partial(n.Record(dp,n.Number()),{description:"Count of SLO statuses for this service: one entry per group matching the service when the SLO groups by service.name, otherwise the overall status"})}))}),hmr=f({tags:["service-catalog"],method:"GET",url:`${ba}/services/:serviceId/related-resources`,params:n.Object({serviceId:p()}),response:uBe}),ymr=f({tags:["service-catalog"],method:"GET",url:`${ba}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var Sae="/v0/service-catalog/queues",JC=n.Object({clusterId:n.String(),name:n.String(),env:n.String(),messagingSystem:n.String(),publishPerSecond:n.Number({description:"Messages published per second."}),consumePerSecond:n.Number({description:"Messages consumed per second."}),consumerErrorsPerSecond:n.Number({description:"Messages per second whose consumer span has an error status."}),p90ProcessingMs:n.Number({description:"p90 duration of consumer spans."})}),bmr=f({tags:["service-catalog"],query:n.Object({...fe,clusterId:n.Optional(p({description:"Cluster ID used to restrict the returned queue catalog entries."})),env:n.Optional(p({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(BS,{description:"Lookback over producer and consumer messaging spans used to list the queues and compute their rates."}))}),method:"GET",paginated:!0,url:Sae,response:n.Array(JC)}),xmr=f({tags:["service-catalog"],method:"GET",url:`${Sae}/by-name`,query:n.Object({name:p({allowEmpty:!1}),messagingSystem:p({allowEmpty:!1}),env:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1}))}),response:JC});var Tae=`/${"v1"}/queues`,dF=n.Pick(JC,["name","env","messagingSystem","publishPerSecond","consumePerSecond","consumerErrorsPerSecond","p90ProcessingMs"],{$id:"Queue",description:"Message queue inferred from producer and consumer messaging spans (OpenTelemetry `messaging.*` attributes), with its publish, consume, and consumer error rates."}),pBe={name:"orders",env:"production",messagingSystem:"kafka",publishPerSecond:42.5,consumePerSecond:41.9,consumerErrorsPerSecond:.2,p90ProcessingMs:18.4};Object.assign(dF,{examples:[pBe]});var _ae=n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."})),Iae=f({description:"Lists message queues inferred from producer and consumer messaging spans, with their publish, consume, and consumer error rates over the stats window.",operationId:"listQueues",tags:["queues"],method:"GET",url:Tae,paginated:!0,query:n.Object({...je,clusterId:_ae,env:n.Optional(p({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(BS,{description:"Lookback over messaging spans used to list the queues and compute their rates. Defaults to `1h`."}))}),response:n.Array(dF)}),bae=f({description:"Retrieves one message queue by name, messaging system, and environment. Searches the last hour first, then the last 24 hours.",operationId:"getQueue",tags:["queues"],method:"GET",url:`${Tae}/by-name`,query:n.Object({name:p({allowEmpty:!1,description:"Queue name (`messaging.destination.name`)."}),messagingSystem:p({allowEmpty:!1,description:"Messaging system (`messaging.system`), for example `kafka` or `aws_sqs`."}),env:p({allowEmpty:!1,description:"Environment the queue was observed in."}),clusterId:_ae}),response:dF});var xae=P("queues").pipe(U("List and inspect message queues inferred from messaging spans"),_e([fr("list",Iae,!1),fr("get",bae,!0)]));var jS=`/${"v1"}/adaptive-notification-rules`,qS=n.Pick(xd,["id","name","owner","isActive","shouldCreateInvestigation","tags","monitorIds","sloIds","fallbackTarget"],{$id:"AdaptiveRule",description:"Adaptive notification rule that reacts to selected monitors and SLOs. When one of them fires, Tsuga pages the owners of the failing service it identifies from the sampled traces, and pages the fallback target when no owner can be resolved. See [Rules](/documentation/alert/notifications/rules)."}),Oae={name:"Checkout latency",owner:"team-123-abc",isActive:!0,shouldCreateInvestigation:!0,tags:[{key:"channel",value:"alerts"}],monitorIds:["monitor-123-abc"],sloIds:["slo-456-def"],fallbackTarget:{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}},lBe={id:"123-456-abc",...Oae};Object.assign(qS,{examples:[lBe]});var Aae=f({description:"Lists adaptive notification rules visible to the authenticated operation key. Standard notification rules are listed by the notification rules endpoint. Pagination fields limit the returned page.",operationId:"listAdaptiveNotificationRules",tags:["adaptive-notification-rules"],url:jS,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(qS)}),Cae=f({description:"Retrieves one adaptive notification rule by ID.",operationId:"getAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${jS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to retrieve. Use the `id` returned by adaptive notification rule list or create responses."})}),response:qS}),mF=n.Pick(XC,["name","owner","tags","isActive","shouldCreateInvestigation","monitorIds","sloIds","fallbackTarget"],{description:"Adaptive notification rule create or update request. Provide the monitors or SLOs the rule reacts to, the owner, the active state, and the fallback target."}),dBe=Oae;Object.assign(mF,{examples:[dBe]});var Rae=f({description:"Creates an adaptive notification rule. Only trace monitors, metric monitors over OTel span metrics, and SLOs over traces or OTel span metrics are eligible.",operationId:"createAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:jS,method:"POST",body:mF,response:qS}),Pae=f({description:"Updates an existing adaptive notification rule by ID. Required fields and the fallback target are overwritten; omitted optional fields, including `monitorIds` and `sloIds`, keep their existing values. Send an empty array to clear a list.",operationId:"updateAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${jS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to update. Use the `id` returned by adaptive notification rule list, get, or create responses."})}),body:mF,response:qS}),Uae=f({description:"Deletes an adaptive notification rule by ID. Its monitors and SLOs keep evaluating, but this rule no longer pages anyone.",operationId:"deleteAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${jS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to delete. Use the `id` returned by adaptive notification rule list, get, create, or update responses."})}),response:B});var wae=Ue({commandName:"adaptive-notification-rules",description:"Manage adaptive notification rules",endpoints:{list:Aae,get:Cae,create:Rae,update:Pae,delete:Uae}});var mBe={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[Vmr,eR,HS]=fBe(mBe),Wmr=Object.fromEntries(eR.map(e=>[e,e]));function fBe(e){let t=[],r=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let s=e[a];for(let u in s){r.push(u);let l=s[u];Array.isArray(l)&&o.push(...l)}}return[fF(t),fF(r),fF(o)]}function fF(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var gF=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),gBe=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),hBe=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),yBe=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),EBe=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),SBe=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC","RUBY"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),TBe=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),_Be=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(w()),protectionEnabled:n.Optional(n.Boolean()),protectionExpiresAt:n.Optional(w())}),IBe=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),bBe=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),xBe=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(w()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),OBe=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),ABe=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),ephemeralStorageMib:n.Optional(n.Number({description:"Size of the temporary storage mounted on the function instance, in MiB. Only present for platforms that expose it, such as AWS Lambda."})),codeSha256:n.Optional(n.String())}),CBe=n.Object({kind:n.Optional(n.String())}),RBe=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),PBe=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),UBe=n.Object({protocol:n.Optional(gF),port:n.Optional(n.Number()),instanceProtocol:n.Optional(gF),instancePort:n.Optional(n.Number())}),wBe=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),vBe=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),NBe=n.Object({type:n.String(),name:n.String()}),LBe=n.Object({frontendIp:n.Optional(vBe),backendIpPools:n.Array(NBe)}),kBe=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),MBe=n.Object({protocol:n.Optional(gF),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(kBe)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),DBe=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),FBe=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),DBe]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),$Be=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),GBe=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(UBe),n.Array(wBe)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array($Be),n.Array(FBe)])),azureLoadBalancingRules:n.Optional(n.Array(LBe))}),BBe=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(w()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(w()),status:n.Optional(n.String()),type:n.Optional(n.String())}),jBe=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),qBe=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),HBe=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),KBe=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([jBe,HBe,qBe])]),zBe=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),tR=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(zBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(gBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(OBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(IBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(hBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(yBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(CBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(KBe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(RBe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(ABe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(EBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(SBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(TBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(_Be)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(bBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(xBe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(PBe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:GBe}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(MBe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(BBe)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var Od="/v0/inventory",vae=["scan_in_progress","success","failure","partial"],yF=n.Object({id:n.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:n.Enum(Xu,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:n.String({description:"Cloud-native account identifier where Tsuga discovered this resource, such as an AWS account ID, GCP project ID, or Azure subscription ID."}),cloudRegion:n.Optional(n.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:n.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:n.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:n.Optional(w({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:n.Optional(w({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:w({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:Ut,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),yg={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},Nae=n.Object({cloudPlatforms:he(n.Enum(Xu),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:Xu.length}),cloudAccounts:he(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:he(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:he(n.Enum(HS),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:HS.length}),resourceTypes:he(n.Enum(eR),{description:"Restrict results to resources of any of these normalized resource types",maxItems:eR.length}),tags:he(en.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:n.Boolean({description:"Restrict results by infrastructure-as-code coverage. When true, only resources covered by the configured IaC identifiers are returned; when false, only uncovered resources are returned."}),searchQuery:n.Object({value:p({allowEmpty:!1,description:"Case-insensitive substring matched against resource ID, display name, fully-qualified resource ID, cloud account, region, and resource type. Use the `tags` filter to narrow by tag. Wildcard characters are treated literally."}),exclude:n.Optional(n.Boolean({description:"If true, exclude resources matching this value instead of including them"}))},{description:"Search query filter for resources."})},{description:"Optional filters applied to narrow the returned resources"}),EF=n.Partial(n.Object({...fe,filters:n.Partial(Nae,{description:"Filters applied to narrow the returned resources."}),sort:n.Object({by:n.Enum([yg.DISPLAY_NAME,yg.CLOUD_ACCOUNT,yg.NATIVE_RESOURCE_TYPE,yg.CLOUD_REGION,yg.RESOURCE_TYPE,yg.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:pe},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),ofr=f({tags:["inventory"],method:"POST",url:`${Od}/resources/query`,paginated:!0,body:EF,response:n.Array(n.Intersect([yF,tR]))}),YBe=["resourceType","cloudAccount","isIacManaged"],ifr=f({tags:["inventory"],method:"POST",url:`${Od}/resources/counts`,body:n.Object({filters:n.Optional(n.Partial(Nae)),groupBy:n.Enum(YBe,{description:"Dimension to group the resource counts by."})}),response:n.Array(n.Object({value:n.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:n.Integer({description:"Number of resources in this group matching the requested filters."})}))}),afr=f({tags:["inventory"],method:"GET",url:`${Od}/resources/filter-options`,response:n.Object({cloudRegions:n.Array(n.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:n.Array(n.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:Yr})}),sfr=D("type",[n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({description:"AWS account ID that Tsuga scans."}),externalId:n.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:n.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:n.String({description:"Workload identity provider resource name used for federated authentication."})}),n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:n.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:n.String({description:"Azure tenant ID that owns the subscription."})})]),VBe="^[0-9]{12}$",WBe="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",QBe="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",XBe="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",ZBe="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",hF="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",JBe=n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({pattern:VBe,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:p({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({pattern:WBe,minLength:1,maxLength:2048,description:"ARN of the IAM role Tsuga assumes to read inventory in the account.",errorMessage:{pattern:"Must be an IAM role ARN, e.g. arn:aws:iam::123456789012:role/MyRole."}})},{$id:"AwsConnectionSettings"}),eje=n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({pattern:QBe,minLength:6,maxLength:30,description:"GCP project ID that Tsuga scans.",errorMessage:{pattern:"Must be a GCP project ID (6-30 chars: lowercase letters, digits, hyphens)."}}),serviceAccountId:n.String({pattern:XBe,minLength:1,maxLength:128,description:"Service account Tsuga impersonates to read inventory.",errorMessage:{pattern:"Must be a service account email, e.g. name@project.iam.gserviceaccount.com."}}),workloadIdentityProvider:n.String({pattern:ZBe,minLength:1,maxLength:256,description:"Full resource name of the workload identity provider used for federated authentication, e.g. //iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider.",errorMessage:{pattern:"Must be the full provider resource name: //iam.googleapis.com/projects/<PROJECT_NUMBER>/locations/global/workloadIdentityPools/<POOL_ID>/providers/<PROVIDER_ID>."}})},{$id:"GcpConnectionSettings"}),tje=n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({pattern:hF,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:n.String({pattern:hF,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:n.String({pattern:hF,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),Lae=D("type",[JBe,eje,tje],{description:"Credentials Tsuga uses to scan the account, in the provider-specific shape selected by `type`. Credentials are stored as provided and are not validated at creation time; failures surface through `lastScanStatus`."}),Eg=n.Object({id:n.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:n.Enum(Xu,{description:"Cloud provider of the account."}),cloudAccountId:n.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(n.String({description:"Human-readable name for the account shown in Tsuga."})),organizationId:n.Optional(n.String({description:"Cloud organization identifier, when known."})),createdBy:n.Optional(n.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:w({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:n.Optional(w({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:n.Optional(w({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:n.Optional(n.Enum(vae,{description:"Status of the most recent inventory scan."}))}),SF=n.Object({cloudType:n.Enum(Xu,{description:"Cloud provider of the account."}),cloudAccountId:p({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(p({description:"Human-readable name for the account shown in Tsuga."})),organizationId:n.Optional(p({description:"Cloud organization identifier, when known."})),connectionSettings:Lae,lastScanStatus:n.Optional(n.Enum(vae,{description:"Status of the most recent inventory scan."}))}),Ad=`${Od}/cloud-accounts`,cfr=f({tags:["inventory"],url:Ad,method:"GET",response:n.Array(Eg)}),ufr=f({tags:["inventory"],url:`${Ad}/:id`,method:"GET",params:n.Object({id:p()}),response:Eg}),pfr=f({tags:["inventory"],url:Ad,method:"POST",body:SF,response:Eg}),TF=n.Object({accountFriendlyName:p({description:"Human-readable name for the account shown in Tsuga."})}),lfr=f({tags:["inventory"],url:`${Ad}/:id`,method:"PUT",params:n.Object({id:p()}),body:TF,response:Eg}),dfr=f({tags:["inventory"],url:`${Ad}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),mfr=f({tags:["inventory"],url:`${Od}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),ffr=f({tags:["inventory"],url:`${Ad}/azure/onboarding`,method:"POST",body:n.Object({tenantId:p()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),gfr=f({tags:["inventory"],method:"POST",url:`${Ad}/validate/:type`,params:n.Object({type:p()}),body:n.Object({data:Lae,id:n.Optional(p())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),kae=`${Od}/settings`,hfr=f({tags:["inventory"],url:kae,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),rje=50,yfr=f({tags:["inventory"],url:kae,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:p({allowEmpty:!1}),value:n.Optional(p({allowEmpty:!1}))}),{maxItems:rje})}),response:n.Object({})}),Efr=f({tags:["inventory"],url:`${Od}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var Mae=`/${"v1"}/inventory`,nje=n.Omit(yF,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields shared by cloud resources discovered during inventory scans. Public inventory resources omit raw provider-native attributes and infrastructure-as-code coverage fields. See [Cloud resources](/documentation/categorize/cloud-resources)."}),Dae=n.Intersect([nje,tR],{$id:"InventoryResource",description:"Cloud resource discovered by an inventory scan, together with normalized category, resource type, and public category-specific attributes. See [Cloud resources](/documentation/categorize/cloud-resources)."}),oje={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(Dae,{examples:[oje]});var Fae=n.Object({...EF.properties,...je},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),ije={filters:{cloudPlatforms:{values:["aws"]},cloudAccounts:{values:["123456789012"]},cloudRegions:{values:["us-east-1"]},resourceTypes:{values:["bucket"]},nativeResourceTypes:{values:["aws_s3_bucket"]},tags:{values:[{key:"team",value:"platform"}]},isIacManaged:!0,searchQuery:{value:"tsuga-example"}},sort:{by:"displayName",direction:"asc"},limit:10,offset:0};Object.assign(Fae,{examples:[ije]});var $ae=f({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${Mae}/resources/query`,method:"POST",paginated:!0,body:Fae,response:n.Array(Dae)}),KS=`${Mae}/cloud-accounts`,zS=n.Pick(Eg,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),aje={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(zS,{examples:[aje]});var Gae=n.Pick(SF,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),sje={cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS",connectionSettings:{type:"aws",accountId:"123456789012",externalId:"tsuga-external-id",roleArn:"arn:aws:iam::123456789012:role/tsuga-inventory"}};Object.assign(Gae,{examples:[sje]});var Bae=n.Pick(TF,["accountFriendlyName"]),cje={accountFriendlyName:"Production AWS"};Object.assign(Bae,{examples:[cje]});var Cfr=f({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:KS,method:"GET",response:n.Array(zS)}),Rfr=f({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${KS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:zS}),Pfr=f({description:"Registers a cloud account for inventory scanning. Connection settings are stored as provided and are not validated at creation time; scan failures surface through `lastScanStatus`.",operationId:"createCloudAccount",tags:["inventory"],url:KS,method:"POST",body:Gae,response:zS}),Ufr=f({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${KS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:Bae,response:zS}),wfr=f({description:"Deletes a cloud account by ID. Future inventory scans stop for the account, and the trust relationship on the cloud side can be safely removed afterward.",operationId:"deleteCloudAccount",tags:["inventory"],url:`${KS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:B});var jae=Ue({commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:$ae},enableListBody:!0});var YS=`/${"v1"}/custom-roles`,VS=n.Pick(hd,["id","name","description","teamScope","assets","telemetry","telemetryQuery"],{$id:"CustomRole",description:"Global role defined by the organization. It sets which teams its holders reach, which telemetry signals they can query, and which resource types they can read or write. See [Custom global roles](/documentation/account-and-settings/roles-and-permissions#custom-global-roles)."}),uje={id:"123-456-abc",name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(VS,{examples:[uje]});var _F=n.Pick(FC,["name","description","teamScope","assets","telemetry","telemetryQuery"],{description:"Custom role create or update request. Provide the role name, optional description, team scope, resource type grants, readable telemetry signals, and optional telemetry restriction."}),pje={name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(_F,{examples:[pje]});var qae=f({description:"Lists every custom global role of the organization, ordered by name, with what each role grants.",operationId:"listCustomRoles",tags:["custom-roles"],url:YS,method:"GET",response:n.Array(VS)}),Hae=f({description:"Retrieves one custom global role by ID.",operationId:"getCustomRole",tags:["custom-roles"],url:`${YS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to retrieve. Use the `id` returned by custom role list, create, or update responses."})}),response:VS}),Kae=f({description:"Creates a custom global role. The name must be unique across the organization. Grants on resource types a custom role cannot configure are dropped. Requires write access on custom roles, which only an operation key scoped to all teams can hold. Only a Global admin can first grant it to a key; a key holding it and write access on operation API keys can then pass it on to the keys it creates or updates.",operationId:"createCustomRole",tags:["custom-roles"],url:YS,method:"POST",body:_F,response:VS}),zae=f({description:"Replaces the name, team scope, resource type grants, and telemetry signals of a custom global role by ID. The new grants apply to every user holding the role. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"updateCustomRole",tags:["custom-roles"],url:`${YS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to update. Use the `id` returned by custom role list, get, or create responses."})}),body:_F,response:VS}),Yae=f({description:"Deletes a custom global role by ID. Fails while a user still holds the role; change their global role first. Pending invitations that carry the role are deleted with it. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"deleteCustomRole",tags:["custom-roles"],url:`${YS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to delete. Use the `id` returned by custom role list, get, create, or update responses."})}),response:B});var Vae=Ue({commandName:"custom-roles",description:"Manage custom global roles",endpoints:{list:qae,get:Hae,create:Kae,update:zae,delete:Yae}});var Tg="/v0/dashboard-folders",_g=n.Object({id:n.String({description:"Tsuga-generated dashboard folder ID assigned when the folder is created. Use it as dashboard `folderId` or child-folder `parentFolderId`."}),name:n.String({description:"Display name of the dashboard folder. Set by the caller on create or update."}),owner:n.String({description:"ID of the team that owns the dashboard folder. Set by the caller on create or update and used for folder access control."}),parentFolderId:n.Optional(n.String({description:"ID of the top-level parent folder when this folder is nested. Set by the caller on create or update. Returned only for child folders; omitted for top-level folders."})),tags:Ut,creator:n.Optional(Te),updater:n.Optional(Te),createdAt:w(),updatedAt:w()},{title:"DashboardFolder"}),IF=n.Object({..._g.properties,dashboardCount:n.Number({description:"Number of dashboards in this folder and its readable subfolders that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."}),folderCount:n.Number({description:"Number of folders nested directly under this folder that the caller can read."})}),rR=n.Object({name:p({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard folder. Required and used for folder access control."}),parentFolderId:n.Optional(n.Union([n.Null(),p({allowEmpty:!1})],{description:"ID of the top-level folder to nest this folder under. Omit on create or pass null to create a top-level folder; omit on update to keep the current parent; pass null on update to move the folder to top level. Non-null values must name a readable top-level folder. Folders can be nested at most two levels deep."})),tags:Dt}),nR=n.Partial(n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard folder names or folder IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboard folders matching this value instead of including them"}))},{description:"Text filter for dashboard folder names or IDs. Optional; `exclude: true` returns folders whose name and ID do not match the substring."}),tags:he(en.items,{description:"Restrict results to dashboard folders that have at least one of the listed key/value tags",maxItems:50}),parentFolderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Parent folder filter for dashboard folder query results. Optional; pass a folder ID to return the child folders nested directly under it, or null to return only top-level folders. Omit to return all folders."})},{description:"Optional filters applied to narrow the returned dashboard folders"})),Sg={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},bF=[Sg.OWNER,Sg.TAGS,Sg.DASHBOARD_COUNT,Sg.UPDATED_AT,Sg.NAME],lje=n.Partial(n.Object({...fe,filters:nR,sort:n.Object({by:n.Enum([...bF,Sg.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:pe},{description:"Optional sorting applied to the returned dashboard folders"})})),Zfr=f({tags:["dashboard-folders"],url:`${Tg}/query`,method:"POST",paginated:!0,body:lje,response:n.Array(IF)}),Jfr=f({tags:["dashboard-folders"],url:`${Tg}/:id`,method:"GET",params:n.Object({id:p()}),response:_g}),egr=f({tags:["dashboard-folders"],url:Tg,method:"POST",body:rR,response:_g}),tgr=f({tags:["dashboard-folders"],url:`${Tg}/:id`,method:"PUT",params:n.Object({id:p()}),body:rR,response:_g}),rgr=f({tags:["dashboard-folders"],url:`${Tg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),ngr=f({tags:["dashboard-folders"],url:`${Tg}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(nR,["tags"]))}),response:Yr});var WS=`/${"v1"}/dashboard-folders`,oR=n.Pick(_g,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),Wae={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(oR,{examples:[Wae]});var Qae=n.Pick(IF,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards in it and its readable subfolders."}),dje={...Wae,dashboardCount:10};Object.assign(Qae,{examples:[dje]});var xF=n.Pick(rR,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),mje={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(xF,{examples:[mje]});var fje=n.Object({by:n.Enum(bF,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards in the folder and its readable subfolders, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:pe},{description:"Optional sorting applied to the returned dashboard folders"}),Xae=n.Object({...je,filters:n.Optional(n.Pick(nR,["owners","searchQuery","tags","parentFolderId"])),sort:n.Optional(fje)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),gje={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"Platform"},tags:{values:[{key:"team",value:"platform"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Xae,{examples:[gje]});var Zae=f({description:"Queries dashboard folders visible to the authenticated operation key. Returns all folders unless the `parentFolderId` filter is set: pass a folder ID to select the children of that folder, or null to return only top-level folders. Results are ordered by most recently updated folder first unless `sort` is set, and include the number of readable dashboards in each folder and its readable subfolders. Use filters to narrow by owning team, name or ID substring, or tags.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${WS}/query`,method:"POST",paginated:!0,body:Xae,response:n.Array(Qae)}),Jae=f({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${WS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:oR}),ese=f({description:"Creates a dashboard folder owned by the specified team. To create a child folder, set `parentFolderId` to a readable top-level folder.",operationId:"createDashboardFolder",tags:["dashboard-folders"],url:WS,method:"POST",body:xF,response:oR}),tse=f({description:"Updates an existing dashboard folder by ID. Send the folder name, owner, tags, and parent relationship; omit `parentFolderId` to keep the current parent or send null to move the folder to top level.",operationId:"updateDashboardFolder",tags:["dashboard-folders"],url:`${WS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:xF,response:oR}),rse=f({description:"Deletes an empty dashboard folder by ID. The request fails if the folder still contains dashboards or child folders; dashboards and child folders are not moved or deleted automatically.",operationId:"deleteDashboardFolder",tags:["dashboard-folders"],url:`${WS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:B});var nse=Ue({commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:Zae,get:Jae,create:ese,update:tse,delete:rse},enableListBody:!0});var Ss="/v0/dashboards",ose=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],hje=["bar","distribution","gauge","heatmap","list","pie","query-value","slo","table","timeseries","top-list"],Pgr=[...hje,"note"];var yje=["ns","us","ms","s","m","h","days"];var Eje=["B","KB","MB","GB","TB","PB"],Sje=["bit","Kibit","Mibit","Gibit","Tibit","Pibit"],Tje=[...Eje,...Sje];var _je=20;var ise=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),ase=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(yje,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),sse=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte or bit units"}),unit:n.Enum(Tje,{description:"Data size unit of the raw values. Byte units (B, KB, MB, ...) scale in steps of 1000. Bit units (bit, Kibit, Mibit, ...) are binary: values are converted to bytes and scale in steps of 1024 (KiB, MiB, GiB, ...)."})},{$id:"DataNormalizerData",title:"Data"}),cse=n.Object({type:n.Literal("percent",{description:"Formats numeric values as percentages. Use it when the raw value is already on a 0-100 scale, for example `25` to display `25%`."})},{$id:"DataNormalizerPercent",title:"Percent"}),use=n.Object({type:n.Literal("percent-fraction",{description:"Formats numeric values as percentages. Use it when the raw value is a 0-1 fraction; Tsuga multiplies the value by 100 for display, for example `0.2` to display `20%`."})},{$id:"DataNormalizerPercentFraction",title:"Percent Fraction"}),pse=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),lse=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),dse=n.Object({type:n.Literal("none",{description:"Displays raw values without a unit. Records an explicit removal of the unit, so it is not re-derived from metric metadata"})},{$id:"DataNormalizerNone",title:"None"}),Ije=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),bje=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit. Must not be empty.",minLength:1,maxLength:_je})},{$id:"InputDataNormalizerCustom",title:"Custom"}),gr=D("type",[ase,sse,cse,use,pse,lse,ise,dse,Ije],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),hr=D("type",[ase,sse,cse,use,pse,lse,ise,dse,bje],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),aR=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(gr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),sR=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(hr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),Ig=["background","no-background"],xje=["table","legend-only","no-legend"];var Oje=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],mse=["alert","warning","success"],Ts=n.Object({operator:n.Enum(Oje,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(mse,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting",description:"Color rule evaluated against the raw query value, before the unit is applied. The first matching rule in the array is applied."}),Aje=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(mse,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),Cje=["sec","min","hour","day"],mp=n.Object({time:n.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:n.Enum(Cje,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Optional; when present, `time` and `metric` together define the bucket width."});var Es=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),Cd=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),Rd=n.Object({formula:n.Optional(p({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),p({type:"short",description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),cR={source:ci,queries:iX,formula:n.Optional(gA),aliases:n.Optional(Cd),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},uR={source:ci,queries:XE,formula:n.Optional(Ql),aliases:n.Optional(Rd),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},_s=n.Optional(n.Enum(["relative","absolute"],{description:"`absolute` keeps each group at its own value; `relative` shows it as a percentage of the ungrouped total (defaults to absolute)"})),bg={...cR,groupBy:n.Optional(Nf)},xg={...uR,groupBy:n.Optional(Ac)},pr=n.Enum(xje,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),ct=n.Optional(n.Union([n.Number(),n.Literal("max")],{description:"Display precision for numeric labels, tooltips, tables, and scalar values. Use a number of decimal places to round displayed values, or `max` to display the full submitted precision."})),ji=n.Optional(n.Array(Aje,{description:"Threshold markers displayed on the chart"})),Rje="^https?:\\/\\/(?:[^\\s{}]|\\{\\{group\\.[^}\\s]+\\}\\})+$",fse='Text of the entry added to the widget context menu. Defaults to "Open custom link" when omitted.',gse="URL opened in a new tab by the context menu entry. Every `{{group.<field>}}` placeholder is replaced by the URL-encoded value the clicked series has for that group-by field; without placeholders, every series opens the same URL. `{` and `}` are only allowed as part of a placeholder. Tsuga omits the menu entry when the clicked series has no value for one of the referenced fields.",QS=n.Object({label:n.Optional(n.String({description:fse})),url:n.String({description:gse})},{$id:"WidgetCustomLink",title:"CustomLink"}),XS=n.Object({label:n.Optional(p({allowEmpty:!1,description:fse})),url:n.String({pattern:Rje,maxLength:Mi,description:gse})},{$id:"InputWidgetCustomLink",title:"CustomLink"});var OF=["monitor","slo"],hse="Events displayed on top of the chart, over its time axis, so they can be correlated with the plotted data. A widget carries at most one overlay, and each kind of overlay carries its own settings.",yse=n.Literal("service-deployments",{description:"Draws the deployments contained in the time range over the chart"}),Ese="IDs of the teams whose services are drawn. The set is resolved when the widget renders, so a service joining one of these teams later is picked up automatically. Every service is drawn when omitted.",Sse="OpenTelemetry service names to draw, narrowing `teams` down to an explicit list. Every service matching `teams` is drawn when omitted.",Tse="Environment whose deployments are drawn. Deployments from every environment are drawn when omitted.",Pje=n.Object({type:yse,teams:n.Optional(n.Array(n.String(),{description:Ese})),services:n.Optional(n.Array(n.String(),{description:Sse})),env:n.Optional(n.String({description:Tse}))},{$id:"WidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),Uje=n.Object({type:yse,teams:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Ese})),services:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:200,description:Sse})),env:n.Optional(p({allowEmpty:!1,description:Tse}))},{$id:"InputWidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),_se="Tsuga query selecting the log events drawn over the chart. All log events in the time range are drawn when omitted.",wje=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(n.String({description:_se}))},{$id:"WidgetLogsOverlay",title:"LogsOverlay"}),vje=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(p({type:"tsuga-query",description:_se}))},{$id:"InputWidgetLogsOverlay",title:"LogsOverlay"}),Ise="Kinds of alert drawn over the chart. Both monitor and SLO alerts are drawn when omitted.",bse="Case-insensitive substring matched against the alert, the same way the Ongoing alerts page matches its search box. Every alert is drawn when omitted.",xse="Narrows the drawn alerts. An alert must match every listed filter, and a filter matches when the alert has any of its values.",Ose="Names of the teams owning the monitor, or the SLO for an SLO alert. Names rather than IDs, matching how the Ongoing alerts page filters by owner.",Ase="Group-by dimensions that raised the alert, each formatted as `key:value`. An alert matches when any of its triggering dimensions is listed.",Cse="Priorities the alert was raised at. A monitor alert takes its priority from the monitor, an SLO alert from the SLO alert that fired.",Rse="IDs of the clusters the alert was raised on. Alerts raised on no cluster are always drawn.",Nje=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(OF),{description:Ise})),query:n.Optional(n.String({description:bse})),filters:n.Optional(n.Object({team:n.Optional(n.Array(n.String(),{description:Ose})),triggeredBy:n.Optional(n.Array(n.String(),{description:Ase})),priority:n.Optional(n.Array(n.Enum(yn),{description:Cse})),cluster:n.Optional(n.Array(n.String(),{description:Rse}))},{description:xse}))},{$id:"WidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),Lje=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(OF),{maxItems:OF.length,description:Ise})),query:n.Optional(p({description:bse})),filters:n.Optional(n.Object({team:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Ose})),triggeredBy:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Ase})),priority:n.Optional(n.Array(n.Enum(yn),{maxItems:yn.length,description:Cse})),cluster:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Rse}))},{description:xse}))},{$id:"InputWidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),Pd=D("type",[Pje,wje,Nje],{title:"EventsOverlay",description:hse}),Ud=D("type",[Uje,vje,Lje],{title:"EventsOverlay",description:hse}),kje=n.Object({name:n.String({description:"Display name of the table column"}),...cR,source:ci,normalizer:n.Optional(gr),precision:ct},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),Mje=n.Object({name:p({description:"Display name of the table column"}),...uR,source:ci,normalizer:n.Optional(hr),precision:ct},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),Dje=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),Fje=n.Array(n.Object({id:p({description:"ID of the column to sort by: `label` for the grouping column, or `col-<index>` with the zero-based position of the entry in `columns`."}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),pR=n.Array(n.Object({id:n.String({description:"Column attribute used for the default list sort. It matches an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:n.Boolean({description:"Sort direction for the default list sort. `true` sorts descending; `false` sorts ascending."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Applies to log, span, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),lR=n.Array(n.Object({id:p({description:"Column attribute used for the default list sort. Set this to an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:n.Boolean({description:"Sort direction for the default list sort. Set `true` for descending order or `false` for ascending order."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Optional on create or update for log, span, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),Pse=["horizontal","vertical"],$je=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(aR,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets."})),defaultSorting:n.Optional(pR)},{$id:"GraphVisualizationList",title:"List"}),Gje=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(sR,{description:"Custom columns to display for each log. Omit it and the list renders no columns: there is no default set."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(lR)},{$id:"InputGraphVisualizationList",title:"List"}),iR=D("type",[n.Object({type:n.Literal("auto",{description:"Automatically choose this axis bound"})}),n.Object({type:n.Literal("number",{description:"Use a fixed numeric axis bound"}),value:n.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),fp=n.Object({min:iR,max:iR,scale:D("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),gp=n.Object({min:iR,max:iR,scale:D("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({minimum:0,description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Optional on create or update."}),Use=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),wse=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var Bje=["regular","dashed"],Og=n.Record(n.String(),n.Object({groupId:n.String(),lineStyle:n.Enum(Bje)}),{description:"Line style of each series, keyed by 1-based query index. The last index is the formula when there is one. Each entry is `{groupId, lineStyle}`, where `groupId` is `_q<n>` for query n or `_value` for the formula. For widgets with a single query, only the `1` entry is read and it applies to every series. Defaults to regular."}),jje=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(fp),lineStyleOptions:n.Optional(Og),normalizer:n.Optional(gr),eventsOverlay:n.Optional(Pd)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),qje=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(gp),lineStyleOptions:n.Optional(Og),normalizer:n.Optional(hr),eventsOverlay:n.Optional(Ud)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),Hje=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(aR,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets."})),defaultSorting:n.Optional(pR)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),Kje=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(sR,{description:"Custom columns to display for each database row. Omit it and the list renders no columns: there is no default set."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(lR)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),zje=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),normalizer:n.Optional(gr)},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),Yje=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),Vje=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(pr),normalizer:n.Optional(gr)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),Wje=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(pr),normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),Qje=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(fp),normalizer:n.Optional(gr),eventsOverlay:n.Optional(Pd)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),Xje=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(gp),normalizer:n.Optional(hr),eventsOverlay:n.Optional(Ud)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),Zje=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(Ig,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(gr),legendMode:n.Optional(pr)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),Jje=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(Ig,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(hr),legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),eqe=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(Pse,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),tqe=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:p({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(Pse,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),rqe=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:n.String({description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(aR,{description:"Custom columns to display for each span"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets."})),defaultSorting:n.Optional(pR)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),nqe=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(sR,{description:"Custom columns to display for each span. Omit it and the list renders no columns: there is no default set."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(lR)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),oqe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:n.String({description:"Query that selects RUM events for the list"}),listColumns:n.Optional(n.Array(aR,{description:"Custom columns to display for each RUM event. Attributes are read without their stream prefix, e.g. `view.name` rather than `events.view.name`."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets."})),defaultSorting:n.Optional(pR)},{$id:"GraphVisualizationListRum",title:"ListRum"}),iqe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects RUM events for the list. Prefix every field with the stream it belongs to (`measurements.`, `events.`, or `exceptions.`) and filter on a single stream per query. A query without stream-prefixed fields searches the `events` stream."}),listColumns:n.Optional(n.Array(sR,{description:"Custom columns to display for each RUM event. Set attributes without their stream prefix, e.g. `view.name` rather than `events.view.name`. Omit it and the list renders no columns: there is no default set."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(lR)},{$id:"InputGraphVisualizationListRum",title:"ListRum"}),hp=n.Array(n.String({description:"Raw PromQL expression for this widget, returned exactly as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),yp=n.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget. Only the first expression is rendered; later entries are stored and ignored."}),aqe=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:hp,aliases:n.Optional(Cd),timeBucket:n.Optional(mp),normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(fp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Og),eventsOverlay:n.Optional(Pd)},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),sqe=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:yp,aliases:n.Optional(Rd),timeBucket:n.Optional(mp),normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(gp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Og),eventsOverlay:n.Optional(Ud)},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),cqe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:hp,aliases:n.Optional(Cd),backgroundMode:n.Optional(n.Enum(Ig,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(gr),legendMode:n.Optional(pr)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),uqe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:yp,aliases:n.Optional(Rd),backgroundMode:n.Optional(n.Enum(Ig,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(hr),legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),vse=["red","pink","violet","blue","cyan","green","yellow","orange"],dR=n.Enum(vse,{description:"Color palette used to render the heatmap intensity gradient"}),mR=n.Object({from:n.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:n.Enum(vse,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold",description:"Color band of the gauge range. Bands are ordered by `from`, so entries may be listed in any order."}),pqe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:hp,aliases:n.Optional(Cd),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(mR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(gr)},{$id:"GraphVisualizationGaugePromql",title:"GaugePromql"}),lqe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:yp,aliases:n.Optional(Rd),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(mR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationGaugePromql",title:"GaugePromql"}),dqe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:hp,aliases:n.Optional(Cd),normalizer:n.Optional(gr),precision:ct,conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),mqe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:yp,aliases:n.Optional(Rd),normalizer:n.Optional(hr),precision:ct,conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),fqe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:hp,aliases:n.Optional(Cd),normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),gqe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:yp,aliases:n.Optional(Rd),normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),hqe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:hp,aliases:n.Optional(Cd),timeBucket:n.Optional(mp),precision:ct,normalizer:n.Optional(gr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(fp),eventsOverlay:n.Optional(Pd)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),yqe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:yp,aliases:n.Optional(Rd),timeBucket:n.Optional(mp),precision:ct,normalizer:n.Optional(hr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(gp),eventsOverlay:n.Optional(Ud)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),Eqe=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:hp,precision:ct,normalizer:n.Optional(gr),percentileMarkers:n.Optional(Use)},{$id:"GraphVisualizationDistributionPromql",title:"DistributionPromql"}),Sqe=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:yp,precision:ct,normalizer:n.Optional(hr),percentileMarkers:n.Optional(wse)},{$id:"InputGraphVisualizationDistributionPromql",title:"DistributionPromql"}),Tqe=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:hp,precision:ct,normalizer:n.Optional(gr),palette:n.Optional(dR),yAxisSettings:n.Optional(fp)},{$id:"GraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),_qe=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:yp,precision:ct,normalizer:n.Optional(hr),palette:n.Optional(dR),yAxisSettings:n.Optional(gp)},{$id:"InputGraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),Iqe=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...bg,groupByMode:_s,timeBucket:n.Optional(mp),normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(fp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Og),customLink:n.Optional(QS),eventsOverlay:n.Optional(Pd)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),bqe=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...xg,groupByMode:_s,timeBucket:n.Optional(mp),normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(gp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Og),customLink:n.Optional(XS),eventsOverlay:n.Optional(Ud)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),Nse="Requests stacked rendering for a top-list widget. Tsuga renders stacked rows only for one count or sum query with exactly two grouped fields, no formula, non-negative values, and a single-cluster context; otherwise the widget renders as a normal top list.",xqe=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...bg,groupByMode:_s,normalizer:n.Optional(gr),precision:ct,conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:Nse})),legendMode:n.Optional(pr),customLink:n.Optional(QS)},{$id:"GraphVisualizationTopList",title:"TopList"}),Oqe=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...xg,groupByMode:_s,normalizer:n.Optional(hr),precision:ct,conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:Nse})),legendMode:n.Optional(pr),customLink:n.Optional(XS)},{$id:"InputGraphVisualizationTopList",title:"TopList"}),Aqe=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...bg,groupByMode:_s,normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr),customLink:n.Optional(QS)},{$id:"GraphVisualizationPie",title:"Pie"}),Cqe=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...xg,groupByMode:_s,normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr),customLink:n.Optional(XS)},{$id:"InputGraphVisualizationPie",title:"Pie"}),Rqe=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...cR,backgroundMode:n.Optional(n.Enum(Ig,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(gr),legendMode:n.Optional(pr)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),Pqe=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...uR,backgroundMode:n.Optional(n.Enum(Ig,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ts,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(hr),legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),Uqe=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...bg,groupByMode:_s,timeBucket:n.Optional(mp),precision:ct,normalizer:n.Optional(gr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(fp),customLink:n.Optional(QS),eventsOverlay:n.Optional(Pd)},{$id:"GraphVisualizationBar",title:"Bar"}),wqe=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...xg,groupByMode:_s,timeBucket:n.Optional(mp),precision:ct,normalizer:n.Optional(hr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(gp),customLink:n.Optional(XS),eventsOverlay:n.Optional(Ud)},{$id:"InputGraphVisualizationBar",title:"Bar"}),Lse='Attribute that switches the count to "Groups" mode: records are grouped by this attribute, the aggregation produces one value per group, and the chart buckets those per-group values. When omitted, individual records are bucketed.',kse=n.String({description:Lse}),Mse=p({description:Lse}),vqe=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...bg,group:n.Optional(kse),precision:ct,normalizer:n.Optional(gr),percentileMarkers:n.Optional(Use),boundsScale:n.Optional(WE)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),Nqe=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...xg,group:n.Optional(Mse),precision:ct,normalizer:n.Optional(hr),percentileMarkers:n.Optional(wse),boundsScale:n.Optional(WE)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),Lqe=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...bg,group:n.Optional(kse),precision:ct,normalizer:n.Optional(gr),palette:n.Optional(dR),yAxisSettings:n.Optional(fp),eventsOverlay:n.Optional(Pd)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),kqe=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...xg,group:n.Optional(Mse),precision:ct,normalizer:n.Optional(hr),palette:n.Optional(dR),yAxisSettings:n.Optional(gp),eventsOverlay:n.Optional(Ud)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),Mqe=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...cR,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(mR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(gr)},{$id:"GraphVisualizationGauge",title:"Gauge"}),Dqe=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...uR,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied. Defaults to 100 when omitted."})),colorThresholds:n.Optional(n.Array(mR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),Fqe=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(kje,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Nf),groupByMode:_s,defaultSorting:n.Optional(Dje),columnSizes:n.Optional(n.Record(n.String(),n.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."})),customLink:n.Optional(QS)},{$id:"GraphVisualizationTable",title:"Table"}),$qe=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(Mje,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Ac),groupByMode:_s,defaultSorting:n.Optional(Fje),columnSizes:n.Optional(n.Record(n.String(),n.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`, counting from 0. Columns without an entry keep their default width."})),customLink:n.Optional(XS)},{$id:"InputGraphVisualizationTable",title:"Table"}),Gqe=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(ose,{description:"Background color used to render the note"})),noteAlign:n.Optional(Es),noteJustifyContent:n.Optional(Es)},{$id:"GraphVisualizationNote",title:"Note"}),Bqe=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(p({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(ose,{description:"Background color used to render the note"})),noteAlign:n.Optional(Es),noteJustifyContent:n.Optional(Es)},{$id:"InputGraphVisualizationNote",title:"Note"}),Dse=["summary","table"],Fse="Displays the latest status of SLOs as summary cards with the result count per status, a table of results, or both. Status is not recomputed over the dashboard time range.",$se="Id of the SLO to display. Omit it to cover every SLO that matches `filters`.",Gse="Narrows the SLOs the widget covers. Omit it, or any of its fields, to apply no filter.",jqe="Restrict results to SLOs owned by any of these team IDs",qqe="Restrict results to SLOs that have at least one of the listed key/value tags",Bse="Keep only the results whose status is one of these values. A result is one cluster of an ungrouped SLO, or one group of a grouped SLO.",jse="Keep only the results matching every key filter. A result's values for a key are its group-by value when its SLO groups by that field, and its SLO's tag values for that key. A result matches when one of its values is in `values`, or, with `exclude: true`, when none is; a result with no value for the key only matches an exclusion.",qse="Group-by field or tag key to filter on, such as `context.team`",Hse="Values compared with the result's group-by value and its SLO's tag values for `key`",Kse="If true, keep the results with none of these values instead of those with at least one",zse="Groups the results by owning team, or by the value of a tag key or group-by field. Omit it to list results ungrouped.",Yse="Tag key or group-by field to group by, such as `env` or `context.team`. A result falls under each value it has for this key: its group-by value when its SLO groups by this field, and its SLO's tag values for this key. Results with no value for the key are not shown.",Vse="Sections to show: `summary` for the result count per status, `table` for the list of results.",Wse=n.Object({type:n.Literal("team",{description:"Groups the results by the team owning their SLO"})},{$id:"SloWidgetOrganizeByTeam",title:"Team"}),Hqe=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:n.String({description:Yse})},{$id:"SloWidgetOrganizeByKey",title:"Key"}),Kqe=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:p({allowEmpty:!1,description:Yse})},{$id:"InputSloWidgetOrganizeByKey",title:"Key"}),zqe=D("type",[Wse,Hqe],{title:"SloWidgetOrganizeBy",description:zse}),Yqe=D("type",[Wse,Kqe],{title:"SloWidgetOrganizeBy",description:zse}),Vqe=n.Object({type:n.Literal("slo",{description:Fse}),sloId:n.Optional(n.String({description:$se})),filters:n.Optional(n.Object({owners:n.Optional(n.Object({values:n.Array(n.String()),exclude:n.Optional(n.Boolean())},{description:jqe})),tags:n.Optional(n.Object({values:Yr,exclude:n.Optional(n.Boolean())},{description:qqe})),statuses:n.Optional(n.Object({values:n.Array(dp),exclude:n.Optional(n.Boolean())},{description:Bse})),keys:n.Optional(n.Array(n.Object({key:n.String({description:qse}),values:n.Array(n.String(),{description:Hse}),exclude:n.Optional(n.Boolean({description:Kse}))}),{description:jse}))},{description:Gse})),organizeBy:n.Optional(zqe),display:n.Array(n.Enum(Dse),{description:Vse})},{$id:"GraphVisualizationSlo",title:"Slo"}),Wqe=n.Object({type:n.Literal("slo",{description:Fse}),sloId:n.Optional(p({allowEmpty:!1,description:$se})),filters:n.Optional(n.Object({owners:n.Optional(gg.properties.owners),tags:n.Optional(gg.properties.tags),statuses:n.Optional(he(dp,{description:Bse,maxItems:3})),keys:n.Optional(n.Array(n.Object({key:p({allowEmpty:!1,description:qse}),values:n.Array(p({allowEmpty:!1}),{maxItems:50,description:Hse}),exclude:n.Optional(n.Boolean({description:Kse}))}),{maxItems:50,description:jse}))},{description:Gse})),organizeBy:n.Optional(Yqe),display:n.Array(n.Enum(Dse),{minItems:1,uniqueItems:!0,description:Vse})},{$id:"InputGraphVisualizationSlo",title:"Slo"}),Qqe=D("type",[jje,Hje,zje,Vje,Qje,Zje,aqe,cqe,pqe,dqe,fqe,hqe,Eqe,Tqe,Iqe,xqe,Aqe,Rqe,Mqe,Uqe,vqe,Lqe,Fqe,$je,Gqe,eqe,rqe,oqe,Vqe],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Qse=D("type",[qje,Kje,Yje,Wje,Xje,Jje,sqe,uqe,lqe,mqe,gqe,yqe,Sqe,_qe,bqe,Oqe,Cqe,Pqe,Dqe,wqe,Nqe,kqe,$qe,Gje,Bqe,tqe,nqe,iqe,Wqe],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),AF=n.Object({x:n.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:n.Number({description:"Row position of the widget on the dashboard grid, in row units of 50 pixels each. 0 is the topmost row; increasing values move down."}),w:n.Number({description:"Width of the widget in grid columns, out of the 12-column grid. Dashboard validation uses this with `h` and the widget type to reject layouts below the widget minimum."}),h:n.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall. Dashboard validation uses this with `w` and the widget type to reject layouts below the widget minimum."})},{description:`Grid position and size of the widget. Optional; when provided, the size must be at least ${CX}\xD7${RX} (width\xD7height) grid units, except note widgets which can go down to 1\xD71.`}),Xse="ID of the dashboard tab that shows the widget. Widgets without a tab, or whose tab no longer exists, are shown in the first tab.",fR=n.Object({id:n.String({description:"Unique identifier of the graph widget inside the dashboard. Set by the caller when the graph is created; use it to target the graph in later update requests."}),name:n.Optional(n.String({description:"Display name of the graph widget."})),description:n.Optional(n.String({description:"Optional text shown with the graph widget."})),descriptionAlign:n.Optional(Es),descriptionJustifyContent:n.Optional(Es),visualization:Qqe,layout:n.Optional(AF),tabId:n.Optional(n.String({description:Xse}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),Xqe=n.Object({id:p({description:"Unique identifier of the graph widget inside the dashboard. Assign it when the graph is created; use it to target the graph in later update requests."}),name:n.Optional(p({description:"Display name of the graph widget."})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:n.Optional(Es),descriptionJustifyContent:n.Optional(Es),visualization:Qse,layout:n.Optional(AF),tabId:n.Optional(p({description:Xse}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),CF=n.Object({name:ze(p(),{description:"Display name of the graph widget. Pass null to remove it."}),description:ze(n.String({minLength:1,maxLength:800}),{description:"Text shown with the graph widget. Pass null to remove it."}),descriptionAlign:ze(Es,{description:"Vertical alignment of the description. Pass null to remove it."}),descriptionJustifyContent:ze(Es,{description:"Horizontal alignment of the description. Pass null to remove it."}),visualization:n.Optional(Qse),layout:ze(AF,{description:"Grid position and size of the widget. Pass null to remove it."})},{title:"GraphPatch",description:"Partial update of a single dashboard widget. Omitted fields keep their current values, and `visualization` and `layout` are replaced as a whole when provided."}),Zqe=10,Jqe=n.Array(n.Object({key:n.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(n.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:n.Optional(n.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),e2e=n.Array(n.Object({key:p({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(p({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:n.Optional(n.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:Zqe,description:"Dashboard-wide filters applied to every widget on the dashboard."}),Zse="Ordered tabs splitting the dashboard widgets into separate pages. When omitted or empty, the dashboard shows all its widgets on a single page.",t2e=n.Object({id:n.String({description:"Unique identifier of the tab inside the dashboard."}),name:n.String({description:"Display name of the tab."})}),r2e=n.Object({id:p({allowEmpty:!1,description:"Unique identifier of the tab inside the dashboard."}),name:p({allowEmpty:!1,description:"Display name of the tab."})}),n2e=20,Ag=n.Object({id:n.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:n.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:n.String({description:"ID of the team that owns the dashboard. Set by the caller on create or update and used for dashboard access control."}),graphs:n.Array(fR,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(Jqe),tabs:n.Optional(n.Array(t2e,{description:Zse})),createdAt:w({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:w({description:"Timestamp when Tsuga last updated the dashboard."}),creator:n.Optional(Te),updater:n.Optional(Te),tags:Ut,timePreset:n.Optional(n.Enum(zk,{description:"Relative time preset used when opening the dashboard."})),clusterIds:n.Optional(n.Array(n.String(),{description:"Clusters selected when opening the dashboard."})),folderId:n.Optional(n.String({description:"Folder that contains the dashboard. Set from the dashboard's saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),gR=n.Object({name:p({description:"Display name of the dashboard."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:n.Array(Xqe,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(e2e),tabs:n.Optional(n.Array(r2e,{maxItems:n2e,description:Zse})),tags:Dt,timePreset:n.Optional(n.Enum(zk,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),clusterIds:ze(Ic,{description:"Clusters to select when opening the dashboard."}),folderId:n.Optional(n.Union([n.Null(),p({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Optional; omit on update to keep the current folder, pass null to clear the folder, or pass a readable dashboard-folder ID to move it."}))}),xa={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},Jse=[xa.OWNER,xa.TAGS,xa.WIDGET_COUNT,xa.UPDATED_AT,xa.NAME],wd=n.Partial(n.Object({ids:he(p({allowEmpty:!1}),{description:"Restrict results to dashboards with any of these IDs",maxItems:50}),owners:he(p({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:he(en.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Optional; pass a folder ID to return dashboards in that folder, or null to return only dashboards that are not in any folder."})},{description:"Optional filters applied to narrow the returned dashboards"})),o2e=n.Partial(n.Object({...fe,filters:wd,sort:n.Object({by:n.Enum([xa.IS_FAVORITE,xa.OWNER,xa.TAGS,xa.WIDGET_COUNT,xa.UPDATED_AT,xa.NAME],{description:"Field to sort the returned dashboards by"}),direction:pe},{description:"Optional sorting applied to the returned dashboards"})})),Ugr=f({tags:["dashboards"],url:`${Ss}/query`,method:"POST",paginated:!0,response:n.Array(Ag),body:o2e}),wgr=f({tags:["dashboards"],url:`${Ss}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(wd,["tags"]))}),response:Yr}),vgr=f({tags:["dashboards"],url:`${Ss}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(wd))}),response:n.Object({all:n.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),Ngr=f({tags:["dashboards"],url:`${Ss}/:id`,method:"GET",params:n.Object({id:p()}),response:Ag}),Lgr=f({tags:["dashboards"],url:Ss,method:"POST",body:gR,response:Ag}),kgr=f({tags:["dashboards"],url:`${Ss}/:id`,method:"PATCH",params:n.Object({id:p()}),body:n.Partial(gR),response:Ag}),i2e=si(wd,{maxIds:100}),Mgr=f({tags:["dashboards"],url:`${Ss}/bulk-update`,method:"PUT",body:n.Object({selection:i2e,owner:n.Optional(p({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:ze(p({allowEmpty:!1}),{description:"Folder that should contain every dashboard. Optional when owner is provided; omit to keep the current folder, pass null to clear the folder, or pass a dashboard-folder ID to move dashboards."})}),response:n.Object({})}),Dgr=f({tags:["dashboards"],url:`${Ss}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),a2e=f({tags:["dashboards"],url:`${Ss}/:id/graphs/:graphId`,method:"PATCH",params:n.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:CF,response:fR}),Fgr=Y5(a2e),s2e=si(wd),$gr=f({tags:["dashboards"],url:`${Ss}/bulk-delete`,method:"DELETE",body:n.Object({selection:s2e}),response:n.Object({})});var Cg=`/${"v1"}/dashboards`,ZS=n.Pick(Ag,["id","name","owner","graphs","filters","tags","timePreset","folderId"],{$id:"Dashboard",description:"Saved visualization made of dashboard-wide filters and ordered graphs. Use dashboards to preserve reusable views for a team or workflow. See [Dashboards](/documentation/visualize/dashboards/index)."}),c2e={id:"123-456-abc",name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(ZS,{examples:[c2e]});var u2e=n.Object({by:n.Enum([...Jse],{description:"Field to sort the returned dashboards by: `owner` sorts by owning team ID, `tags` sorts by tag key/value pairs, `widgetCount` sorts by the number of graphs on the dashboard, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by dashboard name."}),direction:pe},{description:"Optional sorting applied to the returned dashboards"}),ece=n.Object({...je,filters:n.Optional(n.Pick(wd,["owners","searchQuery","tags","folderId"])),sort:n.Optional(u2e)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),p2e={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]},folderId:"folder-123-abc"},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(ece,{examples:[p2e]});var tce=f({description:"Queries dashboards visible to the authenticated operation key. Use this endpoint to build dashboard inventories or synchronize dashboard metadata. Pagination fields limit the returned page; use the response metadata to request additional pages. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${Cg}/query`,method:"POST",paginated:!0,body:ece,response:n.Array(ZS)}),rce=f({description:"Retrieves one dashboard by ID.",operationId:"getDashboard",tags:["dashboards"],url:`${Cg}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:ZS}),RF=n.Pick(gR,["name","owner","graphs","filters","tags","timePreset","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),nce={name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour",folderId:null};Object.assign(RF,{examples:[nce]});var oce=n.Object(CF.properties,{description:"Dashboard graph update request. The graph identifier is supplied in the `graphId` path parameter; every body field is optional and omitted fields keep their current values."}),l2e={name:"Request Latency P99",description:"p99 request latency for the API gateway.",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}};Object.assign(oce,{examples:[l2e]});var ice=f({description:"Creates a dashboard owned by the specified team. Use this to provision dashboards from automation or templates. The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:Cg,method:"POST",body:RF,response:ZS}),ace=f({description:"Updates an existing dashboard by ID. Top-level fields are patched from the request body and omitted ones keep their current values, but a sent array replaces the stored one whole: a `graphs` array missing a widget deletes that widget. Read the dashboard first and send back every widget you keep, or use `updateDashboardGraph` to change one widget.",operationId:"updateDashboard",tags:["dashboards"],url:`${Cg}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:n.Partial(RF,{examples:[nce]}),response:ZS}),d2e=n.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),sce=f({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${Cg}/:id`,method:"DELETE",params:d2e,response:B}),Ygr=f({description:"Updates one graph inside a dashboard without replacing the full dashboard. Use this for targeted widget edits when you already know the dashboard ID and graph ID. Fields are patched from the request body; omitted fields keep their current values and null clears them. A sent `visualization` or `layout` replaces the stored one whole rather than merging into it.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${Cg}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:p({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:oce,response:fR});var cce=Ue({commandName:"dashboards",description:"Manage dashboards",endpoints:{list:tce,get:rce,create:ice,update:ace,delete:sce},enableListBody:!0});var uce="tsuga_in:v1:";var m2e=100,PF=3,Rg=n.Object({id:n.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:n.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:n.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:n.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Yr,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:w({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:w({description:"Timestamp when Tsuga created the key."}),creator:n.Optional(Te),updater:n.Optional(Te),assetUpdatedAt:w({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),JS=n.Object({name:n.String({format:ki,minLength:1,maxLength:m2e,description:"Kebab-case name for the ingestion API key."}),owner:p({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:en,teamOverrideFields:n.Union([n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:PF,description:"Array form."}),n.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this key. Send null to clear existing override fields."})}),Pg="/v0/ingestion-api-keys",ihr=f({tags:["ingestion-api-keys"],url:Pg,method:"POST",body:JS,response:n.Object({...Rg.properties,key:n.String({description:"Full secret value of the ingestion API key. Generated by Tsuga and returned only in this create response; subsequent get and list responses expose only `keyLastCharacters`. Store it immediately, since it cannot be retrieved again after this response."})})}),ahr=f({tags:["ingestion-api-keys"],url:Pg,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(Rg)}),shr=f({tags:["ingestion-api-keys"],url:`${Pg}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:Rg}),chr=f({tags:["ingestion-api-keys"],url:`${Pg}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1})}),body:JS,response:Rg}),uhr=f({tags:["ingestion-api-keys"],url:`${Pg}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1})}),response:B}),phr=f({tags:["ingestion-api-keys"],url:`${Pg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var eT=`/${"v1"}/ingestion-api-keys`,tT=n.Pick(Rg,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),pce={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(tT,{examples:[pce]});var lce=n.Pick(JS,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest",description:"Ingestion API key creation request. Provide a kebab-case name, owner team, required tags, and required team override fields as an array of fields or null."}),dce=n.Pick(JS,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest",description:"Ingestion API key update request. Provide the full metadata definition, including name, owner team, tags, and team override fields."}),mce={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(lce,{examples:[mce]});Object.assign(dce,{examples:[mce]});var f2e={...pce,key:`${uce}abc123xyx7Qm`},fce=f({description:"Lists ingestion API keys visible to the authenticated operation key. Use this to inventory telemetry intake keys, owners, tags, and team override fields. Pagination fields limit the returned page.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:eT,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(tT)}),Ehr=f({description:"Retrieves one ingestion API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${eT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:tT}),g2e=n.Object({...tT.properties,key:n.String({description:"Full Tsuga-generated ingestion API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})},{title:"IngestionApiKeyCreated",example:f2e}),gce=f({description:"Creates an ingestion API key for telemetry intake. Store the returned `key` immediately because Tsuga returns the full secret only in this response.",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:eT,method:"POST",body:lce,response:g2e}),hce=f({description:"Updates ingestion API key metadata by ID, including name, owner, tags, and team override fields. The secret key value is not rotated by this operation.",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${eT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to update. Use the `id` returned by ingestion API key list, get, or create responses."})}),body:dce,response:tT}),yce=f({description:"Deletes an ingestion API key by ID. Telemetry clients using the deleted key can no longer send data with it.",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${eT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to delete. Use the `id` returned by ingestion API key list, create, or update responses."})}),response:B});var Ece=Ue({commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:fce,create:gce,update:hce,delete:yce}});var rT="/v0/investigations",h2e=["dashboard","monitor","service","slo","log-route","adaptive-notification-rule"],y2e=n.Object({type:n.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:n.String({description:"Identifier of the linked asset"})}),E2e=n.Object({type:n.Enum(h2e,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),Nc=n.Object({id:n.String({description:"Identifier of the investigation"}),name:n.String({description:"Human readable name shown for the investigation"}),slug:n.Optional(n.String({description:'Immutable identifier supplied by the creating agent, e.g. "incident-2024-06-payments-5xx". Set once at creation and matched against the agent telemetry to link back to the run that created the investigation.'})),contentMd:n.Optional(n.String({description:"Markdown content capturing the investigation notes and findings"})),tags:Ut,owner:n.String({description:"Team ID owning the investigation"}),env:n.Optional(n.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:n.Array(y2e,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:n.Optional(Te),updater:n.Optional(Te),createdAt:w({description:"Timestamp the investigation was created at."}),updatedAt:w({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),nT=n.Object({name:p({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:p({type:"kebab-case",allowEmpty:!1,description:'Immutable, unique identifier supplied by the creating agent, used to link the investigation back to the agent run, e.g. "incident-2024-06-payments-5xx". The agent should also emit this value in its telemetry.'}),contentMd:ze(p({type:"long"}),{description:"Markdown content capturing the investigation notes and findings"}),tags:Dt,owner:p({allowEmpty:!1,description:"Team ID owning the investigation"}),env:ze(p({allowEmpty:!0}),{description:"Environment the investigation relates to"}),linkedAssets:n.Optional(n.Array(E2e,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),S2e={name:"Payments 5xx spike",slug:"incident-2024-06-payments-5xx",contentMd:`## Summary
@@ -319,7 +319,7 @@ ${s}`:`[${e}]`),s&&u?`${s}
319
319
  ${u}`:s||u}function T$(e,{maxDepth:t=1e3,numbersAsFloat:r=!1,strictTemporal:o=!1}={}){if(FT(e)!=="object")throw new TypeError("stringify can only be called with an object");let i=S$(0,e,"",t,r,o);return i[i.length-1]!==`
320
320
  `?i+`
321
321
  `:i}function Nze(e,t,r){return{environment:"dev",log_user_prompt:r,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}var Lze=v("cli.setup.codex")(function*(e,t,r,o){let i=yield*Xr,a=(0,_$.join)(e,".codex"),s=(0,_$.join)(a,"config.toml");yield*Le(`Codex \u2192 ${s}`),yield*i.makeDirectory(a,{recursive:!0}).pipe(Cc("create",a));let u=yield*Mf(s),l=yield*u===void 0?A({}):lt(()=>y$(u)).pipe(dt(()=>new Nn({message:`${s} is not valid TOML. Fix or remove it before re-running.`}))),m="otel"in l,{otel:g,...y}=l,E={...y,otel:Nze(t,r,o)},h=yield*Df(s,u,yield*MR);yield*kf(s,T$(E)),yield*Le(h===void 0?" created":m?` replaced existing [otel] tables (backup: ${h})`:` appended (backup: ${h})`)}),xde=P("codex",{endpoint:DR,ingestionApiKey:FR,includePrompts:$R("user prompts")},v("cli.setup.codexCli")(function*(e){yield*Lze((0,bde.homedir)(),e.endpoint.replace(/\/+$/,""),e.ingestionApiKey,e.includePrompts),yield*Le(kR)})).pipe(U("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)"));var Ode=P("setup").pipe(U("Configure local LLM CLIs to ship OTEL telemetry to Tsuga"),_e([fde,xde]));var Ade=kn("contrast-sets","Compare two groups of spans and return the attribute values that separate them",fZ);var qR=Fe("trace-id").pipe(Z("Trace ID to summarize"),Ee("TRACE_ID"));var Cde=P("latency-summary",{traceId:qR,...Kt,minRangeDurationMs:eY("min-range-duration-ms").pipe(Z("Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)"),Ee("MILLISECONDS"),Je),ranges:ro("ranges").pipe(Z("Include the per-range timeline; --no-ranges returns only services and serviceTotals"),_n(!0))},v("cli.traces.latencySummary")(function*(e){yield*xe(yield*tt(lZ,{query:hn({traceId:e.traceId,...yield*Kr(e),minRangeDurationMs:ne(e.minRangeDurationMs),includeRanges:e.ranges?void 0:!1})}))})).pipe(U("Summarize where wall-clock time is spent in a trace, attributed per service"));var kze=["start_time","duration","context.service.name","span.name","status_code","trace_id"],Rde=P("search",{...Kt,query:np,maxResults:Jf,output:uo},v("cli.traces.search")(function*(e){let t=yield*mn,{spans:r}=yield*Qt(rS,{query:yield*ug(e)});yield*t.rows(r,{...e,defaultFields:kze})})).pipe(U("Search spans"));var Pde=P("summarize",{traceId:qR,...Kt},v("cli.traces.summarize")(function*(e){yield*xe(yield*tt(uZ,{query:{traceId:e.traceId,...yield*Kr(e)}}))})).pipe(U("Summarize a trace by aggregating groups of similar spans into summary spans"));var Ude=P("traces").pipe(U("Search and summarize traces"),_e([Ade,Rde,Pde,Cde]));var wde="/logs",vde="/explorer",I$="/analytics";var Nde=n.Object({id:n.String({description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."}),url:n.String({description:"Relative app URL (path and search) the short link opens. Search parameters use the app URL encoding: object and array values are JSON-stringified, then URL-encoded."}),expiresAt:w({description:"Timestamp after which the short link stops resolving."})},{$id:"ShortUrl",description:"A short link copied with **Copy page URL** on the Logs or Traces page, resolved to the app URL it opens. See [Share the current search](/documentation/explore/logs#share-the-current-search)."}),Mze={id:"aB3-dE5fG-h7J",url:"/logs?query=level%3Aerror&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(Nde,{examples:[Mze]});var Lde=f({description:"Resolves a short link to the app URL it opens. Use this to recover the query, filters, and time range behind a link copied from the Logs or Traces page. An expired or unknown code returns 404.",operationId:"getShortUrl",tags:["short-urls"],url:`/${"v1"}/short-urls/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."})}),response:Nde});var kde=n.Object({id:n.String({description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."}),title:n.Optional(n.String({description:"Name of the widget the link was shared from. Omitted when the widget had no name."})),search:n.String({description:"Analytics search parameters captured when the link was created, without the leading `?`. Values use the app URL encoding: object and array values are JSON-stringified, then URL-encoded. `timeZone` is the time zone of the user who created the link, which the shared image uses."}),dashboardId:n.Optional(n.String({description:"ID of the dashboard holding the shared widget. Omitted for Analytics shares."})),graphId:n.Optional(n.String({description:"ID of the shared widget on its dashboard. Omitted for Analytics shares."})),url:n.String({description:"Absolute app URL a signed-in browser opening the share link is redirected to: the widget on its dashboard, or Analytics. It carries no `timeZone`, so the app shows the result in the time zone of the viewer."}),expiresAt:w({description:"Timestamp after which the share link stops resolving."})},{$id:"WidgetShare",description:"A widget share link created from Analytics or a dashboard widget, with the query it renders. See [Share links](/documentation/visualize/analytics/index#share-links)."}),Dze={id:"kL9-mN2pQ-r4S",title:"Checkout errors",search:"source=logs&queries=%5B%7B%22aggregate%22%3A%7B%22type%22%3A%22count%22%7D%2C%22filter%22%3A%22service%3Acheckout%22%7D%5D&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",dashboardId:"dashboard-123-abc",graphId:"graph-123-abc",url:"https://app.tsuga.com/dashboards/dashboard-123-abc?openedGraph=graph-123-abc&openedGraphReadonly=true&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(kde,{examples:[Dze]});var Mde=f({description:"Retrieves the query behind a widget share link. Use this to recover the widget title, Analytics search, and dashboard of a link whose unfurl only shows an image. An expired or unknown code returns 404.",operationId:"getWidgetShare",tags:["public","widget-shares"],url:`/${"v1"}/widget-shares/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."})}),response:kde});var Fze=/^\/l\/([^/]+)\/?$/,$ze=/^\/v0\/widget-shares\/[^/]+\/([^/]+?)(?:\/image\.png)?\/?$/,Gze={[wde]:"logs-explorer",[vde]:"logs-explorer","/traces":"traces-explorer",[I$]:"analytics"};function Bze(e){if(!URL.canParse(e))return;let t=new URL(e);if(t.protocol!=="https:"&&t.protocol!=="http:"||!jze(t.hostname))return;let r=$ze.exec(t.pathname);if(r?.[1])return{type:"widget-share",code:decodeURIComponent(r[1])};if(t.hostname.startsWith("api."))return;let o=Fze.exec(t.pathname);return o?.[1]?{type:"explorer-short-link",origin:t.origin,code:decodeURIComponent(o[1])}:{type:"app-url",url:t}}function jze(e){return e==="localhost"||e==="127.0.0.1"||["tsuga.com","tsuga-staging.com"].some(t=>e===t||e.endsWith(`.${t}`))}function b$(e,t,{search:r=t.search,...o}={}){return lt({try:()=>{let i=qze(r);return"timeRange"in i&&(i.timeRange=Hze(i.timeRange)),{type:e,url:t.href,view:Kze(t.pathname),path:t.pathname,...o,searchParams:i}},catch:()=>new Yl({message:"The link contains an invalid time range."})})}function qze(e){let t={};for(let[r,o]of new URLSearchParams(e))try{t[r]=JSON.parse(o)}catch{t[r]=o}return t}function Hze(e){if(e===null||typeof e!="object")return e;let{type:t,from:r,to:o}=e;return t!=="absolute"||typeof r!="number"||typeof o!="number"?e:{type:t,from:new Date(r).toISOString(),to:new Date(o).toISOString()}}function Kze(e){return e.startsWith("/dashboards/")?"dashboard":Gze[e]}var Dde=P("unshorten",{url:zr("URL").pipe(ur("A short link from Logs or Traces, a widget share link, or a full app.tsuga.com URL"))},v("cli.unshorten")(function*({url:e}){let t=yield*lt({try:()=>Bze(e.trim()),catch:()=>new Yl({message:"The link contains invalid URL encoding."})});if(t===void 0)return yield*new Yl({message:`Not a Tsuga short link, widget share link, or app URL: ${e}`,suggestions:["Pass a short link (https://app.tsuga.com/l/<code>), a widget share link (https://api.tsuga.com/v0/widget-shares/<orgId>/<code>), or an app.tsuga.com URL"]});switch(t.type){case"app-url":yield*xe({data:yield*b$("app-url",t.url)});return;case"explorer-short-link":{let r=yield*Qt(Lde,{params:{id:t.code}});yield*xe({data:yield*b$("explorer-short-link",new URL(r.url,t.origin),{expiresAt:r.expiresAt})});return}case"widget-share":{let r=yield*Qt(Mde,{params:{id:t.code}}),o=new URL(r.url);yield*xe({data:yield*b$("widget-share",o,{search:r.search,expiresAt:r.expiresAt,widget:{title:r.title,dashboardId:r.dashboardId,graphId:r.graphId,analyticsUrl:new URL(`${I$}?${r.search}`,o.origin).href}})});return}default:Pt(t)}})).pipe(U("Expand a Tsuga short link or widget share link and decode its query, time range, and view"));var Fde=zle.pipe(_e([{group:"Resources",commands:Hle},{group:"Query & explore",commands:[Sie,Uie,Ude,Fie,ode,ore,dde,uoe,Toe,mie,xae,Gie,Tne,eoe,Dde]},{group:"Documentation, help & feedback",commands:[vne,ooe,sde]},{group:"Setup & config",commands:[gne,Pne,Ine,Ode,yoe,ude]}]),nx(Rf,e=>e.fields),nx(cs,e=>({operationApiKey:ne(e.operationApiKey),cluster:ne(e.cluster),rationale:ne(e.rationale)})),NY(mn.pageLayer)),x$=Fde.pipe(nx(NT,()=>({root:Fde})));function $de(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let a=(r[i]??0)-(o[i]??0);if(a!==0)return a}return 0}var zze=3e3,Yze="https://registry.npmjs.org/@tsuga/cli/latest",Vze=un({version:ye}),Wze=Lo(Vze),Qze=v("cli.checkForUpdate")(function*(e){let t=yield*gt,r=yield*Ol,o=yield*sn,i=yield*t.getLastUpdateCheck;if(i&&o-new Date(i).getTime()<as)return;let a=yield*r.get(Yze).pipe(H(xL),H(s=>s.json),H(Wze),Ej(zze),gj);on(a)||($de(a.value.version,e)>0&&(yield*Hn(`
322
- Update available: ${e} \u2192 ${a.value.version}`),yield*Hn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(new Date(o).toISOString()))}),Gde=e=>zs(Qze(e));t0(process.stdout);t0(process.stderr);var Xze=rm(gt.layer,Yu.layer).pipe(nm(Pf.layer),nm(iV),nm(MK)),O$=process.argv.slice(2),jde=O$.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),A$,qde=e=>{A$=e;for(let t of ZO)process.removeListener(t,qde)};for(let e of ZO)process.once(e,qde);var Hde=loe(process.stdout,process.stderr);process.on("exit",Hde.release);var Bde=dL(x$,{version:"1.145.0"})(O$).pipe(doe(Hde)),Zze=jde?Bde:TZ(Bde,O$,x$,()=>A$).pipe(Xn(Gde("1.145.0")));Zze.pipe(So(e=>nA(e)?Xn(e.pipe(d7,Hn),X(()=>process.exitCode=tA(e))):oA(e)&&!jde?X(()=>process.exitCode=Ar.usage):F(e)),pI(Xze),Ij(EZ),Ii(aV,!0),e=>wj(e,{teardown:(t,r)=>nu(t)&&Bs(t.cause)?r(rA(A$)):gw(t,r)}));
322
+ Update available: ${e} \u2192 ${a.value.version}`),yield*Hn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(new Date(o).toISOString()))}),Gde=e=>zs(Qze(e));t0(process.stdout);t0(process.stderr);var Xze=rm(gt.layer,Yu.layer).pipe(nm(Pf.layer),nm(iV),nm(MK)),O$=process.argv.slice(2),jde=O$.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),A$,qde=e=>{A$=e;for(let t of ZO)process.removeListener(t,qde)};for(let e of ZO)process.once(e,qde);var Hde=loe(process.stdout,process.stderr);process.on("exit",Hde.release);var Bde=dL(x$,{version:"1.147.0"})(O$).pipe(doe(Hde)),Zze=jde?Bde:TZ(Bde,O$,x$,()=>A$).pipe(Xn(Gde("1.147.0")));Zze.pipe(So(e=>nA(e)?Xn(e.pipe(d7,Hn),X(()=>process.exitCode=tA(e))):oA(e)&&!jde?X(()=>process.exitCode=Ar.usage):F(e)),pI(Xze),Ij(EZ),Ii(aV,!0),e=>wj(e,{teardown:(t,r)=>nu(t)&&Bs(t.cause)?r(rA(A$)):gw(t,r)}));
323
323
  /**
324
324
  * The following is a list of HTTP status codes and their meanings.
325
325
  *