@sazabi/cli 1.1.0-dev.gb6f926c → 1.1.0-dev.gc9fc0ae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,7 +102,7 @@ ${dn("OPTIONS")}`,c+=`
|
|
|
102
102
|
|
|
103
103
|
`)}m.write("payload.value = newResult;"),m.write("return payload;");let P=m.compile();return(O,V)=>P(g,O,V)},i,s=Ns,c=!Sd.jitless,u=c&&WC.value,d=t.catchall,p;e._zod.parse=(g,m)=>{p??(p=r.value);let A=g.value;if(!s(A))return g.issues.push({expected:"object",code:"invalid_type",input:A,inst:e}),g;if(c&&u&&m?.async===!1&&m.jitless!==!0){if(!i)i=o(t.shape);if(g=i(g,m),!d)return g;return Zj([],A,g,m,p,e)}return n(g,m)}});Ld=R("$ZodUnion",(e,t)=>{xe.init(e,t),Le(e._zod,"optin",()=>t.options.some((o)=>o._zod.optin==="optional")?"optional":void 0),Le(e._zod,"optout",()=>t.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),Le(e._zod,"values",()=>{if(t.options.every((o)=>o._zod.values))return new Set(t.options.flatMap((o)=>Array.from(o._zod.values)));return}),Le(e._zod,"pattern",()=>{if(t.options.every((o)=>o._zod.pattern)){let o=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>wd(i.source)).join("|")})$`)}return});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1,c=[];for(let l of t.options){let u=l._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)c.push(u),s=!0;else{if(u.issues.length===0)return u;c.push(u)}}if(!s)return zj(c,o,e,i);return Promise.all(c).then((l)=>zj(l,o,e,i))}});UE=R("$ZodXor",(e,t)=>{Ld.init(e,t),t.inclusive=!1;let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1,c=[];for(let l of t.options){let u=l._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)c.push(u),s=!0;else c.push(u)}if(!s)return jj(c,o,e,i);return Promise.all(c).then((l)=>jj(l,o,e,i))}}),FE=R("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ld.init(e,t);let n=e._zod.parse;Le(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[c,l]of Object.entries(s)){if(!o[c])o[c]=new Set;for(let u of l)o[c].add(u)}}return o});let r=cc(()=>{let o=t.options,i=new Map;for(let s of o){let c=s._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let l of c){if(i.has(l))throw Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!Ns(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let c=r.value.get(s?.[t.discriminator]);if(c)return c._zod.run(o,i);if(t.unionFallback)return n(o,i);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o}}),$E=R("$ZodIntersection",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{let o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([l,u])=>Uj(n,l,u));return Uj(n,i,s)}});zh=R("$ZodTuple",(e,t)=>{xe.init(e,t);let n=t.items;e._zod.parse=(r,o)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let s=[],c=[...n].reverse().findIndex((d)=>d._zod.optin!=="optional"),l=c===-1?0:n.length-c;if(!t.rest){let d=i.length>n.length,p=i.length<l-1;if(d||p)return r.issues.push({...d?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let u=-1;for(let d of n){if(u++,u>=i.length){if(u>=l)continue}let p=d._zod.run({value:i[u],issues:[]},o);if(p instanceof Promise)s.push(p.then((g)=>Oh(g,r,u)));else Oh(p,r,u)}if(t.rest){let d=i.slice(n.length);for(let p of d){u++;let g=t.rest._zod.run({value:p,issues:[]},o);if(g instanceof Promise)s.push(g.then((m)=>Oh(m,r,u)));else Oh(g,r,u)}}if(s.length)return Promise.all(s).then(()=>r);return r}});GE=R("$ZodRecord",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!Ri(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;let i=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let u of s)if(typeof u==="string"||typeof u==="number"||typeof u==="symbol"){c.add(typeof u==="number"?u.toString():u);let d=t.valueType._zod.run({value:o[u],issues:[]},r);if(d instanceof Promise)i.push(d.then((p)=>{if(p.issues.length)n.issues.push(...oo(u,p.issues));n.value[u]=p.value}));else{if(d.issues.length)n.issues.push(...oo(u,d.issues));n.value[u]=d.value}}let l;for(let u in o)if(!c.has(u))l=l??[],l.push(u);if(l&&l.length>0)n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=t.keyType._zod.run({value:c,issues:[]},r);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof c==="string"&&Od.test(c)&&l.issues.length){let p=t.keyType._zod.run({value:Number(c),issues:[]},r);if(p instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(p.issues.length===0)l=p}if(l.issues.length){if(t.mode==="loose")n.value[c]=o[c];else n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((p)=>Mn(p,r,Rt())),input:c,path:[c],inst:e});continue}let d=t.valueType._zod.run({value:o[c],issues:[]},r);if(d instanceof Promise)i.push(d.then((p)=>{if(p.issues.length)n.issues.push(...oo(c,p.issues));n.value[l.value]=p.value}));else{if(d.issues.length)n.issues.push(...oo(c,d.issues));n.value[l.value]=d.value}}}if(i.length)return Promise.all(i).then(()=>n);return n}}),HE=R("$ZodMap",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!(o instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),n;let i=[];n.value=new Map;for(let[s,c]of o){let l=t.keyType._zod.run({value:s,issues:[]},r),u=t.valueType._zod.run({value:c,issues:[]},r);if(l instanceof Promise||u instanceof Promise)i.push(Promise.all([l,u]).then(([d,p])=>{Fj(d,p,n,s,o,e,r)}));else Fj(l,u,n,s,o,e,r)}if(i.length)return Promise.all(i).then(()=>n);return n}});qE=R("$ZodSet",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!(o instanceof Set))return n.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of o){let c=t.valueType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)i.push(c.then((l)=>$j(l,n)));else $j(c,n)}if(i.length)return Promise.all(i).then(()=>n);return n}});VE=R("$ZodEnum",(e,t)=>{xe.init(e,t);let n=Ed(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter((o)=>kd.has(typeof o)).map((o)=>typeof o==="string"?So(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),KE=R("$ZodLiteral",(e,t)=>{if(xe.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((r)=>typeof r==="string"?So(r):r?So(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{let i=r.value;if(n.has(i))return r;return r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),YE=R("$ZodFile",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(o instanceof File)return n;return n.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),n}}),WE=R("$ZodTransform",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ls(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(n.value=s,n));if(o instanceof Promise)throw new dr;return n.value=o,n}});jh=R("$ZodOptional",(e,t)=>{xe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Le(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${wd(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((i)=>Gj(i,n.value));return Gj(o,n.value)}if(n.value===void 0)return n;return t.innerType._zod.run(n,r)}}),JE=R("$ZodExactOptional",(e,t)=>{jh.init(e,t),Le(e._zod,"values",()=>t.innerType._zod.values),Le(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),ZE=R("$ZodNullable",(e,t)=>{xe.init(e,t),Le(e._zod,"optin",()=>t.innerType._zod.optin),Le(e._zod,"optout",()=>t.innerType._zod.optout),Le(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${wd(n.source)}|null)$`):void 0}),Le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>{if(n.value===null)return n;return t.innerType._zod.run(n,r)}}),XE=R("$ZodDefault",(e,t)=>{xe.init(e,t),e._zod.optin="optional",Le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((i)=>Hj(i,t));return Hj(o,t)}});ew=R("$ZodPrefault",(e,t)=>{xe.init(e,t),e._zod.optin="optional",Le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)n.value=t.defaultValue;return t.innerType._zod.run(n,r)}}),tw=R("$ZodNonOptional",(e,t)=>{xe.init(e,t),Le(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter((r)=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((i)=>qj(i,e));return qj(o,e)}});nw=R("$ZodSuccess",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ls("ZodSuccess");let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((i)=>(n.value=i.issues.length===0,n));return n.value=o.issues.length===0,n}}),ow=R("$ZodCatch",(e,t)=>{xe.init(e,t),Le(e._zod,"optin",()=>t.innerType._zod.optin),Le(e._zod,"optout",()=>t.innerType._zod.optout),Le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((i)=>{if(n.value=i.value,i.issues.length)n.value=t.catchValue({...n,error:{issues:i.issues.map((s)=>Mn(s,r,Rt()))},input:n.value}),n.issues=[];return n});if(n.value=o.value,o.issues.length)n.value=t.catchValue({...n,error:{issues:o.issues.map((i)=>Mn(i,r,Rt()))},input:n.value}),n.issues=[];return n}}),rw=R("$ZodNaN",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>{if(typeof n.value!=="number"||!Number.isNaN(n.value))return n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n;return n}}),iw=R("$ZodPipe",(e,t)=>{xe.init(e,t),Le(e._zod,"values",()=>t.in._zod.values),Le(e._zod,"optin",()=>t.in._zod.optin),Le(e._zod,"optout",()=>t.out._zod.optout),Le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let i=t.out._zod.run(n,r);if(i instanceof Promise)return i.then((s)=>_h(s,t.in,r));return _h(i,t.in,r)}let o=t.in._zod.run(n,r);if(o instanceof Promise)return o.then((i)=>_h(i,t.out,r));return _h(o,t.out,r)}});Nd=R("$ZodCodec",(e,t)=>{xe.init(e,t),Le(e._zod,"values",()=>t.in._zod.values),Le(e._zod,"optin",()=>t.in._zod.optin),Le(e._zod,"optout",()=>t.out._zod.optout),Le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){let i=t.in._zod.run(n,r);if(i instanceof Promise)return i.then((s)=>Dh(s,t,r));return Dh(i,t,r)}else{let i=t.out._zod.run(n,r);if(i instanceof Promise)return i.then((s)=>Dh(s,t,r));return Dh(i,t,r)}}});sw=R("$ZodReadonly",(e,t)=>{xe.init(e,t),Le(e._zod,"propValues",()=>t.innerType._zod.propValues),Le(e._zod,"values",()=>t.innerType._zod.values),Le(e._zod,"optin",()=>t.innerType?._zod?.optin),Le(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then(Vj);return Vj(o)}});aw=R("$ZodTemplateLiteral",(e,t)=>{xe.init(e,t);let n=[];for(let r of t.parts)if(typeof r==="object"&&r!==null){if(!r._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let o=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${r._zod.traits}`);let i=o.startsWith("^")?1:0,s=o.endsWith("$")?o.length-1:o.length;n.push(o.slice(i,s))}else if(r===null||ZC.has(typeof r))n.push(So(`${r}`));else throw Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,o)=>{if(typeof r.value!=="string")return r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(r.value))return r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r;return r}}),cw=R("$ZodFunction",(e,t)=>(xe.init(e,t),e._def=t,e._zod.def=t,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return function(...r){let o=e._def.input?Ah(e._def.input,r):r,i=Reflect.apply(n,this,o);if(e._def.output)return Ah(e._def.output,i);return i}},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return async function(...r){let o=e._def.input?await fh(e._def.input,r):r,i=await Reflect.apply(n,this,o);if(e._def.output)return await fh(e._def.output,i);return i}},e._zod.parse=(n,r)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let r=e.constructor;if(Array.isArray(n[0]))return new r({type:"function",input:new zh({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new r({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),lw=R("$ZodPromise",(e,t)=>{xe.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then((o)=>t.innerType._zod.run({value:o,issues:[]},r))}),uw=R("$ZodLazy",(e,t)=>{xe.init(e,t),Le(e._zod,"innerType",()=>t.getter()),Le(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Le(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Le(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Le(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),dw=R("$ZodCustom",(e,t)=>{dt.init(e,t),xe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=(n)=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then((i)=>Kj(i,n,r,e));Kj(o,n,r,e);return}})});function gw(){return{localeError:LSe()}}var LSe=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(o){return e[o]??null}let n={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${o.expected}، ولكن تم إدخال ${c}`;return`مدخلات غير مقبولة: يفترض إدخال ${i}، ولكن تم إدخال ${c}`}case"invalid_value":if(o.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${Y(o.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return` أكبر من اللازم: يفترض أن تكون ${o.origin??"القيمة"} ${i} ${o.maximum.toString()} ${s.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${o.origin??"القيمة"} ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`أصغر من اللازم: يفترض لـ ${o.origin} أن يكون ${i} ${o.minimum.toString()} ${s.unit}`;return`أصغر من اللازم: يفترض لـ ${o.origin} أن يكون ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${o.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${n[i.format]??o.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${o.divisor}`;case"unrecognized_keys":return`معرف${o.keys.length>1?"ات":""} غريب${o.keys.length>1?"ة":""}: ${_(o.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${o.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${o.origin}`;default:return"مدخل غير مقبول"}}};var eU=h(()=>{ge()});function mw(){return{localeError:NSe()}}var NSe=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Yanlış dəyər: gözlənilən instanceof ${o.expected}, daxil olan ${c}`;return`Yanlış dəyər: gözlənilən ${i}, daxil olan ${c}`}case"invalid_value":if(o.values.length===1)return`Yanlış dəyər: gözlənilən ${Y(o.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Çox böyük: gözlənilən ${o.origin??"dəyər"} ${i}${o.maximum.toString()} ${s.unit??"element"}`;return`Çox böyük: gözlənilən ${o.origin??"dəyər"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Çox kiçik: gözlənilən ${o.origin} ${i}${o.minimum.toString()} ${s.unit}`;return`Çox kiçik: gözlənilən ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${n[i.format]??o.format}`}case"not_multiple_of":return`Yanlış ədəd: ${o.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${o.keys.length>1?"lar":""}: ${_(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${o.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var tU=h(()=>{ge()});function nU(e,t,n,r){let o=Math.abs(e),i=o%10,s=o%100;if(s>=11&&s<=19)return r;if(i===1)return t;if(i>=2&&i<=4)return n;return r}function hw(){return{localeError:MSe()}}var MSe=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(o){return e[o]??null}let n={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},r={nan:"NaN",number:"лік",array:"масіў"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Няправільны ўвод: чакаўся instanceof ${o.expected}, атрымана ${c}`;return`Няправільны ўвод: чакаўся ${i}, атрымана ${c}`}case"invalid_value":if(o.values.length===1)return`Няправільны ўвод: чакалася ${Y(o.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s){let c=Number(o.maximum),l=nU(c,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${o.origin??"значэнне"} павінна ${s.verb} ${i}${o.maximum.toString()} ${l}`}return`Занадта вялікі: чакалася, што ${o.origin??"значэнне"} павінна быць ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s){let c=Number(o.minimum),l=nU(c,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${o.origin} павінна ${s.verb} ${i}${o.minimum.toString()} ${l}`}return`Занадта малы: чакалася, што ${o.origin} павінна быць ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${n[i.format]??o.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${o.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${o.keys.length>1?"ключы":"ключ"}: ${_(o.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${o.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${o.origin}`;default:return"Няправільны ўвод"}}};var oU=h(()=>{ge()});function Aw(){return{localeError:zSe()}}var zSe=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(o){return e[o]??null}let n={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},r={nan:"NaN",number:"число",array:"масив"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Невалиден вход: очакван instanceof ${o.expected}, получен ${c}`;return`Невалиден вход: очакван ${i}, получен ${c}`}case"invalid_value":if(o.values.length===1)return`Невалиден вход: очакван ${Y(o.values[0])}`;return`Невалидна опция: очаквано едно от ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Твърде голямо: очаква се ${o.origin??"стойност"} да съдържа ${i}${o.maximum.toString()} ${s.unit??"елемента"}`;return`Твърде голямо: очаква се ${o.origin??"стойност"} да бъде ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Твърде малко: очаква се ${o.origin} да съдържа ${i}${o.minimum.toString()} ${s.unit}`;return`Твърде малко: очаква се ${o.origin} да бъде ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let s="Невалиден";if(i.format==="emoji")s="Невалидно";if(i.format==="datetime")s="Невалидно";if(i.format==="date")s="Невалидна";if(i.format==="time")s="Невалидно";if(i.format==="duration")s="Невалидна";return`${s} ${n[i.format]??o.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${o.divisor}`;case"unrecognized_keys":return`Неразпознат${o.keys.length>1?"и":""} ключ${o.keys.length>1?"ове":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${o.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${o.origin}`;default:return"Невалиден вход"}}};var rU=h(()=>{ge()});function fw(){return{localeError:jSe()}}var jSe=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(o){return e[o]??null}let n={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Tipus invàlid: s'esperava instanceof ${o.expected}, s'ha rebut ${c}`;return`Tipus invàlid: s'esperava ${i}, s'ha rebut ${c}`}case"invalid_value":if(o.values.length===1)return`Valor invàlid: s'esperava ${Y(o.values[0])}`;return`Opció invàlida: s'esperava una de ${_(o.values," o ")}`;case"too_big":{let i=o.inclusive?"com a màxim":"menys de",s=t(o.origin);if(s)return`Massa gran: s'esperava que ${o.origin??"el valor"} contingués ${i} ${o.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"com a mínim":"més de",s=t(o.origin);if(s)return`Massa petit: s'esperava que ${o.origin} contingués ${i} ${o.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${o.origin} fos ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${n[i.format]??o.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${o.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${o.origin}`;default:return"Entrada invàlida"}}};var iU=h(()=>{ge()});function yw(){return{localeError:USe()}}var USe=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(o){return e[o]??null}let n={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Neplatný vstup: očekáváno instanceof ${o.expected}, obdrženo ${c}`;return`Neplatný vstup: očekáváno ${i}, obdrženo ${c}`}case"invalid_value":if(o.values.length===1)return`Neplatný vstup: očekáváno ${Y(o.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Hodnota je příliš velká: ${o.origin??"hodnota"} musí mít ${i}${o.maximum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš velká: ${o.origin??"hodnota"} musí být ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Hodnota je příliš malá: ${o.origin??"hodnota"} musí mít ${i}${o.minimum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš malá: ${o.origin??"hodnota"} musí být ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${n[i.format]??o.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${o.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${_(o.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${o.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${o.origin}`;default:return"Neplatný vstup"}}};var sU=h(()=>{ge()});function bw(){return{localeError:FSe()}}var FSe=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(o){return e[o]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Ugyldigt input: forventede instanceof ${o.expected}, fik ${c}`;return`Ugyldigt input: forventede ${i}, fik ${c}`}case"invalid_value":if(o.values.length===1)return`Ugyldig værdi: forventede ${Y(o.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin),c=r[o.origin]??o.origin;if(s)return`For stor: forventede ${c??"value"} ${s.verb} ${i} ${o.maximum.toString()} ${s.unit??"elementer"}`;return`For stor: forventede ${c??"value"} havde ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin),c=r[o.origin]??o.origin;if(s)return`For lille: forventede ${c} ${s.verb} ${i} ${o.minimum.toString()} ${s.unit}`;return`For lille: forventede ${c} havde ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ugyldig streng: skal starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: skal ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: skal indeholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: skal matche mønsteret ${i.pattern}`;return`Ugyldig ${n[i.format]??o.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${_(o.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${o.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${o.origin}`;default:return"Ugyldigt input"}}};var aU=h(()=>{ge()});function Iw(){return{localeError:$Se()}}var $Se=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(o){return e[o]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Ungültige Eingabe: erwartet instanceof ${o.expected}, erhalten ${c}`;return`Ungültige Eingabe: erwartet ${i}, erhalten ${c}`}case"invalid_value":if(o.values.length===1)return`Ungültige Eingabe: erwartet ${Y(o.values[0])}`;return`Ungültige Option: erwartet eine von ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Zu groß: erwartet, dass ${o.origin??"Wert"} ${i}${o.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${o.origin??"Wert"} ${i}${o.maximum.toString()} ist`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Zu klein: erwartet, dass ${o.origin} ${i}${o.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${o.origin} ${i}${o.minimum.toString()} ist`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${n[i.format]??o.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${_(o.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${o.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${o.origin}`;default:return"Ungültige Eingabe"}}};var cU=h(()=>{ge()});function Md(){return{localeError:GSe()}}var GSe=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${Y(o.values[0])}`;return`Invalid option: expected one of ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Too big: expected ${o.origin??"value"} to have ${i}${o.maximum.toString()} ${s.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Too small: expected ${o.origin} to have ${i}${o.minimum.toString()} ${s.unit}`;return`Too small: expected ${o.origin} to be ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${n[i.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};var Sw=h(()=>{ge()});function Cw(){return{localeError:HSe()}}var HSe=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Nevalida enigo: atendiĝis instanceof ${o.expected}, riceviĝis ${c}`;return`Nevalida enigo: atendiĝis ${i}, riceviĝis ${c}`}case"invalid_value":if(o.values.length===1)return`Nevalida enigo: atendiĝis ${Y(o.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${i}${o.maximum.toString()} ${s.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Tro malgranda: atendiĝis ke ${o.origin} havu ${i}${o.minimum.toString()} ${s.unit}`;return`Tro malgranda: atendiĝis ke ${o.origin} estu ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`;if(i.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`;if(i.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if(i.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${n[i.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} ŝlosilo${o.keys.length>1?"j":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};var lU=h(()=>{ge()});function vw(){return{localeError:qSe()}}var qSe=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(o){return e[o]??null}let n={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Entrada inválida: se esperaba instanceof ${o.expected}, recibido ${c}`;return`Entrada inválida: se esperaba ${i}, recibido ${c}`}case"invalid_value":if(o.values.length===1)return`Entrada inválida: se esperaba ${Y(o.values[0])}`;return`Opción inválida: se esperaba una de ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin),c=r[o.origin]??o.origin;if(s)return`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${i}${o.maximum.toString()} ${s.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${c??"valor"} fuera ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin),c=r[o.origin]??o.origin;if(s)return`Demasiado pequeño: se esperaba que ${c} tuviera ${i}${o.minimum.toString()} ${s.unit}`;return`Demasiado pequeño: se esperaba que ${c} fuera ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Cadena inválida: debe comenzar con "${i.prefix}"`;if(i.format==="ends_with")return`Cadena inválida: debe terminar en "${i.suffix}"`;if(i.format==="includes")return`Cadena inválida: debe incluir "${i.includes}"`;if(i.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${i.pattern}`;return`Inválido ${n[i.format]??o.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r[o.origin]??o.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r[o.origin]??o.origin}`;default:return"Entrada inválida"}}};var uU=h(()=>{ge()});function Ew(){return{localeError:VSe()}}var VSe=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(o){return e[o]??null}let n={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},r={nan:"NaN",number:"عدد",array:"آرایه"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`ورودی نامعتبر: میبایست instanceof ${o.expected} میبود، ${c} دریافت شد`;return`ورودی نامعتبر: میبایست ${i} میبود، ${c} دریافت شد`}case"invalid_value":if(o.values.length===1)return`ورودی نامعتبر: میبایست ${Y(o.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${_(o.values,"|")} میبود`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`خیلی بزرگ: ${o.origin??"مقدار"} باید ${i}${o.maximum.toString()} ${s.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${o.origin??"مقدار"} باید ${i}${o.maximum.toString()} باشد`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`خیلی کوچک: ${o.origin} باید ${i}${o.minimum.toString()} ${s.unit} باشد`;return`خیلی کوچک: ${o.origin} باید ${i}${o.minimum.toString()} باشد`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${n[i.format]??o.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${o.divisor} باشد`;case"unrecognized_keys":return`کلید${o.keys.length>1?"های":""} ناشناس: ${_(o.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${o.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${o.origin}`;default:return"ورودی نامعتبر"}}};var dU=h(()=>{ge()});function ww(){return{localeError:KSe()}}var KSe=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(o){return e[o]??null}let n={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Virheellinen tyyppi: odotettiin instanceof ${o.expected}, oli ${c}`;return`Virheellinen tyyppi: odotettiin ${i}, oli ${c}`}case"invalid_value":if(o.values.length===1)return`Virheellinen syöte: täytyy olla ${Y(o.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Liian suuri: ${s.subject} täytyy olla ${i}${o.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Liian pieni: ${s.subject} täytyy olla ${i}${o.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${n[i.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};var pU=h(()=>{ge()});function kw(){return{localeError:YSe()}}var YSe=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(o){return e[o]??null}let n={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN",number:"nombre",array:"tableau"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Entrée invalide : instanceof ${o.expected} attendu, ${c} reçu`;return`Entrée invalide : ${i} attendu, ${c} reçu`}case"invalid_value":if(o.values.length===1)return`Entrée invalide : ${Y(o.values[0])} attendu`;return`Option invalide : une valeur parmi ${_(o.values,"|")} attendue`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Trop grand : ${o.origin??"valeur"} doit ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"élément(s)"}`;return`Trop grand : ${o.origin??"valeur"} doit être ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Trop petit : ${o.origin} doit ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Trop petit : ${o.origin} doit être ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${n[i.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${o.divisor}`;case"unrecognized_keys":return`Clé${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${_(o.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${o.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entrée invalide"}}};var gU=h(()=>{ge()});function xw(){return{localeError:WSe()}}var WSe=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(o){return e[o]??null}let n={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Entrée invalide : attendu instanceof ${o.expected}, reçu ${c}`;return`Entrée invalide : attendu ${i}, reçu ${c}`}case"invalid_value":if(o.values.length===1)return`Entrée invalide : attendu ${Y(o.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"≤":"<",s=t(o.origin);if(s)return`Trop grand : attendu que ${o.origin??"la valeur"} ait ${i}${o.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${o.origin??"la valeur"} soit ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"≥":">",s=t(o.origin);if(s)return`Trop petit : attendu que ${o.origin} ait ${i}${o.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${o.origin} soit ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${n[i.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${o.divisor}`;case"unrecognized_keys":return`Clé${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${_(o.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${o.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entrée invalide"}}};var mU=h(()=>{ge()});function Pw(){return{localeError:JSe()}}var JSe=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=(u)=>u?e[u]:void 0,r=(u)=>{let d=n(u);if(d)return d.label;return u??e.unknown.label},o=(u)=>`ה${r(u)}`,i=(u)=>(n(u)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",s=(u)=>{if(!u)return null;return t[u]??null},c={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},l={nan:"NaN"};return(u)=>{switch(u.code){case"invalid_type":{let d=u.expected,p=l[d??""]??r(d),g=W(u.input),m=l[g]??e[g]?.label??g;if(/^[A-Z]/.test(u.expected))return`קלט לא תקין: צריך להיות instanceof ${u.expected}, התקבל ${m}`;return`קלט לא תקין: צריך להיות ${p}, התקבל ${m}`}case"invalid_value":{if(u.values.length===1)return`ערך לא תקין: הערך חייב להיות ${Y(u.values[0])}`;let d=u.values.map((m)=>Y(m));if(u.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;let p=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${p}`}case"too_big":{let d=s(u.origin),p=o(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"ארוך"} מדי: ${p} צריכה להכיל ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"או פחות":"לכל היותר"}`.trim();if(u.origin==="number"){let A=u.inclusive?`קטן או שווה ל-${u.maximum}`:`קטן מ-${u.maximum}`;return`גדול מדי: ${p} צריך להיות ${A}`}if(u.origin==="array"||u.origin==="set"){let A=u.origin==="set"?"צריכה":"צריך",f=u.inclusive?`${u.maximum} ${d?.unit??""} או פחות`:`פחות מ-${u.maximum} ${d?.unit??""}`;return`גדול מדי: ${p} ${A} להכיל ${f}`.trim()}let g=u.inclusive?"<=":"<",m=i(u.origin??"value");if(d?.unit)return`${d.longLabel} מדי: ${p} ${m} ${g}${u.maximum.toString()} ${d.unit}`;return`${d?.longLabel??"גדול"} מדי: ${p} ${m} ${g}${u.maximum.toString()}`}case"too_small":{let d=s(u.origin),p=o(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"קצר"} מדי: ${p} צריכה להכיל ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"או יותר":"לפחות"}`.trim();if(u.origin==="number"){let A=u.inclusive?`גדול או שווה ל-${u.minimum}`:`גדול מ-${u.minimum}`;return`קטן מדי: ${p} צריך להיות ${A}`}if(u.origin==="array"||u.origin==="set"){let A=u.origin==="set"?"צריכה":"צריך";if(u.minimum===1&&u.inclusive){let S=u.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${p} ${A} להכיל ${S}`}let f=u.inclusive?`${u.minimum} ${d?.unit??""} או יותר`:`יותר מ-${u.minimum} ${d?.unit??""}`;return`קטן מדי: ${p} ${A} להכיל ${f}`.trim()}let g=u.inclusive?">=":">",m=i(u.origin??"value");if(d?.unit)return`${d.shortLabel} מדי: ${p} ${m} ${g}${u.minimum.toString()} ${d.unit}`;return`${d?.shortLabel??"קטן"} מדי: ${p} ${m} ${g}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;let p=c[d.format],g=p?.label??d.format,A=(p?.gender??"m")==="f"?"תקינה":"תקין";return`${g} לא ${A}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${u.divisor}`;case"unrecognized_keys":return`מפתח${u.keys.length>1?"ות":""} לא מזוה${u.keys.length>1?"ים":"ה"}: ${_(u.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${o(u.origin??"array")}`;default:return"קלט לא תקין"}}};var hU=h(()=>{ge()});function Rw(){return{localeError:ZSe()}}var ZSe=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(o){return e[o]??null}let n={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"szám",array:"tömb"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Érvénytelen bemenet: a várt érték instanceof ${o.expected}, a kapott érték ${c}`;return`Érvénytelen bemenet: a várt érték ${i}, a kapott érték ${c}`}case"invalid_value":if(o.values.length===1)return`Érvénytelen bemenet: a várt érték ${Y(o.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Túl nagy: ${o.origin??"érték"} mérete túl nagy ${i}${o.maximum.toString()} ${s.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${o.origin??"érték"} túl nagy: ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Túl kicsi: a bemeneti érték ${o.origin} mérete túl kicsi ${i}${o.minimum.toString()} ${s.unit}`;return`Túl kicsi: a bemeneti érték ${o.origin} túl kicsi ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${n[i.format]??o.format}`}case"not_multiple_of":return`Érvénytelen szám: ${o.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${o.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${o.origin}`;default:return"Érvénytelen bemenet"}}};var AU=h(()=>{ge()});function fU(e,t,n){return Math.abs(e)===1?t:n}function hc(e){if(!e)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],n=e[e.length-1];return e+(t.includes(n)?"ն":"ը")}function Tw(){return{localeError:XSe()}}var XSe=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(o){return e[o]??null}let n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${o.expected}, ստացվել է ${c}`;return`Սխալ մուտքագրում․ սպասվում էր ${i}, ստացվել է ${c}`}case"invalid_value":if(o.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${Y(o.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s){let c=Number(o.maximum),l=fU(c,s.unit.one,s.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${hc(o.origin??"արժեք")} կունենա ${i}${o.maximum.toString()} ${l}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${hc(o.origin??"արժեք")} լինի ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s){let c=Number(o.minimum),l=fU(c,s.unit.one,s.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${hc(o.origin)} կունենա ${i}${o.minimum.toString()} ${l}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${hc(o.origin)} լինի ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${i.prefix}"-ով`;if(i.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${i.suffix}"-ով`;if(i.format==="includes")return`Սխալ տող․ պետք է պարունակի "${i.includes}"`;if(i.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${i.pattern} ձևաչափին`;return`Սխալ ${n[i.format]??o.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${o.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${o.keys.length>1?"ներ":""}. ${_(o.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${hc(o.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${hc(o.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};var yU=h(()=>{ge()});function Bw(){return{localeError:eCe()}}var eCe=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(o){return e[o]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Input tidak valid: diharapkan instanceof ${o.expected}, diterima ${c}`;return`Input tidak valid: diharapkan ${i}, diterima ${c}`}case"invalid_value":if(o.values.length===1)return`Input tidak valid: diharapkan ${Y(o.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${i}${o.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Terlalu kecil: diharapkan ${o.origin} memiliki ${i}${o.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${o.origin} menjadi ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${n[i.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}};var bU=h(()=>{ge()});function Ow(){return{localeError:tCe()}}var tCe=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"númer",array:"fylki"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Rangt gildi: Þú slóst inn ${c} þar sem á að vera instanceof ${o.expected}`;return`Rangt gildi: Þú slóst inn ${c} þar sem á að vera ${i}`}case"invalid_value":if(o.values.length===1)return`Rangt gildi: gert ráð fyrir ${Y(o.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} hafi ${i}${o.maximum.toString()} ${s.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} sé ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Of lítið: gert er ráð fyrir að ${o.origin} hafi ${i}${o.minimum.toString()} ${s.unit}`;return`Of lítið: gert er ráð fyrir að ${o.origin} sé ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ógildur strengur: verður að byrja á "${i.prefix}"`;if(i.format==="ends_with")return`Ógildur strengur: verður að enda á "${i.suffix}"`;if(i.format==="includes")return`Ógildur strengur: verður að innihalda "${i.includes}"`;if(i.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`;return`Rangt ${n[i.format]??o.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`Óþekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${_(o.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${o.origin}`;default:return"Rangt gildi"}}};var IU=h(()=>{ge()});function _w(){return{localeError:nCe()}}var nCe=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(o){return e[o]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Input non valido: atteso instanceof ${o.expected}, ricevuto ${c}`;return`Input non valido: atteso ${i}, ricevuto ${c}`}case"invalid_value":if(o.values.length===1)return`Input non valido: atteso ${Y(o.values[0])}`;return`Opzione non valida: atteso uno tra ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Troppo grande: ${o.origin??"valore"} deve avere ${i}${o.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${o.origin??"valore"} deve essere ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Troppo piccolo: ${o.origin} deve avere ${i}${o.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${o.origin} deve essere ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${n[i.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${_(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}};var SU=h(()=>{ge()});function Dw(){return{localeError:oCe()}}var oCe=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(o){return e[o]??null}let n={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},r={nan:"NaN",number:"数値",array:"配列"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`無効な入力: instanceof ${o.expected}が期待されましたが、${c}が入力されました`;return`無効な入力: ${i}が期待されましたが、${c}が入力されました`}case"invalid_value":if(o.values.length===1)return`無効な入力: ${Y(o.values[0])}が期待されました`;return`無効な選択: ${_(o.values,"、")}のいずれかである必要があります`;case"too_big":{let i=o.inclusive?"以下である":"より小さい",s=t(o.origin);if(s)return`大きすぎる値: ${o.origin??"値"}は${o.maximum.toString()}${s.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${o.origin??"値"}は${o.maximum.toString()}${i}必要があります`}case"too_small":{let i=o.inclusive?"以上である":"より大きい",s=t(o.origin);if(s)return`小さすぎる値: ${o.origin}は${o.minimum.toString()}${s.unit}${i}必要があります`;return`小さすぎる値: ${o.origin}は${o.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${n[i.format]??o.format}`}case"not_multiple_of":return`無効な数値: ${o.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${o.keys.length>1?"群":""}: ${_(o.keys,"、")}`;case"invalid_key":return`${o.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${o.origin}内の無効な値`;default:return"無効な入力"}}};var CU=h(()=>{ge()});function Qw(){return{localeError:rCe()}}var rCe=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(o){return e[o]??null}let n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},r={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${o.expected}, მიღებული ${c}`;return`არასწორი შეყვანა: მოსალოდნელი ${i}, მიღებული ${c}`}case"invalid_value":if(o.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${Y(o.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${_(o.values,"|")}-დან`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} ${s.verb} ${i}${o.maximum.toString()} ${s.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} იყოს ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} იყოს ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${i.prefix}"-ით`;if(i.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${i.suffix}"-ით`;if(i.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${i.includes}"-ს`;if(i.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`;return`არასწორი ${n[i.format]??o.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${o.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${o.keys.length>1?"ები":"ი"}: ${_(o.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${o.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${o.origin}-ში`;default:return"არასწორი შეყვანა"}}};var vU=h(()=>{ge()});function zd(){return{localeError:iCe()}}var iCe=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(o){return e[o]??null}let n={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},r={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${o.expected} ប៉ុន្តែទទួលបាន ${c}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i} ប៉ុន្តែទទួលបាន ${c}`}case"invalid_value":if(o.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Y(o.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`ធំពេក៖ ត្រូវការ ${o.origin??"តម្លៃ"} ${i} ${o.maximum.toString()} ${s.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${o.origin??"តម្លៃ"} ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`តូចពេក៖ ត្រូវការ ${o.origin} ${i} ${o.minimum.toString()} ${s.unit}`;return`តូចពេក៖ ត្រូវការ ${o.origin} ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${n[i.format]??o.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${o.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${_(o.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${o.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${o.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var Lw=h(()=>{ge()});function Nw(){return zd()}var EU=h(()=>{Lw()});function Mw(){return{localeError:sCe()}}var sCe=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`잘못된 입력: 예상 타입은 instanceof ${o.expected}, 받은 타입은 ${c}입니다`;return`잘못된 입력: 예상 타입은 ${i}, 받은 타입은 ${c}입니다`}case"invalid_value":if(o.values.length===1)return`잘못된 입력: 값은 ${Y(o.values[0])} 이어야 합니다`;return`잘못된 옵션: ${_(o.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=o.inclusive?"이하":"미만",s=i==="미만"?"이어야 합니다":"여야 합니다",c=t(o.origin),l=c?.unit??"요소";if(c)return`${o.origin??"값"}이 너무 큽니다: ${o.maximum.toString()}${l} ${i}${s}`;return`${o.origin??"값"}이 너무 큽니다: ${o.maximum.toString()} ${i}${s}`}case"too_small":{let i=o.inclusive?"이상":"초과",s=i==="이상"?"이어야 합니다":"여야 합니다",c=t(o.origin),l=c?.unit??"요소";if(c)return`${o.origin??"값"}이 너무 작습니다: ${o.minimum.toString()}${l} ${i}${s}`;return`${o.origin??"값"}이 너무 작습니다: ${o.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${n[i.format]??o.format}`}case"not_multiple_of":return`잘못된 숫자: ${o.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${_(o.keys,", ")}`;case"invalid_key":return`잘못된 키: ${o.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${o.origin}`;default:return"잘못된 입력"}}};var wU=h(()=>{ge()});function kU(e){let t=Math.abs(e),n=t%10,r=t%100;if(r>=11&&r<=19||n===0)return"many";if(n===1)return"one";return"few"}function zw(){return{localeError:aCe()}}var jd=(e)=>e.charAt(0).toUpperCase()+e.slice(1),aCe=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(o,i,s,c){let l=e[o]??null;if(l===null)return l;return{unit:l.unit[i],verb:l.verb[c][s?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Gautas tipas ${c}, o tikėtasi - instanceof ${o.expected}`;return`Gautas tipas ${c}, o tikėtasi - ${i}`}case"invalid_value":if(o.values.length===1)return`Privalo būti ${Y(o.values[0])}`;return`Privalo būti vienas iš ${_(o.values,"|")} pasirinkimų`;case"too_big":{let i=r[o.origin]??o.origin,s=t(o.origin,kU(Number(o.maximum)),o.inclusive??!1,"smaller");if(s?.verb)return`${jd(i??o.origin??"reikšmė")} ${s.verb} ${o.maximum.toString()} ${s.unit??"elementų"}`;let c=o.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${jd(i??o.origin??"reikšmė")} turi būti ${c} ${o.maximum.toString()} ${s?.unit}`}case"too_small":{let i=r[o.origin]??o.origin,s=t(o.origin,kU(Number(o.minimum)),o.inclusive??!1,"bigger");if(s?.verb)return`${jd(i??o.origin??"reikšmė")} ${s.verb} ${o.minimum.toString()} ${s.unit??"elementų"}`;let c=o.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${jd(i??o.origin??"reikšmė")} turi būti ${c} ${o.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Eilutė privalo prasidėti "${i.prefix}"`;if(i.format==="ends_with")return`Eilutė privalo pasibaigti "${i.suffix}"`;if(i.format==="includes")return`Eilutė privalo įtraukti "${i.includes}"`;if(i.format==="regex")return`Eilutė privalo atitikti ${i.pattern}`;return`Neteisingas ${n[i.format]??o.format}`}case"not_multiple_of":return`Skaičius privalo būti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${_(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let i=r[o.origin]??o.origin;return`${jd(i??o.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var xU=h(()=>{ge()});function jw(){return{localeError:cCe()}}var cCe=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(o){return e[o]??null}let n={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},r={nan:"NaN",number:"број",array:"низа"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Грешен внес: се очекува instanceof ${o.expected}, примено ${c}`;return`Грешен внес: се очекува ${i}, примено ${c}`}case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${Y(o.values[0])}`;return`Грешана опција: се очекува една ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Премногу голем: се очекува ${o.origin??"вредноста"} да има ${i}${o.maximum.toString()} ${s.unit??"елементи"}`;return`Премногу голем: се очекува ${o.origin??"вредноста"} да биде ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Премногу мал: се очекува ${o.origin} да има ${i}${o.minimum.toString()} ${s.unit}`;return`Премногу мал: се очекува ${o.origin} да биде ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${n[i.format]??o.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${_(o.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${o.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${o.origin}`;default:return"Грешен внес"}}};var PU=h(()=>{ge()});function Uw(){return{localeError:lCe()}}var lCe=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(o){return e[o]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Input tidak sah: dijangka instanceof ${o.expected}, diterima ${c}`;return`Input tidak sah: dijangka ${i}, diterima ${c}`}case"invalid_value":if(o.values.length===1)return`Input tidak sah: dijangka ${Y(o.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Terlalu besar: dijangka ${o.origin??"nilai"} ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Terlalu kecil: dijangka ${o.origin} ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${o.origin} adalah ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${n[i.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}};var RU=h(()=>{ge()});function Fw(){return{localeError:uCe()}}var uCe=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(o){return e[o]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Ongeldige invoer: verwacht instanceof ${o.expected}, ontving ${c}`;return`Ongeldige invoer: verwacht ${i}, ontving ${c}`}case"invalid_value":if(o.values.length===1)return`Ongeldige invoer: verwacht ${Y(o.values[0])}`;return`Ongeldige optie: verwacht één van ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin),c=o.origin==="date"?"laat":o.origin==="string"?"lang":"groot";if(s)return`Te ${c}: verwacht dat ${o.origin??"waarde"} ${i}${o.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`;return`Te ${c}: verwacht dat ${o.origin??"waarde"} ${i}${o.maximum.toString()} is`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin),c=o.origin==="date"?"vroeg":o.origin==="string"?"kort":"klein";if(s)return`Te ${c}: verwacht dat ${o.origin} ${i}${o.minimum.toString()} ${s.unit} ${s.verb}`;return`Te ${c}: verwacht dat ${o.origin} ${i}${o.minimum.toString()} is`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${n[i.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}};var TU=h(()=>{ge()});function $w(){return{localeError:dCe()}}var dCe=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(o){return e[o]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Ugyldig input: forventet instanceof ${o.expected}, fikk ${c}`;return`Ugyldig input: forventet ${i}, fikk ${c}`}case"invalid_value":if(o.values.length===1)return`Ugyldig verdi: forventet ${Y(o.values[0])}`;return`Ugyldig valg: forventet en av ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`For stor(t): forventet ${o.origin??"value"} til å ha ${i}${o.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${o.origin??"value"} til å ha ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`For lite(n): forventet ${o.origin} til å ha ${i}${o.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${o.origin} til å ha ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${n[i.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${_(o.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}};var BU=h(()=>{ge()});function Gw(){return{localeError:pCe()}}var pCe=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(o){return e[o]??null}let n={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Fâsit giren: umulan instanceof ${o.expected}, alınan ${c}`;return`Fâsit giren: umulan ${i}, alınan ${c}`}case"invalid_value":if(o.values.length===1)return`Fâsit giren: umulan ${Y(o.values[0])}`;return`Fâsit tercih: mûteberler ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Fazla büyük: ${o.origin??"value"}, ${i}${o.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${o.origin??"value"}, ${i}${o.maximum.toString()} olmalıydı.`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Fazla küçük: ${o.origin}, ${i}${o.minimum.toString()} ${s.unit} sahip olmalıydı.`;return`Fazla küçük: ${o.origin}, ${i}${o.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${n[i.format]??o.format}`}case"not_multiple_of":return`Fâsit sayı: ${o.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`${o.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${o.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var OU=h(()=>{ge()});function Hw(){return{localeError:gCe()}}var gCe=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(o){return e[o]??null}let n={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},r={nan:"NaN",number:"عدد",array:"ارې"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`ناسم ورودي: باید instanceof ${o.expected} وای, مګر ${c} ترلاسه شو`;return`ناسم ورودي: باید ${i} وای, مګر ${c} ترلاسه شو`}case"invalid_value":if(o.values.length===1)return`ناسم ورودي: باید ${Y(o.values[0])} وای`;return`ناسم انتخاب: باید یو له ${_(o.values,"|")} څخه وای`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`ډیر لوی: ${o.origin??"ارزښت"} باید ${i}${o.maximum.toString()} ${s.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${o.origin??"ارزښت"} باید ${i}${o.maximum.toString()} وي`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`ډیر کوچنی: ${o.origin} باید ${i}${o.minimum.toString()} ${s.unit} ولري`;return`ډیر کوچنی: ${o.origin} باید ${i}${o.minimum.toString()} وي`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${n[i.format]??o.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${o.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${o.keys.length>1?"کلیډونه":"کلیډ"}: ${_(o.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${o.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${o.origin} کې`;default:return"ناسمه ورودي"}}};var _U=h(()=>{ge()});function qw(){return{localeError:mCe()}}var mCe=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(o){return e[o]??null}let n={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},r={nan:"NaN",number:"liczba",array:"tablica"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${o.expected}, otrzymano ${c}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${i}, otrzymano ${c}`}case"invalid_value":if(o.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${Y(o.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Za duża wartość: oczekiwano, że ${o.origin??"wartość"} będzie mieć ${i}${o.maximum.toString()} ${s.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${o.origin??"wartość"} będzie wynosić ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Za mała wartość: oczekiwano, że ${o.origin??"wartość"} będzie mieć ${i}${o.minimum.toString()} ${s.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${o.origin??"wartość"} będzie wynosić ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${n[i.format]??o.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${o.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${o.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var DU=h(()=>{ge()});function Vw(){return{localeError:hCe()}}var hCe=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(o){return e[o]??null}let n={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",number:"número",null:"nulo"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Tipo inválido: esperado instanceof ${o.expected}, recebido ${c}`;return`Tipo inválido: esperado ${i}, recebido ${c}`}case"invalid_value":if(o.values.length===1)return`Entrada inválida: esperado ${Y(o.values[0])}`;return`Opção inválida: esperada uma das ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Muito grande: esperado que ${o.origin??"valor"} tivesse ${i}${o.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${o.origin??"valor"} fosse ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Muito pequeno: esperado que ${o.origin} tivesse ${i}${o.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${o.origin} fosse ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${n[i.format]??o.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Chave inválida em ${o.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${o.origin}`;default:return"Campo inválido"}}};var QU=h(()=>{ge()});function LU(e,t,n,r){let o=Math.abs(e),i=o%10,s=o%100;if(s>=11&&s<=19)return r;if(i===1)return t;if(i>=2&&i<=4)return n;return r}function Kw(){return{localeError:ACe()}}var ACe=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(o){return e[o]??null}let n={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},r={nan:"NaN",number:"число",array:"массив"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Неверный ввод: ожидалось instanceof ${o.expected}, получено ${c}`;return`Неверный ввод: ожидалось ${i}, получено ${c}`}case"invalid_value":if(o.values.length===1)return`Неверный ввод: ожидалось ${Y(o.values[0])}`;return`Неверный вариант: ожидалось одно из ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s){let c=Number(o.maximum),l=LU(c,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${o.origin??"значение"} будет иметь ${i}${o.maximum.toString()} ${l}`}return`Слишком большое значение: ожидалось, что ${o.origin??"значение"} будет ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s){let c=Number(o.minimum),l=LU(c,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${o.origin} будет иметь ${i}${o.minimum.toString()} ${l}`}return`Слишком маленькое значение: ожидалось, что ${o.origin} будет ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${n[i.format]??o.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${o.divisor}`;case"unrecognized_keys":return`Нераспознанн${o.keys.length>1?"ые":"ый"} ключ${o.keys.length>1?"и":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${o.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${o.origin}`;default:return"Неверные входные данные"}}};var NU=h(()=>{ge()});function Yw(){return{localeError:fCe()}}var fCe=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(o){return e[o]??null}let n={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"število",array:"tabela"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Neveljaven vnos: pričakovano instanceof ${o.expected}, prejeto ${c}`;return`Neveljaven vnos: pričakovano ${i}, prejeto ${c}`}case"invalid_value":if(o.values.length===1)return`Neveljaven vnos: pričakovano ${Y(o.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Preveliko: pričakovano, da bo ${o.origin??"vrednost"} imelo ${i}${o.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${o.origin??"vrednost"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Premajhno: pričakovano, da bo ${o.origin} imelo ${i}${o.minimum.toString()} ${s.unit}`;return`Premajhno: pričakovano, da bo ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${n[i.format]??o.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i ključi":" ključ"}: ${_(o.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}};var MU=h(()=>{ge()});function Ww(){return{localeError:yCe()}}var yCe=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(o){return e[o]??null}let n={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Ogiltig inmatning: förväntat instanceof ${o.expected}, fick ${c}`;return`Ogiltig inmatning: förväntat ${i}, fick ${c}`}case"invalid_value":if(o.values.length===1)return`Ogiltig inmatning: förväntat ${Y(o.values[0])}`;return`Ogiltigt val: förväntade en av ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`För stor(t): förväntade ${o.origin??"värdet"} att ha ${i}${o.maximum.toString()} ${s.unit??"element"}`;return`För stor(t): förväntat ${o.origin??"värdet"} att ha ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`För lite(t): förväntade ${o.origin??"värdet"} att ha ${i}${o.minimum.toString()} ${s.unit}`;return`För lite(t): förväntade ${o.origin??"värdet"} att ha ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${n[i.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${_(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${o.origin??"värdet"}`;default:return"Ogiltig input"}}};var zU=h(()=>{ge()});function Jw(){return{localeError:bCe()}}var bCe=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(o){return e[o]??null}let n={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${o.expected}, பெறப்பட்டது ${c}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i}, பெறப்பட்டது ${c}`}case"invalid_value":if(o.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Y(o.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${_(o.values,"|")} இல் ஒன்று`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${o.origin??"மதிப்பு"} ${i}${o.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${o.origin??"மதிப்பு"} ${i}${o.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${o.origin} ${i}${o.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${o.origin} ${i}${o.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${n[i.format]??o.format}`}case"not_multiple_of":return`தவறான எண்: ${o.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${o.keys.length>1?"கள்":""}: ${_(o.keys,", ")}`;case"invalid_key":return`${o.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${o.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var jU=h(()=>{ge()});function Zw(){return{localeError:ICe()}}var ICe=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(o){return e[o]??null}let n={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},r={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${o.expected} แต่ได้รับ ${c}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i} แต่ได้รับ ${c}`}case"invalid_value":if(o.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${Y(o.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(o.origin);if(s)return`เกินกำหนด: ${o.origin??"ค่า"} ควรมี${i} ${o.maximum.toString()} ${s.unit??"รายการ"}`;return`เกินกำหนด: ${o.origin??"ค่า"} ควรมี${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"อย่างน้อย":"มากกว่า",s=t(o.origin);if(s)return`น้อยกว่ากำหนด: ${o.origin} ควรมี${i} ${o.minimum.toString()} ${s.unit}`;return`น้อยกว่ากำหนด: ${o.origin} ควรมี${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${n[i.format]??o.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${o.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${_(o.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${o.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${o.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var UU=h(()=>{ge()});function Xw(){return{localeError:SCe()}}var SCe=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Geçersiz değer: beklenen instanceof ${o.expected}, alınan ${c}`;return`Geçersiz değer: beklenen ${i}, alınan ${c}`}case"invalid_value":if(o.values.length===1)return`Geçersiz değer: beklenen ${Y(o.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Çok büyük: beklenen ${o.origin??"değer"} ${i}${o.maximum.toString()} ${s.unit??"öğe"}`;return`Çok büyük: beklenen ${o.origin??"değer"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Çok küçük: beklenen ${o.origin} ${i}${o.minimum.toString()} ${s.unit}`;return`Çok küçük: beklenen ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Geçersiz metin: "${i.prefix}" ile başlamalı`;if(i.format==="ends_with")return`Geçersiz metin: "${i.suffix}" ile bitmeli`;if(i.format==="includes")return`Geçersiz metin: "${i.includes}" içermeli`;if(i.format==="regex")return`Geçersiz metin: ${i.pattern} desenine uymalı`;return`Geçersiz ${n[i.format]??o.format}`}case"not_multiple_of":return`Geçersiz sayı: ${o.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${o.keys.length>1?"lar":""}: ${_(o.keys,", ")}`;case"invalid_key":return`${o.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${o.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var FU=h(()=>{ge()});function Ud(){return{localeError:CCe()}}var CCe=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(o){return e[o]??null}let n={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},r={nan:"NaN",number:"число",array:"масив"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Неправильні вхідні дані: очікується instanceof ${o.expected}, отримано ${c}`;return`Неправильні вхідні дані: очікується ${i}, отримано ${c}`}case"invalid_value":if(o.values.length===1)return`Неправильні вхідні дані: очікується ${Y(o.values[0])}`;return`Неправильна опція: очікується одне з ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Занадто велике: очікується, що ${o.origin??"значення"} ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"елементів"}`;return`Занадто велике: очікується, що ${o.origin??"значення"} буде ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Занадто мале: очікується, що ${o.origin} ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Занадто мале: очікується, що ${o.origin} буде ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${n[i.format]??o.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${o.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${o.keys.length>1?"і":""}: ${_(o.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${o.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${o.origin}`;default:return"Неправильні вхідні дані"}}};var ek=h(()=>{ge()});function tk(){return Ud()}var $U=h(()=>{ek()});function nk(){return{localeError:vCe()}}var vCe=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(o){return e[o]??null}let n={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},r={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`غلط ان پٹ: instanceof ${o.expected} متوقع تھا، ${c} موصول ہوا`;return`غلط ان پٹ: ${i} متوقع تھا، ${c} موصول ہوا`}case"invalid_value":if(o.values.length===1)return`غلط ان پٹ: ${Y(o.values[0])} متوقع تھا`;return`غلط آپشن: ${_(o.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`بہت بڑا: ${o.origin??"ویلیو"} کے ${i}${o.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${o.origin??"ویلیو"} کا ${i}${o.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`بہت چھوٹا: ${o.origin} کے ${i}${o.minimum.toString()} ${s.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${o.origin} کا ${i}${o.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${n[i.format]??o.format}`}case"not_multiple_of":return`غلط نمبر: ${o.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${o.keys.length>1?"ز":""}: ${_(o.keys,"، ")}`;case"invalid_key":return`${o.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${o.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var GU=h(()=>{ge()});function ok(){return{localeError:ECe()}}var ECe=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(o){return e[o]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${o.expected}, qabul qilingan ${c}`;return`Noto‘g‘ri kirish: kutilgan ${i}, qabul qilingan ${c}`}case"invalid_value":if(o.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${Y(o.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Juda katta: kutilgan ${o.origin??"qiymat"} ${i}${o.maximum.toString()} ${s.unit} ${s.verb}`;return`Juda katta: kutilgan ${o.origin??"qiymat"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Juda kichik: kutilgan ${o.origin} ${i}${o.minimum.toString()} ${s.unit} ${s.verb}`;return`Juda kichik: kutilgan ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Noto‘g‘ri satr: "${i.prefix}" bilan boshlanishi kerak`;if(i.format==="ends_with")return`Noto‘g‘ri satr: "${i.suffix}" bilan tugashi kerak`;if(i.format==="includes")return`Noto‘g‘ri satr: "${i.includes}" ni o‘z ichiga olishi kerak`;if(i.format==="regex")return`Noto‘g‘ri satr: ${i.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${n[i.format]??o.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${o.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${o.keys.length>1?"lar":""}: ${_(o.keys,", ")}`;case"invalid_key":return`${o.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${o.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};var HU=h(()=>{ge()});function rk(){return{localeError:wCe()}}var wCe=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(o){return e[o]??null}let n={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},r={nan:"NaN",number:"số",array:"mảng"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${o.expected}, nhận được ${c}`;return`Đầu vào không hợp lệ: mong đợi ${i}, nhận được ${c}`}case"invalid_value":if(o.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${Y(o.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Quá lớn: mong đợi ${o.origin??"giá trị"} ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"phần tử"}`;return`Quá lớn: mong đợi ${o.origin??"giá trị"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Quá nhỏ: mong đợi ${o.origin} ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Quá nhỏ: mong đợi ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${n[i.format]??o.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${o.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${_(o.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${o.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${o.origin}`;default:return"Đầu vào không hợp lệ"}}};var qU=h(()=>{ge()});function ik(){return{localeError:kCe()}}var kCe=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(o){return e[o]??null}let n={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},r={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`无效输入:期望 instanceof ${o.expected},实际接收 ${c}`;return`无效输入:期望 ${i},实际接收 ${c}`}case"invalid_value":if(o.values.length===1)return`无效输入:期望 ${Y(o.values[0])}`;return`无效选项:期望以下之一 ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`数值过大:期望 ${o.origin??"值"} ${i}${o.maximum.toString()} ${s.unit??"个元素"}`;return`数值过大:期望 ${o.origin??"值"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`数值过小:期望 ${o.origin} ${i}${o.minimum.toString()} ${s.unit}`;return`数值过小:期望 ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${n[i.format]??o.format}`}case"not_multiple_of":return`无效数字:必须是 ${o.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${_(o.keys,", ")}`;case"invalid_key":return`${o.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${o.origin} 中包含无效值(value)`;default:return"无效输入"}}};var VU=h(()=>{ge()});function sk(){return{localeError:xCe()}}var xCe=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(o){return e[o]??null}let n={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`無效的輸入值:預期為 instanceof ${o.expected},但收到 ${c}`;return`無效的輸入值:預期為 ${i},但收到 ${c}`}case"invalid_value":if(o.values.length===1)return`無效的輸入值:預期為 ${Y(o.values[0])}`;return`無效的選項:預期為以下其中之一 ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`數值過大:預期 ${o.origin??"值"} 應為 ${i}${o.maximum.toString()} ${s.unit??"個元素"}`;return`數值過大:預期 ${o.origin??"值"} 應為 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`數值過小:預期 ${o.origin} 應為 ${i}${o.minimum.toString()} ${s.unit}`;return`數值過小:預期 ${o.origin} 應為 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${n[i.format]??o.format}`}case"not_multiple_of":return`無效的數字:必須為 ${o.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${o.keys.length>1?"們":""}:${_(o.keys,"、")}`;case"invalid_key":return`${o.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${o.origin} 中有無效的值`;default:return"無效的輸入值"}}};var KU=h(()=>{ge()});function ak(){return{localeError:PCe()}}var PCe=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(o){return e[o]??null}let n={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},r={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(o)=>{switch(o.code){case"invalid_type":{let i=r[o.expected]??o.expected,s=W(o.input),c=r[s]??s;if(/^[A-Z]/.test(o.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${o.expected}, àmọ̀ a rí ${c}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${i}, àmọ̀ a rí ${c}`}case"invalid_value":if(o.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${Y(o.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${_(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${o.origin??"iye"} ${s.verb} ${i}${o.maximum} ${s.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${o.maximum}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Kéré ju: a ní láti jẹ́ pé ${o.origin} ${s.verb} ${i}${o.minimum} ${s.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${o.minimum}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${n[i.format]??o.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${o.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${_(o.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${o.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${o.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var YU=h(()=>{ge()});var Fd={};cr(Fd,{ar:()=>gw,az:()=>mw,be:()=>hw,bg:()=>Aw,ca:()=>fw,cs:()=>yw,da:()=>bw,de:()=>Iw,en:()=>Md,eo:()=>Cw,es:()=>vw,fa:()=>Ew,fi:()=>ww,fr:()=>kw,frCA:()=>xw,he:()=>Pw,hu:()=>Rw,hy:()=>Tw,id:()=>Bw,is:()=>Ow,it:()=>_w,ja:()=>Dw,ka:()=>Qw,kh:()=>Nw,km:()=>zd,ko:()=>Mw,lt:()=>zw,mk:()=>jw,ms:()=>Uw,nl:()=>Fw,no:()=>$w,ota:()=>Gw,pl:()=>qw,ps:()=>Hw,pt:()=>Vw,ru:()=>Kw,sl:()=>Yw,sv:()=>Ww,ta:()=>Jw,th:()=>Zw,tr:()=>Xw,ua:()=>tk,uk:()=>Ud,ur:()=>nk,uz:()=>ok,vi:()=>rk,yo:()=>ak,zhCN:()=>ik,zhTW:()=>sk});var ck=h(()=>{eU();tU();oU();rU();iU();sU();aU();cU();Sw();lU();uU();dU();pU();gU();mU();hU();AU();yU();bU();IU();SU();CU();vU();EU();Lw();wU();xU();PU();RU();TU();BU();OU();_U();DU();QU();NU();MU();zU();jU();UU();FU();$U();ek();GU();HU();qU();VU();KU();YU()});class dk{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Uh(){return new dk}var WU,lk,uk,Xt;var $d=h(()=>{lk=Symbol("ZodOutput"),uk=Symbol("ZodInput");(WU=globalThis).__zod_globalRegistry??(WU.__zod_globalRegistry=Uh());Xt=globalThis.__zod_globalRegistry});function pk(e,t){return new e({type:"string",...X(t)})}function gk(e,t){return new e({type:"string",coerce:!0,...X(t)})}function Fh(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...X(t)})}function Gd(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...X(t)})}function $h(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...X(t)})}function Gh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...X(t)})}function Hh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...X(t)})}function qh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...X(t)})}function Hd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...X(t)})}function Vh(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...X(t)})}function Kh(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...X(t)})}function Yh(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...X(t)})}function Wh(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...X(t)})}function Jh(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...X(t)})}function Zh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...X(t)})}function Xh(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...X(t)})}function eA(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...X(t)})}function tA(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...X(t)})}function mk(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...X(t)})}function nA(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...X(t)})}function oA(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...X(t)})}function rA(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...X(t)})}function iA(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...X(t)})}function sA(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...X(t)})}function aA(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...X(t)})}function Ak(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...X(t)})}function fk(e,t){return new e({type:"string",format:"date",check:"string_format",...X(t)})}function yk(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...X(t)})}function bk(e,t){return new e({type:"string",format:"duration",check:"string_format",...X(t)})}function Ik(e,t){return new e({type:"number",checks:[],...X(t)})}function Sk(e,t){return new e({type:"number",coerce:!0,checks:[],...X(t)})}function Ck(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...X(t)})}function vk(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...X(t)})}function Ek(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...X(t)})}function wk(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...X(t)})}function kk(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...X(t)})}function xk(e,t){return new e({type:"boolean",...X(t)})}function Pk(e,t){return new e({type:"boolean",coerce:!0,...X(t)})}function Rk(e,t){return new e({type:"bigint",...X(t)})}function Tk(e,t){return new e({type:"bigint",coerce:!0,...X(t)})}function Bk(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...X(t)})}function Ok(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...X(t)})}function _k(e,t){return new e({type:"symbol",...X(t)})}function Dk(e,t){return new e({type:"undefined",...X(t)})}function Qk(e,t){return new e({type:"null",...X(t)})}function Lk(e){return new e({type:"any"})}function Nk(e){return new e({type:"unknown"})}function Mk(e,t){return new e({type:"never",...X(t)})}function zk(e,t){return new e({type:"void",...X(t)})}function jk(e,t){return new e({type:"date",...X(t)})}function Uk(e,t){return new e({type:"date",coerce:!0,...X(t)})}function Fk(e,t){return new e({type:"nan",...X(t)})}function pr(e,t){return new Ph({check:"less_than",...X(t),value:e,inclusive:!1})}function ro(e,t){return new Ph({check:"less_than",...X(t),value:e,inclusive:!0})}function gr(e,t){return new Rh({check:"greater_than",...X(t),value:e,inclusive:!1})}function wn(e,t){return new Rh({check:"greater_than",...X(t),value:e,inclusive:!0})}function cA(e){return gr(0,e)}function lA(e){return pr(0,e)}function uA(e){return ro(0,e)}function dA(e){return wn(0,e)}function Bi(e,t){return new Lv({check:"multiple_of",...X(t),value:e})}function Oi(e,t){return new zv({check:"max_size",...X(t),maximum:e})}function mr(e,t){return new jv({check:"min_size",...X(t),minimum:e})}function js(e,t){return new Uv({check:"size_equals",...X(t),size:e})}function Us(e,t){return new Fv({check:"max_length",...X(t),maximum:e})}function Yr(e,t){return new $v({check:"min_length",...X(t),minimum:e})}function Fs(e,t){return new Gv({check:"length_equals",...X(t),length:e})}function Ac(e,t){return new Hv({check:"string_format",format:"regex",...X(t),pattern:e})}function fc(e){return new qv({check:"string_format",format:"lowercase",...X(e)})}function yc(e){return new Vv({check:"string_format",format:"uppercase",...X(e)})}function bc(e,t){return new Kv({check:"string_format",format:"includes",...X(t),includes:e})}function Ic(e,t){return new Yv({check:"string_format",format:"starts_with",...X(t),prefix:e})}function Sc(e,t){return new Wv({check:"string_format",format:"ends_with",...X(t),suffix:e})}function pA(e,t,n){return new Jv({check:"property",property:e,schema:t,...X(n)})}function Cc(e,t){return new Zv({check:"mime_type",mime:e,...X(t)})}function $o(e){return new Xv({check:"overwrite",tx:e})}function vc(e){return $o((t)=>t.normalize(e))}function Ec(){return $o((e)=>e.trim())}function wc(){return $o((e)=>e.toLowerCase())}function kc(){return $o((e)=>e.toUpperCase())}function xc(){return $o((e)=>YC(e))}function $k(e,t,n){return new e({type:"array",element:t,...X(n)})}function TCe(e,t,n){return new e({type:"union",options:t,...X(n)})}function BCe(e,t,n){return new e({type:"union",options:t,inclusive:!1,...X(n)})}function OCe(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...X(r)})}function _Ce(e,t,n){return new e({type:"intersection",left:t,right:n})}function DCe(e,t,n,r){let o=n instanceof xe;return new e({type:"tuple",items:t,rest:o?n:null,...X(o?r:n)})}function QCe(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...X(r)})}function LCe(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...X(r)})}function NCe(e,t,n){return new e({type:"set",valueType:t,...X(n)})}function MCe(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map((o)=>[o,o])):t;return new e({type:"enum",entries:r,...X(n)})}function zCe(e,t,n){return new e({type:"enum",entries:t,...X(n)})}function jCe(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...X(n)})}function Gk(e,t){return new e({type:"file",...X(t)})}function UCe(e,t){return new e({type:"transform",transform:t})}function FCe(e,t){return new e({type:"optional",innerType:t})}function $Ce(e,t){return new e({type:"nullable",innerType:t})}function GCe(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n==="function"?n():JC(n)}})}function HCe(e,t,n){return new e({type:"nonoptional",innerType:t,...X(n)})}function qCe(e,t){return new e({type:"success",innerType:t})}function VCe(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n==="function"?n:()=>n})}function KCe(e,t,n){return new e({type:"pipe",in:t,out:n})}function YCe(e,t){return new e({type:"readonly",innerType:t})}function WCe(e,t,n){return new e({type:"template_literal",parts:t,...X(n)})}function JCe(e,t){return new e({type:"lazy",getter:t})}function ZCe(e,t){return new e({type:"promise",innerType:t})}function Hk(e,t,n){let r=X(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function qk(e,t,n){return new e({type:"custom",check:"custom",fn:t,...X(n)})}function Vk(e){let t=JU((n)=>(n.addIssue=(r)=>{if(typeof r==="string")n.issues.push(lc(r,n.value,t._zod.def));else{let o=r;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(lc(o))}},e(n.value,n)));return t}function JU(e,t){let n=new dt({check:"custom",...X(t)});return n._zod.check=e,n}function Kk(e){let t=new dt({check:"describe"});return t._zod.onattach=[(n)=>{let r=Xt.get(n)??{};Xt.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function Yk(e){let t=new dt({check:"meta"});return t._zod.onattach=[(n)=>{let r=Xt.get(n)??{};Xt.add(n,{...r,...e})}],t._zod.check=()=>{},t}function Wk(e,t){let n=X(t),r=n.truthy??["true","1","yes","on","y","enabled"],o=n.falsy??["false","0","no","off","n","disabled"];if(n.case!=="sensitive")r=r.map((m)=>typeof m==="string"?m.toLowerCase():m),o=o.map((m)=>typeof m==="string"?m.toLowerCase():m);let i=new Set(r),s=new Set(o),c=e.Codec??Nd,l=e.Boolean??Qd,d=new(e.String??zs)({type:"string",error:n.error}),p=new l({type:"boolean",error:n.error}),g=new c({type:"pipe",in:d,out:p,transform:(m,A)=>{let f=m;if(n.case!=="sensitive")f=f.toLowerCase();if(i.has(f))return!0;else if(s.has(f))return!1;else return A.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:A.value,inst:g,continue:!1}),{}},reverseTransform:(m,A)=>{if(m===!0)return r[0]||"true";else return o[0]||"false"},error:n.error});return g}function Pc(e,t,n,r={}){let o=X(r),i={...X(r),check:"string_format",type:"string",format:t,fn:typeof n==="function"?n:(c)=>n.test(c),...o};if(n instanceof RegExp)i.pattern=n;return new e(i)}var hk;var ZU=h(()=>{Th();$d();pw();ge();hk={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function _i(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Xt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ze(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,n.schemaPath.includes(e))i.cycle=n.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let g=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,g,d)}let p=e._zod.parent;if(p){if(!s.ref)s.ref=p;Ze(p,t,d),t.seen.get(p).isParent=!0}}let l=t.metadataRegistry.get(e);if(l)Object.assign(s.schema,l);if(t.io==="input"&&kn(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&s.schema._prefault)(r=s.schema).default??(r.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Di(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let l=r.get(c);if(l&&l!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,s[0])}}let o=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(s[0])?.id,g=e.external.uri??((A)=>A);if(p)return{ref:g(p)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${g("__shared")}#/${c}/${m}`}}if(s[1]===n)return{ref:"#"};let u=`${"#"}/${c}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:l,defId:u}=o(s);if(c.def={...c.schema},u)c.defId=u;let d=c.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
104
104
|
|
|
105
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref"){i(s);continue}}}}function Qi(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=(s)=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){r(d);let g=e.seen.get(d),m=g.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(m);else Object.assign(l,m);if(Object.assign(l,u),s._zod.parent===d)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(!(f in u))delete l[f]}if(m.$ref&&g.def)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(f in g.def&&JSON.stringify(l[f])===JSON.stringify(g.def[f]))delete l[f]}}let p=s._zod.parent;if(p&&p!==d){r(p);let g=e.seen.get(p);if(g?.schema.$ref){if(l.$ref=g.schema.$ref,g.def)for(let m in l){if(m==="$ref"||m==="allOf")continue;if(m in g.def&&JSON.stringify(l[m])===JSON.stringify(g.def[m]))delete l[m]}}}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())r(s[0]);let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,n.def??n.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];if(c.def&&c.defId)i[c.defId]=c.def}if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")o.$defs=i;else o.definitions=i;try{let s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rc(t,"input",e.processors),output:Rc(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch(s){throw Error("Error converting schema to JSON.")}}function kn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return kn(r.element,n);if(r.type==="set")return kn(r.valueType,n);if(r.type==="lazy")return kn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return kn(r.innerType,n);if(r.type==="intersection")return kn(r.left,n)||kn(r.right,n);if(r.type==="record"||r.type==="map")return kn(r.keyType,n)||kn(r.valueType,n);if(r.type==="pipe")return kn(r.in,n)||kn(r.out,n);if(r.type==="object"){for(let o in r.shape)if(kn(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(kn(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(kn(o,n))return!0;if(r.rest&&kn(r.rest,n))return!0;return!1}return!1}var Jk=(e,t={})=>(n)=>{let r=_i({...n,processors:t});return Ze(e,r),Di(r,e),Qi(r,e)},Rc=(e,t,n={})=>(r)=>{let{libraryOptions:o,target:i}=r??{},s=_i({...o??{},target:i,io:t,processors:n});return Ze(e,s),Di(s,e),Qi(s,e)};var qd=h(()=>{$d()});function AA(e,t){if("_idmap"in e){let r=e,o=_i({...t,processors:gA}),i={};for(let l of r._idmap.entries()){let[u,d]=l;Ze(d,o)}let s={},c={registry:r,uri:t?.uri,defs:i};o.external=c;for(let l of r._idmap.entries()){let[u,d]=l;Di(o,d),s[u]=Qi(o,d)}if(Object.keys(i).length>0){let l=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:i}}return{schemas:s}}let n=_i({...t,processors:gA});return Ze(e,n),Di(n,e),Qi(n,e)}var XCe,Zk=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=XCe[c]??c,o.format==="")delete o.format;if(c==="time")delete o.format}if(u)o.contentEncoding=u;if(l&&l.size>0){let d=[...l];if(d.length===1)o.pattern=d[0].source;else if(d.length>1)o.allOf=[...d.map((p)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))]}},Xk=(e,t,n,r)=>{let o=n,{minimum:i,maximum:s,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))o.type="integer";else o.type="number";if(typeof d==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")o.minimum=d,o.exclusiveMinimum=!0;else o.exclusiveMinimum=d;if(typeof i==="number"){if(o.minimum=i,typeof d==="number"&&t.target!=="draft-04")if(d>=i)delete o.minimum;else delete o.exclusiveMinimum}if(typeof u==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")o.maximum=u,o.exclusiveMaximum=!0;else o.exclusiveMaximum=u;if(typeof s==="number"){if(o.maximum=s,typeof u==="number"&&t.target!=="draft-04")if(u<=s)delete o.maximum;else delete o.exclusiveMaximum}if(typeof l==="number")o.multipleOf=l},ex=(e,t,n,r)=>{n.type="boolean"},tx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},nx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},ox=(e,t,n,r)=>{if(t.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},rx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},ix=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},sx=(e,t,n,r)=>{n.not={}},ax=(e,t,n,r)=>{},cx=(e,t,n,r)=>{},lx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},ux=(e,t,n,r)=>{let o=e._zod.def,i=Ed(o.entries);if(i.every((s)=>typeof s==="number"))n.type="number";if(i.every((s)=>typeof s==="string"))n.type="string";n.enum=i},dx=(e,t,n,r)=>{let o=e._zod.def,i=[];for(let s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(s));else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")n.enum=[s];else n.const=s}else{if(i.every((s)=>typeof s==="number"))n.type="number";if(i.every((s)=>typeof s==="string"))n.type="string";if(i.every((s)=>typeof s==="boolean"))n.type="boolean";if(i.every((s)=>s===null))n.type="null";n.enum=i}},px=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},gx=(e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},mx=(e,t,n,r)=>{let o=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:l}=e._zod.bag;if(s!==void 0)i.minLength=s;if(c!==void 0)i.maxLength=c;if(l)if(l.length===1)i.contentMediaType=l[0],Object.assign(o,i);else Object.assign(o,i),o.anyOf=l.map((u)=>({contentMediaType:u}));else Object.assign(o,i)},hx=(e,t,n,r)=>{n.type="boolean"},Ax=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},fx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},yx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},bx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Ix=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Sx=(e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=Ze(i.element,t,{...r,path:[...r.path,"items"]})},Cx=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object",o.properties={};let s=i.shape;for(let u in s)o.properties[u]=Ze(s[u],t,{...r,path:[...r.path,"properties",u]});let c=new Set(Object.keys(s)),l=new Set([...c].filter((u)=>{let d=i.shape[u]._zod;if(t.io==="input")return d.optin===void 0;else return d.optout===void 0}));if(l.size>0)o.required=Array.from(l);if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=Ze(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})},mA=(e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,l)=>Ze(c,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));if(i)n.oneOf=s;else n.anyOf=s},vx=(e,t,n,r)=>{let o=e._zod.def,i=Ze(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Ze(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=(u)=>("allOf"in u)&&Object.keys(u).length===1,l=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];n.allOf=l},Ex=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((g,m)=>Ze(g,t,{...r,path:[...r.path,s,m]})),u=i.rest?Ze(i.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(o.prefixItems=l,u)o.items=u}else if(t.target==="openapi-3.0"){if(o.items={anyOf:l},u)o.items.anyOf.push(u);if(o.minItems=l.length,!u)o.maxItems=l.length}else if(o.items=l,u)o.additionalItems=u;let{minimum:d,maximum:p}=e._zod.bag;if(typeof d==="number")o.minItems=d;if(typeof p==="number")o.maxItems=p},wx=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let d=Ze(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let p of l)o.patternProperties[p.source]=d}else{if(t.target==="draft-07"||t.target==="draft-2020-12")o.propertyNames=Ze(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});o.additionalProperties=Ze(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=s._zod.values;if(u){let d=[...u].filter((p)=>typeof p==="string"||typeof p==="number");if(d.length>0)o.required=d}},kx=(e,t,n,r)=>{let o=e._zod.def,i=Ze(o.innerType,t,r),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,n.nullable=!0;else n.anyOf=[i,{type:"null"}]},xx=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Px=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Rx=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);if(i.ref=o.innerType,t.io==="input")n._prefault=JSON.parse(JSON.stringify(o.defaultValue))},Tx=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Bx=(e,t,n,r)=>{let o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ze(i,t,r);let s=t.seen.get(e);s.ref=i},Ox=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},_x=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},hA=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Dx=(e,t,n,r)=>{let o=e._zod.innerType;Ze(o,t,r);let i=t.seen.get(e);i.ref=o},gA;var Vd=h(()=>{qd();ge();XCe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gA={string:Zk,number:Xk,boolean:ex,bigint:tx,symbol:nx,null:ox,undefined:rx,void:ix,never:sx,any:ax,unknown:cx,date:lx,enum:ux,literal:dx,nan:px,template_literal:gx,file:mx,success:hx,custom:Ax,function:fx,transform:yx,map:bx,set:Ix,array:Sx,object:Cx,union:mA,intersection:vx,tuple:Ex,record:wx,nullable:kx,nonoptional:xx,default:Px,prefault:Rx,catch:Tx,pipe:Bx,readonly:Ox,promise:_x,optional:hA,lazy:Dx}});class Qx{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=_i({processors:gA,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Ze(e,this.ctx,t)}emit(e,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}Di(this.ctx,e);let n=Qi(this.ctx,e),{"~standard":r,...o}=n;return o}}var XU=h(()=>{Vd();qd()});var eF={};var tF=()=>{};var Wr={};cr(Wr,{$ZodAny:()=>DE,$ZodArray:()=>zE,$ZodAsyncError:()=>dr,$ZodBase64:()=>EE,$ZodBase64URL:()=>wE,$ZodBigInt:()=>Mh,$ZodBigIntFormat:()=>TE,$ZodBoolean:()=>Qd,$ZodCIDRv4:()=>SE,$ZodCIDRv6:()=>CE,$ZodCUID:()=>lE,$ZodCUID2:()=>uE,$ZodCatch:()=>ow,$ZodCheck:()=>dt,$ZodCheckBigIntFormat:()=>Mv,$ZodCheckEndsWith:()=>Wv,$ZodCheckGreaterThan:()=>Rh,$ZodCheckIncludes:()=>Kv,$ZodCheckLengthEquals:()=>Gv,$ZodCheckLessThan:()=>Ph,$ZodCheckLowerCase:()=>qv,$ZodCheckMaxLength:()=>Fv,$ZodCheckMaxSize:()=>zv,$ZodCheckMimeType:()=>Zv,$ZodCheckMinLength:()=>$v,$ZodCheckMinSize:()=>jv,$ZodCheckMultipleOf:()=>Lv,$ZodCheckNumberFormat:()=>Nv,$ZodCheckOverwrite:()=>Xv,$ZodCheckProperty:()=>Jv,$ZodCheckRegex:()=>Hv,$ZodCheckSizeEquals:()=>Uv,$ZodCheckStartsWith:()=>Yv,$ZodCheckStringFormat:()=>mc,$ZodCheckUpperCase:()=>Vv,$ZodCodec:()=>Nd,$ZodCustom:()=>dw,$ZodCustomStringFormat:()=>PE,$ZodDate:()=>ME,$ZodDefault:()=>XE,$ZodDiscriminatedUnion:()=>FE,$ZodE164:()=>kE,$ZodEmail:()=>iE,$ZodEmoji:()=>aE,$ZodEncodeError:()=>Ls,$ZodEnum:()=>VE,$ZodError:()=>Rd,$ZodExactOptional:()=>JE,$ZodFile:()=>YE,$ZodFunction:()=>cw,$ZodGUID:()=>oE,$ZodIPv4:()=>yE,$ZodIPv6:()=>bE,$ZodISODate:()=>hE,$ZodISODateTime:()=>mE,$ZodISODuration:()=>fE,$ZodISOTime:()=>AE,$ZodIntersection:()=>$E,$ZodJWT:()=>xE,$ZodKSUID:()=>gE,$ZodLazy:()=>uw,$ZodLiteral:()=>KE,$ZodMAC:()=>IE,$ZodMap:()=>HE,$ZodNaN:()=>rw,$ZodNanoID:()=>cE,$ZodNever:()=>LE,$ZodNonOptional:()=>tw,$ZodNull:()=>_E,$ZodNullable:()=>ZE,$ZodNumber:()=>Nh,$ZodNumberFormat:()=>RE,$ZodObject:()=>Xj,$ZodObjectJIT:()=>jE,$ZodOptional:()=>jh,$ZodPipe:()=>iw,$ZodPrefault:()=>ew,$ZodPromise:()=>lw,$ZodReadonly:()=>sw,$ZodRealError:()=>zn,$ZodRecord:()=>GE,$ZodRegistry:()=>dk,$ZodSet:()=>qE,$ZodString:()=>zs,$ZodStringFormat:()=>at,$ZodSuccess:()=>nw,$ZodSymbol:()=>BE,$ZodTemplateLiteral:()=>aw,$ZodTransform:()=>WE,$ZodTuple:()=>zh,$ZodType:()=>xe,$ZodULID:()=>dE,$ZodURL:()=>sE,$ZodUUID:()=>rE,$ZodUndefined:()=>OE,$ZodUnion:()=>Ld,$ZodUnknown:()=>QE,$ZodVoid:()=>NE,$ZodXID:()=>pE,$ZodXor:()=>UE,$brand:()=>qC,$constructor:()=>R,$input:()=>uk,$output:()=>lk,Doc:()=>Bh,JSONSchema:()=>eF,JSONSchemaGenerator:()=>Qx,NEVER:()=>Cd,TimePrecision:()=>hk,_any:()=>Lk,_array:()=>$k,_base64:()=>rA,_base64url:()=>iA,_bigint:()=>Rk,_boolean:()=>xk,_catch:()=>VCe,_check:()=>JU,_cidrv4:()=>nA,_cidrv6:()=>oA,_coercedBigint:()=>Tk,_coercedBoolean:()=>Pk,_coercedDate:()=>Uk,_coercedNumber:()=>Sk,_coercedString:()=>gk,_cuid:()=>Yh,_cuid2:()=>Wh,_custom:()=>Hk,_date:()=>jk,_decode:()=>bh,_decodeAsync:()=>Sh,_default:()=>GCe,_discriminatedUnion:()=>OCe,_e164:()=>sA,_email:()=>Fh,_emoji:()=>Vh,_encode:()=>yh,_encodeAsync:()=>Ih,_endsWith:()=>Sc,_enum:()=>MCe,_file:()=>Gk,_float32:()=>vk,_float64:()=>Ek,_gt:()=>gr,_gte:()=>wn,_guid:()=>Gd,_includes:()=>bc,_int:()=>Ck,_int32:()=>wk,_int64:()=>Bk,_intersection:()=>_Ce,_ipv4:()=>eA,_ipv6:()=>tA,_isoDate:()=>fk,_isoDateTime:()=>Ak,_isoDuration:()=>bk,_isoTime:()=>yk,_jwt:()=>aA,_ksuid:()=>Xh,_lazy:()=>JCe,_length:()=>Fs,_literal:()=>jCe,_lowercase:()=>fc,_lt:()=>pr,_lte:()=>ro,_mac:()=>mk,_map:()=>LCe,_max:()=>ro,_maxLength:()=>Us,_maxSize:()=>Oi,_mime:()=>Cc,_min:()=>wn,_minLength:()=>Yr,_minSize:()=>mr,_multipleOf:()=>Bi,_nan:()=>Fk,_nanoid:()=>Kh,_nativeEnum:()=>zCe,_negative:()=>lA,_never:()=>Mk,_nonnegative:()=>dA,_nonoptional:()=>HCe,_nonpositive:()=>uA,_normalize:()=>vc,_null:()=>Qk,_nullable:()=>$Ce,_number:()=>Ik,_optional:()=>FCe,_overwrite:()=>$o,_parse:()=>uc,_parseAsync:()=>dc,_pipe:()=>KCe,_positive:()=>cA,_promise:()=>ZCe,_property:()=>pA,_readonly:()=>YCe,_record:()=>QCe,_refine:()=>qk,_regex:()=>Ac,_safeDecode:()=>vh,_safeDecodeAsync:()=>wh,_safeEncode:()=>Ch,_safeEncodeAsync:()=>Eh,_safeParse:()=>pc,_safeParseAsync:()=>gc,_set:()=>NCe,_size:()=>js,_slugify:()=>xc,_startsWith:()=>Ic,_string:()=>pk,_stringFormat:()=>Pc,_stringbool:()=>Wk,_success:()=>qCe,_superRefine:()=>Vk,_symbol:()=>_k,_templateLiteral:()=>WCe,_toLowerCase:()=>wc,_toUpperCase:()=>kc,_transform:()=>UCe,_trim:()=>Ec,_tuple:()=>DCe,_uint32:()=>kk,_uint64:()=>Ok,_ulid:()=>Jh,_undefined:()=>Dk,_union:()=>TCe,_unknown:()=>Nk,_uppercase:()=>yc,_url:()=>Hd,_uuid:()=>$h,_uuidv4:()=>Gh,_uuidv6:()=>Hh,_uuidv7:()=>qh,_void:()=>zk,_xid:()=>Zh,_xor:()=>BCe,clone:()=>En,config:()=>Rt,createStandardJSONSchemaMethod:()=>Rc,createToJSONSchemaMethod:()=>Jk,decode:()=>tSe,decodeAsync:()=>oSe,describe:()=>Kk,encode:()=>eSe,encodeAsync:()=>nSe,extractDefs:()=>Di,finalize:()=>Qi,flattenError:()=>Td,formatError:()=>Bd,globalConfig:()=>Sd,globalRegistry:()=>Xt,initializeContext:()=>_i,isValidBase64:()=>vE,isValidBase64URL:()=>Yj,isValidJWT:()=>Wj,locales:()=>Fd,meta:()=>Yk,parse:()=>Ah,parseAsync:()=>fh,prettifyError:()=>ov,process:()=>Ze,regexes:()=>Co,registry:()=>Uh,safeDecode:()=>iSe,safeDecodeAsync:()=>aSe,safeEncode:()=>rSe,safeEncodeAsync:()=>sSe,safeParse:()=>iv,safeParseAsync:()=>sv,toDotPath:()=>Bj,toJSONSchema:()=>AA,treeifyError:()=>nv,util:()=>J,version:()=>eE});var io=h(()=>{ge();xh();ck();Vd();XU();tF();sc();av();rv();pw();Th();tE();$d();ZU();qd()});var fA={};cr(fA,{endsWith:()=>Sc,gt:()=>gr,gte:()=>wn,includes:()=>bc,length:()=>Fs,lowercase:()=>fc,lt:()=>pr,lte:()=>ro,maxLength:()=>Us,maxSize:()=>Oi,mime:()=>Cc,minLength:()=>Yr,minSize:()=>mr,multipleOf:()=>Bi,negative:()=>lA,nonnegative:()=>dA,nonpositive:()=>uA,normalize:()=>vc,overwrite:()=>$o,positive:()=>cA,property:()=>pA,regex:()=>Ac,size:()=>js,slugify:()=>xc,startsWith:()=>Ic,toLowerCase:()=>wc,toUpperCase:()=>kc,trim:()=>Ec,uppercase:()=>yc});var yA=h(()=>{io()});var Li={};cr(Li,{ZodISODate:()=>IA,ZodISODateTime:()=>bA,ZodISODuration:()=>CA,ZodISOTime:()=>SA,date:()=>Nx,datetime:()=>Lx,duration:()=>zx,time:()=>Mx});function Lx(e){return Ak(bA,e)}function Nx(e){return fk(IA,e)}function Mx(e){return yk(SA,e)}function zx(e){return bk(CA,e)}var bA,IA,SA,CA;var Kd=h(()=>{io();Wd();bA=R("ZodISODateTime",(e,t)=>{mE.init(e,t),ct.init(e,t)});IA=R("ZodISODate",(e,t)=>{hE.init(e,t),ct.init(e,t)});SA=R("ZodISOTime",(e,t)=>{AE.init(e,t),ct.init(e,t)});CA=R("ZodISODuration",(e,t)=>{fE.init(e,t),ct.init(e,t)})});var nF=(e,t)=>{Rd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>Bd(e,n)},flatten:{value:(n)=>Td(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ac,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ac,2)}},isEmpty:{get(){return e.issues.length===0}}})},tve,jn;var jx=h(()=>{io();io();ge();tve=R("ZodError",nF),jn=R("ZodError",nF,{Parent:Error})});var Ux,Fx,$x,Gx,Hx,qx,Vx,Kx,Yx,Wx,Jx,Zx;var Xx=h(()=>{io();jx();Ux=uc(jn),Fx=dc(jn),$x=pc(jn),Gx=gc(jn),Hx=yh(jn),qx=bh(jn),Vx=Ih(jn),Kx=Sh(jn),Yx=Ch(jn),Wx=vh(jn),Jx=Eh(jn),Zx=wh(jn)});var Yd={};cr(Yd,{ZodAny:()=>rP,ZodArray:()=>cP,ZodBase64:()=>MA,ZodBase64URL:()=>zA,ZodBigInt:()=>Qc,ZodBigIntFormat:()=>FA,ZodBoolean:()=>Dc,ZodCIDRv4:()=>LA,ZodCIDRv6:()=>NA,ZodCUID:()=>RA,ZodCUID2:()=>TA,ZodCatch:()=>PP,ZodCodec:()=>YA,ZodCustom:()=>ap,ZodCustomStringFormat:()=>Oc,ZodDate:()=>np,ZodDefault:()=>CP,ZodDiscriminatedUnion:()=>uP,ZodE164:()=>jA,ZodEmail:()=>wA,ZodEmoji:()=>xA,ZodEnum:()=>Tc,ZodExactOptional:()=>bP,ZodFile:()=>fP,ZodFunction:()=>NP,ZodGUID:()=>Jd,ZodIPv4:()=>DA,ZodIPv6:()=>QA,ZodIntersection:()=>dP,ZodJWT:()=>UA,ZodKSUID:()=>_A,ZodLazy:()=>DP,ZodLiteral:()=>AP,ZodMAC:()=>eP,ZodMap:()=>mP,ZodNaN:()=>TP,ZodNanoID:()=>PA,ZodNever:()=>sP,ZodNonOptional:()=>VA,ZodNull:()=>oP,ZodNullable:()=>SP,ZodNumber:()=>_c,ZodNumberFormat:()=>$s,ZodObject:()=>op,ZodOptional:()=>qA,ZodPipe:()=>KA,ZodPrefault:()=>EP,ZodPromise:()=>LP,ZodReadonly:()=>BP,ZodRecord:()=>sp,ZodSet:()=>hP,ZodString:()=>Bc,ZodStringFormat:()=>ct,ZodSuccess:()=>xP,ZodSymbol:()=>tP,ZodTemplateLiteral:()=>_P,ZodTransform:()=>yP,ZodTuple:()=>pP,ZodType:()=>_e,ZodULID:()=>BA,ZodURL:()=>ep,ZodUUID:()=>hr,ZodUndefined:()=>nP,ZodUnion:()=>rp,ZodUnknown:()=>iP,ZodVoid:()=>aP,ZodXID:()=>OA,ZodXor:()=>lP,_ZodString:()=>EA,_default:()=>vP,_function:()=>n$,any:()=>$A,array:()=>ee,base64:()=>CF,base64url:()=>vF,bigint:()=>DF,boolean:()=>Xe,catch:()=>RP,check:()=>o$,cidrv4:()=>IF,cidrv6:()=>SF,codec:()=>XF,cuid:()=>pF,cuid2:()=>gF,custom:()=>WA,date:()=>jF,describe:()=>r$,discriminatedUnion:()=>ip,e164:()=>EF,email:()=>oF,emoji:()=>uF,enum:()=>en,exactOptional:()=>IP,file:()=>YF,float32:()=>TF,float64:()=>BF,function:()=>n$,guid:()=>rF,hash:()=>RF,hex:()=>PF,hostname:()=>xF,httpUrl:()=>lF,instanceof:()=>s$,int:()=>vA,int32:()=>OF,int64:()=>QF,intersection:()=>Lc,ipv4:()=>fF,ipv6:()=>bF,json:()=>c$,jwt:()=>wF,keyof:()=>UF,ksuid:()=>AF,lazy:()=>QP,literal:()=>ue,looseObject:()=>Tt,looseRecord:()=>HF,mac:()=>yF,map:()=>qF,meta:()=>i$,nan:()=>ZF,nanoid:()=>dF,nativeEnum:()=>KF,never:()=>GA,nonoptional:()=>kP,null:()=>tp,nullable:()=>Zd,nullish:()=>WF,number:()=>je,object:()=>ne,optional:()=>pt,partialRecord:()=>GF,pipe:()=>Xd,prefault:()=>wP,preprocess:()=>cp,promise:()=>t$,readonly:()=>OP,record:()=>tt,refine:()=>MP,set:()=>VF,strictObject:()=>FF,string:()=>k,stringFormat:()=>kF,stringbool:()=>a$,success:()=>JF,superRefine:()=>zP,symbol:()=>NF,templateLiteral:()=>e$,transform:()=>HA,tuple:()=>gP,uint32:()=>_F,uint64:()=>LF,ulid:()=>mF,undefined:()=>MF,union:()=>ut,unknown:()=>lt,url:()=>kA,uuid:()=>iF,uuidv4:()=>sF,uuidv6:()=>aF,uuidv7:()=>cF,void:()=>zF,xid:()=>hF,xor:()=>$F});function k(e){return pk(Bc,e)}function oF(e){return Fh(wA,e)}function rF(e){return Gd(Jd,e)}function iF(e){return $h(hr,e)}function sF(e){return Gh(hr,e)}function aF(e){return Hh(hr,e)}function cF(e){return qh(hr,e)}function kA(e){return Hd(ep,e)}function lF(e){return Hd(ep,{protocol:/^https?$/,hostname:Co.domain,...J.normalizeParams(e)})}function uF(e){return Vh(xA,e)}function dF(e){return Kh(PA,e)}function pF(e){return Yh(RA,e)}function gF(e){return Wh(TA,e)}function mF(e){return Jh(BA,e)}function hF(e){return Zh(OA,e)}function AF(e){return Xh(_A,e)}function fF(e){return eA(DA,e)}function yF(e){return mk(eP,e)}function bF(e){return tA(QA,e)}function IF(e){return nA(LA,e)}function SF(e){return oA(NA,e)}function CF(e){return rA(MA,e)}function vF(e){return iA(zA,e)}function EF(e){return sA(jA,e)}function wF(e){return aA(UA,e)}function kF(e,t,n={}){return Pc(Oc,e,t,n)}function xF(e){return Pc(Oc,"hostname",Co.hostname,e)}function PF(e){return Pc(Oc,"hex",Co.hex,e)}function RF(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,o=Co[r];if(!o)throw Error(`Unrecognized hash format: ${r}`);return Pc(Oc,r,o,t)}function je(e){return Ik(_c,e)}function vA(e){return Ck($s,e)}function TF(e){return vk($s,e)}function BF(e){return Ek($s,e)}function OF(e){return wk($s,e)}function _F(e){return kk($s,e)}function Xe(e){return xk(Dc,e)}function DF(e){return Rk(Qc,e)}function QF(e){return Bk(FA,e)}function LF(e){return Ok(FA,e)}function NF(e){return _k(tP,e)}function MF(e){return Dk(nP,e)}function tp(e){return Qk(oP,e)}function $A(){return Lk(rP)}function lt(){return Nk(iP)}function GA(e){return Mk(sP,e)}function zF(e){return zk(aP,e)}function jF(e){return jk(np,e)}function ee(e,t){return $k(cP,e,t)}function UF(e){let t=e._zod.def.shape;return en(Object.keys(t))}function ne(e,t){let n={type:"object",shape:e??{},...J.normalizeParams(t)};return new op(n)}function FF(e,t){return new op({type:"object",shape:e,catchall:GA(),...J.normalizeParams(t)})}function Tt(e,t){return new op({type:"object",shape:e,catchall:lt(),...J.normalizeParams(t)})}function ut(e,t){return new rp({type:"union",options:e,...J.normalizeParams(t)})}function $F(e,t){return new lP({type:"union",options:e,inclusive:!1,...J.normalizeParams(t)})}function ip(e,t,n){return new uP({type:"union",options:t,discriminator:e,...J.normalizeParams(n)})}function Lc(e,t){return new dP({type:"intersection",left:e,right:t})}function gP(e,t,n){let r=t instanceof xe,o=r?n:t;return new pP({type:"tuple",items:e,rest:r?t:null,...J.normalizeParams(o)})}function tt(e,t,n){return new sp({type:"record",keyType:e,valueType:t,...J.normalizeParams(n)})}function GF(e,t,n){let r=En(e);return r._zod.values=void 0,new sp({type:"record",keyType:r,valueType:t,...J.normalizeParams(n)})}function HF(e,t,n){return new sp({type:"record",keyType:e,valueType:t,mode:"loose",...J.normalizeParams(n)})}function qF(e,t,n){return new mP({type:"map",keyType:e,valueType:t,...J.normalizeParams(n)})}function VF(e,t){return new hP({type:"set",valueType:e,...J.normalizeParams(t)})}function en(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((r)=>[r,r])):e;return new Tc({type:"enum",entries:n,...J.normalizeParams(t)})}function KF(e,t){return new Tc({type:"enum",entries:e,...J.normalizeParams(t)})}function ue(e,t){return new AP({type:"literal",values:Array.isArray(e)?e:[e],...J.normalizeParams(t)})}function YF(e){return Gk(fP,e)}function HA(e){return new yP({type:"transform",transform:e})}function pt(e){return new qA({type:"optional",innerType:e})}function IP(e){return new bP({type:"optional",innerType:e})}function Zd(e){return new SP({type:"nullable",innerType:e})}function WF(e){return pt(Zd(e))}function vP(e,t){return new CP({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():J.shallowClone(t)}})}function wP(e,t){return new EP({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():J.shallowClone(t)}})}function kP(e,t){return new VA({type:"nonoptional",innerType:e,...J.normalizeParams(t)})}function JF(e){return new xP({type:"success",innerType:e})}function RP(e,t){return new PP({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}function ZF(e){return Fk(TP,e)}function Xd(e,t){return new KA({type:"pipe",in:e,out:t})}function XF(e,t,n){return new YA({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function OP(e){return new BP({type:"readonly",innerType:e})}function e$(e,t){return new _P({type:"template_literal",parts:e,...J.normalizeParams(t)})}function QP(e){return new DP({type:"lazy",getter:e})}function t$(e){return new LP({type:"promise",innerType:e})}function n$(e){return new NP({type:"function",input:Array.isArray(e?.input)?gP(e?.input):e?.input??ee(lt()),output:e?.output??lt()})}function o$(e){let t=new dt({check:"custom"});return t._zod.check=e,t}function WA(e,t){return Hk(ap,e??(()=>!0),t)}function MP(e,t={}){return qk(ap,e,t)}function zP(e){return Vk(e)}function s$(e,t={}){let n=new ap({type:"custom",check:"custom",fn:(r)=>r instanceof e,abort:!0,...J.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=(r)=>{if(!(r.value instanceof e))r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function c$(e){let t=QP(()=>ut([k(e),je(),Xe(),tp(),ee(t),tt(k(),t)]));return t}function cp(e,t){return Xd(HA(e),t)}var _e,EA,Bc,ct,wA,Jd,hr,ep,xA,PA,RA,TA,BA,OA,_A,DA,eP,QA,LA,NA,MA,zA,jA,UA,Oc,_c,$s,Dc,Qc,FA,tP,nP,oP,rP,iP,sP,aP,np,cP,op,rp,lP,uP,dP,pP,sp,mP,hP,Tc,AP,fP,yP,qA,bP,SP,CP,EP,VA,xP,PP,TP,KA,YA,BP,_P,DP,LP,NP,ap,r$,i$,a$=(...e)=>Wk({Codec:YA,Boolean:Dc,String:Bc},...e);var Wd=h(()=>{io();io();Vd();qd();yA();Kd();Xx();_e=R("ZodType",(e,t)=>(xe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rc(e,"input"),output:Rc(e,"output")}}),e.toJSONSchema=Jk(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(J.mergeDefs(t,{checks:[...t.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>En(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>Ux(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$x(e,n,r),e.parseAsync=async(n,r)=>Fx(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Gx(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Hx(e,n,r),e.decode=(n,r)=>qx(e,n,r),e.encodeAsync=async(n,r)=>Vx(e,n,r),e.decodeAsync=async(n,r)=>Kx(e,n,r),e.safeEncode=(n,r)=>Yx(e,n,r),e.safeDecode=(n,r)=>Wx(e,n,r),e.safeEncodeAsync=async(n,r)=>Jx(e,n,r),e.safeDecodeAsync=async(n,r)=>Zx(e,n,r),e.refine=(n,r)=>e.check(MP(n,r)),e.superRefine=(n)=>e.check(zP(n)),e.overwrite=(n)=>e.check($o(n)),e.optional=()=>pt(e),e.exactOptional=()=>IP(e),e.nullable=()=>Zd(e),e.nullish=()=>pt(Zd(e)),e.nonoptional=(n)=>kP(e,n),e.array=()=>ee(e),e.or=(n)=>ut([e,n]),e.and=(n)=>Lc(e,n),e.transform=(n)=>Xd(e,HA(n)),e.default=(n)=>vP(e,n),e.prefault=(n)=>wP(e,n),e.catch=(n)=>RP(e,n),e.pipe=(n)=>Xd(e,n),e.readonly=()=>OP(e),e.describe=(n)=>{let r=e.clone();return Xt.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Xt.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Xt.get(e);let r=e.clone();return Xt.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=(n)=>n(e),e)),EA=R("_ZodString",(e,t)=>{zs.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Zk(e,r,o,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Ac(...r)),e.includes=(...r)=>e.check(bc(...r)),e.startsWith=(...r)=>e.check(Ic(...r)),e.endsWith=(...r)=>e.check(Sc(...r)),e.min=(...r)=>e.check(Yr(...r)),e.max=(...r)=>e.check(Us(...r)),e.length=(...r)=>e.check(Fs(...r)),e.nonempty=(...r)=>e.check(Yr(1,...r)),e.lowercase=(r)=>e.check(fc(r)),e.uppercase=(r)=>e.check(yc(r)),e.trim=()=>e.check(Ec()),e.normalize=(...r)=>e.check(vc(...r)),e.toLowerCase=()=>e.check(wc()),e.toUpperCase=()=>e.check(kc()),e.slugify=()=>e.check(xc())}),Bc=R("ZodString",(e,t)=>{zs.init(e,t),EA.init(e,t),e.email=(n)=>e.check(Fh(wA,n)),e.url=(n)=>e.check(Hd(ep,n)),e.jwt=(n)=>e.check(aA(UA,n)),e.emoji=(n)=>e.check(Vh(xA,n)),e.guid=(n)=>e.check(Gd(Jd,n)),e.uuid=(n)=>e.check($h(hr,n)),e.uuidv4=(n)=>e.check(Gh(hr,n)),e.uuidv6=(n)=>e.check(Hh(hr,n)),e.uuidv7=(n)=>e.check(qh(hr,n)),e.nanoid=(n)=>e.check(Kh(PA,n)),e.guid=(n)=>e.check(Gd(Jd,n)),e.cuid=(n)=>e.check(Yh(RA,n)),e.cuid2=(n)=>e.check(Wh(TA,n)),e.ulid=(n)=>e.check(Jh(BA,n)),e.base64=(n)=>e.check(rA(MA,n)),e.base64url=(n)=>e.check(iA(zA,n)),e.xid=(n)=>e.check(Zh(OA,n)),e.ksuid=(n)=>e.check(Xh(_A,n)),e.ipv4=(n)=>e.check(eA(DA,n)),e.ipv6=(n)=>e.check(tA(QA,n)),e.cidrv4=(n)=>e.check(nA(LA,n)),e.cidrv6=(n)=>e.check(oA(NA,n)),e.e164=(n)=>e.check(sA(jA,n)),e.datetime=(n)=>e.check(Lx(n)),e.date=(n)=>e.check(Nx(n)),e.time=(n)=>e.check(Mx(n)),e.duration=(n)=>e.check(zx(n))});ct=R("ZodStringFormat",(e,t)=>{at.init(e,t),EA.init(e,t)}),wA=R("ZodEmail",(e,t)=>{iE.init(e,t),ct.init(e,t)});Jd=R("ZodGUID",(e,t)=>{oE.init(e,t),ct.init(e,t)});hr=R("ZodUUID",(e,t)=>{rE.init(e,t),ct.init(e,t)});ep=R("ZodURL",(e,t)=>{sE.init(e,t),ct.init(e,t)});xA=R("ZodEmoji",(e,t)=>{aE.init(e,t),ct.init(e,t)});PA=R("ZodNanoID",(e,t)=>{cE.init(e,t),ct.init(e,t)});RA=R("ZodCUID",(e,t)=>{lE.init(e,t),ct.init(e,t)});TA=R("ZodCUID2",(e,t)=>{uE.init(e,t),ct.init(e,t)});BA=R("ZodULID",(e,t)=>{dE.init(e,t),ct.init(e,t)});OA=R("ZodXID",(e,t)=>{pE.init(e,t),ct.init(e,t)});_A=R("ZodKSUID",(e,t)=>{gE.init(e,t),ct.init(e,t)});DA=R("ZodIPv4",(e,t)=>{yE.init(e,t),ct.init(e,t)});eP=R("ZodMAC",(e,t)=>{IE.init(e,t),ct.init(e,t)});QA=R("ZodIPv6",(e,t)=>{bE.init(e,t),ct.init(e,t)});LA=R("ZodCIDRv4",(e,t)=>{SE.init(e,t),ct.init(e,t)});NA=R("ZodCIDRv6",(e,t)=>{CE.init(e,t),ct.init(e,t)});MA=R("ZodBase64",(e,t)=>{EE.init(e,t),ct.init(e,t)});zA=R("ZodBase64URL",(e,t)=>{wE.init(e,t),ct.init(e,t)});jA=R("ZodE164",(e,t)=>{kE.init(e,t),ct.init(e,t)});UA=R("ZodJWT",(e,t)=>{xE.init(e,t),ct.init(e,t)});Oc=R("ZodCustomStringFormat",(e,t)=>{PE.init(e,t),ct.init(e,t)});_c=R("ZodNumber",(e,t)=>{Nh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Xk(e,r,o,i),e.gt=(r,o)=>e.check(gr(r,o)),e.gte=(r,o)=>e.check(wn(r,o)),e.min=(r,o)=>e.check(wn(r,o)),e.lt=(r,o)=>e.check(pr(r,o)),e.lte=(r,o)=>e.check(ro(r,o)),e.max=(r,o)=>e.check(ro(r,o)),e.int=(r)=>e.check(vA(r)),e.safe=(r)=>e.check(vA(r)),e.positive=(r)=>e.check(gr(0,r)),e.nonnegative=(r)=>e.check(wn(0,r)),e.negative=(r)=>e.check(pr(0,r)),e.nonpositive=(r)=>e.check(ro(0,r)),e.multipleOf=(r,o)=>e.check(Bi(r,o)),e.step=(r,o)=>e.check(Bi(r,o)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});$s=R("ZodNumberFormat",(e,t)=>{RE.init(e,t),_c.init(e,t)});Dc=R("ZodBoolean",(e,t)=>{Qd.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ex(e,n,r,o)});Qc=R("ZodBigInt",(e,t)=>{Mh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>tx(e,r,o,i),e.gte=(r,o)=>e.check(wn(r,o)),e.min=(r,o)=>e.check(wn(r,o)),e.gt=(r,o)=>e.check(gr(r,o)),e.gte=(r,o)=>e.check(wn(r,o)),e.min=(r,o)=>e.check(wn(r,o)),e.lt=(r,o)=>e.check(pr(r,o)),e.lte=(r,o)=>e.check(ro(r,o)),e.max=(r,o)=>e.check(ro(r,o)),e.positive=(r)=>e.check(gr(BigInt(0),r)),e.negative=(r)=>e.check(pr(BigInt(0),r)),e.nonpositive=(r)=>e.check(ro(BigInt(0),r)),e.nonnegative=(r)=>e.check(wn(BigInt(0),r)),e.multipleOf=(r,o)=>e.check(Bi(r,o));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});FA=R("ZodBigIntFormat",(e,t)=>{TE.init(e,t),Qc.init(e,t)});tP=R("ZodSymbol",(e,t)=>{BE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nx(e,n,r,o)});nP=R("ZodUndefined",(e,t)=>{OE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rx(e,n,r,o)});oP=R("ZodNull",(e,t)=>{_E.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ox(e,n,r,o)});rP=R("ZodAny",(e,t)=>{DE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ax(e,n,r,o)});iP=R("ZodUnknown",(e,t)=>{QE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cx(e,n,r,o)});sP=R("ZodNever",(e,t)=>{LE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sx(e,n,r,o)});aP=R("ZodVoid",(e,t)=>{NE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ix(e,n,r,o)});np=R("ZodDate",(e,t)=>{ME.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>lx(e,r,o,i),e.min=(r,o)=>e.check(wn(r,o)),e.max=(r,o)=>e.check(ro(r,o));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});cP=R("ZodArray",(e,t)=>{zE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sx(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Yr(n,r)),e.nonempty=(n)=>e.check(Yr(1,n)),e.max=(n,r)=>e.check(Us(n,r)),e.length=(n,r)=>e.check(Fs(n,r)),e.unwrap=()=>e.element});op=R("ZodObject",(e,t)=>{jE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cx(e,n,r,o),J.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>en(Object.keys(e._zod.def.shape)),e.catchall=(n)=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:lt()}),e.loose=()=>e.clone({...e._zod.def,catchall:lt()}),e.strict=()=>e.clone({...e._zod.def,catchall:GA()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(n)=>J.extend(e,n),e.safeExtend=(n)=>J.safeExtend(e,n),e.merge=(n)=>J.merge(e,n),e.pick=(n)=>J.pick(e,n),e.omit=(n)=>J.omit(e,n),e.partial=(...n)=>J.partial(qA,e,n[0]),e.required=(...n)=>J.required(VA,e,n[0])});rp=R("ZodUnion",(e,t)=>{Ld.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mA(e,n,r,o),e.options=t.options});lP=R("ZodXor",(e,t)=>{rp.init(e,t),UE.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mA(e,n,r,o),e.options=t.options});uP=R("ZodDiscriminatedUnion",(e,t)=>{rp.init(e,t),FE.init(e,t)});dP=R("ZodIntersection",(e,t)=>{$E.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vx(e,n,r,o)});pP=R("ZodTuple",(e,t)=>{zh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ex(e,n,r,o),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});sp=R("ZodRecord",(e,t)=>{GE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wx(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});mP=R("ZodMap",(e,t)=>{HE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bx(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(mr(...n)),e.nonempty=(n)=>e.check(mr(1,n)),e.max=(...n)=>e.check(Oi(...n)),e.size=(...n)=>e.check(js(...n))});hP=R("ZodSet",(e,t)=>{qE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ix(e,n,r,o),e.min=(...n)=>e.check(mr(...n)),e.nonempty=(n)=>e.check(mr(1,n)),e.max=(...n)=>e.check(Oi(...n)),e.size=(...n)=>e.check(js(...n))});Tc=R("ZodEnum",(e,t)=>{VE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>ux(e,r,o,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let i={};for(let s of r)if(n.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Tc({...t,checks:[],...J.normalizeParams(o),entries:i})},e.exclude=(r,o)=>{let i={...t.entries};for(let s of r)if(n.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Tc({...t,checks:[],...J.normalizeParams(o),entries:i})}});AP=R("ZodLiteral",(e,t)=>{KE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dx(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});fP=R("ZodFile",(e,t)=>{YE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mx(e,n,r,o),e.min=(n,r)=>e.check(mr(n,r)),e.max=(n,r)=>e.check(Oi(n,r)),e.mime=(n,r)=>e.check(Cc(Array.isArray(n)?n:[n],r))});yP=R("ZodTransform",(e,t)=>{WE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yx(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ls(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(J.issue(i,n.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(J.issue(s))}};let o=t.transform(n.value,n);if(o instanceof Promise)return o.then((i)=>(n.value=i,n));return n.value=o,n}});qA=R("ZodOptional",(e,t)=>{jh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hA(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});bP=R("ZodExactOptional",(e,t)=>{JE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hA(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});SP=R("ZodNullable",(e,t)=>{ZE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});CP=R("ZodDefault",(e,t)=>{XE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Px(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});EP=R("ZodPrefault",(e,t)=>{ew.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});VA=R("ZodNonOptional",(e,t)=>{tw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});xP=R("ZodSuccess",(e,t)=>{nw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});PP=R("ZodCatch",(e,t)=>{ow.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});TP=R("ZodNaN",(e,t)=>{rw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>px(e,n,r,o)});KA=R("ZodPipe",(e,t)=>{iw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bx(e,n,r,o),e.in=t.in,e.out=t.out});YA=R("ZodCodec",(e,t)=>{KA.init(e,t),Nd.init(e,t)});BP=R("ZodReadonly",(e,t)=>{sw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ox(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});_P=R("ZodTemplateLiteral",(e,t)=>{aw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gx(e,n,r,o)});DP=R("ZodLazy",(e,t)=>{uw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dx(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});LP=R("ZodPromise",(e,t)=>{lw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_x(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});NP=R("ZodFunction",(e,t)=>{cw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fx(e,n,r,o)});ap=R("ZodCustom",(e,t)=>{dw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ax(e,n,r,o)});r$=Kk,i$=Yk});function ove(e){Rt({customError:e})}function rve(){return Rt().customError}var UP,jP;var l$=h(()=>{io();UP={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(e){})(jP||(jP={}))});function sve(e,t){let n=e.$schema;if(n==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(n==="http://json-schema.org/draft-07/schema#")return"draft-7";if(n==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function ave(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let o=n[1];if(!o||!t.defs[o])throw Error(`Reference not found: ${e}`);return t.defs[o]}throw Error(`Reference not found: ${e}`)}function u$(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return ie.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return ie.lazy(()=>{if(!t.refs.has(o))throw Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=ave(o,t),s=mn(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return ie.null();if(o.length===0)return ie.never();if(o.length===1)return ie.literal(o[0]);if(o.every((s)=>typeof s==="string"))return ie.enum(o);let i=o.map((s)=>ie.literal(s));if(i.length<2)return i[0];return ie.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return ie.literal(e.const);let n=e.type;if(Array.isArray(n)){let o=n.map((i)=>{let s={...e,type:i};return u$(s,t)});if(o.length===0)return ie.never();if(o.length===1)return o[0];return ie.union(o)}if(!n)return ie.any();let r;switch(n){case"string":{let o=ie.string();if(e.format){let i=e.format;if(i==="email")o=o.check(ie.email());else if(i==="uri"||i==="uri-reference")o=o.check(ie.url());else if(i==="uuid"||i==="guid")o=o.check(ie.uuid());else if(i==="date-time")o=o.check(ie.iso.datetime());else if(i==="date")o=o.check(ie.iso.date());else if(i==="time")o=o.check(ie.iso.time());else if(i==="duration")o=o.check(ie.iso.duration());else if(i==="ipv4")o=o.check(ie.ipv4());else if(i==="ipv6")o=o.check(ie.ipv6());else if(i==="mac")o=o.check(ie.mac());else if(i==="cidr")o=o.check(ie.cidrv4());else if(i==="cidr-v6")o=o.check(ie.cidrv6());else if(i==="base64")o=o.check(ie.base64());else if(i==="base64url")o=o.check(ie.base64url());else if(i==="e164")o=o.check(ie.e164());else if(i==="jwt")o=o.check(ie.jwt());else if(i==="emoji")o=o.check(ie.emoji());else if(i==="nanoid")o=o.check(ie.nanoid());else if(i==="cuid")o=o.check(ie.cuid());else if(i==="cuid2")o=o.check(ie.cuid2());else if(i==="ulid")o=o.check(ie.ulid());else if(i==="xid")o=o.check(ie.xid());else if(i==="ksuid")o=o.check(ie.ksuid())}if(typeof e.minLength==="number")o=o.min(e.minLength);if(typeof e.maxLength==="number")o=o.max(e.maxLength);if(e.pattern)o=o.regex(new RegExp(e.pattern));r=o;break}case"number":case"integer":{let o=n==="integer"?ie.number().int():ie.number();if(typeof e.minimum==="number")o=o.min(e.minimum);if(typeof e.maximum==="number")o=o.max(e.maximum);if(typeof e.exclusiveMinimum==="number")o=o.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")o=o.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")o=o.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")o=o.lt(e.maximum);if(typeof e.multipleOf==="number")o=o.multipleOf(e.multipleOf);r=o;break}case"boolean":{r=ie.boolean();break}case"null":{r=ie.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let d=mn(u,t);o[l]=s.has(l)?d:d.optional()}if(e.propertyNames){let l=mn(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties==="object"?mn(e.additionalProperties,t):ie.any();if(Object.keys(o).length===0){r=ie.record(l,u);break}let d=ie.object(o).passthrough(),p=ie.looseRecord(l,u);r=ie.intersection(d,p);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let g of u){let m=mn(l[g],t),A=ie.string().regex(new RegExp(g));d.push(ie.looseRecord(A,m))}let p=[];if(Object.keys(o).length>0)p.push(ie.object(o).passthrough());if(p.push(...d),p.length===0)r=ie.object({}).passthrough();else if(p.length===1)r=p[0];else{let g=ie.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)g=ie.intersection(g,p[m]);r=g}break}let c=ie.object(o);if(e.additionalProperties===!1)r=c.strict();else if(typeof e.additionalProperties==="object")r=c.catchall(mn(e.additionalProperties,t));else r=c.passthrough();break}case"array":{let{prefixItems:o,items:i}=e;if(o&&Array.isArray(o)){let s=o.map((l)=>mn(l,t)),c=i&&typeof i==="object"&&!Array.isArray(i)?mn(i,t):void 0;if(c)r=ie.tuple(s).rest(c);else r=ie.tuple(s);if(typeof e.minItems==="number")r=r.check(ie.minLength(e.minItems));if(typeof e.maxItems==="number")r=r.check(ie.maxLength(e.maxItems))}else if(Array.isArray(i)){let s=i.map((l)=>mn(l,t)),c=e.additionalItems&&typeof e.additionalItems==="object"?mn(e.additionalItems,t):void 0;if(c)r=ie.tuple(s).rest(c);else r=ie.tuple(s);if(typeof e.minItems==="number")r=r.check(ie.minLength(e.minItems));if(typeof e.maxItems==="number")r=r.check(ie.maxLength(e.maxItems))}else if(i!==void 0){let s=mn(i,t),c=ie.array(s);if(typeof e.minItems==="number")c=c.min(e.minItems);if(typeof e.maxItems==="number")c=c.max(e.maxItems);r=c}else r=ie.array(ie.any());break}default:throw Error(`Unsupported type: ${n}`)}if(e.description)r=r.describe(e.description);if(e.default!==void 0)r=r.default(e.default);return r}function mn(e,t){if(typeof e==="boolean")return e?ie.any():ie.never();let n=u$(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map((u)=>mn(u,t)),l=ie.union(c);n=r?ie.intersection(n,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map((u)=>mn(u,t)),l=ie.xor(c);n=r?ie.intersection(n,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:ie.any();else{let c=r?n:mn(e.allOf[0],t),l=r?0:1;for(let u=l;u<e.allOf.length;u++)c=ie.intersection(c,mn(e.allOf[u],t));n=c}if(e.nullable===!0&&t.version==="openapi-3.0")n=ie.nullable(n);if(e.readOnly===!0)n=ie.readonly(n);let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)if(c in e)o[c]=e[c];let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)if(c in e)o[c]=e[c];for(let c of Object.keys(e))if(!ive.has(c))o[c]=e[c];if(Object.keys(o).length>0)t.registry.add(n,o);return n}function d$(e,t){if(typeof e==="boolean")return e?ie.any():ie.never();let n=sve(e,t?.defaultTarget),r=e.$defs||e.definitions||{},o={version:n,defs:r,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Xt};return mn(e,o)}var ie,ive;var p$=h(()=>{$d();yA();Kd();Wd();ie={...Yd,...fA,iso:Li},ive=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var lp={};cr(lp,{bigint:()=>dve,boolean:()=>uve,date:()=>pve,number:()=>lve,string:()=>cve});function cve(e){return gk(Bc,e)}function lve(e){return Sk(_c,e)}function uve(e){return Pk(Dc,e)}function dve(e){return Tk(Qc,e)}function pve(e){return Uk(np,e)}var g$=h(()=>{io();Wd()});var a={};cr(a,{$brand:()=>qC,$input:()=>uk,$output:()=>lk,NEVER:()=>Cd,TimePrecision:()=>hk,ZodAny:()=>rP,ZodArray:()=>cP,ZodBase64:()=>MA,ZodBase64URL:()=>zA,ZodBigInt:()=>Qc,ZodBigIntFormat:()=>FA,ZodBoolean:()=>Dc,ZodCIDRv4:()=>LA,ZodCIDRv6:()=>NA,ZodCUID:()=>RA,ZodCUID2:()=>TA,ZodCatch:()=>PP,ZodCodec:()=>YA,ZodCustom:()=>ap,ZodCustomStringFormat:()=>Oc,ZodDate:()=>np,ZodDefault:()=>CP,ZodDiscriminatedUnion:()=>uP,ZodE164:()=>jA,ZodEmail:()=>wA,ZodEmoji:()=>xA,ZodEnum:()=>Tc,ZodError:()=>tve,ZodExactOptional:()=>bP,ZodFile:()=>fP,ZodFirstPartyTypeKind:()=>jP,ZodFunction:()=>NP,ZodGUID:()=>Jd,ZodIPv4:()=>DA,ZodIPv6:()=>QA,ZodISODate:()=>IA,ZodISODateTime:()=>bA,ZodISODuration:()=>CA,ZodISOTime:()=>SA,ZodIntersection:()=>dP,ZodIssueCode:()=>UP,ZodJWT:()=>UA,ZodKSUID:()=>_A,ZodLazy:()=>DP,ZodLiteral:()=>AP,ZodMAC:()=>eP,ZodMap:()=>mP,ZodNaN:()=>TP,ZodNanoID:()=>PA,ZodNever:()=>sP,ZodNonOptional:()=>VA,ZodNull:()=>oP,ZodNullable:()=>SP,ZodNumber:()=>_c,ZodNumberFormat:()=>$s,ZodObject:()=>op,ZodOptional:()=>qA,ZodPipe:()=>KA,ZodPrefault:()=>EP,ZodPromise:()=>LP,ZodReadonly:()=>BP,ZodRealError:()=>jn,ZodRecord:()=>sp,ZodSet:()=>hP,ZodString:()=>Bc,ZodStringFormat:()=>ct,ZodSuccess:()=>xP,ZodSymbol:()=>tP,ZodTemplateLiteral:()=>_P,ZodTransform:()=>yP,ZodTuple:()=>pP,ZodType:()=>_e,ZodULID:()=>BA,ZodURL:()=>ep,ZodUUID:()=>hr,ZodUndefined:()=>nP,ZodUnion:()=>rp,ZodUnknown:()=>iP,ZodVoid:()=>aP,ZodXID:()=>OA,ZodXor:()=>lP,_ZodString:()=>EA,_default:()=>vP,_function:()=>n$,any:()=>$A,array:()=>ee,base64:()=>CF,base64url:()=>vF,bigint:()=>DF,boolean:()=>Xe,catch:()=>RP,check:()=>o$,cidrv4:()=>IF,cidrv6:()=>SF,clone:()=>En,codec:()=>XF,coerce:()=>lp,config:()=>Rt,core:()=>Wr,cuid:()=>pF,cuid2:()=>gF,custom:()=>WA,date:()=>jF,decode:()=>qx,decodeAsync:()=>Kx,describe:()=>r$,discriminatedUnion:()=>ip,e164:()=>EF,email:()=>oF,emoji:()=>uF,encode:()=>Hx,encodeAsync:()=>Vx,endsWith:()=>Sc,enum:()=>en,exactOptional:()=>IP,file:()=>YF,flattenError:()=>Td,float32:()=>TF,float64:()=>BF,formatError:()=>Bd,fromJSONSchema:()=>d$,function:()=>n$,getErrorMap:()=>rve,globalRegistry:()=>Xt,gt:()=>gr,gte:()=>wn,guid:()=>rF,hash:()=>RF,hex:()=>PF,hostname:()=>xF,httpUrl:()=>lF,includes:()=>bc,instanceof:()=>s$,int:()=>vA,int32:()=>OF,int64:()=>QF,intersection:()=>Lc,ipv4:()=>fF,ipv6:()=>bF,iso:()=>Li,json:()=>c$,jwt:()=>wF,keyof:()=>UF,ksuid:()=>AF,lazy:()=>QP,length:()=>Fs,literal:()=>ue,locales:()=>Fd,looseObject:()=>Tt,looseRecord:()=>HF,lowercase:()=>fc,lt:()=>pr,lte:()=>ro,mac:()=>yF,map:()=>qF,maxLength:()=>Us,maxSize:()=>Oi,meta:()=>i$,mime:()=>Cc,minLength:()=>Yr,minSize:()=>mr,multipleOf:()=>Bi,nan:()=>ZF,nanoid:()=>dF,nativeEnum:()=>KF,negative:()=>lA,never:()=>GA,nonnegative:()=>dA,nonoptional:()=>kP,nonpositive:()=>uA,normalize:()=>vc,null:()=>tp,nullable:()=>Zd,nullish:()=>WF,number:()=>je,object:()=>ne,optional:()=>pt,overwrite:()=>$o,parse:()=>Ux,parseAsync:()=>Fx,partialRecord:()=>GF,pipe:()=>Xd,positive:()=>cA,prefault:()=>wP,preprocess:()=>cp,prettifyError:()=>ov,promise:()=>t$,property:()=>pA,readonly:()=>OP,record:()=>tt,refine:()=>MP,regex:()=>Ac,regexes:()=>Co,registry:()=>Uh,safeDecode:()=>Wx,safeDecodeAsync:()=>Zx,safeEncode:()=>Yx,safeEncodeAsync:()=>Jx,safeParse:()=>$x,safeParseAsync:()=>Gx,set:()=>VF,setErrorMap:()=>ove,size:()=>js,slugify:()=>xc,startsWith:()=>Ic,strictObject:()=>FF,string:()=>k,stringFormat:()=>kF,stringbool:()=>a$,success:()=>JF,superRefine:()=>zP,symbol:()=>NF,templateLiteral:()=>e$,toJSONSchema:()=>AA,toLowerCase:()=>wc,toUpperCase:()=>kc,transform:()=>HA,treeifyError:()=>nv,trim:()=>Ec,tuple:()=>gP,uint32:()=>_F,uint64:()=>LF,ulid:()=>mF,undefined:()=>MF,union:()=>ut,unknown:()=>lt,uppercase:()=>yc,url:()=>kA,util:()=>J,uuid:()=>iF,uuidv4:()=>sF,uuidv6:()=>aF,uuidv7:()=>cF,void:()=>zF,xid:()=>hF,xor:()=>$F});var JA=h(()=>{io();io();Sw();io();Vd();p$();ck();Kd();Kd();g$();Wd();yA();jx();Xx();l$();Rt(Md())});var De=h(()=>{JA();JA()});var m$,h$,A$,f$,y$,b$,I$,S$,C$,v$,E$,w$,k$,FP,gve,$P,x$,mve,GP="cursor",HP="GET",qP="control",VP="[DONE]";var P$=h(()=>{De();m$=a.object({type:a.literal("run_started"),runId:a.string().describe("Server-assigned run ID for the started run.")}),h$=a.object({type:a.literal("message_started"),messageId:a.string().describe("Server-assigned assistant message ID for this run.")}),A$=a.object({type:a.literal("text_chunk"),messageId:a.string().describe("Assistant message the chunk belongs to."),content:a.string().describe("Incremental text delta to append.")}),f$=a.object({type:a.literal("reasoning_chunk"),messageId:a.string().describe("Assistant message the chunk belongs to."),content:a.string().describe("Incremental reasoning delta to append.")}),y$=a.object({type:a.literal("text_complete"),messageId:a.string().describe("Assistant message that completed."),content:a.string().describe("Full assistant text for the message.")}),b$=a.object({type:a.literal("reasoning_complete"),messageId:a.string().describe("Assistant message that completed."),content:a.string().describe("Full reasoning text for the message.")}),I$=a.object({type:a.literal("tool_call_pending"),toolCallId:a.string().describe("Stable identifier for the tool call."),name:a.string().describe("Name of the tool being called.")}),S$=a.object({type:a.literal("tool_call_start"),toolCallId:a.string().describe("Stable identifier for the tool call."),name:a.string().describe("Name of the tool being called."),params:a.unknown().describe("Resolved tool input params.")}),C$=a.object({type:a.literal("tool_call_complete"),toolCallId:a.string().describe("Stable identifier for the tool call."),status:a.enum(["in_progress","success","error"]).describe("Terminal (or transitional) status of the tool call."),result:a.unknown().optional().describe("Tool output, when available."),durationMs:a.number().nonnegative().optional().describe("Authoritative server-measured tool execution time in ms.")}),v$=a.object({type:a.literal("artifact"),name:a.string().describe("Artifact kind (for example table, timeseries)."),data:a.unknown().describe("Artifact payload; shape depends on name."),toolCallId:a.string().describe("Tool call that produced the artifact.")}),E$=a.object({type:a.literal("error"),message:a.string().describe("Human-readable error message."),name:a.string().optional().describe("Optional error class/name.")}),w$=a.object({type:a.literal("stream_reset"),messageId:a.string().describe("Assistant message whose content to reset.")}),k$=a.object({type:a.literal("disconnected")}),FP=a.discriminatedUnion("type",[m$,h$,A$,f$,y$,b$,I$,S$,C$,v$,E$,w$,k$]),gve=a.enum(["run_started","message_started","text_chunk","reasoning_chunk","text_complete","reasoning_complete","tool_call_pending","tool_call_start","tool_call_complete","artifact","error","stream_reset","disconnected"]),$P=a.object({streamNextOffset:a.string().describe("Opaque resume cursor for the next unread event; pass back as the stream 'cursor' query param.")}),x$=a.string().describe("Opaque resume cursor from a prior control frame's streamNextOffset."),mve=a.object({cursor:x$.optional().describe("Resume the stream after this offset. Omit to start from the beginning of the retained buffer.")})});var E=(e)=>{let t={operationId:e.operationId,backend:e.backend,pagination:e.pagination,async:e.async,examples:e.examples??[]};return{...e,contract:bj.$meta(t).route({method:e.route.method,path:e.route.path,tags:e.route.tags,operationId:e.operationId,summary:e.summary,description:e.description,successStatus:e.route.successStatus,successDescription:e.route.successDescription,deprecated:e.route.deprecated,inputStructure:e.route.inputStructure}).input(e.input).output(e.output)}};var R$=h(()=>{FC()});var T$=h(()=>{R$()});var Ve=h(()=>{T$()});var dp,O$,_$,D$,Q$,L$,N$,M$,z$,j$,hve,JP,U$,ZA,XA,Nc,ef,tf,F$,$$,nf,G$,H$,Mc,KP,Ave,q$,V$,K$,fve,Y$,W$,J$,ZP,Z$,X$,e1,of,rf,sf,af,pp,t1,YP,n1,gp,XP,o1,r1,yve,bve,eR,i1,s1,a1,c1,l1,u1,d1,tR,cf,lf,uf,df,nR,p1,WP,up,oR,Ive,pf,g1,m1,h1,A1,B$,f1,y1,b1,gf,mf,I1,rR,S1,C1,v1,E1,w1,hf,Af,Sve;var iR=h(()=>{De();Ve();dp=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),origin:a.enum(["user_declared","code_detected","log_observed"]),lifecycle:a.enum(["active","retired","merged"]),observationState:a.enum(["observed","stale","unobserved"]),registryRevision:a.number().int().nonnegative(),canonicalComponentId:a.string().uuid(),mergedIntoComponentId:a.string().uuid().nullable(),currentStatus:a.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:a.string().datetime(),lastSeenAt:a.string().datetime(),deletedAt:a.string().datetime().nullable().describe("Timestamp when this component was retired, if any."),retiredAt:a.string().datetime().nullable(),retirementReason:a.string().nullable(),legacyStateUnknown:a.boolean().describe("True only for migration-era inactive rows whose retirement authority is unknown.")}),O$=a.object({projectId:a.string().uuid().optional().describe("Project to list components for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, include retired and merged components.")}),_$=a.object({components:a.array(dp),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),D$=a.object({componentId:a.string().uuid().describe("Component ID to retrieve.")}),Q$=a.object({component:dp}),L$=a.object({projectId:a.string().uuid().optional().describe("Project to register the component in. Auto-filled from CLI and SDK context when omitted."),name:a.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:a.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:a.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request."),origin:a.enum(["code_detected","log_observed"]).optional().describe("Machine provenance of this registration: 'code_detected' when the component was inferred from repository or code analysis, 'log_observed' (the default) when inferred from telemetry. Only applies to machine (secret-key) callers; human registrations are always recorded as 'user_declared' and ignore this field.")}),N$=a.object({component:dp}),M$=a.object({componentId:a.string().uuid().describe("Active component ID to rename."),name:a.string().trim().min(1,"Name is required"),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),z$=a.object({component:dp}),j$=a.object({componentId:a.string().uuid().describe("Component ID to deregister."),reason:a.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),hve=a.object({openIssueIds:a.array(a.string().uuid()),activeComponentIssueIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),notificationRuleIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),externalIncidentIds:a.array(a.string().uuid()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid())}),JP=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),lifecycle:a.enum(["active","retired"]),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),requiresCanonicalGroupConfirmation:a.boolean(),recommendationScopeEnabled:a.literal(!1),dependents:hve,counts:a.record(a.string(),a.number().int().nonnegative())}),U$=a.discriminatedUnion("status",[a.object({status:a.literal("observation_withdrawn"),componentId:a.string().uuid(),sourceType:a.literal("secret_key"),withdrawn:a.boolean()}),a.object({status:a.literal("retirement_confirmation_required"),preview:JP})]),ZA=E({operationId:"components.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/components",tags:["Components"]},input:O$,output:_$,pagination:"cursor",async:"sync"}),XA=E({operationId:"components.get",description:"Get a single component by ID.",backend:"api",route:{method:"GET",path:"/components/{componentId}",tags:["Components"]},input:D$,output:Q$,pagination:"none",async:"sync"}),Nc=E({operationId:"components.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/components",tags:["Components"]},input:L$,output:N$,pagination:"none",async:"sync"}),ef=E({operationId:"components.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/components/{componentId}/deregister",tags:["Components"]},input:j$,output:U$,pagination:"none",async:"sync"}),tf=E({operationId:"components.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/components/{componentId}/rename",tags:["Components"]},input:M$,output:z$,pagination:"none",async:"sync"}),F$=a.object({componentId:a.string().uuid().describe("Component whose owning team to set."),teamId:a.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),$$=a.object({componentId:a.string().uuid().describe("Component that was updated."),teamId:a.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),nf=E({operationId:"components.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/components/{componentId}/team",tags:["Components"]},input:F$,output:$$,pagination:"none",async:"sync"}),G$=a.object({componentId:a.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),H$=a.object({preview:JP}),Mc=a.record(a.string().uuid(),a.number().int().nonnegative()),KP=a.object({id:a.string().uuid(),rowRevision:a.number().int().nonnegative()}),Ave=a.object({notificationRules:a.array(KP),automationBindings:a.array(KP),relationships:a.array(KP)}),q$=a.object({componentId:a.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:Mc.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:a.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),V$=a.object({operationId:a.string().uuid(),status:a.enum(["committed","complete","followup_failed"]),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),counts:a.record(a.string(),a.number().int().nonnegative()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid()),manualExternalIncidentIds:a.array(a.string().uuid()),issueAutomationSuppressions:a.number().int().nonnegative(),outboxEffectCount:a.number().int().nonnegative(),manifest:Ave,followups:a.record(a.string(),a.unknown()).optional()}),K$=a.object({result:V$}),fve=a.object({notificationRuleIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid())}),Y$=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:a.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),W$=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),retirementOperationId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:Mc,eligible:fve}),J$=a.object({preview:W$}),ZP=a.object({notificationRuleIds:a.array(a.string().uuid()).default([]),automationBindingIds:a.array(a.string().uuid()).default([]),recommendationScopeIds:a.array(a.string().uuid()).default([]),relationshipIds:a.array(a.string().uuid()).default([])}),Z$=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:a.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:Mc.describe("Exact canonical-group revisions returned by restorationPreview."),selections:ZP.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),X$=a.object({operationId:a.string().uuid(),status:a.literal("complete"),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),restored:ZP}),e1=a.object({result:X$}),of=E({operationId:"components.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retirement/preview",tags:["Components"]},input:G$,output:H$,pagination:"none",async:"sync"}),rf=E({operationId:"components.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retire",tags:["Components"]},input:q$,output:K$,pagination:"none",async:"sync"}),sf=E({operationId:"components.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restoration/preview",tags:["Components"]},input:Y$,output:J$,pagination:"none",async:"sync"}),af=E({operationId:"components.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restore",tags:["Components"]},input:Z$,output:e1,pagination:"none",async:"sync"}),pp=a.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),t1=a.enum(["observed","stale","unobserved"]),YP=a.object({originalComponentId:a.string().uuid(),effectiveComponentId:a.string().uuid(),name:a.string(),lifecycle:a.enum(["active","retired","merged"]),observationState:t1}),n1=a.object({id:a.string().uuid(),source:YP,target:YP,relationshipType:pp,createdAt:a.string().datetime(),endedAt:a.string().datetime().nullable(),endReason:a.string().nullable(),rowRevision:a.number().int().nonnegative()}),gp=a.object({projectId:a.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),XP=a.object({sourceComponentId:a.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:a.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:pp}),o1=gp.extend({includeHistorical:a.union([a.boolean(),a.stringbool()]).default(!1).describe("Include historically ended relationships.")}),r1=a.object({relationships:a.array(n1)}),yve=a.object({ruleId:a.string().uuid(),ruleGroupId:a.string().uuid().nullable(),ownerComponentId:a.string().uuid(),destinationIds:a.array(a.string().uuid()),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),bve=a.object({bindingId:a.string().uuid(),automationId:a.string().uuid(),ownerComponentId:a.string().uuid(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),eR=a.object({notificationRules:a.array(yve),automationBindings:a.array(bve)}),i1=XP.extend({action:a.enum(["add","remove"]),organizationId:a.string(),projectId:a.string().uuid(),relationshipId:a.string().uuid().nullable(),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),policyImpact:eR,confirmationRequired:a.boolean()}),s1=gp.merge(XP).extend({action:a.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),a1=a.object({preview:i1}),c1=gp.merge(XP).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:a.string().trim().min(1,"Reason cannot be empty"),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),confirmPolicyImpact:a.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),l1=c1,u1=c1,d1=a.object({action:a.enum(["add","remove"]),relationshipId:a.string().uuid(),sourceComponentId:a.string().uuid(),targetComponentId:a.string().uuid(),relationshipType:pp,policyImpact:eR}),tR=a.object({result:d1}),cf=E({operationId:"components.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/components/relationships",tags:["Components"]},input:o1,output:r1,pagination:"none",async:"sync"}),lf=E({operationId:"components.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/components/relationships/preview",tags:["Components"]},input:s1,output:a1,pagination:"none",async:"sync"}),uf=E({operationId:"components.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships",tags:["Components"]},input:l1,output:tR,pagination:"none",async:"sync"}),df=E({operationId:"components.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships/remove",tags:["Components"]},input:u1,output:tR,pagination:"none",async:"sync"}),nR=a.enum(["suspend","move"]),p1=a.object({disposition:nR,beforeComponentIds:a.array(a.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:a.array(a.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),WP=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),sourceRowRevision:a.number().int().nonnegative(),sourceComponentId:a.string().uuid(),equivalentPolicyId:a.string().uuid().nullable(),equivalent:a.boolean(),defaultDisposition:a.enum(["deduplicate","suspend"]),allowedDispositions:a.array(nR),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),up=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),ownerComponentId:a.string().uuid(),rowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),oR=a.object({relationshipId:a.string().uuid(),action:a.enum(["rewire","close_self","close_duplicate"]),relationshipType:pp,beforeSourceComponentId:a.string().uuid(),beforeTargetComponentId:a.string().uuid(),afterSourceComponentId:a.string().uuid(),afterTargetComponentId:a.string().uuid(),survivingRelationshipId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative().nullable()}),Ive=a.object({openIssueIds:a.array(a.string().uuid()),componentIssueIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),nameIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid())}),pf=a.object({sourceComponentId:a.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:a.string().uuid().describe("Active terminal component that becomes the canonical target.")}),g1=gp.merge(pf),m1=pf.extend({organizationId:a.string(),projectId:a.string().uuid(),sourceGroupComponentIds:a.array(a.string().uuid()),targetGroupComponentIds:a.array(a.string().uuid()),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:Mc,inventory:Ive,notificationPolicies:a.array(WP),automationBindings:a.array(WP),notificationScopeChanges:a.array(up),automationScopeChanges:a.array(up),relationshipChanges:a.array(oR),recommendationScopeEnabled:a.literal(!1),dependentCount:a.number().int().nonnegative(),ordinaryTransactionLimit:a.number().int().positive(),operatorAssistanceRequired:a.boolean(),confirmationRequired:a.boolean()}),h1=a.object({preview:m1}),A1=gp.merge(pf).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:Mc.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:a.record(a.string().uuid(),p1).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:a.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),B$=a.object({policyId:a.string().uuid(),action:a.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),f1=a.object({componentRevisions:Mc,redirectedComponentIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),movedAliasIds:a.array(a.string().uuid()),historicalDisplayIds:a.array(a.string().uuid()),relationshipChanges:a.array(oR),notificationPolicies:a.array(B$),automationBindings:a.array(B$),notificationScopeChanges:a.array(up),automationScopeChanges:a.array(up),recommendationScopeIds:a.array(a.string().uuid())}),y1=pf.extend({operationId:a.string().uuid(),status:a.literal("complete"),affectedComponentIds:a.array(a.string().uuid()),manifest:f1}),b1=a.object({result:y1}),gf=E({operationId:"components.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/components/merge/preview",tags:["Components"]},input:g1,output:h1,pagination:"none",async:"sync"}),mf=E({operationId:"components.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/components/merge",tags:["Components"]},input:A1,output:b1,pagination:"none",async:"sync"}),I1=a.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),rR=a.object({id:a.string().uuid(),componentId:a.string().uuid(),projectId:a.string().uuid(),severity:I1,summary:a.string().describe("Human-readable summary of the status-page issue."),startedAt:a.string().datetime().describe("When the incident began affecting the component."),resolvedAt:a.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),S1=a.object({projectId:a.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:a.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),C1=a.object({incidents:a.array(rR),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),v1=a.object({timestamp:a.string().datetime(),status:a.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),E1=a.object({componentId:a.string().uuid().describe("Component to build the timeline for."),windowStart:a.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:a.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),w1=a.object({componentId:a.string().uuid(),windowStart:a.string().datetime(),windowEnd:a.string().datetime(),timeline:a.array(v1),incidents:a.array(rR)}),hf=E({operationId:"components.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Components"]},input:S1,output:C1,pagination:"cursor",async:"sync"}),Af=E({operationId:"components.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/components/{componentId}/timeline",tags:["Components"]},input:E1,output:w1,pagination:"none",async:"sync"}),Sve={list:ZA.contract,get:XA.contract,register:Nc.contract,deregister:ef.contract,rename:tf.contract,assignTeam:nf.contract,retirementPreview:of.contract,retire:rf.contract,restorationPreview:sf.contract,restore:af.contract,mergePreview:gf.contract,merge:mf.contract,relationships:{list:cf.contract,preview:lf.contract,add:uf.contract,remove:df.contract},incidents:{list:hf.contract},timeline:Af.contract}});var ff,sR,k1,x1,aR,P1,R1,T1,cR,B1,O1,_1,lR,D1,Q1,uR;var dR=h(()=>{De();Ve();ff=["github","google","microsoft","linear","bitbucket","slack"],sR=a.enum(ff),k1=a.object({organizationId:a.string().min(1).optional().describe("Organization to connect within. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:sR.describe("Connected-account provider to connect.")}),x1=a.object({url:a.string().describe("Vendor authorization URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:a.string().uuid().describe("Connect attempt to poll via `connectedAccounts.getConnectAttempt` while the browser flow completes."),expiresAt:a.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),aR=E({operationId:"connectedAccounts.beginConnect",description:"Begin a browser connect flow for a connected-account provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/connected-accounts/connect",tags:["Connected Accounts"],successStatus:201},input:k1,output:x1,pagination:"none",async:"sync"}),P1=a.enum(["pending","completed","failed","expired"]),R1=a.object({organizationId:a.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),attemptId:a.string().uuid().describe("Connect attempt ID to poll.")}),T1=a.object({status:P1.describe("Attempt state. `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:a.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized).")}),cR=E({operationId:"connectedAccounts.getConnectAttempt",description:"Poll a browser connect attempt started with `connectedAccounts.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/connected-accounts/connect/attempts/{attemptId}",tags:["Connected Accounts"]},input:R1,output:T1,pagination:"none",async:"sync"}),B1=a.object({organizationId:a.string().min(1).optional().describe("Organization to list accounts for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),O1=a.object({provider:a.string().describe("Provider identifier."),externalName:a.string().nullable().describe("Display name from the provider."),externalLogin:a.string().nullable().describe("Username or login from the provider."),connectedAt:a.string().datetime().nullable().describe("When the account was connected."),authMode:a.enum(["oauth","pat"]).nullable().describe("Auth mode used."),needsReconnect:a.boolean().describe("Whether the token is expired and a reconnect is required.")}),_1=a.object({accounts:a.array(O1)}),lR=E({operationId:"connectedAccounts.list",description:"List the calling user's connected accounts for the organization.",backend:"api",route:{method:"GET",path:"/connected-accounts",tags:["Connected Accounts"]},input:B1,output:_1,pagination:"none",async:"sync"}),D1=a.object({organizationId:a.string().min(1).optional().describe("Organization the account belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:sR.describe("Provider to disconnect.")}),Q1=a.object({success:a.literal(!0)}),uR=E({operationId:"connectedAccounts.disconnect",description:"Disconnect the calling user's connected account for a provider (soft delete).",backend:"api",route:{method:"DELETE",path:"/connected-accounts/{provider}",tags:["Connected Accounts"]},input:D1,output:Q1,pagination:"none",async:"sync"})});var Gs,pR,L1,N1,Cve,vve,Eve,M1,mp,wve,kve,xve,Pve,Rve,Tve,Bve,Ove,_ve,Dve,Qve,Lve,gR,mR,hR,AR,fR,yR,Nve,Mve,zve,jve,bR,IR,Uve,Fve,$ve,Gve,SR,Ypt;var z1=h(()=>{De();Ve();Gs=a.string().uuid().describe("Automation ID."),pR=a.enum(["running","succeeded","failed","timed_out","cancelled"]),L1=a.object({id:a.string().uuid(),automationRunKey:a.string(),status:pR,startedAt:a.string().datetime(),completedAt:a.string().datetime().nullable(),durationMs:a.number().int().nullable(),exitCode:a.number().int().nullable()}),N1=L1.extend({scheduledAt:a.string().datetime().nullable().describe("When the run was scheduled to start, if known."),dueAt:a.string().datetime().nullable().describe("When the run became due, if known."),errorMessage:a.string().nullable().describe("Failure detail for the run, if it failed or timed out.")}),Cve=N1.extend({automationId:a.string().uuid().describe("Automation that owns this run.")}),vve=a.enum(["script","log_match"]),Eve=a.enum(["expression_matched"]),M1=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),kind:vve.describe("Automation kind: a scheduled script or a log-match investigation."),scriptId:a.string().uuid().nullable().describe("ID of the project_scripts row this automation runs, for DB-backed script automations. Null for legacy script_path automations and for log-match automations."),scriptName:a.string().nullable().describe("Name of the project_scripts row this automation runs (see scriptId). Null when scriptId is null."),signalDefinitionId:a.string().uuid().nullable().describe("Signal definition bound to this automation. Null for script automations."),signalType:Eve.nullable().describe("Signal trigger type for log-match automations. Null for script automations."),source:a.enum(["sazabi_managed","custom"]).describe("Whether the automation is Sazabi-managed or customer-defined."),enabled:a.boolean(),cronExpression:a.string().nullable().describe("Cron schedule for scheduled automations. Null for signal automations."),timezone:a.string(),timeoutSeconds:a.number().int().nullable(),health:a.enum(["healthy","failing","never_run"]).describe("Health derived from the most recent run."),lastRun:L1.nullable(),successRate:a.number().nullable().describe("Fraction of terminal runs that succeeded over the last 7 days."),runCount:a.number().int().describe("Total runs over the last 7 days."),failedRunCount:a.number().int().describe("Failed or timed-out runs over the last 7 days.")}),mp=M1.extend({createdAt:a.string().datetime(),updatedAt:a.string().datetime(),recordedHistoryStartsAt:a.string().datetime().describe("Earliest timestamp for which run history is recorded."),scriptIdentifier:a.string().nullable().describe("Relative project script path executed by the automation. Null for signal automations."),canToggle:a.boolean().describe("Whether the caller may enable or disable this automation.")}),wve=a.object({projectId:a.string().uuid().optional().describe("Project to list automations for. Auto-filled from CLI and SDK context when omitted."),search:a.string().optional().describe("Case-insensitive partial match on automation name."),status:a.enum(["active","paused"]).optional().describe("Filter by enabled (active) or disabled (paused) automations."),health:a.enum(["healthy","failing","never_run"]).optional().describe("Filter by automation health."),source:a.enum(["sazabi_managed","custom"]).optional().describe("Filter by automation source."),sort:a.enum(["name","last_run","failures","runs"]).default("name").describe("Sort order for the returned automations."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of automations to return per page."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),kve=a.object({automations:a.array(M1),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),xve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Pve=a.object({automation:mp}),Rve=a.object({projectId:a.string().uuid().optional().describe("Project to create the automation in. Auto-filled from CLI and SDK context when omitted."),name:a.string().min(1).max(200).describe("Automation name."),description:a.string().max(2000).nullable().optional().describe("Human-readable description. Required for log-match automations (investigation instructions)."),scriptId:a.string().uuid().optional().describe("Project script to run, by ID. Provide exactly one of scriptId, script, or expressionId."),script:a.string().optional().describe("Project script to run, by name (resolved to scriptId server-side). Provide exactly one of scriptId, script, or expressionId."),expressionId:a.string().uuid().optional().describe("Log-match expression to bind. Creates a signal automation that investigates matching logs. Mutually exclusive with scriptId and script."),cronExpression:a.string().optional().describe("Cron schedule for the automation. Defaults to every minute when omitted."),timezone:a.string().optional().describe("IANA timezone for cronExpression. Defaults to UTC."),timeoutSeconds:a.coerce.number().int().min(1).max(3600).optional().describe("Execution timeout in seconds. Defaults to 60."),enabled:a.boolean().optional().describe("Whether the automation starts enabled. Defaults to true.")}).superRefine((e,t)=>{let n=e.scriptId!=null,r=e.script!=null,o=e.expressionId!=null;if(Number(n)+Number(r)+Number(o)!==1){t.addIssue({code:"custom",message:"Provide exactly one of scriptId, script, or expressionId.",path:["scriptId"]});return}if(o){if(e.cronExpression!=null)t.addIssue({code:"custom",message:"cronExpression is not used for log-match automations.",path:["cronExpression"]});if(e.timezone!=null)t.addIssue({code:"custom",message:"timezone is not used for log-match automations.",path:["timezone"]});if(e.timeoutSeconds!=null)t.addIssue({code:"custom",message:"timeoutSeconds is not used for log-match automations.",path:["timeoutSeconds"]});if(!e.description?.trim())t.addIssue({code:"custom",message:"description is required for log-match automations (investigation instructions).",path:["description"]})}}),Tve=a.object({automation:mp}),Bve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),name:a.string().min(1).max(200).optional().describe("New automation name."),description:a.string().max(2000).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged."),cronExpression:a.string().optional().describe("New cron schedule."),timezone:a.string().optional().describe("New IANA timezone."),timeoutSeconds:a.coerce.number().int().min(1).max(3600).optional().describe("New execution timeout in seconds.")}),Ove=a.object({automation:mp}),_ve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Dve=a.object({automation:mp}),Qve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Lve=a.object({automation:mp}),gR=E({operationId:"automations.list",description:"List scheduled automations in a project, with run health and recent run stats.",backend:"api",route:{method:"GET",path:"/automations",tags:["Automations"]},input:wve,output:kve,pagination:"cursor",async:"sync"}),mR=E({operationId:"automations.get",description:"Get a single automation by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}",tags:["Automations"]},input:xve,output:Pve,pagination:"none",async:"sync"}),hR=E({operationId:"automations.create",description:"Create an automation: either a cron-driven project script (see scripts.create) or a signal investigation bound to a signal definition (see signalDefinitions.create).",backend:"api",route:{method:"POST",path:"/automations",successStatus:201,tags:["Automations"]},input:Rve,output:Tve,pagination:"none",async:"sync"}),AR=E({operationId:"automations.update",description:"Update an automation's name, description, or schedule. Does not change which script it runs.",backend:"api",route:{method:"PATCH",path:"/automations/{automationId}",tags:["Automations"]},input:Bve,output:Ove,pagination:"none",async:"sync"}),fR=E({operationId:"automations.enable",description:"Enable an automation so it runs on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/enable",tags:["Automations"]},input:_ve,output:Dve,pagination:"none",async:"sync"}),yR=E({operationId:"automations.disable",description:"Disable an automation so it stops running on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/disable",tags:["Automations"]},input:Qve,output:Lve,pagination:"none",async:"sync"}),Nve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),status:a.union([pR,a.array(pR)]).optional().describe("Filter runs by status. Accepts a single status or an array of statuses (matched as OR)."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page.")}),Mve=a.object({runs:a.array(N1),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results."),recordedHistoryStartsAt:a.string().datetime().describe("Earliest timestamp for which run history is recorded.")}),zve=a.object({automationId:Gs,runId:a.string().uuid().describe("Automation run ID."),projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),jve=a.object({run:Cve}),bR=E({operationId:"automations.runs.list",description:"List runs for an automation, most recent first.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs",tags:["Automations"]},input:Nve,output:Mve,pagination:"cursor",async:"sync"}),IR=E({operationId:"automations.runs.get",description:"Get a single automation run by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}",tags:["Automations"]},input:zve,output:jve,pagination:"none",async:"sync"}),Uve=a.enum(["queued","running","succeeded","failed","timed_out"]),Fve=a.object({stdout:a.string().describe("Captured standard output for the run."),stderr:a.string().describe("Captured standard error for the run."),exitCode:a.number().int().nullable().describe("Process exit code of the run's command, if it finished."),status:Uve.describe("Execution status of the run's captured command."),truncated:a.boolean().describe("Whether the captured output exceeded the inline preview limit. The full output is returned when it could be read from durable storage; otherwise the truncated preview is returned with this flag set."),startedAt:a.string().datetime().nullable().describe("When the command started executing, if known."),completedAt:a.string().datetime().nullable().describe("When the command finished executing, if known."),durationMs:a.number().int().nullable().describe("Command execution duration in milliseconds, if known.")}),$ve=a.object({automationId:Gs,runId:a.string().uuid().describe("Automation run ID."),projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Gve=a.object({logs:Fve}),SR=E({operationId:"automations.runs.logs",description:"Get the captured stdout/stderr for a single automation run, reading the full output from durable storage when the inline preview was truncated.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}/logs",tags:["Automations"]},input:$ve,output:Gve,pagination:"none",async:"sync"}),Ypt={list:gR.contract,get:mR.contract,create:hR.contract,update:AR.contract,enable:fR.contract,disable:yR.contract,runs:{list:bR.contract,get:IR.contract,logs:SR.contract}}});var Hve,qve,Vve,Kve,j1,Yve,yf,Wve,Jve,U1,Zve,Xve,eEe,tEe,nEe,oEe,rEe,vR,ER,wR,Go,F1,CR,kR,iEe,$1,sEe,aEe,cEe,lEe,uEe,dEe,pEe,gEe,mEe,hEe,AEe,fEe,yEe,bEe,IEe,SEe,CEe,vEe,EEe,xR,G1,wEe,kEe,PR,RR,TR,BR,OR,_R,DR,QR,LR,NR,MR,zR,jR,Xpt;var H1=h(()=>{De();Ve();Hve=a.enum(["logs_ingested_bytes","logs_accepted_bytes","input_tokens","output_tokens","issues_created","automation_runs_completed","pull_requests_created","pull_request_reviews_completed"]),qve=a.enum(["cycle_top_up","upgrade_top_up","deficit_settlement","auto_top_up","one_off_top_up","usage_debit","adjustment","migration_opening_balance","void"]),Vve=a.enum(["credit","debit"]),Kve=a.enum(["cycle_renewal","plan_upgrade","auto_purchase","one_off_purchase","deficit_settlement","usage","adjustment","migration_opening_balance"]),j1=a.object({startsAt:a.string().datetime(),endsAt:a.string().datetime(),billableStartsAt:a.string().datetime()}),Yve=a.object({subscriptionChargeAmount:a.string(),creditDeficitAmount:a.string(),creditDeficitChargeAmount:a.string(),totalAmount:a.string(),currency:a.string()}),yf=a.object({billingSubscriptionChangeId:a.string(),effectiveAt:a.string().datetime(),planSlug:a.string().nullable(),planName:a.string().nullable(),price:a.string().nullable(),currency:a.string().nullable(),targetCreditBalance:a.string().nullable()}),Wve=a.object({id:a.string(),status:a.string(),billingPlanId:a.string(),priceBookId:a.string().optional(),cycleType:a.string(),cancelAt:a.string().datetime().nullable(),canceledAt:a.string().datetime().nullable()}),Jve=a.object({organizationId:a.string().min(1).optional().describe("Organization to query billing for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),U1=a.object({status:a.enum(["current","payment_retrying","delinquent"]).describe("Negative-balance collection state. `current` means no open collection case; `payment_retrying` means a scheduled retry cadence is running; `delinquent` means retries are exhausted and intake is denied until payment settles the balance."),outstandingCredits:a.string().nullable().describe("Credits owed (absolute value of the negative balance)."),outstandingAmount:a.string().nullable().describe("Amount owed in `currency` at the current additional-credit price."),currency:a.string().nullable(),scheduledAttemptsMade:a.number().int().describe("Scheduled collection attempts consumed by confirmed payment failures."),nextRetryAt:a.string().datetime().nullable(),billingInvoiceId:a.string().nullable(),hostedInvoiceUrl:a.string().nullable()}).describe("Read-only negative-balance collection state for the organization."),Zve=a.object({billingModel:a.enum(["credit-balance-v1"]),billable:a.boolean(),nonBillableReason:a.string().nullable(),status:a.string(),planName:a.string().nullable(),planSlug:a.string().nullable(),currency:a.string().nullable(),currentBalance:a.string().nullable(),targetCreditBalance:a.string().nullable(),currentCycle:j1.nullable(),currentPeriodEstimate:Yve.nullable(),pendingDowngrade:yf.nullable(),subscription:Wve.nullable(),collection:U1,currentPlan:a.object({slug:a.string(),name:a.string(),price:a.string().nullable(),currency:a.string().nullable(),targetCreditBalance:a.string().nullable(),subscriptionStatus:a.string(),cycleStartsAt:a.string().datetime().nullable(),cycleEndsAt:a.string().datetime().nullable(),renewalAt:a.string().datetime().nullable(),pendingSwitch:yf.nullable(),pendingCancellation:a.object({effectiveAt:a.string().datetime()}).nullable()}).nullable()}),Xve=a.object({organizationId:a.string().min(1).optional().describe("Organization to query usage for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),cycle:a.enum(["current","previous"]).default("current").describe("Which billing cycle to report usage for.")}),eEe=a.object({dimension:Hve,totalQuantity:a.string(),ratedQuantity:a.string(),creditsConsumed:a.string(),sourceBreakdown:a.record(a.string(),a.string())}),tEe=a.object({cycle:j1.nullable(),usage:a.array(eEe)}),nEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to query transactions for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),limit:a.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of transactions to return per page."),page:a.coerce.number().int().min(1).default(1).describe("Page number for pagination (1-indexed).")}),oEe=a.object({id:a.string(),transactionType:qve,creditDelta:a.string(),direction:Vve.describe("Which way this entry moved the balance. Derived from the business event, not from the amount: a zero-credit cycle renewal is still a credit."),reason:Kve.describe("The business event that produced this entry."),amount:a.string().describe("Non-negative magnitude of the balance movement. Apply `direction` for the signed value."),balanceAfter:a.string(),occurredAt:a.string().datetime(),billingInvoiceId:a.string().nullable()}),rEe=a.object({items:a.array(oEe),pagination:a.object({page:a.number(),limit:a.number(),total:a.number(),totalPages:a.number(),hasNext:a.boolean(),hasPrev:a.boolean()}).describe("Pagination metadata for the transaction list.")}),vR=E({operationId:"billing.getSummary",description:"Get a billing summary for the current organization, including plan, balance, and cycle information.",backend:"api",route:{method:"GET",path:"/billing/summary",tags:["Billing"]},input:Jve,output:Zve,pagination:"none",async:"sync"}),ER=E({operationId:"billing.getUsage",description:"Get per-dimension usage breakdown for the current or previous billing cycle.",backend:"api",route:{method:"GET",path:"/billing/usage",tags:["Billing"]},input:Xve,output:tEe,pagination:"none",async:"sync"}),wR=E({operationId:"billing.listTransactions",description:"List recent credit ledger transactions with pagination.",backend:"api",route:{method:"GET",path:"/billing/transactions",tags:["Billing"]},input:nEe,output:rEe,pagination:"page",async:"sync"}),Go=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),F1=a.string().trim().regex(/^\d+(?:\.\d{1,6})?$/,"Expected a decimal with up to 6 places"),CR=F1.refine((e)=>{let[,t=""]=e.split(".");return t.slice(2).replaceAll("0","")===""},"Expected a currency amount with up to 2 decimal places").refine((e)=>/[1-9]/.test(e),"Expected a positive currency amount"),kR=a.string().trim().min(1).max(100),iEe=a.object({organizationId:Go}),$1=a.object({supported:a.boolean().describe("Whether auto top-up is available for the account's plan."),enabled:a.boolean(),triggerCreditBalance:a.string(),topUpAmount:a.string(),cycleSpendingLimit:a.string(),currency:a.string(),creditsToGrant:a.string().nullable(),status:a.string()}),sEe=a.object({organizationId:Go,enabled:a.boolean(),triggerCreditBalance:F1,topUpAmount:CR,cycleSpendingLimit:CR}),aEe=a.object({organizationId:Go,amount:CR.describe("Amount to charge in the account currency; grants an equal credit balance."),idempotencyKey:a.string().trim().min(1).max(128).describe("Client-generated key. Repeating a request with the same key returns the original purchase instead of charging again.")}),cEe=a.object({status:a.enum(["paid","pending_payment"]),billingInvoiceId:a.string(),topUpAmount:a.string(),creditsToGrant:a.string(),currency:a.string()}),lEe=a.object({organizationId:Go}),uEe=a.object({slug:a.string(),billingModel:a.string(),name:a.string(),description:a.string(),bestFor:a.string().nullable(),price:a.string(),currency:a.string(),targetCreditBalance:a.string().nullable(),logsIncludedBytes:a.string(),inputTokensIncluded:a.string(),outputTokensIncluded:a.string()}),dEe=a.object({billingModel:a.string(),currentPlanSlug:a.string().nullable(),hasActiveStripeBilling:a.boolean(),plans:a.array(uEe)}),pEe=a.object({organizationId:Go,planSlug:kR}),gEe=a.object({calculatedAt:a.string().datetime(),type:a.enum(["upgrade","downgrade"]),effectiveAt:a.string().datetime(),currency:a.string(),currentPlanSlug:a.string(),targetPlanSlug:a.string(),currentPlanName:a.string(),targetPlanName:a.string(),currentPlanPrice:a.string(),targetPlanPrice:a.string(),currentTargetCreditBalance:a.string(),targetCreditBalance:a.string(),creditDeficitAmount:a.string(),creditDeficitChargeAmount:a.string(),additionalCreditPrice:a.string(),immediateChargeAmount:a.string(),subscriptionChargeAmount:a.string(),proratedCreditGrantAmount:a.string(),remainingCycleFraction:a.string(),nextCycleChargeAmount:a.string()}),mEe=a.object({organizationId:Go,planSlug:kR}),hEe=a.object({billingSubscriptionChangeId:a.string(),billingSubscriptionId:a.string(),status:a.string(),type:a.string(),effectiveAt:a.string().datetime(),invoiceId:a.string().nullable(),creditDeficitAmount:a.string().optional(),creditDeficitChargeAmount:a.string().optional(),creditTopUpAmount:a.string().optional(),immediateChargeAmount:a.string().optional(),subscriptionChargeAmount:a.string().optional(),proratedCreditGrantAmount:a.string().optional()}),AEe=a.object({organizationId:Go,planSlug:kR}),fEe=a.object({sessionId:a.string(),checkoutUrl:a.string().url()}),yEe=a.object({organizationId:Go,sessionId:a.string().min(1).describe("The checkout session id returned by createCheckoutSession.")}),bEe=a.object({status:a.enum(["pending","active","expired"])}),IEe=a.object({organizationId:Go}),SEe=a.object({portalUrl:a.string().url()}),CEe=a.object({organizationId:Go}),vEe=a.object({hasPaymentMethod:a.boolean(),brand:a.string().nullable(),last4:a.string().nullable(),type:a.string().nullable(),expiryMonth:a.number().int().min(1).max(12).nullable(),expiryYear:a.number().int().nullable(),isDefault:a.boolean(),display:a.string().nullable()}),EEe=a.object({slug:a.string(),name:a.string(),price:a.string().nullable(),currency:a.string().nullable(),targetCreditBalance:a.string().nullable(),subscriptionStatus:a.string(),cycleStartsAt:a.string().datetime().nullable(),cycleEndsAt:a.string().datetime().nullable(),renewalAt:a.string().datetime().nullable(),pendingSwitch:yf.nullable(),pendingCancellation:a.object({effectiveAt:a.string().datetime()}).nullable()}),xR=a.object({organizationId:Go}),G1=a.object({currentPlan:EEe,effectiveAt:a.string().datetime(),currentBalance:a.string(),servicePolicy:a.literal("active_until_period_end"),creditPolicy:a.literal("dormant_until_resubscription"),scheduledFinalCharge:a.string().nullable(),autoTopUpEnabled:a.boolean(),pendingDowngrade:yf.nullable(),collectionState:U1,calculatedAt:a.string().datetime()}),wEe=G1.extend({billingSubscriptionChangeId:a.string(),alreadyScheduled:a.boolean()}),kEe=a.object({billingSubscriptionId:a.string(),resumed:a.literal(!0)}),PR=E({operationId:"billing.getAutoTopUp",description:"Get the organization's credit auto top-up settings (trigger balance, top-up amount, cycle spending limit).",backend:"api",route:{method:"GET",path:"/billing/auto-top-up",tags:["Billing"]},input:iEe,output:$1,pagination:"none",async:"sync"}),RR=E({operationId:"billing.updateAutoTopUp",description:"Enable/disable and configure credit auto top-up. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"PUT",path:"/billing/auto-top-up",tags:["Billing"]},input:sEe,output:$1,pagination:"none",async:"sync"}),TR=E({operationId:"billing.purchaseCredits",description:"Purchase a one-time amount of credits against the saved payment method. Requires a user credential with `billing:manage` and a stable idempotency key.",backend:"api",route:{method:"POST",path:"/billing/credits/purchase",tags:["Billing"]},input:aEe,output:cEe,pagination:"none",async:"sync"}),BR=E({operationId:"billing.listPlans",description:"List the self-serve credit plans available for checkout, including the current plan.",backend:"api",route:{method:"GET",path:"/billing/plans",tags:["Billing"]},input:lEe,output:dEe,pagination:"none",async:"sync"}),OR=E({operationId:"billing.previewPlanChange",description:"Preview the cost and effect of changing to a plan without applying it. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change/preview",tags:["Billing"]},input:pEe,output:gEe,pagination:"none",async:"sync"}),_R=E({operationId:"billing.changePlan",description:"Apply a plan upgrade or schedule a downgrade. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change",tags:["Billing"]},input:mEe,output:hEe,pagination:"none",async:"sync"}),DR=E({operationId:"billing.createCheckoutSession",description:"Create a hosted Stripe Checkout session for first-time subscribe from the terminal. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/checkout-session",tags:["Billing"]},input:AEe,output:fEe,pagination:"none",async:"sync"}),QR=E({operationId:"billing.getCheckoutSessionStatus",description:"Poll the completion status of a checkout session created by this organization.",backend:"api",route:{method:"GET",path:"/billing/checkout-session/{sessionId}",tags:["Billing"]},input:yEe,output:bEe,pagination:"none",async:"sync"}),LR=E({operationId:"billing.createPortalSession",description:"Create a Stripe Customer Portal session for updating the payment method. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/portal-session",tags:["Billing"]},input:IEe,output:SEe,pagination:"none",async:"sync"}),NR=E({operationId:"billing.getPaymentMethod",description:"Get a summary of the organization's saved payment method (brand and last 4 digits).",backend:"api",route:{method:"GET",path:"/billing/payment-method",tags:["Billing"]},input:CEe,output:vEe,pagination:"none",async:"sync"}),MR=E({operationId:"billing.previewSubscriptionCancellation",description:"Preview period-end subscription cancellation without changing billing state.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/preview",tags:["Billing"]},input:xR,output:G1,pagination:"none",async:"sync"}),zR=E({operationId:"billing.scheduleSubscriptionCancellation",description:"Schedule cancellation at the end of the paid billing cycle.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation",tags:["Billing"]},input:xR,output:wEe,pagination:"none",async:"sync"}),jR=E({operationId:"billing.resumeSubscriptionCancellation",description:"Resume renewal before a scheduled cancellation takes effect.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/resume",tags:["Billing"]},input:xR,output:kEe,pagination:"none",async:"sync"}),Xpt={getSummary:vR.contract,getUsage:ER.contract,listTransactions:wR.contract,getAutoTopUp:PR.contract,updateAutoTopUp:RR.contract,purchaseCredits:TR.contract,listPlans:BR.contract,previewPlanChange:OR.contract,changePlan:_R.contract,createCheckoutSession:DR.contract,getCheckoutSessionStatus:QR.contract,createPortalSession:LR.contract,getPaymentMethod:NR.contract,previewSubscriptionCancellation:MR.contract,scheduleSubscriptionCancellation:zR.contract,resumeSubscriptionCancellation:jR.contract}});var xEe,hp,PEe,REe,TEe,BEe,OEe,_Ee,Ap,q1,DEe,QEe,V1,LEe,NEe,K1,MEe,zEe,Y1,jEe,UEe,W1,FEe,$Ee,J1,GEe,HEe,qEe,Z1,VEe,KEe,X1,YEe,WEe,e2,UR,t2,n2,o2,r2,i2,s2,fp,a2,JEe,c2,ZEe,l2,u2,XEe,ewe,d2,twe,p2,nwe,owe,g2;var m2=h(()=>{De();Ve();xEe=["slack","github","linear","pagerduty","victorops","rootly","incident_io","webhook","teams","bitbucket","jira"],hp=a.enum(xEe),PEe=a.enum(["oauth","app_installation","api_key"]),REe=a.enum(["alert_routing","inbound_webhooks","messaging","code_search","health_check"]),TEe=a.enum(["pending","connected","error","revoked"]),BEe=a.enum(["healthy","unhealthy","unknown"]),OEe=a.object({name:a.string().describe("Field name used as the JSON key in `credentials`."),label:a.string().describe("Human-readable field label."),required:a.boolean().describe("Whether the field is required."),secret:a.boolean().describe("Whether the field is a secret (masked in UIs, encrypted)."),description:a.string().nullable().describe("Optional hint for the field's expected value.")}),_Ee=a.object({id:hp.describe("Integration provider identifier."),name:a.string().describe("Human-readable display name."),description:a.string().describe("Short description of the provider."),authType:PEe.describe("Auth flow used to connect this provider."),capabilities:a.array(REe).describe("Capabilities the provider exposes once connected."),connectionCount:a.number().int().describe("Number of active connections for this provider in the organization, including error-status connections that need attention."),credentialFields:a.array(OEe).optional().describe("Fields required in `credentials` when creating an api_key connection. Absent for browser-auth providers."),browserConnectSupported:a.boolean().describe("Whether this provider's browser connect flow (`integrations.beginConnect`) is available in this environment. Readiness-derived: the provider begins on the consolidated OAuth callback route and its OAuth client credentials are provisioned. Providers still on legacy browser paths (Slack, Linear, Bitbucket) report false and connect from the dashboard.")}),Ap=a.object({id:a.string().uuid(),provider:hp,displayName:a.string().nullable(),status:TEe,isActive:a.boolean().describe("Whether this connection counts as connected (status 'connected' or 'error'). An error-status connection is the organization's connection — broken, not absent."),needsAttention:a.boolean().describe("Whether the connection should surface a reconnect prompt (status 'error' or health status 'unhealthy')."),metadata:a.record(a.string(),a.unknown()).describe("Non-secret provider metadata (e.g. workspace/team names)."),healthStatus:BEe,healthMessage:a.string().nullable(),healthCheckedAt:a.string().datetime().nullable(),healthConsecutiveFailures:a.number().int(),connectedBy:a.string().nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),q1=a.object({organizationEnabled:a.boolean().describe("Stored organization-wide policy."),connectionEnabled:a.boolean().describe("Stored connection policy."),effectiveEnabled:a.boolean().describe("True only when both stored policies are enabled.")}),DEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to list providers for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),QEe=a.object({providers:a.array(_Ee)}),V1=E({operationId:"integrations.listProviders",description:"List supported integration providers and how many connections the organization has for each.",backend:"api",route:{method:"GET",path:"/integrations/providers",tags:["Integrations"]},input:DEe,output:QEe,pagination:"none",async:"sync"}),LEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to list connections for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:hp.optional().describe("Filter connections by provider.")}),NEe=a.object({connections:a.array(Ap)}),K1=E({operationId:"integrations.listConnections",description:"List integration connections and their connection state for the organization.",backend:"api",route:{method:"GET",path:"/integrations/connections",tags:["Integrations"]},input:LEe,output:NEe,pagination:"none",async:"sync"}),MEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Connection ID to fetch.")}),zEe=a.object({connection:Ap}),Y1=E({operationId:"integrations.getConnection",description:"Get one integration connection by ID (non-secret config only).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:MEe,output:zEe,pagination:"none",async:"sync"}),jEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:hp.describe("Integration provider to connect. Must use api_key auth (see `authType` in the provider catalog)."),displayName:a.string().trim().min(1).max(255).optional().describe("Optional display name for the connection."),credentials:a.record(a.string(),a.unknown()).describe("Vendor credentials. Fields vary by provider (see `credentialFields` on the provider catalog). Validated against the vendor before the connection is created; never returned.")}),UEe=a.object({connection:Ap}),W1=E({operationId:"integrations.createConnection",description:"Create an integration connection for an api_key provider. Credentials are validated against the vendor, then stored encrypted.",backend:"api",route:{method:"POST",path:"/integrations/connections",tags:["Integrations"],successStatus:201},input:jEe,output:UEe,pagination:"none",async:"sync"}),FEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:hp.describe("Browser-auth provider to connect (oauth or app_installation). Must report `browserConnectSupported: true` in the provider catalog."),displayName:a.string().trim().min(1).max(255).optional().describe("Optional display name for the resulting connection."),projectId:a.string().trim().min(1).optional().describe("Project the completed connection defaults its routing to. Must belong to the organization.")}),$Ee=a.object({url:a.string().describe("Vendor authorization (or app installation) URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:a.string().uuid().describe("Connect attempt to poll via `integrations.getConnectAttempt` while the browser flow completes."),expiresAt:a.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),J1=E({operationId:"integrations.beginConnect",description:"Begin a browser connect flow for an OAuth or app-installation provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/integrations/connect",tags:["Integrations"],successStatus:201},input:FEe,output:$Ee,pagination:"none",async:"sync"}),GEe=a.enum(["pending","completed","not_connected","failed","expired"]),HEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),attemptId:a.string().uuid().describe("Connect attempt ID to poll.")}),qEe=a.object({status:GEe.describe("Attempt state. `not_connected` means the flow finished but the connection is not live yet (most commonly awaiting a third-party admin's approval). `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:a.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized) or `not_connected` (e.g. `installation_requested` for GitHub installs awaiting org-admin approval)."),connection:Ap.optional().describe("The created connection when status is `completed`.")}),Z1=E({operationId:"integrations.getConnectAttempt",description:"Poll a browser connect attempt started with `integrations.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/integrations/connect/attempts/{attemptId}",tags:["Integrations"]},input:HEe,output:qEe,pagination:"none",async:"sync"}),VEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Connection ID to disconnect.")}),KEe=a.object({success:a.literal(!0)}),X1=E({operationId:"integrations.disconnectConnection",description:"Disconnect an integration connection (soft delete). Always succeeds regardless of stored credential state; cached vendor catalogs and routing derived from the connection are removed.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:VEe,output:KEe,pagination:"none",async:"sync"}),YEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Connection ID to update."),credentials:a.record(a.string(),a.unknown()).describe("Replacement vendor credentials for an api_key connection. Validated against the vendor; resets the connection's health state on success.")}),WEe=a.object({connection:Ap}),e2=E({operationId:"integrations.updateConnectionCredentials",description:"Replace an api_key connection's credentials in place — the reconnect path for a connection that needs attention. Keeps connection-scoped configuration.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/credentials",tags:["Integrations"]},input:YEe,output:WEe,pagination:"none",async:"sync"}),UR=a.object({organizationId:a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),t2=a.object({organizationEnabled:a.boolean(),effectiveEnabled:a.boolean()}),n2=UR.extend({connectionId:a.string().uuid().describe("Integration connection whose JIT policy is being read or updated.")}),o2=E({operationId:"integrations.getOrganizationExternalIdentityJitPolicy",description:"Read the organization's stored external-identity JIT policy.",backend:"api",route:{method:"GET",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:UR,output:t2,pagination:"none",async:"sync"}),r2=E({operationId:"integrations.updateOrganizationExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT across an organization.",backend:"api",route:{method:"PATCH",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:UR.extend({enabled:a.boolean()}),output:t2,pagination:"none",async:"sync"}),i2=E({operationId:"integrations.getConnectionExternalIdentityJitPolicy",description:"Read stored and effective JIT policy for one connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:n2,output:q1,pagination:"none",async:"sync"}),s2=E({operationId:"integrations.updateConnectionExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT for one connection.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:n2.extend({enabled:a.boolean()}),output:q1,pagination:"none",async:"sync"}),fp=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Slack integration connection ID (the `integration_connections.id`, not the Slack team id).")}),a2=a.object({connectionId:a.string().uuid(),defaultProjectId:a.string().uuid().nullable().describe("Project new threads route to when no channel mapping matches."),automaticResponses:a.boolean().describe("Auto-respond to messages in channels the bot is in (autoReactEnabled)."),acknowledgementMessage:a.boolean().describe("Post a processing acknowledgement while a run is in flight (processingMessageEnabled).")}),JEe=fp,c2=E({operationId:"integrations.getSlackConfiguration",description:"Read Slack connection configuration (default project, automatic responses, acknowledgement message).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:JEe,output:a2,pagination:"none",async:"sync"}),ZEe=fp.extend({defaultProjectId:a.string().uuid().nullable().optional().describe("Project new threads route to when no channel mapping matches. Pass null to clear it. Omit to leave unchanged."),automaticResponses:a.boolean().optional().describe("Omit to leave unchanged."),acknowledgementMessage:a.boolean().optional().describe("Omit to leave unchanged.")}),l2=E({operationId:"integrations.updateSlackConfiguration",description:"Update Slack connection configuration. Omitted fields are left unchanged.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:ZEe,output:a2,pagination:"none",async:"sync"}),u2=a.object({connectionId:a.string().uuid(),slackChannelId:a.string().min(1),slackChannelName:a.string().min(1),projectId:a.string().uuid()}),XEe=fp,ewe=a.object({mappings:a.array(u2)}),d2=E({operationId:"integrations.listSlackChannelProjectMappings",description:"List channel-to-project mappings for a Slack connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings",tags:["Integrations"]},input:XEe,output:ewe,pagination:"none",async:"sync"}),twe=fp.extend({slackChannelId:a.string().min(1).describe("Slack channel ID (e.g. C0123ABCDEF)."),slackChannelName:a.string().min(1).optional().describe("Optional. Ignored for storage — the authoritative channel name is "+"always resolved from the connection's channel catalog. Accepted only as a convenience/label; the response returns the catalog name."),projectId:a.string().uuid().describe("Project the channel routes to. Must belong to the organization.")}),p2=E({operationId:"integrations.setSlackChannelProjectMapping",description:"Create or update the channel-to-project mapping for one Slack channel. Idempotent on (connection, channel).",backend:"api",route:{method:"PUT",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:twe,output:u2,pagination:"none",async:"sync"}),nwe=fp.extend({slackChannelId:a.string().min(1)}),owe=a.object({success:a.boolean()}),g2=E({operationId:"integrations.deleteSlackChannelProjectMapping",description:"Delete a channel-to-project mapping.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:nwe,output:owe,pagination:"none",async:"sync"})});var Ho,rwe,iwe,h2,bf,If,A2,FR,f2,$R,y2,b2,swe,awe,I2,S2,C2,v2,E2,w2,k2,x2,P2,R2,T2,B2,O2,_2,D2,zc,Sf,Cf,vf,Ef,wf,kf,xf,Pf,Rf,Tf,cwe;var GR=h(()=>{De();Ve();Ho=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),status:a.enum(["open","resolved","ignored"]),severity:a.enum(["low","medium","high","critical"]),componentId:a.string().uuid().nullable(),createdAt:a.string().datetime(),resolvedAt:a.string().datetime().nullable(),mutedAt:a.string().datetime().nullable(),muteHitCount:a.number().int().nonnegative(),lastActivityAt:a.string().datetime().nullable(),lastDeliveredAt:a.string().datetime().nullable(),locked:a.boolean(),redacted:a.boolean()}),rwe=a.object({channelId:a.string().nullable(),channelName:a.string().nullable(),threadTs:a.string().nullable(),permalink:a.string().nullable(),workspaceName:a.string().nullable()}),iwe=Ho.extend({slackChannels:a.array(rwe)}),h2=Ho.extend({delivery:a.record(a.string(),a.unknown()).nullable().optional()}),bf=a.object({projectId:a.string().uuid().optional().describe("Project to create the issue in. Auto-filled from CLI and SDK context when omitted."),name:a.string().trim().min(1).optional().describe("Stable issue name for indexing and mute matching. When omitted, the name is derived from contentMdx."),contentMdx:a.string().trim().min(1,"contentMdx cannot be empty").optional().describe("Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence). Required unless sample is true."),severity:a.enum(["low","medium","high","critical"]).default("medium").describe("Issue severity used for prioritization and triage."),componentId:a.string().uuid().optional().describe("UUID of a registered component this issue belongs to. Required unless sample is true: every issue must be attributed to a component. List components first and pick the best match; register one if none fits. Missing or unknown IDs are rejected."),statusStartedAt:a.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident began."),sample:a.boolean().optional().describe("When true, creates (or returns) the organization's onboarding sample issue for the target project using the curated sample payload, and the alert rides the normal issue_triggered broadcast to the configured delivery rules. Mutually exclusive with the content inputs (name, contentMdx, severity, componentId, statusStartedAt); projectId stays allowed. Idempotent per project: an existing sample attempt's issue is returned instead of creating a new one. Requires a user credential.")}),If=bf.superRefine((e,t)=>{if(e.sample){let n=[["name",e.name!==void 0],["contentMdx",e.contentMdx!==void 0],["severity",e.severity!=="medium"],["componentId",e.componentId!==void 0],["statusStartedAt",e.statusStartedAt!==void 0]];for(let[r,o]of n)if(o)t.addIssue({code:"custom",path:[r],message:`${r} is not allowed when sample is true.`})}else{if(!e.contentMdx)t.addIssue({code:"custom",path:["contentMdx"],message:"contentMdx is required"});if(!e.componentId)t.addIssue({code:"custom",path:["componentId"],message:"componentId is required"})}if(e.statusStartedAt&&!e.componentId)t.addIssue({code:"custom",path:["statusStartedAt"],message:"statusStartedAt requires componentId."})}),A2=a.object({issue:Ho,duplicateIssueId:a.string().uuid().optional().describe("Present when creation reused an existing open issue instead of creating a new one.")}),FR=a.object({projectId:a.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:a.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:a.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),componentId:a.string().uuid().optional().describe("Filter by component ID.")}),f2=a.object({issues:a.array(Ho),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),$R=FR.extend({name:a.string().trim().optional().describe("Case-insensitive partial match on issue name."),includeDeliveryMetadata:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, include raw delivery metadata in each issue.")}),y2=a.object({issues:a.array(h2),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),b2=$R.omit({limit:!0,cursor:!0,includeDeliveryMetadata:!0}),swe=a.object({open:a.number().int().nonnegative(),resolved:a.number().int().nonnegative(),ignored:a.number().int().nonnegative()}),awe=a.object({low:a.number().int().nonnegative(),medium:a.number().int().nonnegative(),high:a.number().int().nonnegative(),critical:a.number().int().nonnegative()}),I2=a.object({total:a.number().int().nonnegative(),byStatus:swe,bySeverity:awe,filters:a.object({name:a.string().nullable(),status:a.enum(["open","resolved","ignored"]).nullable(),severity:a.enum(["low","medium","high","critical"]).nullable(),componentId:a.string().uuid().nullable()})}),S2=a.object({issueId:a.string().uuid().describe("Issue ID to retrieve.")}),C2=a.object({issue:iwe}),v2=a.object({issueId:a.string().uuid().describe("Issue ID to resolve."),statusResolvedAt:a.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident ended.")}),E2=a.object({issue:Ho}),w2=a.object({issueId:a.string().uuid().describe("Issue ID to ignore.")}),k2=a.object({issue:Ho}),x2=a.object({issueId:a.string().uuid().describe("Issue ID to reopen.")}),P2=a.object({issue:Ho}),R2=a.object({issueId:a.string().uuid().describe("Issue ID to reassign and reopen."),targetComponentId:a.string().uuid().describe("Active canonical component that will own the reopened issue.")}),T2=a.object({issue:Ho,sourceComponentId:a.string().uuid(),targetComponentId:a.string().uuid()}),B2=a.object({issueId:a.string().uuid().describe("Issue ID to mute.")}),O2=a.object({issue:Ho}),_2=a.object({issueId:a.string().uuid().describe("Issue ID to unmute.")}),D2=a.object({issue:Ho}),zc=E({operationId:"issues.create",description:"Create an issue in a project, returning an existing open issue when root-cause deduplication finds a match.",backend:"api",route:{method:"POST",path:"/issues",tags:["Issues"],successStatus:201},input:If,output:A2,pagination:"none",async:"sync"}),Sf=E({operationId:"issues.list",description:"List issues in a project, optionally filtered by status and severity.",backend:"api",route:{method:"GET",path:"/issues",tags:["Issues"]},input:FR,output:f2,pagination:"cursor",async:"sync"}),Cf=E({operationId:"issues.search",description:"Search issues in a project by name, status, and severity.",backend:"api",route:{method:"GET",path:"/issues/search",tags:["Issues"]},input:$R,output:y2,pagination:"cursor",async:"sync"}),vf=E({operationId:"issues.count",description:"Count issues in a project with status and severity breakdowns.",backend:"api",route:{method:"GET",path:"/issues/count",tags:["Issues"]},input:b2,output:I2,pagination:"none",async:"sync"}),Ef=E({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:S2,output:C2,pagination:"none",async:"sync"}),wf=E({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:v2,output:E2,pagination:"none",async:"sync"}),kf=E({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:w2,output:k2,pagination:"none",async:"sync"}),xf=E({operationId:"issues.reopen",description:"Reopen a resolved or ignored issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reopen",tags:["Issues"]},input:x2,output:P2,pagination:"none",async:"sync"}),Pf=E({operationId:"issues.reassignAndReopen",description:"Atomically reassign a resolved or ignored issue to an active component and reopen it.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reassign-and-reopen",tags:["Issues"]},input:R2,output:T2,pagination:"none",async:"sync"}),Rf=E({operationId:"issues.mute",description:"Mute an issue, suppressing future re-fires without changing status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/mute",tags:["Issues"]},input:B2,output:O2,pagination:"none",async:"sync"}),Tf=E({operationId:"issues.unmute",description:"Unmute an issue, preserving its current status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unmute",tags:["Issues"]},input:_2,output:D2,pagination:"none",async:"sync"}),cwe={count:vf.contract,create:zc.contract,list:Sf.contract,search:Cf.contract,get:Ef.contract,resolve:wf.contract,ignore:kf.contract,reopen:xf.contract,reassignAndReopen:Pf.contract,mute:Rf.contract,unmute:Tf.contract}});var HR,Q2,Bf,Of,L2,N2,M2,z2,_f,qR,j2,U2,F2,$2,G2,H2,q2,V2,K2,Y2,W2,J2,jc,Uc,Fc,$c,Gc,Df,Qf,Lf,Nf,Mf,lwe,uwe;var VR=h(()=>{De();Ve();HR=/^[a-zA-Z0-9\s\-_]+$/,Q2=a.object({id:a.string().uuid(),name:a.string(),expiresAt:a.string().datetime().nullable(),lastUsedAt:a.string().datetime().nullable(),createdAt:a.string().datetime()}),Bf=Q2.extend({projectId:a.string().uuid(),dataSourceConnectionId:a.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:a.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),Of=Q2.extend({projectId:a.string().uuid().nullable()}),L2=a.object({projectId:a.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),N2=a.object({publicKeys:a.array(Bf),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),M2=a.object({secretKeys:a.array(Of),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),z2=a.object({projectId:a.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:a.string().uuid().describe("Key ID to fetch.")}),_f=a.object({publicKey:Bf}),qR=a.object({secretKey:Of}),j2=a.object({publicKey:Bf.extend({value:a.string()})}),U2=a.object({projectId:a.string().uuid().optional().describe("Project to ensure the log forwarding key for. Auto-filled from CLI and SDK context when omitted.")}),F2=a.object({secretKey:Of.extend({value:a.string()})}),$2=a.object({projectId:a.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:a.string().uuid().describe("Key ID to update."),name:a.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(HR,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:a.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),G2=a.object({params:a.object({keyId:a.string().uuid().describe("Public key ID to deactivate.")}),query:a.object({projectId:a.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:e,query:t})=>({...t,...e})),H2=_f,q2=a.void(),V2=a.object({organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),K2=a.object({keyId:a.string().uuid().describe("Key ID to fetch."),organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),Y2=a.object({organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project. Omit for organization-wide access."),name:a.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(HR,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:a.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),W2=a.object({keyId:a.string().uuid().describe("Key ID to update."),organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),name:a.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(HR,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:a.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),J2=a.object({params:a.object({keyId:a.string().uuid().describe("Key ID to delete.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}).default({})}).transform(({params:e,query:t})=>({...e,...t.organizationId!==void 0?{organizationId:t.organizationId}:{}})),jc=E({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:L2,output:N2,pagination:"cursor",async:"sync",examples:[{name:"list-public-keys",input:{projectId:"11111111-1111-4111-8111-111111111111",limit:25},output:{publicKeys:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Uc=E({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:z2,output:_f,pagination:"none",async:"sync",examples:[{name:"get-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Fc=E({operationId:"publicKeys.ensureLogForwarding",description:"Ensure a reusable project-scoped public key exists for CLI log forwarding.",backend:"api",route:{method:"POST",path:"/public-keys/log-forwarding/ensure",tags:["Public Keys"]},input:U2,output:j2,pagination:"none",async:"sync",examples:[{name:"ensure-log-forwarding-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"sazabi-cli-forward",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_public_example"}}}]}),$c=E({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:$2,output:_f,pagination:"none",async:"sync",examples:[{name:"rename-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222",name:"Updated CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"Updated CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Gc=E({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Recently validated requests may continue to authenticate for a short period after deactivation.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:G2,output:H2,pagination:"none",async:"sync"}),Df=E({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:V2,output:M2,pagination:"cursor",async:"sync",examples:[{name:"list-secret-keys",input:{limit:25},output:{secretKeys:[{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Qf=E({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:K2,output:qR,pagination:"none",async:"sync",examples:[{name:"get-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Lf=E({operationId:"secretKeys.create",description:"Create one secret key within the organization.",backend:"api",route:{method:"POST",path:"/secret-keys",successStatus:201,tags:["Secret Keys"]},input:Y2,output:F2,pagination:"none",async:"sync",examples:[{name:"create-secret-key",input:{name:"CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_secret_example"}}}]}),Nf=E({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:W2,output:qR,pagination:"none",async:"sync",examples:[{name:"rename-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333",name:"Updated CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"Updated CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Mf=E({operationId:"secretKeys.delete",description:"Delete one secret key within the organization.",backend:"api",route:{method:"DELETE",path:"/secret-keys/{keyId}",successStatus:204,tags:["Secret Keys"],inputStructure:"detailed"},input:J2,output:q2,pagination:"none",async:"sync"}),lwe={list:jc.contract,get:Uc.contract,ensureLogForwarding:Fc.contract,update:$c.contract,deactivate:Gc.contract},uwe={list:Df.contract,get:Qf.contract,create:Lf.contract,update:Nf.contract,delete:Mf.contract}});var X2="## Overview\n\nSend Claude Code session telemetry to Sazabi. Every session emits lifecycle events — prompts, tool calls, and model API requests with token counts and cost — as OTLP log records.\n\n## How it works\n\nClaude Code has a first-party OTLP exporter. Set a handful of environment variables in `~/.claude/settings.json` pointing the exporter at your Sazabi intake URL, and Claude Code sends telemetry over OTLP/HTTP on its own — no separate SDK or code changes required.\n\n## Streams\n\n- **Session events** — `claude_code.user_prompt`, `claude_code.tool_result`, `claude_code.api_request`, and related events, with attributes for `prompt`, `model`, `session.id`, `user.email`, token counts, and cost.\n\n## Limitations\n\n- Claude Code **metrics** are not ingested; only the logs exporter is supported.\n";var Z2=()=>{};var tG=`---
|
|
105
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref"){i(s);continue}}}}function Qi(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=(s)=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){r(d);let g=e.seen.get(d),m=g.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(m);else Object.assign(l,m);if(Object.assign(l,u),s._zod.parent===d)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(!(f in u))delete l[f]}if(m.$ref&&g.def)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(f in g.def&&JSON.stringify(l[f])===JSON.stringify(g.def[f]))delete l[f]}}let p=s._zod.parent;if(p&&p!==d){r(p);let g=e.seen.get(p);if(g?.schema.$ref){if(l.$ref=g.schema.$ref,g.def)for(let m in l){if(m==="$ref"||m==="allOf")continue;if(m in g.def&&JSON.stringify(l[m])===JSON.stringify(g.def[m]))delete l[m]}}}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())r(s[0]);let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,n.def??n.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];if(c.def&&c.defId)i[c.defId]=c.def}if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")o.$defs=i;else o.definitions=i;try{let s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rc(t,"input",e.processors),output:Rc(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch(s){throw Error("Error converting schema to JSON.")}}function kn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return kn(r.element,n);if(r.type==="set")return kn(r.valueType,n);if(r.type==="lazy")return kn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return kn(r.innerType,n);if(r.type==="intersection")return kn(r.left,n)||kn(r.right,n);if(r.type==="record"||r.type==="map")return kn(r.keyType,n)||kn(r.valueType,n);if(r.type==="pipe")return kn(r.in,n)||kn(r.out,n);if(r.type==="object"){for(let o in r.shape)if(kn(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(kn(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(kn(o,n))return!0;if(r.rest&&kn(r.rest,n))return!0;return!1}return!1}var Jk=(e,t={})=>(n)=>{let r=_i({...n,processors:t});return Ze(e,r),Di(r,e),Qi(r,e)},Rc=(e,t,n={})=>(r)=>{let{libraryOptions:o,target:i}=r??{},s=_i({...o??{},target:i,io:t,processors:n});return Ze(e,s),Di(s,e),Qi(s,e)};var qd=h(()=>{$d()});function AA(e,t){if("_idmap"in e){let r=e,o=_i({...t,processors:gA}),i={};for(let l of r._idmap.entries()){let[u,d]=l;Ze(d,o)}let s={},c={registry:r,uri:t?.uri,defs:i};o.external=c;for(let l of r._idmap.entries()){let[u,d]=l;Di(o,d),s[u]=Qi(o,d)}if(Object.keys(i).length>0){let l=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:i}}return{schemas:s}}let n=_i({...t,processors:gA});return Ze(e,n),Di(n,e),Qi(n,e)}var XCe,Zk=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=XCe[c]??c,o.format==="")delete o.format;if(c==="time")delete o.format}if(u)o.contentEncoding=u;if(l&&l.size>0){let d=[...l];if(d.length===1)o.pattern=d[0].source;else if(d.length>1)o.allOf=[...d.map((p)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))]}},Xk=(e,t,n,r)=>{let o=n,{minimum:i,maximum:s,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))o.type="integer";else o.type="number";if(typeof d==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")o.minimum=d,o.exclusiveMinimum=!0;else o.exclusiveMinimum=d;if(typeof i==="number"){if(o.minimum=i,typeof d==="number"&&t.target!=="draft-04")if(d>=i)delete o.minimum;else delete o.exclusiveMinimum}if(typeof u==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")o.maximum=u,o.exclusiveMaximum=!0;else o.exclusiveMaximum=u;if(typeof s==="number"){if(o.maximum=s,typeof u==="number"&&t.target!=="draft-04")if(u<=s)delete o.maximum;else delete o.exclusiveMaximum}if(typeof l==="number")o.multipleOf=l},ex=(e,t,n,r)=>{n.type="boolean"},tx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},nx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},ox=(e,t,n,r)=>{if(t.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},rx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},ix=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},sx=(e,t,n,r)=>{n.not={}},ax=(e,t,n,r)=>{},cx=(e,t,n,r)=>{},lx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},ux=(e,t,n,r)=>{let o=e._zod.def,i=Ed(o.entries);if(i.every((s)=>typeof s==="number"))n.type="number";if(i.every((s)=>typeof s==="string"))n.type="string";n.enum=i},dx=(e,t,n,r)=>{let o=e._zod.def,i=[];for(let s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(s));else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")n.enum=[s];else n.const=s}else{if(i.every((s)=>typeof s==="number"))n.type="number";if(i.every((s)=>typeof s==="string"))n.type="string";if(i.every((s)=>typeof s==="boolean"))n.type="boolean";if(i.every((s)=>s===null))n.type="null";n.enum=i}},px=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},gx=(e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},mx=(e,t,n,r)=>{let o=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:l}=e._zod.bag;if(s!==void 0)i.minLength=s;if(c!==void 0)i.maxLength=c;if(l)if(l.length===1)i.contentMediaType=l[0],Object.assign(o,i);else Object.assign(o,i),o.anyOf=l.map((u)=>({contentMediaType:u}));else Object.assign(o,i)},hx=(e,t,n,r)=>{n.type="boolean"},Ax=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},fx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},yx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},bx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Ix=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Sx=(e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=Ze(i.element,t,{...r,path:[...r.path,"items"]})},Cx=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object",o.properties={};let s=i.shape;for(let u in s)o.properties[u]=Ze(s[u],t,{...r,path:[...r.path,"properties",u]});let c=new Set(Object.keys(s)),l=new Set([...c].filter((u)=>{let d=i.shape[u]._zod;if(t.io==="input")return d.optin===void 0;else return d.optout===void 0}));if(l.size>0)o.required=Array.from(l);if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=Ze(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})},mA=(e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,l)=>Ze(c,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));if(i)n.oneOf=s;else n.anyOf=s},vx=(e,t,n,r)=>{let o=e._zod.def,i=Ze(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Ze(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=(u)=>("allOf"in u)&&Object.keys(u).length===1,l=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];n.allOf=l},Ex=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((g,m)=>Ze(g,t,{...r,path:[...r.path,s,m]})),u=i.rest?Ze(i.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(o.prefixItems=l,u)o.items=u}else if(t.target==="openapi-3.0"){if(o.items={anyOf:l},u)o.items.anyOf.push(u);if(o.minItems=l.length,!u)o.maxItems=l.length}else if(o.items=l,u)o.additionalItems=u;let{minimum:d,maximum:p}=e._zod.bag;if(typeof d==="number")o.minItems=d;if(typeof p==="number")o.maxItems=p},wx=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let d=Ze(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let p of l)o.patternProperties[p.source]=d}else{if(t.target==="draft-07"||t.target==="draft-2020-12")o.propertyNames=Ze(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});o.additionalProperties=Ze(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=s._zod.values;if(u){let d=[...u].filter((p)=>typeof p==="string"||typeof p==="number");if(d.length>0)o.required=d}},kx=(e,t,n,r)=>{let o=e._zod.def,i=Ze(o.innerType,t,r),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,n.nullable=!0;else n.anyOf=[i,{type:"null"}]},xx=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Px=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Rx=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);if(i.ref=o.innerType,t.io==="input")n._prefault=JSON.parse(JSON.stringify(o.defaultValue))},Tx=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Bx=(e,t,n,r)=>{let o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ze(i,t,r);let s=t.seen.get(e);s.ref=i},Ox=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},_x=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},hA=(e,t,n,r)=>{let o=e._zod.def;Ze(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Dx=(e,t,n,r)=>{let o=e._zod.innerType;Ze(o,t,r);let i=t.seen.get(e);i.ref=o},gA;var Vd=h(()=>{qd();ge();XCe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gA={string:Zk,number:Xk,boolean:ex,bigint:tx,symbol:nx,null:ox,undefined:rx,void:ix,never:sx,any:ax,unknown:cx,date:lx,enum:ux,literal:dx,nan:px,template_literal:gx,file:mx,success:hx,custom:Ax,function:fx,transform:yx,map:bx,set:Ix,array:Sx,object:Cx,union:mA,intersection:vx,tuple:Ex,record:wx,nullable:kx,nonoptional:xx,default:Px,prefault:Rx,catch:Tx,pipe:Bx,readonly:Ox,promise:_x,optional:hA,lazy:Dx}});class Qx{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=_i({processors:gA,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Ze(e,this.ctx,t)}emit(e,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}Di(this.ctx,e);let n=Qi(this.ctx,e),{"~standard":r,...o}=n;return o}}var XU=h(()=>{Vd();qd()});var eF={};var tF=()=>{};var Wr={};cr(Wr,{$ZodAny:()=>DE,$ZodArray:()=>zE,$ZodAsyncError:()=>dr,$ZodBase64:()=>EE,$ZodBase64URL:()=>wE,$ZodBigInt:()=>Mh,$ZodBigIntFormat:()=>TE,$ZodBoolean:()=>Qd,$ZodCIDRv4:()=>SE,$ZodCIDRv6:()=>CE,$ZodCUID:()=>lE,$ZodCUID2:()=>uE,$ZodCatch:()=>ow,$ZodCheck:()=>dt,$ZodCheckBigIntFormat:()=>Mv,$ZodCheckEndsWith:()=>Wv,$ZodCheckGreaterThan:()=>Rh,$ZodCheckIncludes:()=>Kv,$ZodCheckLengthEquals:()=>Gv,$ZodCheckLessThan:()=>Ph,$ZodCheckLowerCase:()=>qv,$ZodCheckMaxLength:()=>Fv,$ZodCheckMaxSize:()=>zv,$ZodCheckMimeType:()=>Zv,$ZodCheckMinLength:()=>$v,$ZodCheckMinSize:()=>jv,$ZodCheckMultipleOf:()=>Lv,$ZodCheckNumberFormat:()=>Nv,$ZodCheckOverwrite:()=>Xv,$ZodCheckProperty:()=>Jv,$ZodCheckRegex:()=>Hv,$ZodCheckSizeEquals:()=>Uv,$ZodCheckStartsWith:()=>Yv,$ZodCheckStringFormat:()=>mc,$ZodCheckUpperCase:()=>Vv,$ZodCodec:()=>Nd,$ZodCustom:()=>dw,$ZodCustomStringFormat:()=>PE,$ZodDate:()=>ME,$ZodDefault:()=>XE,$ZodDiscriminatedUnion:()=>FE,$ZodE164:()=>kE,$ZodEmail:()=>iE,$ZodEmoji:()=>aE,$ZodEncodeError:()=>Ls,$ZodEnum:()=>VE,$ZodError:()=>Rd,$ZodExactOptional:()=>JE,$ZodFile:()=>YE,$ZodFunction:()=>cw,$ZodGUID:()=>oE,$ZodIPv4:()=>yE,$ZodIPv6:()=>bE,$ZodISODate:()=>hE,$ZodISODateTime:()=>mE,$ZodISODuration:()=>fE,$ZodISOTime:()=>AE,$ZodIntersection:()=>$E,$ZodJWT:()=>xE,$ZodKSUID:()=>gE,$ZodLazy:()=>uw,$ZodLiteral:()=>KE,$ZodMAC:()=>IE,$ZodMap:()=>HE,$ZodNaN:()=>rw,$ZodNanoID:()=>cE,$ZodNever:()=>LE,$ZodNonOptional:()=>tw,$ZodNull:()=>_E,$ZodNullable:()=>ZE,$ZodNumber:()=>Nh,$ZodNumberFormat:()=>RE,$ZodObject:()=>Xj,$ZodObjectJIT:()=>jE,$ZodOptional:()=>jh,$ZodPipe:()=>iw,$ZodPrefault:()=>ew,$ZodPromise:()=>lw,$ZodReadonly:()=>sw,$ZodRealError:()=>zn,$ZodRecord:()=>GE,$ZodRegistry:()=>dk,$ZodSet:()=>qE,$ZodString:()=>zs,$ZodStringFormat:()=>at,$ZodSuccess:()=>nw,$ZodSymbol:()=>BE,$ZodTemplateLiteral:()=>aw,$ZodTransform:()=>WE,$ZodTuple:()=>zh,$ZodType:()=>xe,$ZodULID:()=>dE,$ZodURL:()=>sE,$ZodUUID:()=>rE,$ZodUndefined:()=>OE,$ZodUnion:()=>Ld,$ZodUnknown:()=>QE,$ZodVoid:()=>NE,$ZodXID:()=>pE,$ZodXor:()=>UE,$brand:()=>qC,$constructor:()=>R,$input:()=>uk,$output:()=>lk,Doc:()=>Bh,JSONSchema:()=>eF,JSONSchemaGenerator:()=>Qx,NEVER:()=>Cd,TimePrecision:()=>hk,_any:()=>Lk,_array:()=>$k,_base64:()=>rA,_base64url:()=>iA,_bigint:()=>Rk,_boolean:()=>xk,_catch:()=>VCe,_check:()=>JU,_cidrv4:()=>nA,_cidrv6:()=>oA,_coercedBigint:()=>Tk,_coercedBoolean:()=>Pk,_coercedDate:()=>Uk,_coercedNumber:()=>Sk,_coercedString:()=>gk,_cuid:()=>Yh,_cuid2:()=>Wh,_custom:()=>Hk,_date:()=>jk,_decode:()=>bh,_decodeAsync:()=>Sh,_default:()=>GCe,_discriminatedUnion:()=>OCe,_e164:()=>sA,_email:()=>Fh,_emoji:()=>Vh,_encode:()=>yh,_encodeAsync:()=>Ih,_endsWith:()=>Sc,_enum:()=>MCe,_file:()=>Gk,_float32:()=>vk,_float64:()=>Ek,_gt:()=>gr,_gte:()=>wn,_guid:()=>Gd,_includes:()=>bc,_int:()=>Ck,_int32:()=>wk,_int64:()=>Bk,_intersection:()=>_Ce,_ipv4:()=>eA,_ipv6:()=>tA,_isoDate:()=>fk,_isoDateTime:()=>Ak,_isoDuration:()=>bk,_isoTime:()=>yk,_jwt:()=>aA,_ksuid:()=>Xh,_lazy:()=>JCe,_length:()=>Fs,_literal:()=>jCe,_lowercase:()=>fc,_lt:()=>pr,_lte:()=>ro,_mac:()=>mk,_map:()=>LCe,_max:()=>ro,_maxLength:()=>Us,_maxSize:()=>Oi,_mime:()=>Cc,_min:()=>wn,_minLength:()=>Yr,_minSize:()=>mr,_multipleOf:()=>Bi,_nan:()=>Fk,_nanoid:()=>Kh,_nativeEnum:()=>zCe,_negative:()=>lA,_never:()=>Mk,_nonnegative:()=>dA,_nonoptional:()=>HCe,_nonpositive:()=>uA,_normalize:()=>vc,_null:()=>Qk,_nullable:()=>$Ce,_number:()=>Ik,_optional:()=>FCe,_overwrite:()=>$o,_parse:()=>uc,_parseAsync:()=>dc,_pipe:()=>KCe,_positive:()=>cA,_promise:()=>ZCe,_property:()=>pA,_readonly:()=>YCe,_record:()=>QCe,_refine:()=>qk,_regex:()=>Ac,_safeDecode:()=>vh,_safeDecodeAsync:()=>wh,_safeEncode:()=>Ch,_safeEncodeAsync:()=>Eh,_safeParse:()=>pc,_safeParseAsync:()=>gc,_set:()=>NCe,_size:()=>js,_slugify:()=>xc,_startsWith:()=>Ic,_string:()=>pk,_stringFormat:()=>Pc,_stringbool:()=>Wk,_success:()=>qCe,_superRefine:()=>Vk,_symbol:()=>_k,_templateLiteral:()=>WCe,_toLowerCase:()=>wc,_toUpperCase:()=>kc,_transform:()=>UCe,_trim:()=>Ec,_tuple:()=>DCe,_uint32:()=>kk,_uint64:()=>Ok,_ulid:()=>Jh,_undefined:()=>Dk,_union:()=>TCe,_unknown:()=>Nk,_uppercase:()=>yc,_url:()=>Hd,_uuid:()=>$h,_uuidv4:()=>Gh,_uuidv6:()=>Hh,_uuidv7:()=>qh,_void:()=>zk,_xid:()=>Zh,_xor:()=>BCe,clone:()=>En,config:()=>Rt,createStandardJSONSchemaMethod:()=>Rc,createToJSONSchemaMethod:()=>Jk,decode:()=>tSe,decodeAsync:()=>oSe,describe:()=>Kk,encode:()=>eSe,encodeAsync:()=>nSe,extractDefs:()=>Di,finalize:()=>Qi,flattenError:()=>Td,formatError:()=>Bd,globalConfig:()=>Sd,globalRegistry:()=>Xt,initializeContext:()=>_i,isValidBase64:()=>vE,isValidBase64URL:()=>Yj,isValidJWT:()=>Wj,locales:()=>Fd,meta:()=>Yk,parse:()=>Ah,parseAsync:()=>fh,prettifyError:()=>ov,process:()=>Ze,regexes:()=>Co,registry:()=>Uh,safeDecode:()=>iSe,safeDecodeAsync:()=>aSe,safeEncode:()=>rSe,safeEncodeAsync:()=>sSe,safeParse:()=>iv,safeParseAsync:()=>sv,toDotPath:()=>Bj,toJSONSchema:()=>AA,treeifyError:()=>nv,util:()=>J,version:()=>eE});var io=h(()=>{ge();xh();ck();Vd();XU();tF();sc();av();rv();pw();Th();tE();$d();ZU();qd()});var fA={};cr(fA,{endsWith:()=>Sc,gt:()=>gr,gte:()=>wn,includes:()=>bc,length:()=>Fs,lowercase:()=>fc,lt:()=>pr,lte:()=>ro,maxLength:()=>Us,maxSize:()=>Oi,mime:()=>Cc,minLength:()=>Yr,minSize:()=>mr,multipleOf:()=>Bi,negative:()=>lA,nonnegative:()=>dA,nonpositive:()=>uA,normalize:()=>vc,overwrite:()=>$o,positive:()=>cA,property:()=>pA,regex:()=>Ac,size:()=>js,slugify:()=>xc,startsWith:()=>Ic,toLowerCase:()=>wc,toUpperCase:()=>kc,trim:()=>Ec,uppercase:()=>yc});var yA=h(()=>{io()});var Li={};cr(Li,{ZodISODate:()=>IA,ZodISODateTime:()=>bA,ZodISODuration:()=>CA,ZodISOTime:()=>SA,date:()=>Nx,datetime:()=>Lx,duration:()=>zx,time:()=>Mx});function Lx(e){return Ak(bA,e)}function Nx(e){return fk(IA,e)}function Mx(e){return yk(SA,e)}function zx(e){return bk(CA,e)}var bA,IA,SA,CA;var Kd=h(()=>{io();Wd();bA=R("ZodISODateTime",(e,t)=>{mE.init(e,t),ct.init(e,t)});IA=R("ZodISODate",(e,t)=>{hE.init(e,t),ct.init(e,t)});SA=R("ZodISOTime",(e,t)=>{AE.init(e,t),ct.init(e,t)});CA=R("ZodISODuration",(e,t)=>{fE.init(e,t),ct.init(e,t)})});var nF=(e,t)=>{Rd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>Bd(e,n)},flatten:{value:(n)=>Td(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ac,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ac,2)}},isEmpty:{get(){return e.issues.length===0}}})},tve,jn;var jx=h(()=>{io();io();ge();tve=R("ZodError",nF),jn=R("ZodError",nF,{Parent:Error})});var Ux,Fx,$x,Gx,Hx,qx,Vx,Kx,Yx,Wx,Jx,Zx;var Xx=h(()=>{io();jx();Ux=uc(jn),Fx=dc(jn),$x=pc(jn),Gx=gc(jn),Hx=yh(jn),qx=bh(jn),Vx=Ih(jn),Kx=Sh(jn),Yx=Ch(jn),Wx=vh(jn),Jx=Eh(jn),Zx=wh(jn)});var Yd={};cr(Yd,{ZodAny:()=>rP,ZodArray:()=>cP,ZodBase64:()=>MA,ZodBase64URL:()=>zA,ZodBigInt:()=>Qc,ZodBigIntFormat:()=>FA,ZodBoolean:()=>Dc,ZodCIDRv4:()=>LA,ZodCIDRv6:()=>NA,ZodCUID:()=>RA,ZodCUID2:()=>TA,ZodCatch:()=>PP,ZodCodec:()=>YA,ZodCustom:()=>ap,ZodCustomStringFormat:()=>Oc,ZodDate:()=>np,ZodDefault:()=>CP,ZodDiscriminatedUnion:()=>uP,ZodE164:()=>jA,ZodEmail:()=>wA,ZodEmoji:()=>xA,ZodEnum:()=>Tc,ZodExactOptional:()=>bP,ZodFile:()=>fP,ZodFunction:()=>NP,ZodGUID:()=>Jd,ZodIPv4:()=>DA,ZodIPv6:()=>QA,ZodIntersection:()=>dP,ZodJWT:()=>UA,ZodKSUID:()=>_A,ZodLazy:()=>DP,ZodLiteral:()=>AP,ZodMAC:()=>eP,ZodMap:()=>mP,ZodNaN:()=>TP,ZodNanoID:()=>PA,ZodNever:()=>sP,ZodNonOptional:()=>VA,ZodNull:()=>oP,ZodNullable:()=>SP,ZodNumber:()=>_c,ZodNumberFormat:()=>$s,ZodObject:()=>op,ZodOptional:()=>qA,ZodPipe:()=>KA,ZodPrefault:()=>EP,ZodPromise:()=>LP,ZodReadonly:()=>BP,ZodRecord:()=>sp,ZodSet:()=>hP,ZodString:()=>Bc,ZodStringFormat:()=>ct,ZodSuccess:()=>xP,ZodSymbol:()=>tP,ZodTemplateLiteral:()=>_P,ZodTransform:()=>yP,ZodTuple:()=>pP,ZodType:()=>_e,ZodULID:()=>BA,ZodURL:()=>ep,ZodUUID:()=>hr,ZodUndefined:()=>nP,ZodUnion:()=>rp,ZodUnknown:()=>iP,ZodVoid:()=>aP,ZodXID:()=>OA,ZodXor:()=>lP,_ZodString:()=>EA,_default:()=>vP,_function:()=>n$,any:()=>$A,array:()=>ee,base64:()=>CF,base64url:()=>vF,bigint:()=>DF,boolean:()=>Xe,catch:()=>RP,check:()=>o$,cidrv4:()=>IF,cidrv6:()=>SF,codec:()=>XF,cuid:()=>pF,cuid2:()=>gF,custom:()=>WA,date:()=>jF,describe:()=>r$,discriminatedUnion:()=>ip,e164:()=>EF,email:()=>oF,emoji:()=>uF,enum:()=>en,exactOptional:()=>IP,file:()=>YF,float32:()=>TF,float64:()=>BF,function:()=>n$,guid:()=>rF,hash:()=>RF,hex:()=>PF,hostname:()=>xF,httpUrl:()=>lF,instanceof:()=>s$,int:()=>vA,int32:()=>OF,int64:()=>QF,intersection:()=>Lc,ipv4:()=>fF,ipv6:()=>bF,json:()=>c$,jwt:()=>wF,keyof:()=>UF,ksuid:()=>AF,lazy:()=>QP,literal:()=>ue,looseObject:()=>Tt,looseRecord:()=>HF,mac:()=>yF,map:()=>qF,meta:()=>i$,nan:()=>ZF,nanoid:()=>dF,nativeEnum:()=>KF,never:()=>GA,nonoptional:()=>kP,null:()=>tp,nullable:()=>Zd,nullish:()=>WF,number:()=>je,object:()=>ne,optional:()=>pt,partialRecord:()=>GF,pipe:()=>Xd,prefault:()=>wP,preprocess:()=>cp,promise:()=>t$,readonly:()=>OP,record:()=>tt,refine:()=>MP,set:()=>VF,strictObject:()=>FF,string:()=>k,stringFormat:()=>kF,stringbool:()=>a$,success:()=>JF,superRefine:()=>zP,symbol:()=>NF,templateLiteral:()=>e$,transform:()=>HA,tuple:()=>gP,uint32:()=>_F,uint64:()=>LF,ulid:()=>mF,undefined:()=>MF,union:()=>ut,unknown:()=>lt,url:()=>kA,uuid:()=>iF,uuidv4:()=>sF,uuidv6:()=>aF,uuidv7:()=>cF,void:()=>zF,xid:()=>hF,xor:()=>$F});function k(e){return pk(Bc,e)}function oF(e){return Fh(wA,e)}function rF(e){return Gd(Jd,e)}function iF(e){return $h(hr,e)}function sF(e){return Gh(hr,e)}function aF(e){return Hh(hr,e)}function cF(e){return qh(hr,e)}function kA(e){return Hd(ep,e)}function lF(e){return Hd(ep,{protocol:/^https?$/,hostname:Co.domain,...J.normalizeParams(e)})}function uF(e){return Vh(xA,e)}function dF(e){return Kh(PA,e)}function pF(e){return Yh(RA,e)}function gF(e){return Wh(TA,e)}function mF(e){return Jh(BA,e)}function hF(e){return Zh(OA,e)}function AF(e){return Xh(_A,e)}function fF(e){return eA(DA,e)}function yF(e){return mk(eP,e)}function bF(e){return tA(QA,e)}function IF(e){return nA(LA,e)}function SF(e){return oA(NA,e)}function CF(e){return rA(MA,e)}function vF(e){return iA(zA,e)}function EF(e){return sA(jA,e)}function wF(e){return aA(UA,e)}function kF(e,t,n={}){return Pc(Oc,e,t,n)}function xF(e){return Pc(Oc,"hostname",Co.hostname,e)}function PF(e){return Pc(Oc,"hex",Co.hex,e)}function RF(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,o=Co[r];if(!o)throw Error(`Unrecognized hash format: ${r}`);return Pc(Oc,r,o,t)}function je(e){return Ik(_c,e)}function vA(e){return Ck($s,e)}function TF(e){return vk($s,e)}function BF(e){return Ek($s,e)}function OF(e){return wk($s,e)}function _F(e){return kk($s,e)}function Xe(e){return xk(Dc,e)}function DF(e){return Rk(Qc,e)}function QF(e){return Bk(FA,e)}function LF(e){return Ok(FA,e)}function NF(e){return _k(tP,e)}function MF(e){return Dk(nP,e)}function tp(e){return Qk(oP,e)}function $A(){return Lk(rP)}function lt(){return Nk(iP)}function GA(e){return Mk(sP,e)}function zF(e){return zk(aP,e)}function jF(e){return jk(np,e)}function ee(e,t){return $k(cP,e,t)}function UF(e){let t=e._zod.def.shape;return en(Object.keys(t))}function ne(e,t){let n={type:"object",shape:e??{},...J.normalizeParams(t)};return new op(n)}function FF(e,t){return new op({type:"object",shape:e,catchall:GA(),...J.normalizeParams(t)})}function Tt(e,t){return new op({type:"object",shape:e,catchall:lt(),...J.normalizeParams(t)})}function ut(e,t){return new rp({type:"union",options:e,...J.normalizeParams(t)})}function $F(e,t){return new lP({type:"union",options:e,inclusive:!1,...J.normalizeParams(t)})}function ip(e,t,n){return new uP({type:"union",options:t,discriminator:e,...J.normalizeParams(n)})}function Lc(e,t){return new dP({type:"intersection",left:e,right:t})}function gP(e,t,n){let r=t instanceof xe,o=r?n:t;return new pP({type:"tuple",items:e,rest:r?t:null,...J.normalizeParams(o)})}function tt(e,t,n){return new sp({type:"record",keyType:e,valueType:t,...J.normalizeParams(n)})}function GF(e,t,n){let r=En(e);return r._zod.values=void 0,new sp({type:"record",keyType:r,valueType:t,...J.normalizeParams(n)})}function HF(e,t,n){return new sp({type:"record",keyType:e,valueType:t,mode:"loose",...J.normalizeParams(n)})}function qF(e,t,n){return new mP({type:"map",keyType:e,valueType:t,...J.normalizeParams(n)})}function VF(e,t){return new hP({type:"set",valueType:e,...J.normalizeParams(t)})}function en(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((r)=>[r,r])):e;return new Tc({type:"enum",entries:n,...J.normalizeParams(t)})}function KF(e,t){return new Tc({type:"enum",entries:e,...J.normalizeParams(t)})}function ue(e,t){return new AP({type:"literal",values:Array.isArray(e)?e:[e],...J.normalizeParams(t)})}function YF(e){return Gk(fP,e)}function HA(e){return new yP({type:"transform",transform:e})}function pt(e){return new qA({type:"optional",innerType:e})}function IP(e){return new bP({type:"optional",innerType:e})}function Zd(e){return new SP({type:"nullable",innerType:e})}function WF(e){return pt(Zd(e))}function vP(e,t){return new CP({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():J.shallowClone(t)}})}function wP(e,t){return new EP({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():J.shallowClone(t)}})}function kP(e,t){return new VA({type:"nonoptional",innerType:e,...J.normalizeParams(t)})}function JF(e){return new xP({type:"success",innerType:e})}function RP(e,t){return new PP({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}function ZF(e){return Fk(TP,e)}function Xd(e,t){return new KA({type:"pipe",in:e,out:t})}function XF(e,t,n){return new YA({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function OP(e){return new BP({type:"readonly",innerType:e})}function e$(e,t){return new _P({type:"template_literal",parts:e,...J.normalizeParams(t)})}function QP(e){return new DP({type:"lazy",getter:e})}function t$(e){return new LP({type:"promise",innerType:e})}function n$(e){return new NP({type:"function",input:Array.isArray(e?.input)?gP(e?.input):e?.input??ee(lt()),output:e?.output??lt()})}function o$(e){let t=new dt({check:"custom"});return t._zod.check=e,t}function WA(e,t){return Hk(ap,e??(()=>!0),t)}function MP(e,t={}){return qk(ap,e,t)}function zP(e){return Vk(e)}function s$(e,t={}){let n=new ap({type:"custom",check:"custom",fn:(r)=>r instanceof e,abort:!0,...J.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=(r)=>{if(!(r.value instanceof e))r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function c$(e){let t=QP(()=>ut([k(e),je(),Xe(),tp(),ee(t),tt(k(),t)]));return t}function cp(e,t){return Xd(HA(e),t)}var _e,EA,Bc,ct,wA,Jd,hr,ep,xA,PA,RA,TA,BA,OA,_A,DA,eP,QA,LA,NA,MA,zA,jA,UA,Oc,_c,$s,Dc,Qc,FA,tP,nP,oP,rP,iP,sP,aP,np,cP,op,rp,lP,uP,dP,pP,sp,mP,hP,Tc,AP,fP,yP,qA,bP,SP,CP,EP,VA,xP,PP,TP,KA,YA,BP,_P,DP,LP,NP,ap,r$,i$,a$=(...e)=>Wk({Codec:YA,Boolean:Dc,String:Bc},...e);var Wd=h(()=>{io();io();Vd();qd();yA();Kd();Xx();_e=R("ZodType",(e,t)=>(xe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rc(e,"input"),output:Rc(e,"output")}}),e.toJSONSchema=Jk(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(J.mergeDefs(t,{checks:[...t.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>En(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>Ux(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$x(e,n,r),e.parseAsync=async(n,r)=>Fx(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Gx(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Hx(e,n,r),e.decode=(n,r)=>qx(e,n,r),e.encodeAsync=async(n,r)=>Vx(e,n,r),e.decodeAsync=async(n,r)=>Kx(e,n,r),e.safeEncode=(n,r)=>Yx(e,n,r),e.safeDecode=(n,r)=>Wx(e,n,r),e.safeEncodeAsync=async(n,r)=>Jx(e,n,r),e.safeDecodeAsync=async(n,r)=>Zx(e,n,r),e.refine=(n,r)=>e.check(MP(n,r)),e.superRefine=(n)=>e.check(zP(n)),e.overwrite=(n)=>e.check($o(n)),e.optional=()=>pt(e),e.exactOptional=()=>IP(e),e.nullable=()=>Zd(e),e.nullish=()=>pt(Zd(e)),e.nonoptional=(n)=>kP(e,n),e.array=()=>ee(e),e.or=(n)=>ut([e,n]),e.and=(n)=>Lc(e,n),e.transform=(n)=>Xd(e,HA(n)),e.default=(n)=>vP(e,n),e.prefault=(n)=>wP(e,n),e.catch=(n)=>RP(e,n),e.pipe=(n)=>Xd(e,n),e.readonly=()=>OP(e),e.describe=(n)=>{let r=e.clone();return Xt.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Xt.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Xt.get(e);let r=e.clone();return Xt.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=(n)=>n(e),e)),EA=R("_ZodString",(e,t)=>{zs.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Zk(e,r,o,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Ac(...r)),e.includes=(...r)=>e.check(bc(...r)),e.startsWith=(...r)=>e.check(Ic(...r)),e.endsWith=(...r)=>e.check(Sc(...r)),e.min=(...r)=>e.check(Yr(...r)),e.max=(...r)=>e.check(Us(...r)),e.length=(...r)=>e.check(Fs(...r)),e.nonempty=(...r)=>e.check(Yr(1,...r)),e.lowercase=(r)=>e.check(fc(r)),e.uppercase=(r)=>e.check(yc(r)),e.trim=()=>e.check(Ec()),e.normalize=(...r)=>e.check(vc(...r)),e.toLowerCase=()=>e.check(wc()),e.toUpperCase=()=>e.check(kc()),e.slugify=()=>e.check(xc())}),Bc=R("ZodString",(e,t)=>{zs.init(e,t),EA.init(e,t),e.email=(n)=>e.check(Fh(wA,n)),e.url=(n)=>e.check(Hd(ep,n)),e.jwt=(n)=>e.check(aA(UA,n)),e.emoji=(n)=>e.check(Vh(xA,n)),e.guid=(n)=>e.check(Gd(Jd,n)),e.uuid=(n)=>e.check($h(hr,n)),e.uuidv4=(n)=>e.check(Gh(hr,n)),e.uuidv6=(n)=>e.check(Hh(hr,n)),e.uuidv7=(n)=>e.check(qh(hr,n)),e.nanoid=(n)=>e.check(Kh(PA,n)),e.guid=(n)=>e.check(Gd(Jd,n)),e.cuid=(n)=>e.check(Yh(RA,n)),e.cuid2=(n)=>e.check(Wh(TA,n)),e.ulid=(n)=>e.check(Jh(BA,n)),e.base64=(n)=>e.check(rA(MA,n)),e.base64url=(n)=>e.check(iA(zA,n)),e.xid=(n)=>e.check(Zh(OA,n)),e.ksuid=(n)=>e.check(Xh(_A,n)),e.ipv4=(n)=>e.check(eA(DA,n)),e.ipv6=(n)=>e.check(tA(QA,n)),e.cidrv4=(n)=>e.check(nA(LA,n)),e.cidrv6=(n)=>e.check(oA(NA,n)),e.e164=(n)=>e.check(sA(jA,n)),e.datetime=(n)=>e.check(Lx(n)),e.date=(n)=>e.check(Nx(n)),e.time=(n)=>e.check(Mx(n)),e.duration=(n)=>e.check(zx(n))});ct=R("ZodStringFormat",(e,t)=>{at.init(e,t),EA.init(e,t)}),wA=R("ZodEmail",(e,t)=>{iE.init(e,t),ct.init(e,t)});Jd=R("ZodGUID",(e,t)=>{oE.init(e,t),ct.init(e,t)});hr=R("ZodUUID",(e,t)=>{rE.init(e,t),ct.init(e,t)});ep=R("ZodURL",(e,t)=>{sE.init(e,t),ct.init(e,t)});xA=R("ZodEmoji",(e,t)=>{aE.init(e,t),ct.init(e,t)});PA=R("ZodNanoID",(e,t)=>{cE.init(e,t),ct.init(e,t)});RA=R("ZodCUID",(e,t)=>{lE.init(e,t),ct.init(e,t)});TA=R("ZodCUID2",(e,t)=>{uE.init(e,t),ct.init(e,t)});BA=R("ZodULID",(e,t)=>{dE.init(e,t),ct.init(e,t)});OA=R("ZodXID",(e,t)=>{pE.init(e,t),ct.init(e,t)});_A=R("ZodKSUID",(e,t)=>{gE.init(e,t),ct.init(e,t)});DA=R("ZodIPv4",(e,t)=>{yE.init(e,t),ct.init(e,t)});eP=R("ZodMAC",(e,t)=>{IE.init(e,t),ct.init(e,t)});QA=R("ZodIPv6",(e,t)=>{bE.init(e,t),ct.init(e,t)});LA=R("ZodCIDRv4",(e,t)=>{SE.init(e,t),ct.init(e,t)});NA=R("ZodCIDRv6",(e,t)=>{CE.init(e,t),ct.init(e,t)});MA=R("ZodBase64",(e,t)=>{EE.init(e,t),ct.init(e,t)});zA=R("ZodBase64URL",(e,t)=>{wE.init(e,t),ct.init(e,t)});jA=R("ZodE164",(e,t)=>{kE.init(e,t),ct.init(e,t)});UA=R("ZodJWT",(e,t)=>{xE.init(e,t),ct.init(e,t)});Oc=R("ZodCustomStringFormat",(e,t)=>{PE.init(e,t),ct.init(e,t)});_c=R("ZodNumber",(e,t)=>{Nh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Xk(e,r,o,i),e.gt=(r,o)=>e.check(gr(r,o)),e.gte=(r,o)=>e.check(wn(r,o)),e.min=(r,o)=>e.check(wn(r,o)),e.lt=(r,o)=>e.check(pr(r,o)),e.lte=(r,o)=>e.check(ro(r,o)),e.max=(r,o)=>e.check(ro(r,o)),e.int=(r)=>e.check(vA(r)),e.safe=(r)=>e.check(vA(r)),e.positive=(r)=>e.check(gr(0,r)),e.nonnegative=(r)=>e.check(wn(0,r)),e.negative=(r)=>e.check(pr(0,r)),e.nonpositive=(r)=>e.check(ro(0,r)),e.multipleOf=(r,o)=>e.check(Bi(r,o)),e.step=(r,o)=>e.check(Bi(r,o)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});$s=R("ZodNumberFormat",(e,t)=>{RE.init(e,t),_c.init(e,t)});Dc=R("ZodBoolean",(e,t)=>{Qd.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ex(e,n,r,o)});Qc=R("ZodBigInt",(e,t)=>{Mh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>tx(e,r,o,i),e.gte=(r,o)=>e.check(wn(r,o)),e.min=(r,o)=>e.check(wn(r,o)),e.gt=(r,o)=>e.check(gr(r,o)),e.gte=(r,o)=>e.check(wn(r,o)),e.min=(r,o)=>e.check(wn(r,o)),e.lt=(r,o)=>e.check(pr(r,o)),e.lte=(r,o)=>e.check(ro(r,o)),e.max=(r,o)=>e.check(ro(r,o)),e.positive=(r)=>e.check(gr(BigInt(0),r)),e.negative=(r)=>e.check(pr(BigInt(0),r)),e.nonpositive=(r)=>e.check(ro(BigInt(0),r)),e.nonnegative=(r)=>e.check(wn(BigInt(0),r)),e.multipleOf=(r,o)=>e.check(Bi(r,o));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});FA=R("ZodBigIntFormat",(e,t)=>{TE.init(e,t),Qc.init(e,t)});tP=R("ZodSymbol",(e,t)=>{BE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nx(e,n,r,o)});nP=R("ZodUndefined",(e,t)=>{OE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rx(e,n,r,o)});oP=R("ZodNull",(e,t)=>{_E.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ox(e,n,r,o)});rP=R("ZodAny",(e,t)=>{DE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ax(e,n,r,o)});iP=R("ZodUnknown",(e,t)=>{QE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cx(e,n,r,o)});sP=R("ZodNever",(e,t)=>{LE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sx(e,n,r,o)});aP=R("ZodVoid",(e,t)=>{NE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ix(e,n,r,o)});np=R("ZodDate",(e,t)=>{ME.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>lx(e,r,o,i),e.min=(r,o)=>e.check(wn(r,o)),e.max=(r,o)=>e.check(ro(r,o));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});cP=R("ZodArray",(e,t)=>{zE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sx(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Yr(n,r)),e.nonempty=(n)=>e.check(Yr(1,n)),e.max=(n,r)=>e.check(Us(n,r)),e.length=(n,r)=>e.check(Fs(n,r)),e.unwrap=()=>e.element});op=R("ZodObject",(e,t)=>{jE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cx(e,n,r,o),J.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>en(Object.keys(e._zod.def.shape)),e.catchall=(n)=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:lt()}),e.loose=()=>e.clone({...e._zod.def,catchall:lt()}),e.strict=()=>e.clone({...e._zod.def,catchall:GA()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(n)=>J.extend(e,n),e.safeExtend=(n)=>J.safeExtend(e,n),e.merge=(n)=>J.merge(e,n),e.pick=(n)=>J.pick(e,n),e.omit=(n)=>J.omit(e,n),e.partial=(...n)=>J.partial(qA,e,n[0]),e.required=(...n)=>J.required(VA,e,n[0])});rp=R("ZodUnion",(e,t)=>{Ld.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mA(e,n,r,o),e.options=t.options});lP=R("ZodXor",(e,t)=>{rp.init(e,t),UE.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mA(e,n,r,o),e.options=t.options});uP=R("ZodDiscriminatedUnion",(e,t)=>{rp.init(e,t),FE.init(e,t)});dP=R("ZodIntersection",(e,t)=>{$E.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vx(e,n,r,o)});pP=R("ZodTuple",(e,t)=>{zh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ex(e,n,r,o),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});sp=R("ZodRecord",(e,t)=>{GE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wx(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});mP=R("ZodMap",(e,t)=>{HE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bx(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(mr(...n)),e.nonempty=(n)=>e.check(mr(1,n)),e.max=(...n)=>e.check(Oi(...n)),e.size=(...n)=>e.check(js(...n))});hP=R("ZodSet",(e,t)=>{qE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ix(e,n,r,o),e.min=(...n)=>e.check(mr(...n)),e.nonempty=(n)=>e.check(mr(1,n)),e.max=(...n)=>e.check(Oi(...n)),e.size=(...n)=>e.check(js(...n))});Tc=R("ZodEnum",(e,t)=>{VE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,i)=>ux(e,r,o,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let i={};for(let s of r)if(n.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Tc({...t,checks:[],...J.normalizeParams(o),entries:i})},e.exclude=(r,o)=>{let i={...t.entries};for(let s of r)if(n.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Tc({...t,checks:[],...J.normalizeParams(o),entries:i})}});AP=R("ZodLiteral",(e,t)=>{KE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dx(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});fP=R("ZodFile",(e,t)=>{YE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mx(e,n,r,o),e.min=(n,r)=>e.check(mr(n,r)),e.max=(n,r)=>e.check(Oi(n,r)),e.mime=(n,r)=>e.check(Cc(Array.isArray(n)?n:[n],r))});yP=R("ZodTransform",(e,t)=>{WE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yx(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ls(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(J.issue(i,n.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(J.issue(s))}};let o=t.transform(n.value,n);if(o instanceof Promise)return o.then((i)=>(n.value=i,n));return n.value=o,n}});qA=R("ZodOptional",(e,t)=>{jh.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hA(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});bP=R("ZodExactOptional",(e,t)=>{JE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hA(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});SP=R("ZodNullable",(e,t)=>{ZE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});CP=R("ZodDefault",(e,t)=>{XE.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Px(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});EP=R("ZodPrefault",(e,t)=>{ew.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});VA=R("ZodNonOptional",(e,t)=>{tw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});xP=R("ZodSuccess",(e,t)=>{nw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});PP=R("ZodCatch",(e,t)=>{ow.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});TP=R("ZodNaN",(e,t)=>{rw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>px(e,n,r,o)});KA=R("ZodPipe",(e,t)=>{iw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bx(e,n,r,o),e.in=t.in,e.out=t.out});YA=R("ZodCodec",(e,t)=>{KA.init(e,t),Nd.init(e,t)});BP=R("ZodReadonly",(e,t)=>{sw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ox(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});_P=R("ZodTemplateLiteral",(e,t)=>{aw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gx(e,n,r,o)});DP=R("ZodLazy",(e,t)=>{uw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dx(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});LP=R("ZodPromise",(e,t)=>{lw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_x(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});NP=R("ZodFunction",(e,t)=>{cw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fx(e,n,r,o)});ap=R("ZodCustom",(e,t)=>{dw.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ax(e,n,r,o)});r$=Kk,i$=Yk});function ove(e){Rt({customError:e})}function rve(){return Rt().customError}var UP,jP;var l$=h(()=>{io();UP={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(e){})(jP||(jP={}))});function sve(e,t){let n=e.$schema;if(n==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(n==="http://json-schema.org/draft-07/schema#")return"draft-7";if(n==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function ave(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let o=n[1];if(!o||!t.defs[o])throw Error(`Reference not found: ${e}`);return t.defs[o]}throw Error(`Reference not found: ${e}`)}function u$(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return ie.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return ie.lazy(()=>{if(!t.refs.has(o))throw Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=ave(o,t),s=mn(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return ie.null();if(o.length===0)return ie.never();if(o.length===1)return ie.literal(o[0]);if(o.every((s)=>typeof s==="string"))return ie.enum(o);let i=o.map((s)=>ie.literal(s));if(i.length<2)return i[0];return ie.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return ie.literal(e.const);let n=e.type;if(Array.isArray(n)){let o=n.map((i)=>{let s={...e,type:i};return u$(s,t)});if(o.length===0)return ie.never();if(o.length===1)return o[0];return ie.union(o)}if(!n)return ie.any();let r;switch(n){case"string":{let o=ie.string();if(e.format){let i=e.format;if(i==="email")o=o.check(ie.email());else if(i==="uri"||i==="uri-reference")o=o.check(ie.url());else if(i==="uuid"||i==="guid")o=o.check(ie.uuid());else if(i==="date-time")o=o.check(ie.iso.datetime());else if(i==="date")o=o.check(ie.iso.date());else if(i==="time")o=o.check(ie.iso.time());else if(i==="duration")o=o.check(ie.iso.duration());else if(i==="ipv4")o=o.check(ie.ipv4());else if(i==="ipv6")o=o.check(ie.ipv6());else if(i==="mac")o=o.check(ie.mac());else if(i==="cidr")o=o.check(ie.cidrv4());else if(i==="cidr-v6")o=o.check(ie.cidrv6());else if(i==="base64")o=o.check(ie.base64());else if(i==="base64url")o=o.check(ie.base64url());else if(i==="e164")o=o.check(ie.e164());else if(i==="jwt")o=o.check(ie.jwt());else if(i==="emoji")o=o.check(ie.emoji());else if(i==="nanoid")o=o.check(ie.nanoid());else if(i==="cuid")o=o.check(ie.cuid());else if(i==="cuid2")o=o.check(ie.cuid2());else if(i==="ulid")o=o.check(ie.ulid());else if(i==="xid")o=o.check(ie.xid());else if(i==="ksuid")o=o.check(ie.ksuid())}if(typeof e.minLength==="number")o=o.min(e.minLength);if(typeof e.maxLength==="number")o=o.max(e.maxLength);if(e.pattern)o=o.regex(new RegExp(e.pattern));r=o;break}case"number":case"integer":{let o=n==="integer"?ie.number().int():ie.number();if(typeof e.minimum==="number")o=o.min(e.minimum);if(typeof e.maximum==="number")o=o.max(e.maximum);if(typeof e.exclusiveMinimum==="number")o=o.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")o=o.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")o=o.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")o=o.lt(e.maximum);if(typeof e.multipleOf==="number")o=o.multipleOf(e.multipleOf);r=o;break}case"boolean":{r=ie.boolean();break}case"null":{r=ie.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let d=mn(u,t);o[l]=s.has(l)?d:d.optional()}if(e.propertyNames){let l=mn(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties==="object"?mn(e.additionalProperties,t):ie.any();if(Object.keys(o).length===0){r=ie.record(l,u);break}let d=ie.object(o).passthrough(),p=ie.looseRecord(l,u);r=ie.intersection(d,p);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let g of u){let m=mn(l[g],t),A=ie.string().regex(new RegExp(g));d.push(ie.looseRecord(A,m))}let p=[];if(Object.keys(o).length>0)p.push(ie.object(o).passthrough());if(p.push(...d),p.length===0)r=ie.object({}).passthrough();else if(p.length===1)r=p[0];else{let g=ie.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)g=ie.intersection(g,p[m]);r=g}break}let c=ie.object(o);if(e.additionalProperties===!1)r=c.strict();else if(typeof e.additionalProperties==="object")r=c.catchall(mn(e.additionalProperties,t));else r=c.passthrough();break}case"array":{let{prefixItems:o,items:i}=e;if(o&&Array.isArray(o)){let s=o.map((l)=>mn(l,t)),c=i&&typeof i==="object"&&!Array.isArray(i)?mn(i,t):void 0;if(c)r=ie.tuple(s).rest(c);else r=ie.tuple(s);if(typeof e.minItems==="number")r=r.check(ie.minLength(e.minItems));if(typeof e.maxItems==="number")r=r.check(ie.maxLength(e.maxItems))}else if(Array.isArray(i)){let s=i.map((l)=>mn(l,t)),c=e.additionalItems&&typeof e.additionalItems==="object"?mn(e.additionalItems,t):void 0;if(c)r=ie.tuple(s).rest(c);else r=ie.tuple(s);if(typeof e.minItems==="number")r=r.check(ie.minLength(e.minItems));if(typeof e.maxItems==="number")r=r.check(ie.maxLength(e.maxItems))}else if(i!==void 0){let s=mn(i,t),c=ie.array(s);if(typeof e.minItems==="number")c=c.min(e.minItems);if(typeof e.maxItems==="number")c=c.max(e.maxItems);r=c}else r=ie.array(ie.any());break}default:throw Error(`Unsupported type: ${n}`)}if(e.description)r=r.describe(e.description);if(e.default!==void 0)r=r.default(e.default);return r}function mn(e,t){if(typeof e==="boolean")return e?ie.any():ie.never();let n=u$(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map((u)=>mn(u,t)),l=ie.union(c);n=r?ie.intersection(n,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map((u)=>mn(u,t)),l=ie.xor(c);n=r?ie.intersection(n,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:ie.any();else{let c=r?n:mn(e.allOf[0],t),l=r?0:1;for(let u=l;u<e.allOf.length;u++)c=ie.intersection(c,mn(e.allOf[u],t));n=c}if(e.nullable===!0&&t.version==="openapi-3.0")n=ie.nullable(n);if(e.readOnly===!0)n=ie.readonly(n);let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)if(c in e)o[c]=e[c];let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)if(c in e)o[c]=e[c];for(let c of Object.keys(e))if(!ive.has(c))o[c]=e[c];if(Object.keys(o).length>0)t.registry.add(n,o);return n}function d$(e,t){if(typeof e==="boolean")return e?ie.any():ie.never();let n=sve(e,t?.defaultTarget),r=e.$defs||e.definitions||{},o={version:n,defs:r,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Xt};return mn(e,o)}var ie,ive;var p$=h(()=>{$d();yA();Kd();Wd();ie={...Yd,...fA,iso:Li},ive=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var lp={};cr(lp,{bigint:()=>dve,boolean:()=>uve,date:()=>pve,number:()=>lve,string:()=>cve});function cve(e){return gk(Bc,e)}function lve(e){return Sk(_c,e)}function uve(e){return Pk(Dc,e)}function dve(e){return Tk(Qc,e)}function pve(e){return Uk(np,e)}var g$=h(()=>{io();Wd()});var a={};cr(a,{$brand:()=>qC,$input:()=>uk,$output:()=>lk,NEVER:()=>Cd,TimePrecision:()=>hk,ZodAny:()=>rP,ZodArray:()=>cP,ZodBase64:()=>MA,ZodBase64URL:()=>zA,ZodBigInt:()=>Qc,ZodBigIntFormat:()=>FA,ZodBoolean:()=>Dc,ZodCIDRv4:()=>LA,ZodCIDRv6:()=>NA,ZodCUID:()=>RA,ZodCUID2:()=>TA,ZodCatch:()=>PP,ZodCodec:()=>YA,ZodCustom:()=>ap,ZodCustomStringFormat:()=>Oc,ZodDate:()=>np,ZodDefault:()=>CP,ZodDiscriminatedUnion:()=>uP,ZodE164:()=>jA,ZodEmail:()=>wA,ZodEmoji:()=>xA,ZodEnum:()=>Tc,ZodError:()=>tve,ZodExactOptional:()=>bP,ZodFile:()=>fP,ZodFirstPartyTypeKind:()=>jP,ZodFunction:()=>NP,ZodGUID:()=>Jd,ZodIPv4:()=>DA,ZodIPv6:()=>QA,ZodISODate:()=>IA,ZodISODateTime:()=>bA,ZodISODuration:()=>CA,ZodISOTime:()=>SA,ZodIntersection:()=>dP,ZodIssueCode:()=>UP,ZodJWT:()=>UA,ZodKSUID:()=>_A,ZodLazy:()=>DP,ZodLiteral:()=>AP,ZodMAC:()=>eP,ZodMap:()=>mP,ZodNaN:()=>TP,ZodNanoID:()=>PA,ZodNever:()=>sP,ZodNonOptional:()=>VA,ZodNull:()=>oP,ZodNullable:()=>SP,ZodNumber:()=>_c,ZodNumberFormat:()=>$s,ZodObject:()=>op,ZodOptional:()=>qA,ZodPipe:()=>KA,ZodPrefault:()=>EP,ZodPromise:()=>LP,ZodReadonly:()=>BP,ZodRealError:()=>jn,ZodRecord:()=>sp,ZodSet:()=>hP,ZodString:()=>Bc,ZodStringFormat:()=>ct,ZodSuccess:()=>xP,ZodSymbol:()=>tP,ZodTemplateLiteral:()=>_P,ZodTransform:()=>yP,ZodTuple:()=>pP,ZodType:()=>_e,ZodULID:()=>BA,ZodURL:()=>ep,ZodUUID:()=>hr,ZodUndefined:()=>nP,ZodUnion:()=>rp,ZodUnknown:()=>iP,ZodVoid:()=>aP,ZodXID:()=>OA,ZodXor:()=>lP,_ZodString:()=>EA,_default:()=>vP,_function:()=>n$,any:()=>$A,array:()=>ee,base64:()=>CF,base64url:()=>vF,bigint:()=>DF,boolean:()=>Xe,catch:()=>RP,check:()=>o$,cidrv4:()=>IF,cidrv6:()=>SF,clone:()=>En,codec:()=>XF,coerce:()=>lp,config:()=>Rt,core:()=>Wr,cuid:()=>pF,cuid2:()=>gF,custom:()=>WA,date:()=>jF,decode:()=>qx,decodeAsync:()=>Kx,describe:()=>r$,discriminatedUnion:()=>ip,e164:()=>EF,email:()=>oF,emoji:()=>uF,encode:()=>Hx,encodeAsync:()=>Vx,endsWith:()=>Sc,enum:()=>en,exactOptional:()=>IP,file:()=>YF,flattenError:()=>Td,float32:()=>TF,float64:()=>BF,formatError:()=>Bd,fromJSONSchema:()=>d$,function:()=>n$,getErrorMap:()=>rve,globalRegistry:()=>Xt,gt:()=>gr,gte:()=>wn,guid:()=>rF,hash:()=>RF,hex:()=>PF,hostname:()=>xF,httpUrl:()=>lF,includes:()=>bc,instanceof:()=>s$,int:()=>vA,int32:()=>OF,int64:()=>QF,intersection:()=>Lc,ipv4:()=>fF,ipv6:()=>bF,iso:()=>Li,json:()=>c$,jwt:()=>wF,keyof:()=>UF,ksuid:()=>AF,lazy:()=>QP,length:()=>Fs,literal:()=>ue,locales:()=>Fd,looseObject:()=>Tt,looseRecord:()=>HF,lowercase:()=>fc,lt:()=>pr,lte:()=>ro,mac:()=>yF,map:()=>qF,maxLength:()=>Us,maxSize:()=>Oi,meta:()=>i$,mime:()=>Cc,minLength:()=>Yr,minSize:()=>mr,multipleOf:()=>Bi,nan:()=>ZF,nanoid:()=>dF,nativeEnum:()=>KF,negative:()=>lA,never:()=>GA,nonnegative:()=>dA,nonoptional:()=>kP,nonpositive:()=>uA,normalize:()=>vc,null:()=>tp,nullable:()=>Zd,nullish:()=>WF,number:()=>je,object:()=>ne,optional:()=>pt,overwrite:()=>$o,parse:()=>Ux,parseAsync:()=>Fx,partialRecord:()=>GF,pipe:()=>Xd,positive:()=>cA,prefault:()=>wP,preprocess:()=>cp,prettifyError:()=>ov,promise:()=>t$,property:()=>pA,readonly:()=>OP,record:()=>tt,refine:()=>MP,regex:()=>Ac,regexes:()=>Co,registry:()=>Uh,safeDecode:()=>Wx,safeDecodeAsync:()=>Zx,safeEncode:()=>Yx,safeEncodeAsync:()=>Jx,safeParse:()=>$x,safeParseAsync:()=>Gx,set:()=>VF,setErrorMap:()=>ove,size:()=>js,slugify:()=>xc,startsWith:()=>Ic,strictObject:()=>FF,string:()=>k,stringFormat:()=>kF,stringbool:()=>a$,success:()=>JF,superRefine:()=>zP,symbol:()=>NF,templateLiteral:()=>e$,toJSONSchema:()=>AA,toLowerCase:()=>wc,toUpperCase:()=>kc,transform:()=>HA,treeifyError:()=>nv,trim:()=>Ec,tuple:()=>gP,uint32:()=>_F,uint64:()=>LF,ulid:()=>mF,undefined:()=>MF,union:()=>ut,unknown:()=>lt,uppercase:()=>yc,url:()=>kA,util:()=>J,uuid:()=>iF,uuidv4:()=>sF,uuidv6:()=>aF,uuidv7:()=>cF,void:()=>zF,xid:()=>hF,xor:()=>$F});var JA=h(()=>{io();io();Sw();io();Vd();p$();ck();Kd();Kd();g$();Wd();yA();jx();Xx();l$();Rt(Md())});var De=h(()=>{JA();JA()});var m$,h$,A$,f$,y$,b$,I$,S$,C$,v$,E$,w$,k$,FP,gve,$P,x$,mve,GP="cursor",HP="GET",qP="control",VP="[DONE]";var P$=h(()=>{De();m$=a.object({type:a.literal("run_started"),runId:a.string().describe("Server-assigned run ID for the started run.")}),h$=a.object({type:a.literal("message_started"),messageId:a.string().describe("Server-assigned assistant message ID for this run.")}),A$=a.object({type:a.literal("text_chunk"),messageId:a.string().describe("Assistant message the chunk belongs to."),content:a.string().describe("Incremental text delta to append.")}),f$=a.object({type:a.literal("reasoning_chunk"),messageId:a.string().describe("Assistant message the chunk belongs to."),content:a.string().describe("Incremental reasoning delta to append.")}),y$=a.object({type:a.literal("text_complete"),messageId:a.string().describe("Assistant message that completed."),content:a.string().describe("Full assistant text for the message.")}),b$=a.object({type:a.literal("reasoning_complete"),messageId:a.string().describe("Assistant message that completed."),content:a.string().describe("Full reasoning text for the message.")}),I$=a.object({type:a.literal("tool_call_pending"),toolCallId:a.string().describe("Stable identifier for the tool call."),name:a.string().describe("Name of the tool being called.")}),S$=a.object({type:a.literal("tool_call_start"),toolCallId:a.string().describe("Stable identifier for the tool call."),name:a.string().describe("Name of the tool being called."),params:a.unknown().describe("Resolved tool input params.")}),C$=a.object({type:a.literal("tool_call_complete"),toolCallId:a.string().describe("Stable identifier for the tool call."),status:a.enum(["in_progress","success","error"]).describe("Terminal (or transitional) status of the tool call."),result:a.unknown().optional().describe("Tool output, when available."),durationMs:a.number().nonnegative().optional().describe("Authoritative server-measured tool execution time in ms.")}),v$=a.object({type:a.literal("artifact"),name:a.string().describe("Artifact kind (for example table, timeseries)."),data:a.unknown().describe("Artifact payload; shape depends on name."),toolCallId:a.string().describe("Tool call that produced the artifact.")}),E$=a.object({type:a.literal("error"),message:a.string().describe("Human-readable error message."),name:a.string().optional().describe("Optional error class/name.")}),w$=a.object({type:a.literal("stream_reset"),messageId:a.string().describe("Assistant message whose content to reset.")}),k$=a.object({type:a.literal("disconnected")}),FP=a.discriminatedUnion("type",[m$,h$,A$,f$,y$,b$,I$,S$,C$,v$,E$,w$,k$]),gve=a.enum(["run_started","message_started","text_chunk","reasoning_chunk","text_complete","reasoning_complete","tool_call_pending","tool_call_start","tool_call_complete","artifact","error","stream_reset","disconnected"]),$P=a.object({streamNextOffset:a.string().describe("Opaque resume cursor for the next unread event; pass back as the stream 'cursor' query param.")}),x$=a.string().describe("Opaque resume cursor from a prior control frame's streamNextOffset."),mve=a.object({cursor:x$.optional().describe("Resume the stream after this offset. Omit to start from the beginning of the retained buffer.")})});var E=(e)=>{let t={operationId:e.operationId,backend:e.backend,pagination:e.pagination,async:e.async,examples:e.examples??[]};return{...e,contract:bj.$meta(t).route({method:e.route.method,path:e.route.path,tags:e.route.tags,operationId:e.operationId,summary:e.summary,description:e.description,successStatus:e.route.successStatus,successDescription:e.route.successDescription,deprecated:e.route.deprecated,inputStructure:e.route.inputStructure}).input(e.input).output(e.output)}};var R$=h(()=>{FC()});var T$=h(()=>{R$()});var Ve=h(()=>{T$()});var dp,O$,_$,D$,Q$,L$,N$,M$,z$,j$,hve,JP,U$,ZA,XA,Nc,ef,tf,F$,$$,nf,G$,H$,Mc,KP,Ave,q$,V$,K$,fve,Y$,W$,J$,ZP,Z$,X$,e1,of,rf,sf,af,pp,t1,YP,n1,gp,XP,o1,r1,yve,bve,eR,i1,s1,a1,c1,l1,u1,d1,tR,cf,lf,uf,df,nR,p1,WP,up,oR,Ive,pf,g1,m1,h1,A1,B$,f1,y1,b1,gf,mf,I1,rR,S1,C1,v1,E1,w1,hf,Af,Sve;var iR=h(()=>{De();Ve();dp=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),origin:a.enum(["user_declared","code_detected","log_observed"]),lifecycle:a.enum(["active","inactive","merged"]),observationState:a.enum(["observed","stale","unobserved"]),registryRevision:a.number().int().nonnegative(),canonicalComponentId:a.string().uuid(),mergedIntoComponentId:a.string().uuid().nullable(),currentStatus:a.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:a.string().datetime(),lastSeenAt:a.string().datetime(),deletedAt:a.string().datetime().nullable().describe("Timestamp when this component became inactive or was deleted, if any."),inactiveAt:a.string().datetime().nullable().describe("Timestamp when this component became inactive, if any."),inactiveReason:a.string().nullable().describe("Reason recorded when this component became inactive."),legacyStateUnknown:a.boolean().describe("True only for migration-era inactive rows whose deactivation authority is unknown.")}),O$=a.object({projectId:a.string().uuid().optional().describe("Project to list components for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, include inactive and merged components.")}),_$=a.object({components:a.array(dp),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),D$=a.object({componentId:a.string().uuid().describe("Component ID to retrieve.")}),Q$=a.object({component:dp}),L$=a.object({projectId:a.string().uuid().optional().describe("Project to register the component in. Auto-filled from CLI and SDK context when omitted."),name:a.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:a.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:a.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request."),origin:a.enum(["code_detected","log_observed"]).optional().describe("Machine provenance of this registration: 'code_detected' when the component was inferred from repository or code analysis, 'log_observed' (the default) when inferred from telemetry. Only applies to machine (secret-key) callers; human registrations are always recorded as 'user_declared' and ignore this field.")}),N$=a.object({component:dp}),M$=a.object({componentId:a.string().uuid().describe("Active component ID to rename."),name:a.string().trim().min(1,"Name is required"),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),z$=a.object({component:dp}),j$=a.object({componentId:a.string().uuid().describe("Component ID to deregister."),reason:a.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),hve=a.object({openIssueIds:a.array(a.string().uuid()),activeComponentIssueIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),notificationRuleIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),externalIncidentIds:a.array(a.string().uuid()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid())}),JP=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),lifecycle:a.enum(["active","retired"]),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),requiresCanonicalGroupConfirmation:a.boolean(),recommendationScopeEnabled:a.literal(!1),dependents:hve,counts:a.record(a.string(),a.number().int().nonnegative())}),U$=a.discriminatedUnion("status",[a.object({status:a.literal("observation_withdrawn"),componentId:a.string().uuid(),sourceType:a.literal("secret_key"),withdrawn:a.boolean()}),a.object({status:a.literal("retirement_confirmation_required"),preview:JP})]),ZA=E({operationId:"components.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/components",tags:["Components"]},input:O$,output:_$,pagination:"cursor",async:"sync"}),XA=E({operationId:"components.get",description:"Get a single component by ID.",backend:"api",route:{method:"GET",path:"/components/{componentId}",tags:["Components"]},input:D$,output:Q$,pagination:"none",async:"sync"}),Nc=E({operationId:"components.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/components",tags:["Components"]},input:L$,output:N$,pagination:"none",async:"sync"}),ef=E({operationId:"components.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/components/{componentId}/deregister",tags:["Components"]},input:j$,output:U$,pagination:"none",async:"sync"}),tf=E({operationId:"components.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/components/{componentId}/rename",tags:["Components"]},input:M$,output:z$,pagination:"none",async:"sync"}),F$=a.object({componentId:a.string().uuid().describe("Component whose owning team to set."),teamId:a.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),$$=a.object({componentId:a.string().uuid().describe("Component that was updated."),teamId:a.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),nf=E({operationId:"components.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/components/{componentId}/team",tags:["Components"]},input:F$,output:$$,pagination:"none",async:"sync"}),G$=a.object({componentId:a.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),H$=a.object({preview:JP}),Mc=a.record(a.string().uuid(),a.number().int().nonnegative()),KP=a.object({id:a.string().uuid(),rowRevision:a.number().int().nonnegative()}),Ave=a.object({notificationRules:a.array(KP),automationBindings:a.array(KP),relationships:a.array(KP)}),q$=a.object({componentId:a.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:Mc.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:a.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),V$=a.object({operationId:a.string().uuid(),status:a.enum(["committed","complete","followup_failed"]),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),counts:a.record(a.string(),a.number().int().nonnegative()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid()),manualExternalIncidentIds:a.array(a.string().uuid()),issueAutomationSuppressions:a.number().int().nonnegative(),outboxEffectCount:a.number().int().nonnegative(),manifest:Ave,followups:a.record(a.string(),a.unknown()).optional()}),K$=a.object({result:V$}),fve=a.object({notificationRuleIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid())}),Y$=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:a.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),W$=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),retirementOperationId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:Mc,eligible:fve}),J$=a.object({preview:W$}),ZP=a.object({notificationRuleIds:a.array(a.string().uuid()).default([]),automationBindingIds:a.array(a.string().uuid()).default([]),recommendationScopeIds:a.array(a.string().uuid()).default([]),relationshipIds:a.array(a.string().uuid()).default([])}),Z$=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:a.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:Mc.describe("Exact canonical-group revisions returned by restorationPreview."),selections:ZP.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),X$=a.object({operationId:a.string().uuid(),status:a.literal("complete"),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),restored:ZP}),e1=a.object({result:X$}),of=E({operationId:"components.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retirement/preview",tags:["Components"]},input:G$,output:H$,pagination:"none",async:"sync"}),rf=E({operationId:"components.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retire",tags:["Components"]},input:q$,output:K$,pagination:"none",async:"sync"}),sf=E({operationId:"components.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restoration/preview",tags:["Components"]},input:Y$,output:J$,pagination:"none",async:"sync"}),af=E({operationId:"components.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restore",tags:["Components"]},input:Z$,output:e1,pagination:"none",async:"sync"}),pp=a.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),t1=a.enum(["observed","stale","unobserved"]),YP=a.object({originalComponentId:a.string().uuid(),effectiveComponentId:a.string().uuid(),name:a.string(),lifecycle:a.enum(["active","retired","merged"]),observationState:t1}),n1=a.object({id:a.string().uuid(),source:YP,target:YP,relationshipType:pp,createdAt:a.string().datetime(),endedAt:a.string().datetime().nullable(),endReason:a.string().nullable(),rowRevision:a.number().int().nonnegative()}),gp=a.object({projectId:a.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),XP=a.object({sourceComponentId:a.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:a.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:pp}),o1=gp.extend({includeHistorical:a.union([a.boolean(),a.stringbool()]).default(!1).describe("Include historically ended relationships.")}),r1=a.object({relationships:a.array(n1)}),yve=a.object({ruleId:a.string().uuid(),ruleGroupId:a.string().uuid().nullable(),ownerComponentId:a.string().uuid(),destinationIds:a.array(a.string().uuid()),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),bve=a.object({bindingId:a.string().uuid(),automationId:a.string().uuid(),ownerComponentId:a.string().uuid(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),eR=a.object({notificationRules:a.array(yve),automationBindings:a.array(bve)}),i1=XP.extend({action:a.enum(["add","remove"]),organizationId:a.string(),projectId:a.string().uuid(),relationshipId:a.string().uuid().nullable(),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),policyImpact:eR,confirmationRequired:a.boolean()}),s1=gp.merge(XP).extend({action:a.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),a1=a.object({preview:i1}),c1=gp.merge(XP).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:a.string().trim().min(1,"Reason cannot be empty"),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),confirmPolicyImpact:a.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),l1=c1,u1=c1,d1=a.object({action:a.enum(["add","remove"]),relationshipId:a.string().uuid(),sourceComponentId:a.string().uuid(),targetComponentId:a.string().uuid(),relationshipType:pp,policyImpact:eR}),tR=a.object({result:d1}),cf=E({operationId:"components.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/components/relationships",tags:["Components"]},input:o1,output:r1,pagination:"none",async:"sync"}),lf=E({operationId:"components.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/components/relationships/preview",tags:["Components"]},input:s1,output:a1,pagination:"none",async:"sync"}),uf=E({operationId:"components.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships",tags:["Components"]},input:l1,output:tR,pagination:"none",async:"sync"}),df=E({operationId:"components.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships/remove",tags:["Components"]},input:u1,output:tR,pagination:"none",async:"sync"}),nR=a.enum(["suspend","move"]),p1=a.object({disposition:nR,beforeComponentIds:a.array(a.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:a.array(a.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),WP=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),sourceRowRevision:a.number().int().nonnegative(),sourceComponentId:a.string().uuid(),equivalentPolicyId:a.string().uuid().nullable(),equivalent:a.boolean(),defaultDisposition:a.enum(["deduplicate","suspend"]),allowedDispositions:a.array(nR),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),up=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),ownerComponentId:a.string().uuid(),rowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),oR=a.object({relationshipId:a.string().uuid(),action:a.enum(["rewire","close_self","close_duplicate"]),relationshipType:pp,beforeSourceComponentId:a.string().uuid(),beforeTargetComponentId:a.string().uuid(),afterSourceComponentId:a.string().uuid(),afterTargetComponentId:a.string().uuid(),survivingRelationshipId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative().nullable()}),Ive=a.object({openIssueIds:a.array(a.string().uuid()),componentIssueIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),nameIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid())}),pf=a.object({sourceComponentId:a.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:a.string().uuid().describe("Active terminal component that becomes the canonical target.")}),g1=gp.merge(pf),m1=pf.extend({organizationId:a.string(),projectId:a.string().uuid(),sourceGroupComponentIds:a.array(a.string().uuid()),targetGroupComponentIds:a.array(a.string().uuid()),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:Mc,inventory:Ive,notificationPolicies:a.array(WP),automationBindings:a.array(WP),notificationScopeChanges:a.array(up),automationScopeChanges:a.array(up),relationshipChanges:a.array(oR),recommendationScopeEnabled:a.literal(!1),dependentCount:a.number().int().nonnegative(),ordinaryTransactionLimit:a.number().int().positive(),operatorAssistanceRequired:a.boolean(),confirmationRequired:a.boolean()}),h1=a.object({preview:m1}),A1=gp.merge(pf).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:Mc.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:a.record(a.string().uuid(),p1).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:a.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),B$=a.object({policyId:a.string().uuid(),action:a.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),f1=a.object({componentRevisions:Mc,redirectedComponentIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),movedAliasIds:a.array(a.string().uuid()),historicalDisplayIds:a.array(a.string().uuid()),relationshipChanges:a.array(oR),notificationPolicies:a.array(B$),automationBindings:a.array(B$),notificationScopeChanges:a.array(up),automationScopeChanges:a.array(up),recommendationScopeIds:a.array(a.string().uuid())}),y1=pf.extend({operationId:a.string().uuid(),status:a.literal("complete"),affectedComponentIds:a.array(a.string().uuid()),manifest:f1}),b1=a.object({result:y1}),gf=E({operationId:"components.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/components/merge/preview",tags:["Components"]},input:g1,output:h1,pagination:"none",async:"sync"}),mf=E({operationId:"components.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/components/merge",tags:["Components"]},input:A1,output:b1,pagination:"none",async:"sync"}),I1=a.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),rR=a.object({id:a.string().uuid(),componentId:a.string().uuid(),projectId:a.string().uuid(),severity:I1,summary:a.string().describe("Human-readable summary of the status-page issue."),startedAt:a.string().datetime().describe("When the incident began affecting the component."),resolvedAt:a.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),S1=a.object({projectId:a.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:a.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),C1=a.object({incidents:a.array(rR),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),v1=a.object({timestamp:a.string().datetime(),status:a.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),E1=a.object({componentId:a.string().uuid().describe("Component to build the timeline for."),windowStart:a.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:a.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),w1=a.object({componentId:a.string().uuid(),windowStart:a.string().datetime(),windowEnd:a.string().datetime(),timeline:a.array(v1),incidents:a.array(rR)}),hf=E({operationId:"components.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Components"]},input:S1,output:C1,pagination:"cursor",async:"sync"}),Af=E({operationId:"components.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/components/{componentId}/timeline",tags:["Components"]},input:E1,output:w1,pagination:"none",async:"sync"}),Sve={list:ZA.contract,get:XA.contract,register:Nc.contract,deregister:ef.contract,rename:tf.contract,assignTeam:nf.contract,retirementPreview:of.contract,retire:rf.contract,restorationPreview:sf.contract,restore:af.contract,mergePreview:gf.contract,merge:mf.contract,relationships:{list:cf.contract,preview:lf.contract,add:uf.contract,remove:df.contract},incidents:{list:hf.contract},timeline:Af.contract}});var ff,sR,k1,x1,aR,P1,R1,T1,cR,B1,O1,_1,lR,D1,Q1,uR;var dR=h(()=>{De();Ve();ff=["github","google","microsoft","linear","bitbucket","slack"],sR=a.enum(ff),k1=a.object({organizationId:a.string().min(1).optional().describe("Organization to connect within. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:sR.describe("Connected-account provider to connect.")}),x1=a.object({url:a.string().describe("Vendor authorization URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:a.string().uuid().describe("Connect attempt to poll via `connectedAccounts.getConnectAttempt` while the browser flow completes."),expiresAt:a.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),aR=E({operationId:"connectedAccounts.beginConnect",description:"Begin a browser connect flow for a connected-account provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/connected-accounts/connect",tags:["Connected Accounts"],successStatus:201},input:k1,output:x1,pagination:"none",async:"sync"}),P1=a.enum(["pending","completed","failed","expired"]),R1=a.object({organizationId:a.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),attemptId:a.string().uuid().describe("Connect attempt ID to poll.")}),T1=a.object({status:P1.describe("Attempt state. `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:a.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized).")}),cR=E({operationId:"connectedAccounts.getConnectAttempt",description:"Poll a browser connect attempt started with `connectedAccounts.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/connected-accounts/connect/attempts/{attemptId}",tags:["Connected Accounts"]},input:R1,output:T1,pagination:"none",async:"sync"}),B1=a.object({organizationId:a.string().min(1).optional().describe("Organization to list accounts for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),O1=a.object({provider:a.string().describe("Provider identifier."),externalName:a.string().nullable().describe("Display name from the provider."),externalLogin:a.string().nullable().describe("Username or login from the provider."),connectedAt:a.string().datetime().nullable().describe("When the account was connected."),authMode:a.enum(["oauth","pat"]).nullable().describe("Auth mode used."),needsReconnect:a.boolean().describe("Whether the token is expired and a reconnect is required.")}),_1=a.object({accounts:a.array(O1)}),lR=E({operationId:"connectedAccounts.list",description:"List the calling user's connected accounts for the organization.",backend:"api",route:{method:"GET",path:"/connected-accounts",tags:["Connected Accounts"]},input:B1,output:_1,pagination:"none",async:"sync"}),D1=a.object({organizationId:a.string().min(1).optional().describe("Organization the account belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:sR.describe("Provider to disconnect.")}),Q1=a.object({success:a.literal(!0)}),uR=E({operationId:"connectedAccounts.disconnect",description:"Disconnect the calling user's connected account for a provider (soft delete).",backend:"api",route:{method:"DELETE",path:"/connected-accounts/{provider}",tags:["Connected Accounts"]},input:D1,output:Q1,pagination:"none",async:"sync"})});var Gs,pR,L1,N1,Cve,vve,Eve,M1,mp,wve,kve,xve,Pve,Rve,Tve,Bve,Ove,_ve,Dve,Qve,Lve,gR,mR,hR,AR,fR,yR,Nve,Mve,zve,jve,bR,IR,Uve,Fve,$ve,Gve,SR,Ypt;var z1=h(()=>{De();Ve();Gs=a.string().uuid().describe("Automation ID."),pR=a.enum(["running","succeeded","failed","timed_out","cancelled"]),L1=a.object({id:a.string().uuid(),automationRunKey:a.string(),status:pR,startedAt:a.string().datetime(),completedAt:a.string().datetime().nullable(),durationMs:a.number().int().nullable(),exitCode:a.number().int().nullable()}),N1=L1.extend({scheduledAt:a.string().datetime().nullable().describe("When the run was scheduled to start, if known."),dueAt:a.string().datetime().nullable().describe("When the run became due, if known."),errorMessage:a.string().nullable().describe("Failure detail for the run, if it failed or timed out.")}),Cve=N1.extend({automationId:a.string().uuid().describe("Automation that owns this run.")}),vve=a.enum(["script","log_match"]),Eve=a.enum(["expression_matched"]),M1=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),kind:vve.describe("Automation kind: a scheduled script or a log-match investigation."),scriptId:a.string().uuid().nullable().describe("ID of the project_scripts row this automation runs, for DB-backed script automations. Null for legacy script_path automations and for log-match automations."),scriptName:a.string().nullable().describe("Name of the project_scripts row this automation runs (see scriptId). Null when scriptId is null."),signalDefinitionId:a.string().uuid().nullable().describe("Signal definition bound to this automation. Null for script automations."),signalType:Eve.nullable().describe("Signal trigger type for log-match automations. Null for script automations."),source:a.enum(["sazabi_managed","custom"]).describe("Whether the automation is Sazabi-managed or customer-defined."),enabled:a.boolean(),cronExpression:a.string().nullable().describe("Cron schedule for scheduled automations. Null for signal automations."),timezone:a.string(),timeoutSeconds:a.number().int().nullable(),health:a.enum(["healthy","failing","never_run"]).describe("Health derived from the most recent run."),lastRun:L1.nullable(),successRate:a.number().nullable().describe("Fraction of terminal runs that succeeded over the last 7 days."),runCount:a.number().int().describe("Total runs over the last 7 days."),failedRunCount:a.number().int().describe("Failed or timed-out runs over the last 7 days.")}),mp=M1.extend({createdAt:a.string().datetime(),updatedAt:a.string().datetime(),recordedHistoryStartsAt:a.string().datetime().describe("Earliest timestamp for which run history is recorded."),scriptIdentifier:a.string().nullable().describe("Relative project script path executed by the automation. Null for signal automations."),canToggle:a.boolean().describe("Whether the caller may enable or disable this automation.")}),wve=a.object({projectId:a.string().uuid().optional().describe("Project to list automations for. Auto-filled from CLI and SDK context when omitted."),search:a.string().optional().describe("Case-insensitive partial match on automation name."),status:a.enum(["active","paused"]).optional().describe("Filter by enabled (active) or disabled (paused) automations."),health:a.enum(["healthy","failing","never_run"]).optional().describe("Filter by automation health."),source:a.enum(["sazabi_managed","custom"]).optional().describe("Filter by automation source."),sort:a.enum(["name","last_run","failures","runs"]).default("name").describe("Sort order for the returned automations."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of automations to return per page."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),kve=a.object({automations:a.array(M1),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),xve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Pve=a.object({automation:mp}),Rve=a.object({projectId:a.string().uuid().optional().describe("Project to create the automation in. Auto-filled from CLI and SDK context when omitted."),name:a.string().min(1).max(200).describe("Automation name."),description:a.string().max(2000).nullable().optional().describe("Human-readable description. Required for log-match automations (investigation instructions)."),scriptId:a.string().uuid().optional().describe("Project script to run, by ID. Provide exactly one of scriptId, script, or expressionId."),script:a.string().optional().describe("Project script to run, by name (resolved to scriptId server-side). Provide exactly one of scriptId, script, or expressionId."),expressionId:a.string().uuid().optional().describe("Log-match expression to bind. Creates a signal automation that investigates matching logs. Mutually exclusive with scriptId and script."),cronExpression:a.string().optional().describe("Cron schedule for the automation. Defaults to every minute when omitted."),timezone:a.string().optional().describe("IANA timezone for cronExpression. Defaults to UTC."),timeoutSeconds:a.coerce.number().int().min(1).max(3600).optional().describe("Execution timeout in seconds. Defaults to 60."),enabled:a.boolean().optional().describe("Whether the automation starts enabled. Defaults to true.")}).superRefine((e,t)=>{let n=e.scriptId!=null,r=e.script!=null,o=e.expressionId!=null;if(Number(n)+Number(r)+Number(o)!==1){t.addIssue({code:"custom",message:"Provide exactly one of scriptId, script, or expressionId.",path:["scriptId"]});return}if(o){if(e.cronExpression!=null)t.addIssue({code:"custom",message:"cronExpression is not used for log-match automations.",path:["cronExpression"]});if(e.timezone!=null)t.addIssue({code:"custom",message:"timezone is not used for log-match automations.",path:["timezone"]});if(e.timeoutSeconds!=null)t.addIssue({code:"custom",message:"timeoutSeconds is not used for log-match automations.",path:["timeoutSeconds"]});if(!e.description?.trim())t.addIssue({code:"custom",message:"description is required for log-match automations (investigation instructions).",path:["description"]})}}),Tve=a.object({automation:mp}),Bve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),name:a.string().min(1).max(200).optional().describe("New automation name."),description:a.string().max(2000).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged."),cronExpression:a.string().optional().describe("New cron schedule."),timezone:a.string().optional().describe("New IANA timezone."),timeoutSeconds:a.coerce.number().int().min(1).max(3600).optional().describe("New execution timeout in seconds.")}),Ove=a.object({automation:mp}),_ve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Dve=a.object({automation:mp}),Qve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Lve=a.object({automation:mp}),gR=E({operationId:"automations.list",description:"List scheduled automations in a project, with run health and recent run stats.",backend:"api",route:{method:"GET",path:"/automations",tags:["Automations"]},input:wve,output:kve,pagination:"cursor",async:"sync"}),mR=E({operationId:"automations.get",description:"Get a single automation by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}",tags:["Automations"]},input:xve,output:Pve,pagination:"none",async:"sync"}),hR=E({operationId:"automations.create",description:"Create an automation: either a cron-driven project script (see scripts.create) or a signal investigation bound to a signal definition (see signalDefinitions.create).",backend:"api",route:{method:"POST",path:"/automations",successStatus:201,tags:["Automations"]},input:Rve,output:Tve,pagination:"none",async:"sync"}),AR=E({operationId:"automations.update",description:"Update an automation's name, description, or schedule. Does not change which script it runs.",backend:"api",route:{method:"PATCH",path:"/automations/{automationId}",tags:["Automations"]},input:Bve,output:Ove,pagination:"none",async:"sync"}),fR=E({operationId:"automations.enable",description:"Enable an automation so it runs on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/enable",tags:["Automations"]},input:_ve,output:Dve,pagination:"none",async:"sync"}),yR=E({operationId:"automations.disable",description:"Disable an automation so it stops running on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/disable",tags:["Automations"]},input:Qve,output:Lve,pagination:"none",async:"sync"}),Nve=a.object({automationId:Gs,projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),status:a.union([pR,a.array(pR)]).optional().describe("Filter runs by status. Accepts a single status or an array of statuses (matched as OR)."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page.")}),Mve=a.object({runs:a.array(N1),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results."),recordedHistoryStartsAt:a.string().datetime().describe("Earliest timestamp for which run history is recorded.")}),zve=a.object({automationId:Gs,runId:a.string().uuid().describe("Automation run ID."),projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),jve=a.object({run:Cve}),bR=E({operationId:"automations.runs.list",description:"List runs for an automation, most recent first.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs",tags:["Automations"]},input:Nve,output:Mve,pagination:"cursor",async:"sync"}),IR=E({operationId:"automations.runs.get",description:"Get a single automation run by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}",tags:["Automations"]},input:zve,output:jve,pagination:"none",async:"sync"}),Uve=a.enum(["queued","running","succeeded","failed","timed_out"]),Fve=a.object({stdout:a.string().describe("Captured standard output for the run."),stderr:a.string().describe("Captured standard error for the run."),exitCode:a.number().int().nullable().describe("Process exit code of the run's command, if it finished."),status:Uve.describe("Execution status of the run's captured command."),truncated:a.boolean().describe("Whether the captured output exceeded the inline preview limit. The full output is returned when it could be read from durable storage; otherwise the truncated preview is returned with this flag set."),startedAt:a.string().datetime().nullable().describe("When the command started executing, if known."),completedAt:a.string().datetime().nullable().describe("When the command finished executing, if known."),durationMs:a.number().int().nullable().describe("Command execution duration in milliseconds, if known.")}),$ve=a.object({automationId:Gs,runId:a.string().uuid().describe("Automation run ID."),projectId:a.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),Gve=a.object({logs:Fve}),SR=E({operationId:"automations.runs.logs",description:"Get the captured stdout/stderr for a single automation run, reading the full output from durable storage when the inline preview was truncated.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}/logs",tags:["Automations"]},input:$ve,output:Gve,pagination:"none",async:"sync"}),Ypt={list:gR.contract,get:mR.contract,create:hR.contract,update:AR.contract,enable:fR.contract,disable:yR.contract,runs:{list:bR.contract,get:IR.contract,logs:SR.contract}}});var Hve,qve,Vve,Kve,j1,Yve,yf,Wve,Jve,U1,Zve,Xve,eEe,tEe,nEe,oEe,rEe,vR,ER,wR,Go,F1,CR,kR,iEe,$1,sEe,aEe,cEe,lEe,uEe,dEe,pEe,gEe,mEe,hEe,AEe,fEe,yEe,bEe,IEe,SEe,CEe,vEe,EEe,xR,G1,wEe,kEe,PR,RR,TR,BR,OR,_R,DR,QR,LR,NR,MR,zR,jR,Xpt;var H1=h(()=>{De();Ve();Hve=a.enum(["logs_ingested_bytes","logs_accepted_bytes","input_tokens","output_tokens","issues_created","automation_runs_completed","pull_requests_created","pull_request_reviews_completed"]),qve=a.enum(["cycle_top_up","upgrade_top_up","deficit_settlement","auto_top_up","one_off_top_up","usage_debit","adjustment","migration_opening_balance","void"]),Vve=a.enum(["credit","debit"]),Kve=a.enum(["cycle_renewal","plan_upgrade","auto_purchase","one_off_purchase","deficit_settlement","usage","adjustment","migration_opening_balance"]),j1=a.object({startsAt:a.string().datetime(),endsAt:a.string().datetime(),billableStartsAt:a.string().datetime()}),Yve=a.object({subscriptionChargeAmount:a.string(),creditDeficitAmount:a.string(),creditDeficitChargeAmount:a.string(),totalAmount:a.string(),currency:a.string()}),yf=a.object({billingSubscriptionChangeId:a.string(),effectiveAt:a.string().datetime(),planSlug:a.string().nullable(),planName:a.string().nullable(),price:a.string().nullable(),currency:a.string().nullable(),targetCreditBalance:a.string().nullable()}),Wve=a.object({id:a.string(),status:a.string(),billingPlanId:a.string(),priceBookId:a.string().optional(),cycleType:a.string(),cancelAt:a.string().datetime().nullable(),canceledAt:a.string().datetime().nullable()}),Jve=a.object({organizationId:a.string().min(1).optional().describe("Organization to query billing for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),U1=a.object({status:a.enum(["current","payment_retrying","delinquent"]).describe("Negative-balance collection state. `current` means no open collection case; `payment_retrying` means a scheduled retry cadence is running; `delinquent` means retries are exhausted and intake is denied until payment settles the balance."),outstandingCredits:a.string().nullable().describe("Credits owed (absolute value of the negative balance)."),outstandingAmount:a.string().nullable().describe("Amount owed in `currency` at the current additional-credit price."),currency:a.string().nullable(),scheduledAttemptsMade:a.number().int().describe("Scheduled collection attempts consumed by confirmed payment failures."),nextRetryAt:a.string().datetime().nullable(),billingInvoiceId:a.string().nullable(),hostedInvoiceUrl:a.string().nullable()}).describe("Read-only negative-balance collection state for the organization."),Zve=a.object({billingModel:a.enum(["credit-balance-v1"]),billable:a.boolean(),nonBillableReason:a.string().nullable(),status:a.string(),planName:a.string().nullable(),planSlug:a.string().nullable(),currency:a.string().nullable(),currentBalance:a.string().nullable(),targetCreditBalance:a.string().nullable(),currentCycle:j1.nullable(),currentPeriodEstimate:Yve.nullable(),pendingDowngrade:yf.nullable(),subscription:Wve.nullable(),collection:U1,currentPlan:a.object({slug:a.string(),name:a.string(),price:a.string().nullable(),currency:a.string().nullable(),targetCreditBalance:a.string().nullable(),subscriptionStatus:a.string(),cycleStartsAt:a.string().datetime().nullable(),cycleEndsAt:a.string().datetime().nullable(),renewalAt:a.string().datetime().nullable(),pendingSwitch:yf.nullable(),pendingCancellation:a.object({effectiveAt:a.string().datetime()}).nullable()}).nullable()}),Xve=a.object({organizationId:a.string().min(1).optional().describe("Organization to query usage for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),cycle:a.enum(["current","previous"]).default("current").describe("Which billing cycle to report usage for.")}),eEe=a.object({dimension:Hve,totalQuantity:a.string(),ratedQuantity:a.string(),creditsConsumed:a.string(),sourceBreakdown:a.record(a.string(),a.string())}),tEe=a.object({cycle:j1.nullable(),usage:a.array(eEe)}),nEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to query transactions for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),limit:a.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of transactions to return per page."),page:a.coerce.number().int().min(1).default(1).describe("Page number for pagination (1-indexed).")}),oEe=a.object({id:a.string(),transactionType:qve,creditDelta:a.string(),direction:Vve.describe("Which way this entry moved the balance. Derived from the business event, not from the amount: a zero-credit cycle renewal is still a credit."),reason:Kve.describe("The business event that produced this entry."),amount:a.string().describe("Non-negative magnitude of the balance movement. Apply `direction` for the signed value."),balanceAfter:a.string(),occurredAt:a.string().datetime(),billingInvoiceId:a.string().nullable()}),rEe=a.object({items:a.array(oEe),pagination:a.object({page:a.number(),limit:a.number(),total:a.number(),totalPages:a.number(),hasNext:a.boolean(),hasPrev:a.boolean()}).describe("Pagination metadata for the transaction list.")}),vR=E({operationId:"billing.getSummary",description:"Get a billing summary for the current organization, including plan, balance, and cycle information.",backend:"api",route:{method:"GET",path:"/billing/summary",tags:["Billing"]},input:Jve,output:Zve,pagination:"none",async:"sync"}),ER=E({operationId:"billing.getUsage",description:"Get per-dimension usage breakdown for the current or previous billing cycle.",backend:"api",route:{method:"GET",path:"/billing/usage",tags:["Billing"]},input:Xve,output:tEe,pagination:"none",async:"sync"}),wR=E({operationId:"billing.listTransactions",description:"List recent credit ledger transactions with pagination.",backend:"api",route:{method:"GET",path:"/billing/transactions",tags:["Billing"]},input:nEe,output:rEe,pagination:"page",async:"sync"}),Go=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),F1=a.string().trim().regex(/^\d+(?:\.\d{1,6})?$/,"Expected a decimal with up to 6 places"),CR=F1.refine((e)=>{let[,t=""]=e.split(".");return t.slice(2).replaceAll("0","")===""},"Expected a currency amount with up to 2 decimal places").refine((e)=>/[1-9]/.test(e),"Expected a positive currency amount"),kR=a.string().trim().min(1).max(100),iEe=a.object({organizationId:Go}),$1=a.object({supported:a.boolean().describe("Whether auto top-up is available for the account's plan."),enabled:a.boolean(),triggerCreditBalance:a.string(),topUpAmount:a.string(),cycleSpendingLimit:a.string(),currency:a.string(),creditsToGrant:a.string().nullable(),status:a.string()}),sEe=a.object({organizationId:Go,enabled:a.boolean(),triggerCreditBalance:F1,topUpAmount:CR,cycleSpendingLimit:CR}),aEe=a.object({organizationId:Go,amount:CR.describe("Amount to charge in the account currency; grants an equal credit balance."),idempotencyKey:a.string().trim().min(1).max(128).describe("Client-generated key. Repeating a request with the same key returns the original purchase instead of charging again.")}),cEe=a.object({status:a.enum(["paid","pending_payment"]),billingInvoiceId:a.string(),topUpAmount:a.string(),creditsToGrant:a.string(),currency:a.string()}),lEe=a.object({organizationId:Go}),uEe=a.object({slug:a.string(),billingModel:a.string(),name:a.string(),description:a.string(),bestFor:a.string().nullable(),price:a.string(),currency:a.string(),targetCreditBalance:a.string().nullable(),logsIncludedBytes:a.string(),inputTokensIncluded:a.string(),outputTokensIncluded:a.string()}),dEe=a.object({billingModel:a.string(),currentPlanSlug:a.string().nullable(),hasActiveStripeBilling:a.boolean(),plans:a.array(uEe)}),pEe=a.object({organizationId:Go,planSlug:kR}),gEe=a.object({calculatedAt:a.string().datetime(),type:a.enum(["upgrade","downgrade"]),effectiveAt:a.string().datetime(),currency:a.string(),currentPlanSlug:a.string(),targetPlanSlug:a.string(),currentPlanName:a.string(),targetPlanName:a.string(),currentPlanPrice:a.string(),targetPlanPrice:a.string(),currentTargetCreditBalance:a.string(),targetCreditBalance:a.string(),creditDeficitAmount:a.string(),creditDeficitChargeAmount:a.string(),additionalCreditPrice:a.string(),immediateChargeAmount:a.string(),subscriptionChargeAmount:a.string(),proratedCreditGrantAmount:a.string(),remainingCycleFraction:a.string(),nextCycleChargeAmount:a.string()}),mEe=a.object({organizationId:Go,planSlug:kR}),hEe=a.object({billingSubscriptionChangeId:a.string(),billingSubscriptionId:a.string(),status:a.string(),type:a.string(),effectiveAt:a.string().datetime(),invoiceId:a.string().nullable(),creditDeficitAmount:a.string().optional(),creditDeficitChargeAmount:a.string().optional(),creditTopUpAmount:a.string().optional(),immediateChargeAmount:a.string().optional(),subscriptionChargeAmount:a.string().optional(),proratedCreditGrantAmount:a.string().optional()}),AEe=a.object({organizationId:Go,planSlug:kR}),fEe=a.object({sessionId:a.string(),checkoutUrl:a.string().url()}),yEe=a.object({organizationId:Go,sessionId:a.string().min(1).describe("The checkout session id returned by createCheckoutSession.")}),bEe=a.object({status:a.enum(["pending","active","expired"])}),IEe=a.object({organizationId:Go}),SEe=a.object({portalUrl:a.string().url()}),CEe=a.object({organizationId:Go}),vEe=a.object({hasPaymentMethod:a.boolean(),brand:a.string().nullable(),last4:a.string().nullable(),type:a.string().nullable(),expiryMonth:a.number().int().min(1).max(12).nullable(),expiryYear:a.number().int().nullable(),isDefault:a.boolean(),display:a.string().nullable()}),EEe=a.object({slug:a.string(),name:a.string(),price:a.string().nullable(),currency:a.string().nullable(),targetCreditBalance:a.string().nullable(),subscriptionStatus:a.string(),cycleStartsAt:a.string().datetime().nullable(),cycleEndsAt:a.string().datetime().nullable(),renewalAt:a.string().datetime().nullable(),pendingSwitch:yf.nullable(),pendingCancellation:a.object({effectiveAt:a.string().datetime()}).nullable()}),xR=a.object({organizationId:Go}),G1=a.object({currentPlan:EEe,effectiveAt:a.string().datetime(),currentBalance:a.string(),servicePolicy:a.literal("active_until_period_end"),creditPolicy:a.literal("dormant_until_resubscription"),scheduledFinalCharge:a.string().nullable(),autoTopUpEnabled:a.boolean(),pendingDowngrade:yf.nullable(),collectionState:U1,calculatedAt:a.string().datetime()}),wEe=G1.extend({billingSubscriptionChangeId:a.string(),alreadyScheduled:a.boolean()}),kEe=a.object({billingSubscriptionId:a.string(),resumed:a.literal(!0)}),PR=E({operationId:"billing.getAutoTopUp",description:"Get the organization's credit auto top-up settings (trigger balance, top-up amount, cycle spending limit).",backend:"api",route:{method:"GET",path:"/billing/auto-top-up",tags:["Billing"]},input:iEe,output:$1,pagination:"none",async:"sync"}),RR=E({operationId:"billing.updateAutoTopUp",description:"Enable/disable and configure credit auto top-up. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"PUT",path:"/billing/auto-top-up",tags:["Billing"]},input:sEe,output:$1,pagination:"none",async:"sync"}),TR=E({operationId:"billing.purchaseCredits",description:"Purchase a one-time amount of credits against the saved payment method. Requires a user credential with `billing:manage` and a stable idempotency key.",backend:"api",route:{method:"POST",path:"/billing/credits/purchase",tags:["Billing"]},input:aEe,output:cEe,pagination:"none",async:"sync"}),BR=E({operationId:"billing.listPlans",description:"List the self-serve credit plans available for checkout, including the current plan.",backend:"api",route:{method:"GET",path:"/billing/plans",tags:["Billing"]},input:lEe,output:dEe,pagination:"none",async:"sync"}),OR=E({operationId:"billing.previewPlanChange",description:"Preview the cost and effect of changing to a plan without applying it. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change/preview",tags:["Billing"]},input:pEe,output:gEe,pagination:"none",async:"sync"}),_R=E({operationId:"billing.changePlan",description:"Apply a plan upgrade or schedule a downgrade. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change",tags:["Billing"]},input:mEe,output:hEe,pagination:"none",async:"sync"}),DR=E({operationId:"billing.createCheckoutSession",description:"Create a hosted Stripe Checkout session for first-time subscribe from the terminal. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/checkout-session",tags:["Billing"]},input:AEe,output:fEe,pagination:"none",async:"sync"}),QR=E({operationId:"billing.getCheckoutSessionStatus",description:"Poll the completion status of a checkout session created by this organization.",backend:"api",route:{method:"GET",path:"/billing/checkout-session/{sessionId}",tags:["Billing"]},input:yEe,output:bEe,pagination:"none",async:"sync"}),LR=E({operationId:"billing.createPortalSession",description:"Create a Stripe Customer Portal session for updating the payment method. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/portal-session",tags:["Billing"]},input:IEe,output:SEe,pagination:"none",async:"sync"}),NR=E({operationId:"billing.getPaymentMethod",description:"Get a summary of the organization's saved payment method (brand and last 4 digits).",backend:"api",route:{method:"GET",path:"/billing/payment-method",tags:["Billing"]},input:CEe,output:vEe,pagination:"none",async:"sync"}),MR=E({operationId:"billing.previewSubscriptionCancellation",description:"Preview period-end subscription cancellation without changing billing state.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/preview",tags:["Billing"]},input:xR,output:G1,pagination:"none",async:"sync"}),zR=E({operationId:"billing.scheduleSubscriptionCancellation",description:"Schedule cancellation at the end of the paid billing cycle.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation",tags:["Billing"]},input:xR,output:wEe,pagination:"none",async:"sync"}),jR=E({operationId:"billing.resumeSubscriptionCancellation",description:"Resume renewal before a scheduled cancellation takes effect.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/resume",tags:["Billing"]},input:xR,output:kEe,pagination:"none",async:"sync"}),Xpt={getSummary:vR.contract,getUsage:ER.contract,listTransactions:wR.contract,getAutoTopUp:PR.contract,updateAutoTopUp:RR.contract,purchaseCredits:TR.contract,listPlans:BR.contract,previewPlanChange:OR.contract,changePlan:_R.contract,createCheckoutSession:DR.contract,getCheckoutSessionStatus:QR.contract,createPortalSession:LR.contract,getPaymentMethod:NR.contract,previewSubscriptionCancellation:MR.contract,scheduleSubscriptionCancellation:zR.contract,resumeSubscriptionCancellation:jR.contract}});var xEe,hp,PEe,REe,TEe,BEe,OEe,_Ee,Ap,q1,DEe,QEe,V1,LEe,NEe,K1,MEe,zEe,Y1,jEe,UEe,W1,FEe,$Ee,J1,GEe,HEe,qEe,Z1,VEe,KEe,X1,YEe,WEe,e2,UR,t2,n2,o2,r2,i2,s2,fp,a2,JEe,c2,ZEe,l2,u2,XEe,ewe,d2,twe,p2,nwe,owe,g2;var m2=h(()=>{De();Ve();xEe=["slack","github","linear","pagerduty","victorops","rootly","incident_io","webhook","teams","bitbucket","jira"],hp=a.enum(xEe),PEe=a.enum(["oauth","app_installation","api_key"]),REe=a.enum(["alert_routing","inbound_webhooks","messaging","code_search","health_check"]),TEe=a.enum(["pending","connected","error","revoked"]),BEe=a.enum(["healthy","unhealthy","unknown"]),OEe=a.object({name:a.string().describe("Field name used as the JSON key in `credentials`."),label:a.string().describe("Human-readable field label."),required:a.boolean().describe("Whether the field is required."),secret:a.boolean().describe("Whether the field is a secret (masked in UIs, encrypted)."),description:a.string().nullable().describe("Optional hint for the field's expected value.")}),_Ee=a.object({id:hp.describe("Integration provider identifier."),name:a.string().describe("Human-readable display name."),description:a.string().describe("Short description of the provider."),authType:PEe.describe("Auth flow used to connect this provider."),capabilities:a.array(REe).describe("Capabilities the provider exposes once connected."),connectionCount:a.number().int().describe("Number of active connections for this provider in the organization, including error-status connections that need attention."),credentialFields:a.array(OEe).optional().describe("Fields required in `credentials` when creating an api_key connection. Absent for browser-auth providers."),browserConnectSupported:a.boolean().describe("Whether this provider's browser connect flow (`integrations.beginConnect`) is available in this environment. Readiness-derived: the provider begins on the consolidated OAuth callback route and its OAuth client credentials are provisioned. Providers still on legacy browser paths (Slack, Linear, Bitbucket) report false and connect from the dashboard.")}),Ap=a.object({id:a.string().uuid(),provider:hp,displayName:a.string().nullable(),status:TEe,isActive:a.boolean().describe("Whether this connection counts as connected (status 'connected' or 'error'). An error-status connection is the organization's connection — broken, not absent."),needsAttention:a.boolean().describe("Whether the connection should surface a reconnect prompt (status 'error' or health status 'unhealthy')."),metadata:a.record(a.string(),a.unknown()).describe("Non-secret provider metadata (e.g. workspace/team names)."),healthStatus:BEe,healthMessage:a.string().nullable(),healthCheckedAt:a.string().datetime().nullable(),healthConsecutiveFailures:a.number().int(),connectedBy:a.string().nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),q1=a.object({organizationEnabled:a.boolean().describe("Stored organization-wide policy."),connectionEnabled:a.boolean().describe("Stored connection policy."),effectiveEnabled:a.boolean().describe("True only when both stored policies are enabled.")}),DEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to list providers for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),QEe=a.object({providers:a.array(_Ee)}),V1=E({operationId:"integrations.listProviders",description:"List supported integration providers and how many connections the organization has for each.",backend:"api",route:{method:"GET",path:"/integrations/providers",tags:["Integrations"]},input:DEe,output:QEe,pagination:"none",async:"sync"}),LEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to list connections for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:hp.optional().describe("Filter connections by provider.")}),NEe=a.object({connections:a.array(Ap)}),K1=E({operationId:"integrations.listConnections",description:"List integration connections and their connection state for the organization.",backend:"api",route:{method:"GET",path:"/integrations/connections",tags:["Integrations"]},input:LEe,output:NEe,pagination:"none",async:"sync"}),MEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Connection ID to fetch.")}),zEe=a.object({connection:Ap}),Y1=E({operationId:"integrations.getConnection",description:"Get one integration connection by ID (non-secret config only).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:MEe,output:zEe,pagination:"none",async:"sync"}),jEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:hp.describe("Integration provider to connect. Must use api_key auth (see `authType` in the provider catalog)."),displayName:a.string().trim().min(1).max(255).optional().describe("Optional display name for the connection."),credentials:a.record(a.string(),a.unknown()).describe("Vendor credentials. Fields vary by provider (see `credentialFields` on the provider catalog). Validated against the vendor before the connection is created; never returned.")}),UEe=a.object({connection:Ap}),W1=E({operationId:"integrations.createConnection",description:"Create an integration connection for an api_key provider. Credentials are validated against the vendor, then stored encrypted.",backend:"api",route:{method:"POST",path:"/integrations/connections",tags:["Integrations"],successStatus:201},input:jEe,output:UEe,pagination:"none",async:"sync"}),FEe=a.object({organizationId:a.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),provider:hp.describe("Browser-auth provider to connect (oauth or app_installation). Must report `browserConnectSupported: true` in the provider catalog."),displayName:a.string().trim().min(1).max(255).optional().describe("Optional display name for the resulting connection."),projectId:a.string().trim().min(1).optional().describe("Project the completed connection defaults its routing to. Must belong to the organization.")}),$Ee=a.object({url:a.string().describe("Vendor authorization (or app installation) URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:a.string().uuid().describe("Connect attempt to poll via `integrations.getConnectAttempt` while the browser flow completes."),expiresAt:a.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),J1=E({operationId:"integrations.beginConnect",description:"Begin a browser connect flow for an OAuth or app-installation provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/integrations/connect",tags:["Integrations"],successStatus:201},input:FEe,output:$Ee,pagination:"none",async:"sync"}),GEe=a.enum(["pending","completed","not_connected","failed","expired"]),HEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),attemptId:a.string().uuid().describe("Connect attempt ID to poll.")}),qEe=a.object({status:GEe.describe("Attempt state. `not_connected` means the flow finished but the connection is not live yet (most commonly awaiting a third-party admin's approval). `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:a.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized) or `not_connected` (e.g. `installation_requested` for GitHub installs awaiting org-admin approval)."),connection:Ap.optional().describe("The created connection when status is `completed`.")}),Z1=E({operationId:"integrations.getConnectAttempt",description:"Poll a browser connect attempt started with `integrations.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/integrations/connect/attempts/{attemptId}",tags:["Integrations"]},input:HEe,output:qEe,pagination:"none",async:"sync"}),VEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Connection ID to disconnect.")}),KEe=a.object({success:a.literal(!0)}),X1=E({operationId:"integrations.disconnectConnection",description:"Disconnect an integration connection (soft delete). Always succeeds regardless of stored credential state; cached vendor catalogs and routing derived from the connection are removed.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:VEe,output:KEe,pagination:"none",async:"sync"}),YEe=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Connection ID to update."),credentials:a.record(a.string(),a.unknown()).describe("Replacement vendor credentials for an api_key connection. Validated against the vendor; resets the connection's health state on success.")}),WEe=a.object({connection:Ap}),e2=E({operationId:"integrations.updateConnectionCredentials",description:"Replace an api_key connection's credentials in place — the reconnect path for a connection that needs attention. Keeps connection-scoped configuration.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/credentials",tags:["Integrations"]},input:YEe,output:WEe,pagination:"none",async:"sync"}),UR=a.object({organizationId:a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),t2=a.object({organizationEnabled:a.boolean(),effectiveEnabled:a.boolean()}),n2=UR.extend({connectionId:a.string().uuid().describe("Integration connection whose JIT policy is being read or updated.")}),o2=E({operationId:"integrations.getOrganizationExternalIdentityJitPolicy",description:"Read the organization's stored external-identity JIT policy.",backend:"api",route:{method:"GET",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:UR,output:t2,pagination:"none",async:"sync"}),r2=E({operationId:"integrations.updateOrganizationExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT across an organization.",backend:"api",route:{method:"PATCH",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:UR.extend({enabled:a.boolean()}),output:t2,pagination:"none",async:"sync"}),i2=E({operationId:"integrations.getConnectionExternalIdentityJitPolicy",description:"Read stored and effective JIT policy for one connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:n2,output:q1,pagination:"none",async:"sync"}),s2=E({operationId:"integrations.updateConnectionExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT for one connection.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:n2.extend({enabled:a.boolean()}),output:q1,pagination:"none",async:"sync"}),fp=a.object({organizationId:a.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),connectionId:a.string().uuid().describe("Slack integration connection ID (the `integration_connections.id`, not the Slack team id).")}),a2=a.object({connectionId:a.string().uuid(),defaultProjectId:a.string().uuid().nullable().describe("Project new threads route to when no channel mapping matches."),automaticResponses:a.boolean().describe("Auto-respond to messages in channels the bot is in (autoReactEnabled)."),acknowledgementMessage:a.boolean().describe("Post a processing acknowledgement while a run is in flight (processingMessageEnabled).")}),JEe=fp,c2=E({operationId:"integrations.getSlackConfiguration",description:"Read Slack connection configuration (default project, automatic responses, acknowledgement message).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:JEe,output:a2,pagination:"none",async:"sync"}),ZEe=fp.extend({defaultProjectId:a.string().uuid().nullable().optional().describe("Project new threads route to when no channel mapping matches. Pass null to clear it. Omit to leave unchanged."),automaticResponses:a.boolean().optional().describe("Omit to leave unchanged."),acknowledgementMessage:a.boolean().optional().describe("Omit to leave unchanged.")}),l2=E({operationId:"integrations.updateSlackConfiguration",description:"Update Slack connection configuration. Omitted fields are left unchanged.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:ZEe,output:a2,pagination:"none",async:"sync"}),u2=a.object({connectionId:a.string().uuid(),slackChannelId:a.string().min(1),slackChannelName:a.string().min(1),projectId:a.string().uuid()}),XEe=fp,ewe=a.object({mappings:a.array(u2)}),d2=E({operationId:"integrations.listSlackChannelProjectMappings",description:"List channel-to-project mappings for a Slack connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings",tags:["Integrations"]},input:XEe,output:ewe,pagination:"none",async:"sync"}),twe=fp.extend({slackChannelId:a.string().min(1).describe("Slack channel ID (e.g. C0123ABCDEF)."),slackChannelName:a.string().min(1).optional().describe("Optional. Ignored for storage — the authoritative channel name is "+"always resolved from the connection's channel catalog. Accepted only as a convenience/label; the response returns the catalog name."),projectId:a.string().uuid().describe("Project the channel routes to. Must belong to the organization.")}),p2=E({operationId:"integrations.setSlackChannelProjectMapping",description:"Create or update the channel-to-project mapping for one Slack channel. Idempotent on (connection, channel).",backend:"api",route:{method:"PUT",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:twe,output:u2,pagination:"none",async:"sync"}),nwe=fp.extend({slackChannelId:a.string().min(1)}),owe=a.object({success:a.boolean()}),g2=E({operationId:"integrations.deleteSlackChannelProjectMapping",description:"Delete a channel-to-project mapping.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:nwe,output:owe,pagination:"none",async:"sync"})});var Ho,rwe,iwe,h2,bf,If,A2,FR,f2,$R,y2,b2,swe,awe,I2,S2,C2,v2,E2,w2,k2,x2,P2,R2,T2,B2,O2,_2,D2,zc,Sf,Cf,vf,Ef,wf,kf,xf,Pf,Rf,Tf,cwe;var GR=h(()=>{De();Ve();Ho=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),status:a.enum(["open","resolved","ignored"]),severity:a.enum(["low","medium","high","critical"]),componentId:a.string().uuid().nullable(),createdAt:a.string().datetime(),resolvedAt:a.string().datetime().nullable(),mutedAt:a.string().datetime().nullable(),muteHitCount:a.number().int().nonnegative(),lastActivityAt:a.string().datetime().nullable(),lastDeliveredAt:a.string().datetime().nullable(),locked:a.boolean(),redacted:a.boolean()}),rwe=a.object({channelId:a.string().nullable(),channelName:a.string().nullable(),threadTs:a.string().nullable(),permalink:a.string().nullable(),workspaceName:a.string().nullable()}),iwe=Ho.extend({slackChannels:a.array(rwe)}),h2=Ho.extend({delivery:a.record(a.string(),a.unknown()).nullable().optional()}),bf=a.object({projectId:a.string().uuid().optional().describe("Project to create the issue in. Auto-filled from CLI and SDK context when omitted."),name:a.string().trim().min(1).optional().describe("Stable issue name for indexing and mute matching. When omitted, the name is derived from contentMdx."),contentMdx:a.string().trim().min(1,"contentMdx cannot be empty").optional().describe("Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence). Required unless sample is true."),severity:a.enum(["low","medium","high","critical"]).default("medium").describe("Issue severity used for prioritization and triage."),componentId:a.string().uuid().optional().describe("UUID of a registered component this issue belongs to. Required unless sample is true: every issue must be attributed to a component. List components first and pick the best match; register one if none fits. Missing or unknown IDs are rejected."),statusStartedAt:a.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident began."),sample:a.boolean().optional().describe("When true, creates (or returns) the organization's onboarding sample issue for the target project using the curated sample payload, and the alert rides the normal issue_triggered broadcast to the configured delivery rules. Mutually exclusive with the content inputs (name, contentMdx, severity, componentId, statusStartedAt); projectId stays allowed. Idempotent per project: an existing sample attempt's issue is returned instead of creating a new one. Requires a user credential.")}),If=bf.superRefine((e,t)=>{if(e.sample){let n=[["name",e.name!==void 0],["contentMdx",e.contentMdx!==void 0],["severity",e.severity!=="medium"],["componentId",e.componentId!==void 0],["statusStartedAt",e.statusStartedAt!==void 0]];for(let[r,o]of n)if(o)t.addIssue({code:"custom",path:[r],message:`${r} is not allowed when sample is true.`})}else{if(!e.contentMdx)t.addIssue({code:"custom",path:["contentMdx"],message:"contentMdx is required"});if(!e.componentId)t.addIssue({code:"custom",path:["componentId"],message:"componentId is required"})}if(e.statusStartedAt&&!e.componentId)t.addIssue({code:"custom",path:["statusStartedAt"],message:"statusStartedAt requires componentId."})}),A2=a.object({issue:Ho,duplicateIssueId:a.string().uuid().optional().describe("Present when creation reused an existing open issue instead of creating a new one.")}),FR=a.object({projectId:a.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:a.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:a.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),componentId:a.string().uuid().optional().describe("Filter by component ID.")}),f2=a.object({issues:a.array(Ho),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),$R=FR.extend({name:a.string().trim().optional().describe("Case-insensitive partial match on issue name."),includeDeliveryMetadata:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, include raw delivery metadata in each issue.")}),y2=a.object({issues:a.array(h2),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),b2=$R.omit({limit:!0,cursor:!0,includeDeliveryMetadata:!0}),swe=a.object({open:a.number().int().nonnegative(),resolved:a.number().int().nonnegative(),ignored:a.number().int().nonnegative()}),awe=a.object({low:a.number().int().nonnegative(),medium:a.number().int().nonnegative(),high:a.number().int().nonnegative(),critical:a.number().int().nonnegative()}),I2=a.object({total:a.number().int().nonnegative(),byStatus:swe,bySeverity:awe,filters:a.object({name:a.string().nullable(),status:a.enum(["open","resolved","ignored"]).nullable(),severity:a.enum(["low","medium","high","critical"]).nullable(),componentId:a.string().uuid().nullable()})}),S2=a.object({issueId:a.string().uuid().describe("Issue ID to retrieve.")}),C2=a.object({issue:iwe}),v2=a.object({issueId:a.string().uuid().describe("Issue ID to resolve."),statusResolvedAt:a.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident ended.")}),E2=a.object({issue:Ho}),w2=a.object({issueId:a.string().uuid().describe("Issue ID to ignore.")}),k2=a.object({issue:Ho}),x2=a.object({issueId:a.string().uuid().describe("Issue ID to reopen.")}),P2=a.object({issue:Ho}),R2=a.object({issueId:a.string().uuid().describe("Issue ID to reassign and reopen."),targetComponentId:a.string().uuid().describe("Active canonical component that will own the reopened issue.")}),T2=a.object({issue:Ho,sourceComponentId:a.string().uuid(),targetComponentId:a.string().uuid()}),B2=a.object({issueId:a.string().uuid().describe("Issue ID to mute.")}),O2=a.object({issue:Ho}),_2=a.object({issueId:a.string().uuid().describe("Issue ID to unmute.")}),D2=a.object({issue:Ho}),zc=E({operationId:"issues.create",description:"Create an issue in a project, returning an existing open issue when root-cause deduplication finds a match.",backend:"api",route:{method:"POST",path:"/issues",tags:["Issues"],successStatus:201},input:If,output:A2,pagination:"none",async:"sync"}),Sf=E({operationId:"issues.list",description:"List issues in a project, optionally filtered by status and severity.",backend:"api",route:{method:"GET",path:"/issues",tags:["Issues"]},input:FR,output:f2,pagination:"cursor",async:"sync"}),Cf=E({operationId:"issues.search",description:"Search issues in a project by name, status, and severity.",backend:"api",route:{method:"GET",path:"/issues/search",tags:["Issues"]},input:$R,output:y2,pagination:"cursor",async:"sync"}),vf=E({operationId:"issues.count",description:"Count issues in a project with status and severity breakdowns.",backend:"api",route:{method:"GET",path:"/issues/count",tags:["Issues"]},input:b2,output:I2,pagination:"none",async:"sync"}),Ef=E({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:S2,output:C2,pagination:"none",async:"sync"}),wf=E({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:v2,output:E2,pagination:"none",async:"sync"}),kf=E({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:w2,output:k2,pagination:"none",async:"sync"}),xf=E({operationId:"issues.reopen",description:"Reopen a resolved or ignored issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reopen",tags:["Issues"]},input:x2,output:P2,pagination:"none",async:"sync"}),Pf=E({operationId:"issues.reassignAndReopen",description:"Atomically reassign a resolved or ignored issue to an active component and reopen it.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reassign-and-reopen",tags:["Issues"]},input:R2,output:T2,pagination:"none",async:"sync"}),Rf=E({operationId:"issues.mute",description:"Mute an issue, suppressing future re-fires without changing status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/mute",tags:["Issues"]},input:B2,output:O2,pagination:"none",async:"sync"}),Tf=E({operationId:"issues.unmute",description:"Unmute an issue, preserving its current status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unmute",tags:["Issues"]},input:_2,output:D2,pagination:"none",async:"sync"}),cwe={count:vf.contract,create:zc.contract,list:Sf.contract,search:Cf.contract,get:Ef.contract,resolve:wf.contract,ignore:kf.contract,reopen:xf.contract,reassignAndReopen:Pf.contract,mute:Rf.contract,unmute:Tf.contract}});var HR,Q2,Bf,Of,L2,N2,M2,z2,_f,qR,j2,U2,F2,$2,G2,H2,q2,V2,K2,Y2,W2,J2,jc,Uc,Fc,$c,Gc,Df,Qf,Lf,Nf,Mf,lwe,uwe;var VR=h(()=>{De();Ve();HR=/^[a-zA-Z0-9\s\-_]+$/,Q2=a.object({id:a.string().uuid(),name:a.string(),expiresAt:a.string().datetime().nullable(),lastUsedAt:a.string().datetime().nullable(),createdAt:a.string().datetime()}),Bf=Q2.extend({projectId:a.string().uuid(),dataSourceConnectionId:a.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:a.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),Of=Q2.extend({projectId:a.string().uuid().nullable()}),L2=a.object({projectId:a.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),N2=a.object({publicKeys:a.array(Bf),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),M2=a.object({secretKeys:a.array(Of),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),z2=a.object({projectId:a.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:a.string().uuid().describe("Key ID to fetch.")}),_f=a.object({publicKey:Bf}),qR=a.object({secretKey:Of}),j2=a.object({publicKey:Bf.extend({value:a.string()})}),U2=a.object({projectId:a.string().uuid().optional().describe("Project to ensure the log forwarding key for. Auto-filled from CLI and SDK context when omitted.")}),F2=a.object({secretKey:Of.extend({value:a.string()})}),$2=a.object({projectId:a.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:a.string().uuid().describe("Key ID to update."),name:a.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(HR,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:a.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),G2=a.object({params:a.object({keyId:a.string().uuid().describe("Public key ID to deactivate.")}),query:a.object({projectId:a.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:e,query:t})=>({...t,...e})),H2=_f,q2=a.void(),V2=a.object({organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),K2=a.object({keyId:a.string().uuid().describe("Key ID to fetch."),organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),Y2=a.object({organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project. Omit for organization-wide access."),name:a.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(HR,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:a.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),W2=a.object({keyId:a.string().uuid().describe("Key ID to update."),organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),name:a.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(HR,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:a.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),J2=a.object({params:a.object({keyId:a.string().uuid().describe("Key ID to delete.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization whose keys the operation targets. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}).default({})}).transform(({params:e,query:t})=>({...e,...t.organizationId!==void 0?{organizationId:t.organizationId}:{}})),jc=E({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:L2,output:N2,pagination:"cursor",async:"sync",examples:[{name:"list-public-keys",input:{projectId:"11111111-1111-4111-8111-111111111111",limit:25},output:{publicKeys:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Uc=E({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:z2,output:_f,pagination:"none",async:"sync",examples:[{name:"get-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Fc=E({operationId:"publicKeys.ensureLogForwarding",description:"Ensure a reusable project-scoped public key exists for CLI log forwarding.",backend:"api",route:{method:"POST",path:"/public-keys/log-forwarding/ensure",tags:["Public Keys"]},input:U2,output:j2,pagination:"none",async:"sync",examples:[{name:"ensure-log-forwarding-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"sazabi-cli-forward",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_public_example"}}}]}),$c=E({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:$2,output:_f,pagination:"none",async:"sync",examples:[{name:"rename-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222",name:"Updated CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"Updated CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Gc=E({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Recently validated requests may continue to authenticate for a short period after deactivation.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:G2,output:H2,pagination:"none",async:"sync"}),Df=E({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:V2,output:M2,pagination:"cursor",async:"sync",examples:[{name:"list-secret-keys",input:{limit:25},output:{secretKeys:[{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Qf=E({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:K2,output:qR,pagination:"none",async:"sync",examples:[{name:"get-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Lf=E({operationId:"secretKeys.create",description:"Create one secret key within the organization.",backend:"api",route:{method:"POST",path:"/secret-keys",successStatus:201,tags:["Secret Keys"]},input:Y2,output:F2,pagination:"none",async:"sync",examples:[{name:"create-secret-key",input:{name:"CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_secret_example"}}}]}),Nf=E({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:W2,output:qR,pagination:"none",async:"sync",examples:[{name:"rename-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333",name:"Updated CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"Updated CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Mf=E({operationId:"secretKeys.delete",description:"Delete one secret key within the organization.",backend:"api",route:{method:"DELETE",path:"/secret-keys/{keyId}",successStatus:204,tags:["Secret Keys"],inputStructure:"detailed"},input:J2,output:q2,pagination:"none",async:"sync"}),lwe={list:jc.contract,get:Uc.contract,ensureLogForwarding:Fc.contract,update:$c.contract,deactivate:Gc.contract},uwe={list:Df.contract,get:Qf.contract,create:Lf.contract,update:Nf.contract,delete:Mf.contract}});var X2="## Overview\n\nSend Claude Code session telemetry to Sazabi. Every session emits lifecycle events — prompts, tool calls, and model API requests with token counts and cost — as OTLP log records.\n\n## How it works\n\nClaude Code has a first-party OTLP exporter. Set a handful of environment variables in `~/.claude/settings.json` pointing the exporter at your Sazabi intake URL, and Claude Code sends telemetry over OTLP/HTTP on its own — no separate SDK or code changes required.\n\n## Streams\n\n- **Session events** — `claude_code.user_prompt`, `claude_code.tool_result`, `claude_code.api_request`, and related events, with attributes for `prompt`, `model`, `session.id`, `user.email`, token counts, and cost.\n\n## Limitations\n\n- Claude Code **metrics** are not ingested; only the logs exporter is supported.\n";var Z2=()=>{};var tG=`---
|
|
106
106
|
name: claude-code-log-source-setup
|
|
107
107
|
description: Export Claude Code session telemetry to a Sazabi project. Use when the user wants to "connect Claude Code", "set up Claude Code telemetry", "ingest Claude Code events", "send my coding agent telemetry to Sazabi", or after running \`sazabi log-sources skill --provider claude_code\`. Points Claude Code's built-in OTLP exporter at Sazabi's keyed intake host — no SDK or code changes required.
|
|
108
108
|
surface: log-source
|
|
@@ -8744,7 +8744,7 @@ Connect 1Password so Sazabi agents can work with your vaults and secrets through
|
|
|
8744
8744
|
- The 1Password CLI (\`op\`) sandbox preset, since no hosted MCP endpoint is available yet
|
|
8745
8745
|
`.trim()});import{dirname as S3e,resolve as C3e}from"node:path";import{fileURLToPath as v3e}from"node:url";var E3e,fce,yce,w3e,bce,k3e,x3e,P3e,Ice;var dN=h(()=>{De();Jf();E3e=C3e(S3e(v3e(import.meta.url)),"../../../skills"),fce=["airbyte","agentcat","atlassian","attio","autumn","aws","axiom","better-stack","braintrust","calendly","cekura","checkly","circleback","clay","clerk","cloudflare","composio","context-dev","custom","datadog","deepwiki","elastic-cloud","exa","gcp","google-drive","grafana","granola","happenstance","herd","honeycomb","incident-io","intercom","langfuse","langsmith","linear","logfire","mercury","neon","notion","onepassword","paper","plug","posthog","plain","planetscale","pylon","railway","render","rentahuman","resend","respan","salesforce","secureframe","sentry","secureframe","signoz","slack","stripe","supabase","superhuman","the-context-company","vercel","x"],yce=a.enum(fce),w3e=a.object({readOnlyToolNames:a.array(a.string()).optional(),blockedToolNames:a.array(a.string()).optional(),defaultUnavailableReason:a.enum(Wf).optional(),allowWriteTools:a.boolean().optional()}),bce=a.object({registrationEndpoint:a.string().url(),tokenEndpointAuthMethod:a.enum(Yf).optional(),includeScopesInRegistration:a.boolean().optional()}),k3e=a.object({providerConfigKey:a.string().min(1),callbackPathSegment:a.string().min(1),authorizationUrl:a.string().url().optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),useServerUrlAsResource:a.boolean().optional(),omitScopeFromAuthorizationUrl:a.boolean().optional(),authorizationUrlParams:a.record(a.string(),a.string()).optional(),defaultAccessTokenTtlSeconds:a.number().int().positive().optional(),dynamicClientRegistration:bce.optional()}),x3e=a.object({label:a.string().min(1),serverUrl:a.string().url(),authorizationUrl:a.string().url().optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),dynamicClientRegistration:bce.optional()}),P3e=a.object({id:a.string().min(1),title:a.string().min(1),description:a.string().optional(),body:a.string().min(1),fieldKeys:a.array(a.string().min(1)).optional(),imageKeys:a.array(a.string().min(1)).optional()}),Ice=a.object({id:a.string().min(1),label:a.string().min(1),iconKey:yce,defaultServerUrl:a.string().url().nullable(),serverUrlPathSuffixMaxSegments:a.number().int().positive().optional(),serverUrlHostnameSuffixes:a.array(a.string().min(2)).optional(),transport:a.enum(yB),authMode:a.enum(bB),availability:a.enum(Xc),oauth:k3e.optional(),regions:a.array(x3e).optional(),capabilityOverrides:w3e.optional(),helpText:a.string().optional(),setupGroups:a.array(P3e).optional(),evidenceHints:a.array(a.string().min(1)).optional(),skill:a.string().min(1).optional(),setupSkill:a.string().min(1).optional(),scopesUserSelectable:a.boolean().optional()})});var U=(e)=>({...Ice.parse(e),...e.getAvailableScopes?{getAvailableScopes:e.getAvailableScopes}:{},...e.getUrlConfiguration?{getUrlConfiguration:e.getUrlConfiguration}:{},...e.validateCredentials?{validateCredentials:e.validateCredentials}:{},...e.normalizeHeaders?{normalizeHeaders:e.normalizeHeaders}:{}});var de=h(()=>{dN()});var Sce;var Cce=h(()=>{de();Sce=U({id:"agentcat",label:"AgentCat",iconKey:"agentcat",defaultServerUrl:"https://mcp.agentcat.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"agentcat",callbackPathSegment:"agentcat",authorizationUrl:"https://api.agentcat.com/oauth/authorize/",tokenUrl:"https://api.agentcat.com/oauth/token/",dynamicClientRegistration:{registrationEndpoint:"https://api.agentcat.com/oauth/register/",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcpcat:read",label:"Read",description:"Read AgentCat project, session, issue, and metric data."},{value:"mcpcat:write",label:"Write",description:"Create and update AgentCat issues and project data."}],capabilityOverrides:{allowWriteTools:!0},helpText:"Inspect agent usage analytics and debug AgentCat issues."})});var vce;var Ece=h(()=>{de();vce=U({id:"airbyte",label:"Airbyte",iconKey:"airbyte",defaultServerUrl:"https://mcp.airbyte.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"airbyte",callbackPathSegment:"airbyte",authorizationUrl:"https://mcp.airbyte.ai/authorize",tokenUrl:"https://mcp.airbyte.ai/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.airbyte.ai/register",tokenEndpointAuthMethod:"client_secret_post"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Airbyte Agent Engine usage (mcp.airbyte.ai) or embedded agent connectors","AIRBYTE_* environment variables or Airbyte agent/connector client code","README/docs naming Airbyte for agent connectors to CRM, support, or analytics platforms"],helpText:"Read and write records on the third-party platforms (CRM, support desk, analytics, billing, databases) you have connected in your Airbyte Agent Engine workspace. Requires an Airbyte Agent Engine workspace with connectors already configured.",skill:"airbyte",setupSkill:"airbyte-setup"})});var wce;var kce=h(()=>{de();wce=U({id:"atlassian",label:"Atlassian",iconKey:"atlassian",defaultServerUrl:"https://mcp.atlassian.com/v1/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"atlassian",callbackPathSegment:"atlassian",authorizationUrl:"https://mcp.atlassian.com/v1/authorize",tokenUrl:"https://cf.mcp.atlassian.com/v1/token",dynamicClientRegistration:{registrationEndpoint:"https://cf.mcp.atlassian.com/v1/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["atlassian.com, Jira, Confluence, Jira Service Management, Compass, or Bitbucket links","Jira or Confluence project keys, issue keys, or workspace documentation","ATLASSIAN_* environment variables or scripts that call Atlassian APIs"],helpText:"Search and manage Jira, Confluence, Jira Service Management, Compass, and Bitbucket. During authorization, pick the Atlassian site you want to connect.",skill:"atlassian",setupSkill:"atlassian-setup"})});var xce;var Pce=h(()=>{de();xce=U({id:"attio",label:"Attio",iconKey:"attio",defaultServerUrl:"https://mcp.attio.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"attio",callbackPathSegment:"attio",authorizationUrl:"https://app.attio.com/oidc/authorize",tokenUrl:"https://app.attio.com/oidc/token",dynamicClientRegistration:{registrationEndpoint:"https://app.attio.com/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Read and manage Attio CRM records, lists, tasks, notes, and meetings."},{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["attio.com links, Attio workspace docs, or ATTIO_* environment variables","CRM account/contact workflows that reference Attio objects, lists, or tasks","README/docs naming Attio as the CRM or customer system of record"],helpText:"Search and manage Attio CRM records, lists, tasks, notes, and meetings. During authorization, pick the Attio workspace you want to connect.",skill:"attio",setupSkill:"attio-setup"})});var Rce;var Tce=h(()=>{_t();de();Rce=U({id:"autumn",label:"Autumn",iconKey:"autumn",defaultServerUrl:"https://mcp.useautumn.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["useautumn.com / autumn-js SDK usage, AUTUMN_SECRET_KEY (am_sk_) environment variables, or an api.useautumn.com base URL","Autumn billing/pricing calls such as attach, check, track, or entitlement gating in code","README/docs naming Autumn for pricing, plans, features, credits, or usage-based billing on top of Stripe"],helpText:"Manage Autumn billing and pricing — customers, plans, features, balances, usage, and subscriptions — using an Autumn secret key.",setupGroups:[{id:"api-key",title:"Create an Autumn secret key",description:"Copy the Autumn secret key Sazabi will send to Autumn's hosted MCP endpoint.",body:"In the [Autumn dashboard](https://app.useautumn.com), open **Developer > API Keys** and copy a secret key (`am_sk_...`). Use a sandbox key to explore and a production key for live billing data. Sazabi stores it securely and sends it as `Authorization: Bearer <key>` to Autumn's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:sce,normalizeHeaders:rce})});var XI,DOt,Bce;var eS=h(()=>{de();XI=[{value:"us-east-1",label:"US East (N. Virginia) — us-east-1"},{value:"eu-central-1",label:"Europe (Frankfurt) — eu-central-1"}],DOt=new Set(XI.map((e)=>e.value)),Bce=U({id:"aws",label:"AWS",iconKey:"aws",defaultServerUrl:"https://aws-mcp.us-east-1.api.aws/mcp",transport:"streamable-http",authMode:"aws-sigv4",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["AWS SDK usage, aws-cli, or AWS_* environment variables in code or config","CloudFormation/CDK/Terraform AWS resources, ECS/Lambda/S3/CloudWatch usage","README/runbooks naming AWS as the cloud platform"],helpText:"Query the AWS-managed AWS MCP server (AWS documentation and AWS API operations) using AWS IAM credentials. Sazabi signs each request with SigV4, so no local proxy is required.",setupGroups:[{id:"iam-credentials",title:"Create scoped IAM credentials",description:"Provide IAM credentials whose permissions match exactly what the agent should be able to do.",body:"In the AWS Console, create an IAM user or role with only the permissions Sazabi should use (for example read-only access via `ReadOnlyAccess`, or a scoped custom policy), then generate an access key. Paste the **Access key ID** and **Secret access key** below. For temporary credentials from an assumed role, also paste the **Session token**. Prefer short-lived, least-privilege credentials.",fieldKeys:["accessKeyId","secretAccessKey","sessionToken"]},{id:"region",title:"Choose the AWS region",description:"The AWS MCP server is region-scoped; pick the region to target.",body:"Select the region where AWS hosts the AWS MCP endpoint. AWS currently offers the AWS MCP server in **US East (N. Virginia) — us-east-1** and **Europe (Frankfurt) — eu-central-1** only. Sazabi builds the `https://aws-mcp.<region>.api.aws/mcp` server URL from your choice and scopes SigV4 signing to it. This is the endpoint region, not the AWS region your API operations target.",fieldKeys:["region"]}]})});var Oce;var _ce=h(()=>{de();Oce=U({id:"axiom",label:"Axiom",iconKey:"axiom",defaultServerUrl:"https://mcp.axiom.co/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"axiom",callbackPathSegment:"axiom",authorizationUrl:"https://mcp.axiom.co/authorize",tokenUrl:"https://mcp.axiom.co/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.axiom.co/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>({docsUrl:"https://axiom.co/docs/console/intelligence/mcp-server",instructions:"Copy the hosted MCP server URL below. If you belong to more than one Axiom organization, append ?org-id=<id> to target a specific organization.",defaultServerUrl:"https://mcp.axiom.co/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Axiom datasets, APL queries, AXIOM_* environment variables, or axiom CLI usage","Log drains or dashboards documented in Axiom","README/docs naming Axiom as a log or event analytics backend"],helpText:"Query Axiom datasets and logs with APL to investigate production events and incidents."})});var Dce;var Qce=h(()=>{de();Dce=U({id:"better-stack",label:"Better Stack",iconKey:"better-stack",defaultServerUrl:"https://mcp.betterstack.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"better-stack",callbackPathSegment:"better-stack",authorizationUrl:"https://betterstack.com/oauth/authorize",tokenUrl:"https://betterstack.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://betterstack.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Better Stack incidents, monitors, log sources, and telemetry."},{value:"write",label:"Write",description:"Acknowledge, resolve, and manage Better Stack incidents."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Better Stack / Better Uptime monitors, heartbeats, or status pages","BETTERSTACK_* or LOGTAIL_* environment variables, or Logtail/Better Stack log drains","README/docs naming Better Stack for uptime monitoring, incidents, or log management"],helpText:"Browse Better Stack incidents, monitors, and log sources, build telemetry queries to investigate production issues, and acknowledge, resolve, and manage incidents."})});var Lce;var Nce=h(()=>{_t();de();Lce=U({id:"braintrust",label:"Braintrust",iconKey:"braintrust",defaultServerUrl:"https://api.braintrust.dev/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["braintrust or autoevals packages, or BRAINTRUST_API_KEY environment variables","Braintrust eval/logging/tracing usage in code or CI (e.g. braintrust eval)","README/docs naming Braintrust for LLM evals, prompt/experiment tracking, or observability"],helpText:"Query Braintrust experiments, datasets, prompts, and logs using a Braintrust API key.",setupGroups:[{id:"api-key",title:"Create a Braintrust API key",description:"Generate the Braintrust API key the hosted MCP server will use.",body:"In Braintrust, go to **Settings > API keys** (https://www.braintrust.dev/app/settings/api-keys) and create an API key. Copy the generated key.",fieldKeys:["apiKey"]},{id:"data-plane",title:"Choose your Braintrust data plane",description:"Pick the region where your Braintrust data lives so Sazabi connects to the matching endpoint.",body:"Select **US** (`https://api.braintrust.dev/mcp`) or **EU** (`https://api-eu.braintrust.dev/mcp`) to match where your Braintrust data lives.",fieldKeys:["dataPlane"]}],validateCredentials:$ae,normalizeHeaders:Fae})});var Mce;var zce=h(()=>{de();Mce=U({id:"calendly",label:"Calendly",iconKey:"calendly",defaultServerUrl:"https://mcp.calendly.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"calendly",callbackPathSegment:"calendly",authorizationUrl:"https://calendly.com/oauth/authorize",tokenUrl:"https://calendly.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://calendly.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["calendly.com scheduling links or Calendly webhook handlers","CALENDLY_* environment variables or API integrations","README/docs naming Calendly for customer calls, interviews, or demos"],helpText:"Check availability, create scheduling links, and manage meetings in Calendly."})});var jce;var Uce=h(()=>{_t();de();jce=U({id:"cekura",label:"Cekura",iconKey:"cekura",defaultServerUrl:"https://api.cekura.ai/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",evidenceHints:["Cekura workflow tests, monitor configs, or CEKURA_* environment variables","Agent evaluation or production monitor docs naming Cekura","Synthetic user-flow tests for AI agents"],helpText:"Test, monitor, and evaluate AI agent workflows with Cekura.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the API key Sazabi will send to Cekura's hosted MCP endpoint.",body:"In the Cekura dashboard, open **Settings > API Keys** and create or copy a project-scoped [API key](https://dashboard.cekura.ai/settings/org/api-key), then paste it below.",fieldKeys:["apiKey"]}],validateCredentials:mce})});var Fce;var $ce=h(()=>{de();Fce=U({id:"checkly",label:"Checkly MCP",iconKey:"checkly",defaultServerUrl:"https://api.checklyhq.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"checkly",callbackPathSegment:"checkly"},getAvailableScopes:async()=>[{value:"checkly:account:read"},{value:"checkly:account:invite"},{value:"checkly:checks:read"},{value:"checkly:checks:run"},{value:"checkly:incidents:read"},{value:"checkly:incidents:write"},{value:"checkly:environment-variables:read"},{value:"checkly:environment-variables:write"},{value:"checkly:status-pages:read"},{value:"checkly:rca:read"},{value:"checkly:rca:run"},{value:"checkly:test-sessions:read"},{value:"checkly:assets:read"}],scopesUserSelectable:!1,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["checkly.config.ts/js, __checks__ directories, @checkly/cli, or CHECKLY_* environment variables","README/docs naming Checkly for synthetic monitoring, API checks, or browser checks","Runbooks that inspect Checkly check results, test sessions, RCA, status pages, or incidents"],helpText:"Query Checkly synthetic monitoring (checks, check results, test sessions, RCA, status pages, and incidents) over Checkly's official OAuth MCP server. Disabled until Sazabi has a Checkly-approved OAuth client, because Checkly rejects Dynamic Client Registration."})});var Gce;var Hce=h(()=>{de();Gce=U({id:"circleback",label:"Circleback",iconKey:"circleback",defaultServerUrl:"https://circleback.ai/api/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"circleback",callbackPathSegment:"circleback",authorizationUrl:"https://circleback.ai/api/oauth/authorize",tokenUrl:"https://circleback.ai/api/oauth/access-token",dynamicClientRegistration:{registrationEndpoint:"https://circleback.ai/api/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["circleback.ai meeting links, Circleback notes exports, or CIRCLEBACK_* environment variables","Incident, customer-call, or product-feedback docs naming Circleback","Operational runbooks that refer to meeting notes or transcripts in Circleback"],helpText:"Search your Circleback meeting notes, transcripts, and action items."})});var qce;var Vce=h(()=>{de();qce=U({id:"clay",label:"Clay",iconKey:"clay",defaultServerUrl:"https://mcp.clay.earth/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"clay",callbackPathSegment:"clay",authorizationUrl:"https://mcp.clay.earth/authorize",tokenUrl:"https://mcp.clay.earth/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.clay.earth/register",tokenEndpointAuthMethod:"client_secret_post"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"read",label:"Read access",description:"Read Clay contacts, interactions, notes, and workspace workflows."},{value:"write",label:"Write access",description:"Create and update Clay records and workspace workflows."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Clay workflow URLs, clay.earth links, or CLAY_* environment variables","Outbound enrichment, lead routing, or contact workflow docs naming Clay","Code or scripts that sync contacts, notes, or workspace workflows with Clay"],helpText:"Search Clay contacts, interactions, notes, and workspace workflows, and create or update records and workflows."})});var Kce;var Yce=h(()=>{de();Kce=U({id:"clerk",label:"Clerk",iconKey:"clerk",defaultServerUrl:"https://mcp.clerk.com/mcp",transport:"streamable-http",authMode:"none",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["list_clerk_sdk_snippets","clerk_sdk_snippet"]},evidenceHints:["@clerk/* SDK imports, CLERK_SECRET_KEY / CLERK_PUBLISHABLE_KEY environment variables, or clerk.com URLs","Authentication, session, or organization/user management logic built on Clerk","README/docs naming Clerk for auth, sign-in flows, or user management"],helpText:"Search Clerk's public documentation and SDK implementation snippets via Clerk's hosted MCP server."})});var Wce;var Jce=h(()=>{de();Wce=U({id:"cloudflare",label:"Cloudflare",iconKey:"cloudflare",defaultServerUrl:"https://mcp.cloudflare.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"cloudflare",callbackPathSegment:"cloudflare",authorizationUrl:"https://mcp.cloudflare.com/authorize",tokenUrl:"https://mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,regions:[{label:"Cloudflare API (all products, account-scoped)",serverUrl:"https://mcp.cloudflare.com/mcp"},{label:"Observability (Workers logs & analytics)",serverUrl:"https://observability.mcp.cloudflare.com/mcp",authorizationUrl:"https://observability.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://observability.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://observability.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Workers Bindings (D1, R2, KV, Workers)",serverUrl:"https://bindings.mcp.cloudflare.com/mcp",authorizationUrl:"https://bindings.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://bindings.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://bindings.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Workers Builds (CI/CD builds)",serverUrl:"https://builds.mcp.cloudflare.com/mcp",authorizationUrl:"https://builds.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://builds.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://builds.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Radar (Internet traffic insights)",serverUrl:"https://radar.mcp.cloudflare.com/mcp",authorizationUrl:"https://radar.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://radar.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://radar.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["wrangler.toml / wrangler.jsonc, @cloudflare/* packages, or CLOUDFLARE_* environment variables","Cloudflare Workers, Pages, R2, D1, KV, or Durable Objects usage in code or config","README/runbooks naming Cloudflare as the CDN, edge, or Workers platform"],helpText:"By default, use Cloudflare's unified all-products API server (mcp.cloudflare.com), scoped by your account's permissions. Optionally pick a per-product server for observability logs and analytics, bindings (D1, R2, KV), builds, or Radar insights."})});var Zce;var Xce=h(()=>{_t();de();Zce=U({id:"cloudflare-api-token",label:"Cloudflare (API token)",iconKey:"cloudflare",defaultServerUrl:"https://mcp.cloudflare.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["wrangler.toml / wrangler.jsonc, @cloudflare/* packages, or CLOUDFLARE_* environment variables","Cloudflare Workers, Pages, R2, D1, KV, or Durable Objects usage in code or config","README/runbooks naming Cloudflare as the CDN, edge, or Workers platform"],helpText:"Query the Cloudflare API MCP server (Workers, DNS, zones, and more) using a Cloudflare API token instead of OAuth.",setupGroups:[{id:"api-token",title:"Create a Cloudflare API token",description:"Mint an API token scoped to exactly the products and permissions Sazabi should access.",body:"In the Cloudflare dashboard, go to **My Profile > API Tokens > Create Token**, then **Create Custom Token**. Under **Permissions**, add read access for the products you want the agent to use — for example **Account > Workers Observability > Read**, **Zone > DNS > Read**, and **Account > Account Settings > Read** — then copy the generated `cfut_...` token. Tokens with **Client IP Address Filtering** enabled are not supported by the hosted MCP server.",fieldKeys:["apiToken"]}],validateCredentials:Nae,normalizeHeaders:Lae})});var ele;var tle=h(()=>{_t();de();ele=U({id:"composio",label:"Composio",iconKey:"composio",defaultServerUrl:"https://connect.composio.dev/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Composio MCP, COMPOSIO_API_KEY, or Composio SDK usage","connect.composio.dev/mcp in MCP client configuration","README/docs naming Composio integrations, toolkits, or connected apps"],helpText:"Use tools from the Composio toolkits you have connected, through Composio's hosted Connect MCP server with a Composio API key.",setupGroups:[{id:"connect-toolkits",title:"Connect the toolkits you want to use",description:"Composio's MCP server only exposes tools for the apps you have connected in Composio.",body:"In the [Composio dashboard](https://dashboard.composio.dev), connect the apps (toolkits) you want the agent to use. Composio can also prompt to connect apps on demand at runtime, but connecting them first makes those tools available right away."},{id:"api-key",title:"Create an API key",description:"Create or copy the Composio API key Sazabi will send to Composio's hosted MCP endpoint.",body:"In the [Composio dashboard](https://dashboard.composio.dev), open **Settings > Project Settings** and copy your project API key from the **API Keys** section (or use the AI Clients page). Paste it below. Sazabi stores it securely and sends it as the `x-consumer-api-key` header to Composio's Connect MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Xae,normalizeHeaders:Zae})});var nle;var ole=h(()=>{_t();de();nle=U({id:"context-dev",label:"Context.dev",iconKey:"context-dev",defaultServerUrl:"https://context-dev.stlmcp.com",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Context.dev SDK usage (context.dev on npm/PyPI/RubyGems), CONTEXT_DEV_API_KEY environment variables, or ctxt_secret_ API keys","context.dev-mcp usage or a context-dev.stlmcp.com server URL in MCP client config","README/docs naming Context.dev for brand intelligence, web scraping/crawling, or website change monitors"],helpText:"Resolve brand data, scrape and crawl websites into LLM-ready Markdown, extract structured data, and manage website-change monitors with Context.dev's hosted MCP server using your Context.dev API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Context.dev API key Sazabi will send to Context.dev's hosted MCP endpoint.",body:"Create or copy an API key (`ctxt_secret_...`) from your [Context.dev dashboard](https://context.dev), then paste it below. Sazabi stores it securely and sends it as the `x-context-dev-api-key` header to Context.dev's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:oce,normalizeHeaders:nce,skill:"context-dev",setupSkill:"context-dev-setup"})});var rle;var ile=h(()=>{_t();de();rle=U({id:"datadog",label:"Datadog",iconKey:"datadog",defaultServerUrl:"https://mcp.datadoghq.com/api/unstable/mcp-server/mcp?toolsets=core",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Datadog config, DD_* environment variables, or @datadog packages","datadog-agent, dd-trace, monitors, dashboards, or incident docs","README/docs naming Datadog for logs, metrics, traces, APM, or incidents"],helpText:"Browse Datadog metrics, logs, traces, and incidents using your Datadog site URL, API key, and Application Key.",setupGroups:[{id:"site",title:"Find your Datadog site",description:"Use the Datadog site URL for the region where your account lives.",body:"Copy the Datadog site URL from the top of your browser, such as `https://app.datadoghq.com` or `https://us3.datadoghq.com`. Sazabi uses this to build the matching hosted MCP endpoint.",fieldKeys:["siteUrl"]},{id:"keys",title:"Create API credentials",description:"Create or copy the two Datadog keys Sazabi needs for hosted MCP.",imageKeys:["mcp.datadog.api-keys-settings","mcp.datadog.application-keys-settings"],body:"In Datadog, go to **Organization Settings > Access > API Keys** to create or copy your API key. Then go to **Organization Settings > Access > Application Keys** to create or copy your Application Key. Note: an Application Key inherits the permissions of the user who creates it, so create it as a least-privilege user or scope the key down to only what the agent needs.",fieldKeys:["apiKey","applicationKey"]}],validateCredentials:Qae,normalizeHeaders:_ae})});var sle;var ale=h(()=>{de();sle=U({id:"deepwiki",label:"DeepWiki",iconKey:"deepwiki",defaultServerUrl:"https://mcp.deepwiki.com/mcp",transport:"streamable-http",authMode:"none",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["read_wiki_structure","read_wiki_contents","ask_question"]},evidenceHints:["Questions about how a public GitHub repository or open-source dependency works","deepwiki.com URLs or references to DeepWiki-generated documentation","Investigations needing up-to-date docs/architecture for a third-party OSS project"],helpText:"Query public GitHub repository documentation and ask questions about open-source code via DeepWiki's hosted MCP server."})});var cle;var lle=h(()=>{_t();de();cle=U({id:"elastic-cloud",label:"Elastic Cloud",iconKey:"elastic-cloud",defaultServerUrl:null,serverUrlHostnameSuffixes:[".elastic.cloud",".cloud.es.io",".elastic-cloud.com"],transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Elasticsearch, Kibana, Elastic Agent, Beats, or Logstash config","ELASTIC_* environment variables or elasticsearch client packages","README/docs naming Elastic Cloud, Elasticsearch, or Kibana"],helpText:"Search Elasticsearch indices and query Elastic Agent Builder tools using your Kibana MCP endpoint and an Elastic API key.",setupGroups:[{id:"deployment",title:"Open Kibana",description:"Find the Kibana URL for the Elastic deployment you want to connect.",body:"Go to [Elastic Cloud deployments](https://cloud.elastic.co/deployments), open the deployment you want to connect, then open Kibana and copy the Kibana base URL from the browser. If your Kibana URL contains `/s/<space>/`, keep that space value for the connect step.",fieldKeys:["kibanaUrl","kibanaSpace"]},{id:"api-key",title:"Create an API key",description:"Create the Elastic API key that the hosted MCP server will use.",body:"In Kibana, go to **Stack Management > API keys** and choose **Create API key**. Restrict its privileges to the Agent Builder MCP server: the `feature_agentBuilder.read` and `feature_actions.read` Kibana privileges, plus read access to the indices your tools query. Copy the generated key.",fieldKeys:["apiKey"]}],validateCredentials:Dae,normalizeHeaders:Oae})});var ule;var dle=h(()=>{_t();de();ule=U({id:"exa",label:"Exa",iconKey:"exa",defaultServerUrl:"https://mcp.exa.ai/mcp?tools=web_search_exa,web_fetch_exa,web_search_advanced_exa,agent_tools",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Exa search, EXA_API_KEY environment variables, or the exa-js / exa-py SDK","exa-mcp-server usage or a mcp.exa.ai server URL in MCP client config","README/docs naming Exa for web search, crawling, or research"],helpText:"Search the web, research companies, crawl pages, and run deep research with Exa's hosted MCP server using your Exa API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Exa API key Sazabi will send to Exa's hosted MCP endpoint.",body:"Create or copy an API key from the [Exa dashboard](https://dashboard.exa.ai/api-keys), then paste it below. Sazabi stores it securely and sends it as the `x-api-key` header to Exa's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Jae,normalizeHeaders:Wae,skill:"exa",setupSkill:"exa-setup"})});var ple;var gle=h(()=>{_t();de();ple=U({id:"gcp",label:"Google Cloud (GCP)",iconKey:"gcp",defaultServerUrl:"https://logging.googleapis.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["GOOGLE_APPLICATION_CREDENTIALS, GCLOUD_PROJECT, or GOOGLE_CLOUD_PROJECT environment variables","gcloud config, app.yaml, cloudbuild.yaml, or @google-cloud/* packages","README/docs naming Google Cloud, GCP, Cloud Logging, Cloud Monitoring, BigQuery, Cloud Run, or GKE"],helpText:"Query Google Cloud (Cloud Logging, Monitoring, BigQuery, and more) using a Google OAuth 2.0 Bearer access token.",setupGroups:[{id:"server-url",title:"Choose the Google Cloud MCP endpoint",description:"Google exposes a separate remote MCP server per product at https://SERVICE.googleapis.com/mcp.",body:"Sazabi defaults to Cloud Logging (`https://logging.googleapis.com/mcp`). To use a different product, replace the server URL with its endpoint, such as `https://monitoring.googleapis.com/mcp` (Cloud Monitoring) or `https://bigquery.googleapis.com/mcp` (BigQuery). See the [supported products list](https://docs.cloud.google.com/mcp/supported-products)."},{id:"access-token",title:"Create a Google OAuth 2.0 access token",description:"Generate a Google access token scoped by IAM to the resources Sazabi should read.",body:"The hosted servers authenticate with a Google OAuth 2.0 Bearer access token. For a non-interactive token, install the [gcloud CLI](https://docs.cloud.google.com/mcp/authenticate-mcp), configure Application Default Credentials (a user login, service-account key, or impersonation), then run `gcloud auth application-default print-access-token` and copy the token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header. Google access tokens are short-lived, so refresh the token when it expires.",fieldKeys:["accessToken"]}],validateCredentials:gce,normalizeHeaders:pce})});var mle;var hle=h(()=>{de();mle=U({id:"google-drive",label:"Google Drive",iconKey:"google-drive",defaultServerUrl:"https://drivemcp.googleapis.com/mcp/v1",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"google-drive",callbackPathSegment:"google-drive",authorizationUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",authorizationUrlParams:{access_type:"offline",prompt:"consent"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"https://www.googleapis.com/auth/drive.readonly",label:"Drive read",description:"Read files and metadata in the user's Google Drive through the hosted MCP server."}],setupGroups:[{id:"google-cloud-oauth-client",title:"Create an OAuth client in Google Cloud",description:"The Google Drive MCP server does not support automatic client registration. An admin must create an OAuth client in a Google Cloud project and provide its credentials to Sazabi.",body:["1. In the Google Cloud console, open **APIs & Services → OAuth consent screen** and configure the consent screen with the Drive scopes.","2. Under **APIs & Services → Credentials**, create an **OAuth client ID** of type **Web application**.","3. Add the Sazabi Google Drive MCP callback URL shown on this page as an **Authorized redirect URI**.","4. Enable both the **Google Drive API** and the **Google Drive MCP API** (`drivemcp.googleapis.com`) for the project. Both are required for the hosted MCP server to be reachable.","5. Provide the generated **Client ID** and **Client Secret** to your Sazabi deployment configuration."].join(`
|
|
8746
8746
|
`)}],evidenceHints:["drive.google.com / docs.google.com links, or Google Drive file IDs in runbooks","googleapis / google-auth-library packages, or GOOGLE_* / GDRIVE_* environment variables","README/runbooks naming Google Drive as a document or asset store"],helpText:"Search and read files and metadata in a Google Drive through Google's hosted MCP server. Coming soon — requires a Sazabi-provisioned Google OAuth client and isn't self-serve connectable yet."})});var Ale;var fle=h(()=>{de();Ale=U({id:"grafana",label:"Grafana Cloud",iconKey:"grafana",defaultServerUrl:"https://mcp.grafana.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"grafana",callbackPathSegment:"grafana",authorizationUrl:"https://mcp.grafana.com/mcp/oauth/authorize",tokenUrl:"https://mcp.grafana.com/mcp/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.grafana.com/mcp/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"grafana:read",label:"Read",description:"Read Grafana dashboards, panels, metrics, logs, traces, alerts, and incidents."},{value:"grafana:write",label:"Write",description:"Create and modify Grafana resources. Write tools require explicit approval per your organization's tool policy."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["grafana.net / grafana.com links, Grafana dashboards, or GRAFANA_* environment variables","Prometheus, Loki, Tempo, or Mimir data sources wired into Grafana","README/runbooks naming Grafana for dashboards, metrics, logs, traces, or alerts"],helpText:"Browse Grafana dashboards, metrics, logs, traces, and alerts across your Grafana Cloud stack."})});var yle;var ble=h(()=>{de();yle=U({id:"granola",label:"Granola",iconKey:"granola",defaultServerUrl:"https://mcp.granola.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"granola",callbackPathSegment:"granola",authorizationUrl:"https://mcp-auth.granola.ai/oauth2/authorize",tokenUrl:"https://mcp-auth.granola.ai/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp-auth.granola.ai/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["granola.ai meeting links, Granola notes exports, or GRANOLA_* environment variables","Incident, customer-call, or product-feedback docs naming Granola","Operational runbooks that refer to meeting notes or transcripts in Granola"],helpText:"Search and browse Granola meeting notes, transcripts, and folders."})});var Ile;var Sle=h(()=>{de();Ile=U({id:"happenstance",label:"Happenstance",iconKey:"happenstance",defaultServerUrl:"https://happenstance.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"happenstance",callbackPathSegment:"happenstance",authorizationUrl:"https://happenstance.ai/oauth/authorize",tokenUrl:"https://clerk.happenstance.ai/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://clerk.happenstance.ai/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"profile",label:"Profile",description:"Read your Happenstance profile."},{value:"email",label:"Email",description:"Read the email associated with your Happenstance account."},{value:"offline_access",label:"Offline access",description:"Keep the connection alive by refreshing access without re-authentication."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["happenstance.ai links or references to a Happenstance network/graph","HAPPENSTANCE_* environment variables or scripts calling Happenstance APIs","Docs naming Happenstance as the people/relationship search tool"],helpText:"Search your Happenstance network to find and get introduced to people."})});var Cle;var vle=h(()=>{de();Cle=U({id:"herd",label:"Herd",iconKey:"herd",defaultServerUrl:"https://mcp.herd.eco/v1",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"herd",callbackPathSegment:"herd",authorizationUrl:"https://mcp.herd.eco/api/auth/oauth2/authorize",tokenUrl:"https://mcp.herd.eco/api/auth/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.herd.eco/api/auth/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0},{value:"profile"},{value:"email"}],scopesUserSelectable:!1,capabilityOverrides:{allowWriteTools:!0},helpText:"Analyze contracts, transactions, wallets, and on-chain activity."})});var Ele;var wle=h(()=>{de();Ele=U({id:"honeycomb",label:"Honeycomb",iconKey:"honeycomb",defaultServerUrl:"https://mcp.honeycomb.io/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"honeycomb",callbackPathSegment:"honeycomb",authorizationUrl:"https://ui.honeycomb.io/oauth/authorize",tokenUrl:"https://ui.honeycomb.io/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://ui.honeycomb.io/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp:read",label:"Read",description:"Query Honeycomb environments, datasets, columns, boards, triggers, SLOs, and run queries."},{value:"mcp:write",label:"Write",description:"Create and update Honeycomb boards, triggers, and other resources."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.honeycomb.io/mcp"},{label:"Europe (EU)",serverUrl:"https://mcp.eu1.honeycomb.io/mcp",authorizationUrl:"https://ui.eu1.honeycomb.io/oauth/authorize",tokenUrl:"https://ui.eu1.honeycomb.io/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://ui.eu1.honeycomb.io/oauth/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["honeycomb.io URLs, HONEYCOMB_API_KEY / HONEYCOMB_DATASET environment variables, or honeycomb:// dataset URIs","libhoney, @honeycombio packages, or OpenTelemetry exporters pointed at api.honeycomb.io / api.eu1.honeycomb.io","README/runbooks naming Honeycomb as the observability or tracing provider"],helpText:"Query Honeycomb environments, datasets, columns, boards, and triggers, run queries, and create or update boards and triggers. Choose the US or EU region when connecting."})});var kle;var xle=h(()=>{de();kle=U({id:"incident-io",label:"incident.io",iconKey:"incident-io",defaultServerUrl:"https://mcp.incident.io/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"incident-io",callbackPathSegment:"incident-io",authorizationUrl:"https://app.incident.io/auth/plugin/authorize",tokenUrl:"https://app.incident.io/auth/plugin/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.incident.io/mcp/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["incident.io alert-source URLs, escalation docs, or incident IDs","INCIDENT_IO_* environment variables or webhooks into incident.io","README/runbooks naming incident.io for incidents, alerts, or on-call"],helpText:"Browse incidents, alerts, and on-call.",skill:"incident-io",setupSkill:"incident-io-setup"})});var Ple;var Rle=h(()=>{_t();de();Ple=U({id:"intercom",label:"Intercom",iconKey:"intercom",defaultServerUrl:"https://mcp.intercom.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Intercom config, INTERCOM_* environment variables, or intercom-client packages","Support inbox, conversations, help center, or customer messaging docs naming Intercom","README/docs naming Intercom for support threads or customer conversations"],helpText:"Read Intercom support conversations, contacts, and help center content using an Intercom API access token. US-hosted Intercom workspaces only.",setupGroups:[{id:"developer-app",title:"Open Intercom developer settings",description:"Use an Intercom app with an access token for the workspace you want to connect.",body:"In Intercom, go to **Settings > Integrations > Developer Hub**, open (or create) an app for your workspace, and confirm it has the permissions you want agents to use. The hosted MCP server lives at `https://mcp.intercom.com/mcp` and currently supports US-hosted Intercom workspaces only."},{id:"access-token",title:"Copy your access token",description:"Copy the Intercom API access token the hosted MCP server will use.",body:"From your Intercom app's **Authentication** section, copy the access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:Hae,normalizeHeaders:Gae})});var Tle;var Ble=h(()=>{_t();de();Tle=U({id:"langfuse",label:"Langfuse",iconKey:"langfuse",defaultServerUrl:"https://us.cloud.langfuse.com/api/public/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",regions:[{label:"United States (US)",serverUrl:"https://us.cloud.langfuse.com/api/public/mcp"},{label:"Europe (EU)",serverUrl:"https://cloud.langfuse.com/api/public/mcp"},{label:"Asia Pacific (JP)",serverUrl:"https://jp.cloud.langfuse.com/api/public/mcp"}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Langfuse SDK usage (langfuse, langfuse-langchain) or @langfuse packages","LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY / LANGFUSE_HOST environment variables","README/docs naming Langfuse as the LLM tracing, evaluation, or observability provider"],helpText:"Query Langfuse traces, observations, metrics, scores, comments, and prompts using project API keys.",setupGroups:[{id:"region",title:"Pick your Langfuse Cloud region",description:"Select the Langfuse Cloud region that hosts your project (or use the custom connector for a self-hosted deployment).",body:"Langfuse Cloud is region-scoped: US (`https://us.cloud.langfuse.com`), EU (`https://cloud.langfuse.com`), or JP (`https://jp.cloud.langfuse.com`). Choose the region matching your Langfuse account; the hosted MCP server lives at `/api/public/mcp` on that host."},{id:"api-keys",title:"Create project API keys",description:"Generate the Langfuse project API key pair the hosted MCP server will use.",body:"In Langfuse, open **Project settings → API keys** and create a new key pair. Copy the Public key (`pk-lf-...`) and Secret key (`sk-lf-...`). Sazabi combines them into an HTTP Basic `Authorization` header (`Basic base64(publicKey:secretKey)`) and sends it to the MCP server. Paste the combined `Authorization` value into Sazabi.",fieldKeys:["authorization"]}],validateCredentials:ace,normalizeHeaders:ice})});var Ole;var _le=h(()=>{de();Ole=U({id:"langsmith",label:"LangSmith",iconKey:"langsmith",defaultServerUrl:"https://api.smith.langchain.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"langsmith",callbackPathSegment:"langsmith",authorizationUrl:"https://api.smith.langchain.com/oauth/authorize",tokenUrl:"https://api.smith.langchain.com/oauth/token",resourceUrl:"https://api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,regions:[{label:"GCP United States (US)",serverUrl:"https://api.smith.langchain.com/mcp"},{label:"GCP Europe (EU)",serverUrl:"https://eu.api.smith.langchain.com/mcp",authorizationUrl:"https://eu.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://eu.api.smith.langchain.com/oauth/token",resourceUrl:"https://eu.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://eu.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},{label:"GCP Asia Pacific (APAC)",serverUrl:"https://apac.api.smith.langchain.com/mcp",authorizationUrl:"https://apac.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://apac.api.smith.langchain.com/oauth/token",resourceUrl:"https://apac.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://apac.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},{label:"AWS United States (US)",serverUrl:"https://aws.api.smith.langchain.com/mcp",authorizationUrl:"https://aws.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://aws.api.smith.langchain.com/oauth/token",resourceUrl:"https://aws.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://aws.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["LANGSMITH_* or LANGCHAIN_* environment variables, or langsmith SDK usage","LangSmith tracing projects, runs, datasets, or evaluations","README/docs naming LangSmith for LLM tracing, evals, or observability"],helpText:"Query LangSmith tracing projects, runs, datasets, and evaluations to investigate LLM application behavior. Choose the region where your LangSmith organization lives when connecting."})});var Dle;var Qle=h(()=>{de();Dle=U({id:"linear",label:"Linear",iconKey:"linear",defaultServerUrl:"https://mcp.linear.app/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"linear",callbackPathSegment:"linear",authorizationUrl:"https://mcp.linear.app/authorize",tokenUrl:"https://mcp.linear.app/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.linear.app/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Linear issues, projects, teams, comments, and related data."},{value:"write",label:"Write",description:"Create and update Linear issues, comments, and project data."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"linear",setupSkill:"linear-setup",evidenceHints:["linear.app URLs, Linear issue keys, or team/project IDs in docs","LINEAR_* environment variables or scripts that call Linear APIs","README/runbooks naming Linear as the issue tracker or planning system"],helpText:"Browse and search Linear issues and projects, and create or update issues, comments, and project data."})});var Lle;var Nle=h(()=>{de();Lle=U({id:"logfire",label:"Pydantic Logfire",iconKey:"logfire",defaultServerUrl:"https://logfire-us.pydantic.dev/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"logfire",callbackPathSegment:"logfire",authorizationUrl:"https://logfire-us.pydantic.dev/api/oauth/authorize",tokenUrl:"https://logfire-us.pydantic.dev/api/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://logfire-us.pydantic.dev/api/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"organization:read_channel"},{value:"project:read"},{value:"project:read_alert"},{value:"project:read_dashboard"},{value:"project:read_variables"}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Pydantic Logfire config, LOGFIRE_* environment variables, or logfire SDK packages","Python/Pydantic observability docs naming Logfire","Alerts, dashboards, or traces hosted in Logfire"],helpText:"Query Pydantic Logfire traces, metrics, and exceptions, and browse projects, alerts, and dashboards. Hosted on Logfire's US region (logfire-us.pydantic.dev)."})});var Mle;var zle=h(()=>{de();Mle=U({id:"mercury",label:"Mercury",iconKey:"mercury",defaultServerUrl:"https://mcp.mercury.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"mercury",callbackPathSegment:"mercury",authorizationUrl:"https://mcp.mercury.com/authorize",tokenUrl:"https://mcp.mercury.com/token",resourceUrl:"https://mcp.mercury.com/mcp",omitScopeFromAuthorizationUrl:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.mercury.com/register",tokenEndpointAuthMethod:"client_secret_basic",includeScopesInRegistration:!0}},getAvailableScopes:async()=>[{value:"read",label:"Read access",description:"Read Mercury accounts, cards, recipients, transactions, treasury, and organization data."},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!1},skill:"mercury",setupSkill:"mercury-setup",evidenceHints:["Mercury dashboard links, mercury.com references, or Mercury API usage","MERCURY_* environment variables or docs mentioning Mercury banking","Treasury, card, account, recipient, or transaction workflows backed by Mercury"],helpText:"Search Mercury banking data including accounts, cards, recipients, transactions, treasury, and organization records. Read-only: this connection cannot move money or change your Mercury account."})});var jle;var Ule=h(()=>{de();jle=U({id:"neon",label:"Neon",iconKey:"neon",defaultServerUrl:"https://mcp.neon.tech/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"neon",callbackPathSegment:"neon",authorizationUrl:"https://mcp.neon.tech/api/authorize",tokenUrl:"https://mcp.neon.tech/api/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.neon.tech/api/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Neon projects, branches, databases, and run queries."},{value:"write",label:"Write",description:"Create and modify Neon projects, branches, and databases."},{value:"*",label:"Full access",description:"All access - read and manage every Neon resource the connected account can reach."}],getUrlConfiguration:async()=>({docsUrl:"https://neon.com/docs/ai/neon-mcp-server",instructions:"Copy the hosted MCP server URL below. Optional: to narrow access, append ?readonly=true, &projectId=<id>, and/or &category=<groups> (see the Neon MCP docs), then copy the edited URL.",defaultServerUrl:"https://mcp.neon.tech/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Neon connection strings, neon.tech hosts, or @neondatabase/serverless packages","DATABASE_URL/POSTGRES_URL values documented as Neon","README/docs naming Neon as the Postgres provider"],helpText:"Manage Neon projects, branches, databases, and run SQL queries."})});var Fle;var $le=h(()=>{de();Fle=U({id:"notion",label:"Notion",iconKey:"notion",defaultServerUrl:"https://mcp.notion.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"notion",callbackPathSegment:"notion",authorizationUrl:"https://mcp.notion.com/authorize",tokenUrl:"https://mcp.notion.com/token",resourceUrl:"https://mcp.notion.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://mcp.notion.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"default",label:"Default",description:"Access Notion pages, databases, and workspace content via MCP."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"notion",setupSkill:"notion-setup",evidenceHints:["notion.so URLs, Notion page IDs, or database IDs in docs","NOTION_* environment variables or scripts that call Notion APIs","README/runbooks naming Notion as the wiki or knowledge base"],helpText:"Browse and manage Notion pages, databases, and workspace content. During authorization, choose which pages and databases to share with the connection."})});var Gle;var Hle=h(()=>{de();Gle=U({id:"1password",label:"1Password",iconKey:"onepassword",defaultServerUrl:"https://developer.1password.com/get-started/secure-ai-access",transport:"streamable-http",authMode:"none",availability:"disabled",getUrlConfiguration:async()=>null,evidenceHints:["1Password service-account tokens (ops_...), op CLI usage, or OP_SERVICE_ACCOUNT_TOKEN","1password.com / *.1password.com references, or op:// secret references","README/docs naming 1Password as the secrets manager or vault"],helpText:"Access 1Password via its documented secure AI access options. A general-purpose hosted MCP server is not available today; use the 1Password CLI (op) sandbox preset instead."})});var qle;var Vle=h(()=>{de();qle=U({id:"paper",label:"Paper MCP",iconKey:"paper",defaultServerUrl:"http://127.0.0.1:29979/mcp",transport:"streamable-http",authMode:"none",availability:"disabled",getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["paper.design URLs, Paper Desktop app references, or PAPER_* environment variables","Design files, component libraries, or design-system docs naming Paper","HTML-to-PDF slide or presentation workflows that reference Paper"],helpText:"Read and write Paper design files, including nodes, selections, text content, and design-system elements. Coming soon — Paper's MCP server runs on desktop localhost and can't be reached by hosted Sazabi agents yet."})});var Kle;var Yle=h(()=>{de();Kle=U({id:"plain",label:"Plain",iconKey:"plain",defaultServerUrl:"https://mcp.plain.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"plain",callbackPathSegment:"plain",authorizationUrl:"https://signin.auth.plain.com/oauth2/authorize",tokenUrl:"https://signin.auth.plain.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://signin.auth.plain.com/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["plain.com links, Plain customer/thread IDs, or PLAIN_* environment variables","Support inbox, customer thread, or tenant docs naming Plain","Code or scripts syncing customers, tenants, or support threads with Plain"],helpText:"Search and manage Plain support threads, customers, and tenants.",skill:"plain",setupSkill:"plain-setup"})});var Wle;var Jle=h(()=>{de();Wle=U({id:"planetscale",label:"PlanetScale",iconKey:"planetscale",defaultServerUrl:"https://mcp.pscale.dev/mcp/planetscale",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"planetscale",callbackPathSegment:"planetscale",authorizationUrl:"https://app.planetscale.com/oauth/authorize",tokenUrl:"https://auth.planetscale.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://auth.planetscale.com/oauth/registration",tokenEndpointAuthMethod:"client_secret_basic"}},getAvailableScopes:async()=>[{value:"read_databases"},{value:"read_user"},{value:"read_organization"},{value:"write_databases"},{value:"write_organization"}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["PlanetScale connection strings, pscale CLI config, or planetscale.com links","PLANETSCALE_* or DATABASE_URL values documented as PlanetScale","README/docs naming PlanetScale for MySQL, branching, or schema changes"],helpText:"Query PlanetScale databases, inspect schema, and browse Insights data.",skill:"planetscale",setupSkill:"planetscale-setup"})});var Zle;var Xle=h(()=>{de();Zle=U({id:"posthog",label:"PostHog",iconKey:"posthog",defaultServerUrl:"https://mcp.posthog.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"posthog",callbackPathSegment:"posthog",authorizationUrl:"https://oauth.posthog.com/oauth/authorize/",tokenUrl:"https://oauth.posthog.com/oauth/token/",dynamicClientRegistration:{registrationEndpoint:"https://oauth.posthog.com/oauth/register/",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"query:read"},{value:"insight:read"},{value:"insight:write"},{value:"feature_flag:read"},{value:"feature_flag:write"},{value:"experiment:read"},{value:"experiment:write"},{value:"dashboard:read"},{value:"dashboard:write"},{value:"event_definition:read"},{value:"event_definition:write"},{value:"person:read"},{value:"user:read",required:!0},{value:"user:write"},{value:"organization:read",required:!0},{value:"project:read",required:!0},{value:"project:write"},{value:"survey:read"},{value:"survey:write"},{value:"error_tracking:read"},{value:"logs:read"},{value:"tracing:read"},{value:"error_tracking:write"},{value:"session_recording:read"},{value:"session_recording_playlist:read"},{value:"alert:read"},{value:"activity_log:read"},{value:"annotation:read"},{value:"cohort:read"},{value:"hog_function:read"}],getUrlConfiguration:async()=>({docsUrl:"https://posthog.com/docs/model-context-protocol/faq",instructions:"Copy the hosted MCP server URL below. Optional: to expose only some tools, append ?features=<groups> or ?tools=<names> (see the PostHog MCP docs), then copy the edited URL.",defaultServerUrl:"https://mcp.posthog.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["posthog-js, posthog-node, POSTHOG_* or NEXT_PUBLIC_POSTHOG_* environment variables","Feature flag, experiment, session replay, or product analytics code using PostHog","README/docs naming PostHog for analytics, flags, experiments, logs, or tracing"],helpText:"Query PostHog analytics, feature flags, and experiments.",skill:"posthog",setupSkill:"posthog-setup"})});var eue;var tue=h(()=>{de();eue=U({id:"pylon",label:"Pylon",iconKey:"pylon",defaultServerUrl:"https://mcp.usepylon.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"pylon",callbackPathSegment:"pylon",authorizationUrl:"https://o.auth.usepylon.com/oauth2/authorize",tokenUrl:"https://o.auth.usepylon.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://o.auth.usepylon.com/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["usepylon.com links, Pylon issue/account IDs, or PYLON_* environment variables","Customer support workflows or account runbooks naming Pylon","Code or scripts syncing support issues, accounts, or contacts with Pylon"],helpText:"Search and manage Pylon support issues, accounts, and contacts.",skill:"pylon",setupSkill:"pylon-setup"})});var nue;var oue=h(()=>{de();nue=U({id:"railway",label:"Railway",iconKey:"railway",defaultServerUrl:"https://mcp.railway.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"railway",callbackPathSegment:"railway",authorizationUrl:"https://backboard.railway.com/oauth/auth",tokenUrl:"https://backboard.railway.com/oauth/token",resourceUrl:"https://mcp.railway.com",dynamicClientRegistration:{registrationEndpoint:"https://backboard.railway.com/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"profile",required:!0},{value:"email",required:!0},{value:"offline_access",required:!0},{value:"workspace:member",label:"Workspace access",description:"Read and manage Railway projects, services, deployments, variables, and logs in the workspaces the connected account belongs to."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"railway",setupSkill:"railway-setup",evidenceHints:["railway.app / railway.com links, RAILWAY_* environment variables, or a railway.json/railway.toml in the repo","Deploy workflows or runbooks naming Railway as the hosting/PaaS provider","Railway project/service/environment IDs referenced in docs or CI"],helpText:"Manage Railway projects, services, deployments, variables, and logs."})});var rue;var iue=h(()=>{_t();de();rue=U({id:"render",label:"Render",iconKey:"render",defaultServerUrl:"https://mcp.render.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["render.com links, RENDER_* environment variables, or a render.yaml in the repo","Deploy workflows or runbooks naming Render as the hosting/PaaS provider","Render service/deploy IDs referenced in docs or CI"],helpText:"Manage Render services, deploys, environment variables, logs, and metrics.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Render API key Sazabi will send to Render's hosted MCP endpoint.",body:"Create a Render [API key](https://dashboard.render.com/settings/api-keys) in **Account Settings > API Keys**, then paste it below. Note: a Render API key is account-wide and can manage and deploy every service in the account, so treat it as a powerful credential.",fieldKeys:["apiKey"]}],validateCredentials:Vae,normalizeHeaders:qae})});var sue;var aue=h(()=>{_t();de();sue=U({id:"rentahuman",label:"RentAHuman",iconKey:"rentahuman",defaultServerUrl:"https://rentahuman.ai/api/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["rentahuman.ai, RENTAHUMAN_API_KEY environment variables, or RentAHuman API keys","rentahuman-mcp usage or a rentahuman.ai/api/mcp server URL in MCP client config","README/docs naming RentAHuman for hiring humans or human-in-the-loop work"],helpText:"Hire and coordinate human workers for real-world tasks with RentAHuman's hosted MCP server using an API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the RentAHuman API key Sazabi will send to its hosted MCP endpoint.",body:"Create or copy an API key from the [RentAHuman API keys page](https://rentahuman.ai/account/api-keys), then paste it below. Sazabi stores it securely and sends it as the `X-API-Key` header. Note: this key can hire workers and trigger payments, so keep the per-connection read-only toggle on unless you intend the agent to act.",fieldKeys:["apiKey"]}],validateCredentials:tce,normalizeHeaders:ece,skill:"rentahuman",setupSkill:"rentahuman-setup"})});var cue;var lue=h(()=>{_t();de();cue=U({id:"resend",label:"Resend",iconKey:"resend",defaultServerUrl:"https://mcp.resend.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Resend email API usage, RESEND_API_KEY environment variables, or the resend SDK","resend-mcp usage or a mcp.resend.com server URL in MCP client config","README/docs naming Resend for transactional or marketing email"],helpText:"Send transactional emails and manage domains, contacts, and audiences with Resend's hosted MCP server using your Resend API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Resend API key Sazabi will send to Resend's hosted MCP endpoint.",body:"Create or copy an API key from the [Resend dashboard](https://resend.com/api-keys), then paste it below. Choose the key's permission to match what you want the agent to do: **Sending access** (send emails only, the safer choice) or **Full access** (also manage domains, contacts, and audiences). Sazabi stores it securely and sends it as the `Authorization: Bearer` token to Resend's MCP endpoint (`https://mcp.resend.com/mcp`).",fieldKeys:["apiKey"]}],validateCredentials:lce,normalizeHeaders:cce,skill:"resend",setupSkill:"resend-setup"})});var uue;var due=h(()=>{_t();de();uue=U({id:"respan",label:"Respan",iconKey:"respan",defaultServerUrl:"https://mcp.respan.ai/api/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Respan / Keywords AI observability usage, RESPAN_API_KEY environment variables, or the respan-ai / keywordsai SDK","respan-mcp usage or a mcp.respan.ai server URL in MCP client config","README/docs naming Respan or Keywords AI for LLM logs, traces, or prompt management"],helpText:"Query LLM request logs, traces, prompts, and customer data from your Respan account using Respan's hosted MCP server and your Respan API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Respan API key Sazabi will send to Respan's hosted MCP endpoint.",body:"Create or copy an API key from the [Respan dashboard](https://platform.respan.ai/platform/api/api-keys), then paste it below. Sazabi stores it securely and sends it as the `Authorization: Bearer` token to Respan's MCP endpoint (`https://mcp.respan.ai/api/mcp`).",fieldKeys:["apiKey"]}],validateCredentials:dce,normalizeHeaders:uce,skill:"respan",setupSkill:"respan-setup"})});var pue;var gue=h(()=>{de();pue=U({id:"salesforce",label:"Salesforce",iconKey:"salesforce",defaultServerUrl:"https://api.salesforce.com/platform/mcp/v1/platform/sobject-all",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"salesforce",callbackPathSegment:"salesforce",authorizationUrl:"https://login.salesforce.com/services/oauth2/authorize",tokenUrl:"https://login.salesforce.com/services/oauth2/token"},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"mcp_api",label:"MCP API access",description:"Access Salesforce data and metadata (sObjects, Apex invocable actions, Flows) through the hosted MCP server. Salesforce hosted MCP External Client Apps require the MCP-specific `mcp_api` scope."},{value:"refresh_token",label:"Offline access",description:"Refresh the access token without requiring the user to re-authenticate.",required:!0}],capabilityOverrides:{allowWriteTools:!0},setupGroups:[{id:"external-client-app",title:"Register an External Client App in Salesforce",description:"Salesforce hosted MCP servers do not support automatic client registration. An admin must create an External Client App (ECA) in the org and enable it for the hosted MCP server.",body:["1. In Salesforce Setup, open **App Manager** and create a new **External Client App**.","2. Enable OAuth, add the **mcp_api** and **refresh_token (offline access)** scopes, and require PKCE.","3. Set the callback URL to the Sazabi Salesforce MCP callback URL shown on this page.","4. Enable the app for your hosted MCP server under **Setup → MCP Servers**.","5. Provide the generated **Consumer Key (Client ID)** and **Consumer Secret (Client Secret)** to your Sazabi deployment configuration."].join(`
|
|
8747
|
-
`)}],evidenceHints:["force.com / my.salesforce.com URLs, SALESFORCE_* or SFDC_* environment variables, or sf/sfdx CLI usage","jsforce, simple-salesforce, or @salesforce packages","README/runbooks naming Salesforce as the CRM or system of record"],helpText:"Query Salesforce data and metadata, and run Apex invocable actions and Flows exposed by a hosted MCP server. Coming soon — a Salesforce admin registers an External Client App in your org and Sazabi provisions its credentials, so it isn't self-serve connectable yet."})});var mue;var hue=h(()=>{de();mue=U({id:"secureframe",label:"Secureframe",iconKey:"secureframe",defaultServerUrl:"https://mcp.secureframe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"secureframe",callbackPathSegment:"secureframe",authorizationUrl:"https://mcp.secureframe.com/oauth/authorize",tokenUrl:"https://mcp.secureframe.com/oauth/token",resourceUrl:"https://mcp.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp.secureframe.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp",label:"MCP Access",description:"Query and manage Secureframe compliance data, controls, tests, vendors, risks, and framework requirements."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.secureframe.com"},{label:"United Kingdom (UK)",serverUrl:"https://mcp-uk.secureframe.com",authorizationUrl:"https://mcp-uk.secureframe.com/oauth/authorize",tokenUrl:"https://mcp-uk.secureframe.com/oauth/token",resourceUrl:"https://mcp-uk.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp-uk.secureframe.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["secureframe.com URLs, SECUREFRAME_API_KEY / SECUREFRAME_API_SECRET environment variables","SOC 2, ISO 27001, HIPAA, PCI DSS, GDPR, or NIST compliance frameworks and controls","README/docs or compliance runbooks naming Secureframe for automated compliance and continuous monitoring"],helpText:"Query and manage Secureframe compliance data, controls, automated tests, vendors, risks, and framework requirements. Choose the US or UK region when connecting.",skill:"secureframe",setupSkill:"secureframe-setup"})});var Aue;var fue=h(()=>{de();Aue=U({id:"sentry",label:"Sentry",iconKey:"sentry",defaultServerUrl:"https://mcp.sentry.dev/mcp",serverUrlPathSuffixMaxSegments:2,transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"sentry",callbackPathSegment:"sentry",authorizationUrl:"https://mcp.sentry.dev/oauth/authorize",tokenUrl:"https://mcp.sentry.dev/oauth/token",useServerUrlAsResource:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.sentry.dev/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"org:read"},{value:"project:write"},{value:"team:write"},{value:"event:write"}],getUrlConfiguration:async()=>({docsUrl:"https://mcp.sentry.dev/",instructions:"Copy the hosted MCP server URL below. Optional: to scope this connection to one organization or project, copy a path-scoped URL from the Sentry MCP page (e.g. .../mcp/your-org).",defaultServerUrl:"https://mcp.sentry.dev/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["@sentry packages, sentry.properties, SENTRY_* environment variables, or sentry-cli usage","Sentry.init calls, release/deploy automation, or Sentry alert docs","README/docs naming Sentry as the error tracking provider"],helpText:"Browse Sentry organizations, teams, projects, and events."})});var yue;var bue=h(()=>{_t();de();yue=U({id:"signoz",label:"SigNoz",iconKey:"signoz",defaultServerUrl:"https://mcp.us.signoz.cloud/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["SigNoz config, SIGNOZ_* environment variables, or signoz.io links","OpenTelemetry Collector exporting to SigNoz, or a signoz docker-compose / self-hosted deployment","README/docs naming SigNoz for metrics, logs, traces, alerts, or dashboards"],helpText:"Query SigNoz metrics, logs, traces, alerts, and dashboards to investigate production issues.",setupGroups:[{id:"instance",title:"Find your SigNoz instance",description:"Point Sazabi at the SigNoz instance whose telemetry you want to query.",body:"For SigNoz Cloud, use the regional MCP endpoint for your account, such as `https://mcp.us.signoz.cloud/mcp` (replace the region as needed). For self-hosted SigNoz, use your instance's MCP endpoint and set the SigNoz base URL below so the server knows which instance to target.",fieldKeys:["signozUrl"]},{id:"api-key",title:"Create an API key",description:"Create or copy the SigNoz API key Sazabi will send to SigNoz's MCP endpoint.",body:"In SigNoz, go to **Settings > API Keys** and create or copy an API key. Alert, dashboard, and notification-channel tools require an admin-level key. Paste it below.",fieldKeys:["apiKey"]}],validateCredentials:Yae,normalizeHeaders:Kae})});var Iue;var Sue=h(()=>{de();Iue=U({id:"slack",label:"Slack",iconKey:"slack",defaultServerUrl:"https://mcp.slack.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"slack",callbackPathSegment:"slack",authorizationUrl:"https://slack.com/oauth/v2_user/authorize",tokenUrl:"https://slack.com/api/oauth.v2.user.access"},getAvailableScopes:async()=>[{value:"search:read.public"},{value:"search:read.private"},{value:"search:read.mpim"},{value:"search:read.im"},{value:"search:read.files"},{value:"search:read.users"},{value:"canvases:read"},{value:"users:read"},{value:"users:read.email"}],getUrlConfiguration:async()=>null,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Slack app manifests, bot/webhook URLs, SLACK_* environment variables, or slack.com links","Runbooks that route incidents, alerts, or deploy notices through Slack","Code or docs naming Slack channels for operational triage"],helpText:"Browse Slack messages, files, and threads. Coming soon — requires backend OAuth plumbing for user_scope and isn't self-serve connectable yet.",skill:"slack",setupSkill:"slack-setup"})});var Cue;var vue=h(()=>{de();Cue=U({id:"stripe",label:"Stripe MCP",iconKey:"stripe",defaultServerUrl:"https://mcp.stripe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"stripe",callbackPathSegment:"stripe",authorizationUrl:"https://access.stripe.com/mcp/oauth2/authorize",tokenUrl:"https://access.stripe.com/mcp/oauth2/token",resourceUrl:"https://mcp.stripe.com",dynamicClientRegistration:{registrationEndpoint:"https://access.stripe.com/mcp/oauth2/register",tokenEndpointAuthMethod:"none"},defaultAccessTokenTtlSeconds:21600},getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Access the Stripe MCP server tools for the connected account.",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Stripe dashboard URLs, `sk_`/`rk_`/`pk_` API keys, or Stripe object IDs (cus_, pi_, ch_)","STRIPE_* environment variables or code that imports the `stripe` SDK","README/runbooks naming Stripe for billing, payments, or subscriptions"],helpText:"Query and manage Stripe payments, customers, and billing."})});var Eue;var wue=h(()=>{de();Eue=U({id:"supabase",label:"Supabase",iconKey:"supabase",defaultServerUrl:"https://mcp.supabase.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"supabase",callbackPathSegment:"supabase",authorizationUrl:"https://api.supabase.com/v1/oauth/authorize",tokenUrl:"https://api.supabase.com/v1/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://api.supabase.com/platform/oauth/apps/register",tokenEndpointAuthMethod:"client_secret_post"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"analytics:read"},{value:"auth:read"},{value:"auth:write"},{value:"database:read"},{value:"database:write"},{value:"domains:read"},{value:"domains:write"},{value:"edge_functions:read"},{value:"edge_functions:write"},{value:"environment:read"},{value:"environment:write"},{value:"organizations:read"},{value:"projects:read"},{value:"projects:write"},{value:"rest:read"},{value:"rest:write"},{value:"secrets:read"},{value:"secrets:write"},{value:"storage:read"}],getUrlConfiguration:async()=>({docsUrl:"https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool",instructions:"Choose your project and options in the Supabase configuration panel, then copy the generated Server URL.",defaultServerUrl:"https://mcp.supabase.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["supabase/ directory, supabase/config.toml, or @supabase packages","SUPABASE_* or NEXT_PUBLIC_SUPABASE_* environment variables","README/docs naming Supabase for Postgres, Auth, Storage, or Edge Functions"],helpText:"Manage Supabase organizations, projects, databases, and run SQL.",skill:"supabase",setupSkill:"supabase-setup"})});var kue;var xue=h(()=>{de();kue=U({id:"superhuman",label:"Superhuman",iconKey:"superhuman",defaultServerUrl:"https://mcp.mail.superhuman.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"superhuman",callbackPathSegment:"superhuman",authorizationUrl:"https://mcp.auth.mail.superhuman.com/oauth2/authorize",tokenUrl:"https://mcp.auth.mail.superhuman.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.auth.mail.superhuman.com/oauth2/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"email",required:!0},{value:"offline_access",required:!0},{value:"openid",required:!0},{value:"profile",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Superhuman mail links, SUPERHUMAN_* environment variables, or support workflows naming Superhuman","Customer communication runbooks that depend on email search or drafting","Docs naming Superhuman Mail for sales, support, or founder-led customer comms"],helpText:"Search, draft, send, and triage emails in Superhuman Mail."})});var Pue;var Rue=h(()=>{_t();de();Pue=U({id:"the-context-company",label:"The Context Company",iconKey:"the-context-company",defaultServerUrl:"https://api.thecontext.company/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!1},evidenceHints:["The Context Company, context company, or context observability references","insight_search, get_agent_runs, or get_agent_sessions tool usage","THE_CONTEXT_COMPANY_API_KEY or api.thecontext.company in MCP configuration"],helpText:"Query agent insights, runs, and sessions through The Context Company's read-only hosted MCP server.",setupGroups:[{id:"api-key",title:"Create a read-only API key",description:"Create the API key The Context Company's hosted MCP server will use.",body:"Generate a read-only API key on The Context Company's [Access Data page](https://www.thecontextcompany.com/prod/mcp-and-api), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:jae,normalizeHeaders:zae,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var Tue;var Bue=h(()=>{de();Tue=U({id:"vercel",label:"Vercel",iconKey:"vercel",defaultServerUrl:"https://mcp.vercel.com",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"vercel",callbackPathSegment:"vercel",authorizationUrl:"https://vercel.com/oauth/authorize",tokenUrl:"https://vercel.com/api/login/oauth/token",resourceUrl:"https://mcp.vercel.com",dynamicClientRegistration:{registrationEndpoint:"https://vercel.com/api/login/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["vercel.com links, VERCEL_* environment variables, or a vercel.json in the repo","Deploy workflows or runbooks naming Vercel as the frontend/hosting provider","Vercel project/deployment IDs or preview URLs referenced in docs or CI"],helpText:"Manage Vercel projects, deployments, and access Vercel platform documentation. Coming soon — Vercel's hosted MCP only authorizes allowlisted clients and Sazabi is pending approval, so it isn't connectable yet."})});var Oue;var _ue=h(()=>{_t();de();Oue=U({id:"x",label:"X",iconKey:"x",defaultServerUrl:"https://api.x.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["search_news","get_news","get_trends_by_woeid","get_posts_by_ids","get_posts_counts_recent","search_posts_all","get_posts_by_id","get_posts_liking_users","get_posts_quoted_posts","get_posts_reposted_by","get_users_by_usernames","get_users_by_username","get_users_me","search_users","get_users_by_id","get_users_bookmarks","get_users_bookmark_folders","get_users_bookmarks_by_folder_id","get_users_mentions","get_users_timeline","get_users_posts"]},evidenceHints:["X (Twitter) API usage, X_BEARER_TOKEN, or TWITTER_* environment variables","twitter-api-v2, tweepy, or other X/Twitter API client packages","README/docs naming the X API, X Developer Platform, or tweet automation"],helpText:"Search X posts and access real-time X data using your app's app-only Bearer Token.",setupGroups:[{id:"developer-app",title:"Open the X Developer Portal",description:"Use an X developer project/app with access to the X API v2.",body:"Go to the [X Developer Portal](https://developer.x.com/en/portal/dashboard), open the project and app you want Sazabi to use, and confirm the app has access to the API tiers you need. The hosted MCP server lives at `https://api.x.com/mcp`."},{id:"bearer-token",title:"Copy the app's Bearer Token",description:"Copy the app-only Bearer Token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, find the app-only **Bearer Token** and copy it (regenerate it if you don't have it saved). This is the app-only token, not a user OAuth 2.0 access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:Uae,normalizeHeaders:Mae,skill:"x",setupSkill:"x-setup"})});var Que,lLt;var Lue=h(()=>{Cce();Ece();kce();Pce();Tce();eS();eS();_ce();Qce();Nce();zce();Uce();$ce();Hce();Vce();Yce();Jce();Xce();tle();ole();ile();ale();lle();dle();gle();hle();fle();ble();Sle();vle();wle();xle();Rle();Ble();_le();Qle();Nle();zle();Ule();$le();Hle();Vle();Yle();Jle();Xle();tue();oue();iue();aue();lue();due();gue();hue();fue();bue();Sue();vue();wue();xue();Rue();Bue();_ue();Que=[Eue,rle,sle,vce,Sce,wce,xce,Rce,Bce,Oce,Dce,Lce,Mce,jce,Fce,qce,Kce,Wce,Zce,Gce,ele,nle,cle,ule,ple,mle,Ale,yle,Ile,Cle,Ele,kle,Ple,Tle,Ole,Dle,Lle,Mle,jle,Fle,Gle,qle,Kle,Wle,Zle,eue,nue,sue,rue,cue,uue,pue,mue,Aue,yue,Iue,Cue,kue,Pue,Tue,Oue],lLt=new Map(Que.map((e)=>[e.id,e]))});var Nue=()=>{};var Mue=()=>{};var zue=()=>{};var jue=()=>{};var Uue=()=>{};var Fue=()=>{};var $ue=()=>{};var Gue=()=>{};var Hue=()=>{};var que=()=>{};var Vue=()=>{};var Kue=()=>{};var Yue=()=>{};var Wue=()=>{};var Jue=()=>{};var Zue=()=>{};var Xue=()=>{};var ede=()=>{};var tde=()=>{};var nde=()=>{};var ode=()=>{};var rde=()=>{};var ide=()=>{};var sde=()=>{};var ade=()=>{};var cde=()=>{};var lde=()=>{};var ude=()=>{};var dde=()=>{};var pde=()=>{};var gde=()=>{};var mde=()=>{};var hde=()=>{};var Ade=()=>{};var fde=()=>{};var yde=()=>{};var bde=()=>{};var Ide=()=>{};var Sde=()=>{};var Cde=()=>{};var vde=()=>{};var Ede=()=>{};var wde=()=>{};var kde=()=>{};var xde=h(()=>{Nue();Mue();zue();jue();Uue();Fue();$ue();Gue();Hue();que();Vue();Kue();Yue();Wue();Jue();Zue();Xue();ede();tde();nde();ode();rde();ide();sde();ade();cde();lde();ude();dde();pde();gde();mde();hde();Ade();fde();yde();bde();Ide();Sde();Cde();vde();Ede();wde();kde()});var Pde=h(()=>{eS()});var Rde=()=>{};var Tde=h(()=>{ZY();Jf();Tae();_t();hce();Ace();Lue();dN();xde();Pde();Rde()});var Bde,B3e,Ode,O3e,_de,pN,Dde,Qde,Is,Lde,Nde,Mde,fu,zde,jde,yu,Ude,Fde,bu,$de,_3e,Gde,tS,Hde,qde,Vde,Kde,Iu,Yde,Wde,Su,Jde,Zde,Cu,gN,mN,Xde,epe,vu,tpe,npe,Eu,ope,D3e,wu,rpe,ipe,ku,spe,ape,xu,cpe,lpe,Pu,Q3e;var hN=h(()=>{Tde();De();Ve();Bde=["configured","authorizing","connected","error"],B3e=a.enum(Bde),Ode=["preset","custom"],O3e=a.enum(Ode),_de=["streamable-http","sse"],pN=a.enum(_de),Dde=["none","headers","oauth","aws-sigv4"],Qde=a.enum(Dde),Is=a.object({connectionId:a.string().uuid().describe("Connection ID."),connectionKey:a.string().describe("Stable key used to reference this connector in tool calls."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),source:O3e.describe("Whether the connector is a built-in preset or a custom server."),installStatus:B3e.describe("Current connection lifecycle status."),authMode:Qde.describe("Authentication mode."),transport:pN.describe("Transport protocol."),serverUrl:a.string().describe("MCP server URL."),readOnly:a.boolean().describe("Whether the connector is restricted to read-only tools."),management:vB.describe("Lifecycle owner and supported connector mutations."),enabledToolCount:a.number().int().nonnegative().describe("Number of tools enabled and available for this connector."),connectedAt:a.string().datetime().nullable().describe("When the connector last became connected, if ever."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Lde=a.object({name:a.string().describe("Tool name as invoked."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),enabled:a.boolean().describe("Whether the tool is enabled and available given the connector config.")}),Nde=a.object({projectId:a.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:a.union([a.boolean(),a.stringbool()]).optional().describe("When true, only return connectors that are connected.")}),Mde=a.object({connectors:a.array(Is)}),fu=E({operationId:"mcpConnectors.list",description:"List configured MCP connectors within one project with provider, status, and enabled-tool count.",backend:"api",route:{method:"GET",path:"/mcp-connectors",tags:["MCP Connectors"]},input:Nde,output:Mde,pagination:"none",async:"sync"}),zde=a.object({connectionId:a.string().uuid().describe("Connection ID to fetch."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),jde=a.object({connector:Is}),yu=E({operationId:"mcpConnectors.get",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:zde,output:jde,pagination:"none",async:"sync"}),Ude=a.object({connectionId:a.string().uuid().describe("Connection ID to inspect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),Fde=a.object({connector:Is,tools:a.array(Lde)}),bu=E({operationId:"mcpConnectors.details",description:"Inspect one MCP connector's tool surface, including each tool's name, description, and read-only status.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}/details",tags:["MCP Connectors"]},input:Ude,output:Fde,pagination:"none",async:"sync"}),$de=a.object({providerId:a.string().describe('Provider identifier, e.g. "linear".'),label:a.string().describe("Human-readable provider name."),authMode:Qde.describe("Authentication mode."),availability:a.enum(Xc).describe("Whether the provider is enabled or coming soon."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),_3e=a.object({}),Gde=a.object({providers:a.array($de)}),tS=E({operationId:"mcpConnectors.listProviders",description:"List all supported MCP connector providers with their auth mode and setup skill.",backend:"api",route:{method:"GET",path:"/mcp-connectors/providers",tags:["MCP Connectors"]},input:_3e,output:Gde,pagination:"none",async:"sync"}),Hde=a.object({connectionKey:a.string().describe("Stable key used to call this connector."),displayName:a.string().describe("Human-readable connector name."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),toolCount:a.number().int().nonnegative().describe("Number of executable tools on this connector.")}),qde=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),description:a.string().describe("Tool description from the stored snapshot."),score:a.number().describe("BM25 rank score. Zero when enumerating a namespace."),inputSchema:a.record(a.string(),a.unknown()).optional().describe("JSON Schema for the tool's arguments, when requested.")}),Vde=a.object({projectId:a.string().uuid().optional().describe("Project to search connectors in. Auto-filled from SDK context when omitted."),query:a.string().optional().describe("Free-text query over tool names, titles, connector keys, and descriptions. Omit or empty to list connectors, or to enumerate one connector when namespace is set."),namespace:a.string().min(1).optional().describe("Restrict results to one connectionKey or providerId."),limit:a.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of connectors or tool hits to return."),offset:a.coerce.number().int().min(0).default(0).describe("Number of connectors or tool hits to skip."),includeInputSchema:a.union([a.boolean(),a.stringbool()]).optional().describe("When true, tool hits include inputSchema so a caller can execute without a describe round-trip.")}),Kde=a.object({kind:a.enum(["connectors","tools"]).describe("connectors when the query is empty and no namespace is set; tools otherwise."),total:a.number().int().nonnegative().describe("Total matches before limit and offset."),connectors:a.array(Hde).describe("Connector index. Empty when kind is tools."),tools:a.array(qde).describe("Ranked or enumerated tool hits. Empty when kind is connectors.")}),Iu=E({operationId:"mcpConnectors.search",description:"Search executable third-party MCP connector tools by free-text query. Empty query lists connectors; empty query plus namespace enumerates that connector. Hits omit input schemas unless includeInputSchema is true.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/search",tags:["MCP Connectors"]},input:Vde,output:Kde,pagination:"none",async:"sync"}),Yde=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked.")}),Wde=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description from the stored snapshot."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),inputSchema:a.record(a.string(),a.unknown()).describe("JSON Schema for the tool's arguments.")}),Su=E({operationId:"mcpConnectors.describe",description:"Load one executable third-party MCP connector tool, including its input schema.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/describe",tags:["MCP Connectors"]},input:Yde,output:Wde,pagination:"none",async:"sync"}),Jde=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked."),arguments:a.record(a.string(),a.unknown()).optional().describe("Arguments matching the tool's input schema.")}),Zde=a.discriminatedUnion("ok",[a.object({ok:a.literal(!0),connectionKey:a.string().describe("Connector that ran the tool."),toolName:a.string().describe("Tool name as invoked."),result:a.unknown().describe("Vendor tool result payload."),structuredContent:a.unknown().optional().describe("Structured content from the vendor when present."),content:a.array(a.record(a.string(),a.unknown())).describe("Raw MCP content parts from the vendor."),text:a.string().nullable().describe("Concatenated text content, if any.")}),a.object({ok:a.literal(!1),code:a.enum(["TOOL_NOT_ENABLED","READ_ONLY","MCP_ERROR"]).describe("Why the tool did not run."),message:a.string().describe("Caller-facing error message.")})]),Cu=E({operationId:"mcpConnectors.call",description:"Invoke one executable third-party MCP connector tool using that connection's stored credential.",backend:"api",route:{method:"POST",path:"/mcp-connectors/tools/call",tags:["MCP Connectors"]},input:Jde,output:Zde,pagination:"none",async:"sync"}),gN=a.object({id:a.string().min(1).describe("Stable ID for this header (must be unique within the connector)."),name:a.string().trim().min(1).describe("HTTP header name."),value:a.string().min(1).describe("HTTP header value (passed verbatim).")}),mN=a.object({accessKeyId:a.string().trim().min(1).describe("AWS access key ID."),secretAccessKey:a.string().min(1).describe("AWS secret access key."),sessionToken:a.string().min(1).optional().describe("Optional session token for temporary credentials."),region:a.string().trim().min(1).describe("AWS region.")}),Xde=a.object({projectId:a.string().uuid().optional().describe("Project to create the connector in. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().describe("MCP server URL (must be https)."),transport:pN.describe("Transport protocol."),headers:a.array(gN).optional().describe("HTTP headers to send with each request."),awsSigV4:mN.optional().describe("AWS SigV4 credentials for AWS MCP servers."),providerId:a.string().min(1).describe("Built-in preset provider ID (for example, linear or datadog)."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools. Defaults to false.")}),epe=a.object({connector:Is}),vu=E({operationId:"mcpConnectors.create",description:"Create a preset MCP connector with header-based or AWS SigV4 authentication. The server URL must match the selected provider's supported endpoints. Connects immediately and returns the connector with its discovered tool snapshot.",backend:"api",route:{method:"POST",path:"/mcp-connectors",tags:["MCP Connectors"],successStatus:201},input:Xde,output:epe,pagination:"none",async:"sync"}),tpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().optional().describe("New MCP server URL."),transport:pN.optional().describe("New transport protocol."),headers:a.array(gN).optional().describe("Complete replacement header set. Replaces all existing headers."),awsSigV4:mN.optional().describe("Replacement AWS SigV4 credentials. Mutually exclusive with headers.")}),npe=a.object({connector:Is}),Eu=E({operationId:"mcpConnectors.update",description:"Deprecated. Preset MCP connector updates are no longer supported via the public API; disconnect and reconnect instead.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:tpe,output:npe,pagination:"none",async:"sync"}),ope=a.object({connectionId:a.string().uuid().describe("Connection ID to disconnect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),D3e=a.void(),wu=E({operationId:"mcpConnectors.disconnect",description:"Disconnect and permanently remove an MCP connector.",backend:"api",route:{method:"DELETE",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"],successStatus:204},input:ope,output:D3e,pagination:"none",async:"sync"}),rpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),readOnly:a.boolean().describe("True to restrict to read-only tools; false to allow all enabled tools.")}),ipe=a.object({connector:Is}),ku=E({operationId:"mcpConnectors.setReadOnly",description:"Toggle the read-only restriction on an MCP connector.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}/read-only",tags:["MCP Connectors"]},input:rpe,output:ipe,pagination:"none",async:"sync"}),spe=a.object({projectId:a.string().uuid().optional().describe("Project to install into. Auto-filled from SDK context when omitted."),providerId:a.string().min(1).describe('Provider ID to install, e.g. "linear".'),requestedScopes:a.array(a.string()).optional().describe("Scopes to request. Defaults to the provider's recommended scope set."),serverUrl:a.string().url().optional().describe("Server URL for multi-region providers; defaults to the provider's primary server."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools after install. Defaults to false."),returnTo:a.string().optional().describe("Path to redirect the user to after OAuth completes.")}),ape=a.object({authorizationUrl:a.string().describe("Authorization URL to open in the user's browser."),connectionId:a.string().uuid().describe("Connection ID to poll for completion via getMcpOAuthInstallAttempt."),expiresAt:a.string().datetime().describe("When the OAuth authorization attempt expires.")}),xu=E({operationId:"mcpConnectors.beginOAuthInstall",description:"Begin an OAuth browser flow to install a preset MCP connector. Opens an authorization URL in the user's browser; poll getMcpOAuthInstallAttempt with the returned connectionId to check completion.",backend:"api",route:{method:"POST",path:"/mcp-connectors/oauth/begin",tags:["MCP Connectors"],successStatus:201},input:spe,output:ape,pagination:"none",async:"sync"}),cpe=a.object({connectionId:a.string().uuid().describe("Connection ID returned by beginMcpOAuthInstall."),projectId:a.string().uuid().optional().describe("Project the connection belongs to. Auto-filled from SDK context when omitted.")}),lpe=a.object({status:a.enum(["authorizing","connected","error"]).describe("Current install status."),connector:Is.optional().describe("Connector details once connected or in error state.")}),Pu=E({operationId:"mcpConnectors.getOAuthInstallAttempt",description:"Poll the status of an in-progress OAuth MCP connector install. Returns authorizing while the user completes the browser flow, connected on success, or error on failure.",backend:"api",route:{method:"GET",path:"/mcp-connectors/oauth/attempts/{connectionId}",tags:["MCP Connectors"]},input:cpe,output:lpe,pagination:"none",async:"sync"}),Q3e={list:fu.contract,get:yu.contract,details:bu.contract,listProviders:tS.contract,search:Iu.contract,describe:Su.contract,call:Cu.contract,create:vu.contract,update:Eu.contract,disconnect:wu.contract,setReadOnly:ku.contract,beginOAuthInstall:xu.contract,getOAuthInstallAttempt:Pu.contract}});var Ss,L3e,N3e,M3e,z3e,j3e,U3e,F3e,AN,Jzt;var nS=h(()=>{De();Ve();Ss=a.enum(["admin","member"]),L3e=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional(),role:Ss}),N3e=a.object({id:a.string().min(1),name:a.string().nullable(),email:a.string().email()}),M3e=a.object({credentialType:a.literal("user"),user:N3e,authorizedOrganizationId:a.string().min(1).nullable(),authorizedProjectId:a.string().min(1).nullable(),organizations:a.array(L3e).describe("Organizations the user belongs to, including membership role.")}),z3e=a.object({credentialType:a.literal("secret"),organization:a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),keyName:a.string()}),j3e=a.object({credentialType:a.literal("partner"),superorganization:a.object({id:a.string().uuid(),name:a.string()})}),U3e=a.object({}),F3e=a.discriminatedUnion("credentialType",[M3e,z3e,j3e]),AN=E({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:U3e,output:F3e,pagination:"none",async:"sync"}),Jzt=AN.contract});var upe,dpe,ppe,$3e,G3e,H3e,q3e,V3e,K3e,fN,yN,bN,Y3e,W3e,J3e,Z3e,X3e,e9e,IN,SN,CN,njt;var gpe=h(()=>{De();Ve();nS();upe=a.object({membershipId:a.string().min(1).describe("Organization membership record ID."),userId:a.string().min(1).describe("User ID for the organization member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),imageUrl:a.string().nullable().describe("Profile image URL for the member, when available."),role:Ss.describe("Organization role."),createdAt:a.string().datetime().describe("When the membership was created.")}),dpe=a.object({id:a.string().min(1).describe("Invitation ID."),email:a.string().email().describe("Invited email address."),role:Ss.describe("Role the invitee will receive when they accept."),status:a.string().min(1).describe('Invitation status (e.g. "pending").'),createdAt:a.string().datetime().describe("When the invitation was created."),expiresAt:a.string().datetime().describe("When the invitation expires.")}),ppe=a.string().min(1).describe("A user ID, or a URL-encoded email address, of the member."),$3e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),G3e=a.object({members:a.array(upe).describe("Members visible within the selected organization.")}),H3e=a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),member:ppe.describe("User ID, or URL-encoded email address, of the member to update."),role:Ss.describe("Role to assign.")}),q3e=a.object({member:upe.describe("Updated organization member.")}),V3e=a.object({params:a.object({member:ppe.describe("User ID, or URL-encoded email address, of the member to remove.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),K3e=a.object({removedUserId:a.string().min(1).describe("User ID removed from the organization.")}),fN=E({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:$3e,output:G3e,pagination:"none",async:"sync",examples:[{name:"organization-members",input:{organizationId:"organization-123"},output:{members:[{membershipId:"membership-123",userId:"user-123",name:"Alex Admin",email:"alex@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}]}}]}),yN=E({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{member}/role",tags:["Members"]},input:H3e,output:q3e,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",member:"user-456",role:"admin"},output:{member:{membershipId:"membership-456",userId:"user-456",name:"Mina Member",email:"mina@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}}}]}),bN=E({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{member}",tags:["Members"],inputStructure:"detailed"},input:V3e,output:K3e,pagination:"none",async:"sync"}),Y3e=a.object({organizationId:a.string().min(1).optional().describe("Organization to invite into. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),email:a.string().email().describe("Email address to invite."),role:Ss.optional().default("member").describe('Role to grant on acceptance. Defaults to "member".')}),W3e=a.object({invitation:dpe.describe("The created pending invitation.")}),J3e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list invitations for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),Z3e=a.object({invitations:a.array(dpe).describe("Pending invitations visible within the selected organization.")}),X3e=a.object({params:a.object({invitationId:a.string().min(1).describe("ID of the invitation to revoke.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the invitation. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),e9e=a.object({revokedInvitationId:a.string().min(1).describe("ID of the revoked invitation.")}),IN=E({operationId:"members.invite",description:"Invite a person to the organization by email.",backend:"api",route:{method:"POST",path:"/members/invitations",tags:["Members"],successStatus:201},input:Y3e,output:W3e,pagination:"none",async:"sync",examples:[{name:"invite-member",input:{organizationId:"organization-123",email:"newhire@example.com",role:"member"},output:{invitation:{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}}}]}),SN=E({operationId:"members.listInvitations",description:"List pending invitations for an organization.",backend:"api",route:{method:"GET",path:"/members/invitations",tags:["Members"]},input:J3e,output:Z3e,pagination:"none",async:"sync",examples:[{name:"organization-invitations",input:{organizationId:"organization-123"},output:{invitations:[{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}]}}]}),CN=E({operationId:"members.revokeInvitation",description:"Revoke a pending invitation.",backend:"api",route:{method:"DELETE",path:"/members/invitations/{invitationId}",tags:["Members"],inputStructure:"detailed"},input:X3e,output:e9e,pagination:"none",async:"sync"}),njt={list:fN.contract,updateRole:yN.contract,remove:bN.contract,invite:IN.contract,listInvitations:SN.contract,revokeInvitation:CN.contract}});var hpe,Ape,oS,fpe,rS,mpe=4194304,vN,EN,t9e=(e)=>{let t=e.split(",").map((r)=>r.trim()).filter(Boolean),n=a.array(oS).safeParse(t);if(!n.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return n.data},lm,wN,kN,ype,bpe,Ipe,Spe,Cpe,vpe,Epe,wpe,kpe,xpe,Ppe,Rpe,Ru,Tu,Bu,Ou,_u,n9e;var xN=h(()=>{De();Ve();hpe=["note","runbook"],Ape=["note","runbook","change"],oS=a.enum(Ape),fpe=a.enum(hpe),rS=a.string().min(1).max(512).refine((e)=>!e.startsWith("/"),{message:"Path must be relative without a leading slash."}).describe("Relative memory path, for example AGENTS.md or notes/architecture.md."),vN=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=mpe,{message:`Memory body must be at most ${mpe} bytes (4 MiB).`}).describe("Document body stored in project memory."),EN=a.string().regex(/^(\d+)(s|m|h|d)$/u,"Duration must use s, m, h, or d units, for example 7d or 30m.").describe("Relative time window, for example 7d or 30m."),lm=a.string().min(1).transform(t9e).describe("Comma-separated kinds, for example note,runbook."),wN=a.object({id:a.string().uuid(),projectId:a.string().uuid(),kind:oS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),contentHash:a.string(),attrs:a.record(a.string(),a.unknown()),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),kN=wN.extend({body:vN}),ype=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:rS.describe("Relative path for the curated document."),body:vN,kind:fpe.default("note").describe("Curated document kind. Only note and runbook may be written through the API."),title:a.string().max(500).optional().describe("Optional display title. Defaults to the path basename.")}),bpe=a.object({document:kN}),Ipe=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:rS.optional().describe("Relative curated path.")}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),Spe=a.object({document:kN}),Cpe=a.object({projectId:a.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:lm.optional(),since:EN.optional().describe("Only return documents updated within this window, for example 7d."),service:a.string().min(1).optional().describe("Filter to documents whose attrs.services contains this value."),pathPrefix:a.string().min(1).optional().describe("Filter to paths starting with this prefix."),managed:a.coerce.boolean().optional(),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of documents to return per page.")}),vpe=a.object({documents:a.array(wN),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),Epe=a.object({documentId:a.string().uuid(),kind:oS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),snippet:a.string(),score:a.number()}),wpe=a.object({calibrated:a.literal(!0),minScoreThreshold:a.number(),queryTerms:a.array(a.string()),message:a.string()}),kpe=a.object({projectId:a.string().uuid().optional().describe("Project to search memory for. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1).max(500).describe("Natural-language search query."),kind:lm.optional(),since:EN.optional(),service:a.string().min(1).optional(),pathPrefix:a.string().min(1).optional(),managed:a.coerce.boolean().optional(),limit:a.coerce.number().int().min(1).max(50).default(10).describe("Maximum ranked search hits to return.")}),xpe=a.object({hits:a.array(Epe),emptyVerdict:wpe.nullable()}),Ppe=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:rS.optional()}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),Rpe=a.void(),Ru=E({operationId:"memory.put",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:ype,output:bpe,pagination:"none",async:"sync"}),Tu=E({operationId:"memory.get",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:Ipe,output:Spe,pagination:"none",async:"sync"}),Bu=E({operationId:"memory.list",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:Cpe,output:vpe,pagination:"cursor",async:"sync"}),Ou=E({operationId:"memory.search",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:kpe,output:xpe,pagination:"none",async:"sync"}),_u=E({operationId:"memory.delete",description:"Soft-delete a curated project memory document by id or path.",backend:"api",route:{method:"DELETE",path:"/memory/document",successStatus:204,tags:["Memory"]},input:Ppe,output:Rpe,pagination:"none",async:"sync"}),n9e={put:Ru.contract,get:Tu.contract,list:Bu.contract,search:Ou.contract,delete:_u.contract}});var Tpe,Bpe,o9e,r9e,i9e,s9e,a9e,um,c9e,l9e,u9e,PN,RN,TN,BN,ljt;var iS=h(()=>{De();Ve();Tpe=a.enum(["processing","completed","aborted","error"]),Bpe=a.object({id:a.string().uuid(),threadId:a.string().uuid(),userMessageId:a.string().uuid().nullable(),assistantMessageId:a.string().uuid().nullable(),parentRunId:a.string().uuid().nullable(),workflowRunId:a.string().nullable(),status:Tpe,source:a.enum(["app","api","mcp","slack","teams","linear","github","agent","cli","web","sdk","bitbucket","system"]),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),completedAt:a.string().datetime().nullable()}),o9e=a.object({projectId:a.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),r9e=a.object({runs:a.array(Bpe),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),i9e=a.object({threadId:a.string().uuid().describe("Thread ID to list runs for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),s9e=a.object({runs:a.array(Bpe),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),a9e=a.object({runId:a.string().uuid().describe("Run ID returned by a deferred operation.")}),um=a.object({completed:a.boolean().describe("Whether the run has reached a terminal status."),threadId:a.string().uuid().describe("Thread ID associated with the run."),runId:a.string().uuid().describe("Run ID for subsequent polling."),messageId:a.string().uuid().optional().describe("ID of the user message that triggered this run."),status:Tpe.describe("Current run lifecycle status."),response:a.string().nullable().describe("Assistant response text when the run has completed.")}),c9e=um.describe("Current run state and, when complete, the assistant response."),l9e=a.object({runId:a.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),u9e=a.object({success:a.literal(!0).describe("Always true when the cancellation request was accepted.")}),PN=E({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:o9e,output:r9e,pagination:"cursor",async:"sync"}),RN=E({operationId:"runs.listForThread",summary:"List Runs for a Thread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:i9e,output:s9e,pagination:"cursor",async:"sync"}),TN=E({operationId:"runs.get",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:a9e,output:c9e,pagination:"none",async:"sync",examples:[{name:"processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),BN=E({operationId:"runs.cancel",description:"Request cancellation of an in-flight run. Idempotent and best-effort: returns success even when the run has already reached a terminal status.",backend:"api",route:{method:"POST",path:"/runs/{runId}/cancel",tags:["Runs"]},input:l9e,output:u9e,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),ljt={list:PN.contract,listForThread:RN.contract,get:TN.contract,cancel:BN.contract}});var sS=(e,t,n)=>{let r=t?20000:1e4;if(e.length>r)n.addIssue({code:"too_big",maximum:r,type:"string",inclusive:!0,message:`Message cannot exceed ${r} characters`,origin:"string",path:["message"]})},aS=(e,t,n)=>{if(e&&!t)n.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var Ope,dm,d9e,p9e,g9e,m9e,h9e,A9e,f9e,y9e,b9e,ON,I9e,S9e,C9e,v9e,E9e,w9e,k9e,x9e,P9e,R9e,T9e,B9e,_N,DN,QN,LN,NN,MN,_pe,O9e,_9e,D9e,Q9e,Dpe,L9e,N9e,M9e,z9e,j9e,U9e,Fa="22222222-2222-4222-8222-222222222222",Qpe="11111111-1111-4111-8111-111111111111",F9e="44444444-4444-4444-8444-444444444444",Lpe="55555555-5555-4555-8555-555555555555",zN,jN,UN,FN,$N,Ajt;var GN=h(()=>{De();Ve();iS();Ope=a.enum(["slack","teams","linear","github","app","mcp","agent","api","cli","web","sdk","bitbucket","system"]),dm=a.object({id:a.string().uuid(),projectId:a.string().uuid(),title:a.string().nullable(),status:a.enum(["regular","archived"]),source:Ope.nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),d9e=a.object({type:a.literal("message"),message:a.string()}),p9e=a.object({type:a.literal("reasoning"),reasoning:a.string(),status:a.enum(["in_progress","complete"]).optional()}),g9e=a.object({type:a.literal("tool_call"),name:a.string(),params:a.any().optional(),result:a.any().optional(),status:a.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:a.string().optional(),durationMs:a.number().nonnegative().optional()}),m9e=a.object({type:a.literal("artifact"),name:a.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card","mdx"]),data:a.any(),toolCallId:a.string().optional()}),h9e=a.object({type:a.literal("fork"),sourceThreadId:a.string(),sourceMessageId:a.string(),sourceThreadTitle:a.string().nullable()}),A9e=a.object({type:a.literal("summary"),summary:a.string()}),f9e=a.object({type:a.literal("slack_context"),channelId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({timestamp:a.string(),slackUserId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),files:a.array(a.object({name:a.string(),mimetype:a.string(),size:a.number().optional(),attachmentId:a.string().uuid().optional(),ingestionStatus:a.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),y9e=a.object({type:a.literal("teams_context"),conversationId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({activityId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),createdDateTime:a.string().optional()}))}),b9e=a.union([d9e,p9e,g9e,m9e,h9e,A9e,f9e,y9e]),ON=a.object({id:a.string().uuid(),role:a.enum(["user","assistant"]),content:a.array(b9e),source:Ope,createdAt:a.string().datetime()}),I9e=a.object({projectId:a.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:a.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),S9e=a.object({threads:a.array(dm).describe("The page of threads matching the query."),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),C9e=a.object({threadId:a.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),v9e=a.object({thread:dm.describe("The requested thread."),messages:a.array(ON).describe("Messages currently stored on the thread in chronological order.")}),E9e=a.object({projectId:a.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:a.string().min(1,"Message cannot be empty").describe("Initial user message that starts the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{sS(e.message,e.automationId,t),aS(e.ambientServiceRun,e.automationId,t)}),w9e=um.describe("Deferred run result for creating a thread."),k9e=a.object({threadId:a.string().uuid().describe("Thread ID whose current processing status should be returned.")}),x9e=a.object({status:a.enum(["idle","processing"]),lastRunStatus:a.enum(["error"]).nullable()}),P9e=a.object({threadId:a.string().uuid().describe("Thread ID whose active run should be stopped.")}),R9e=a.object({success:a.literal(!0).describe("Always true when the stop request was accepted.")}),T9e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),status:a.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),B9e=a.object({thread:dm.describe("The updated thread.")}),_N=E({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:I9e,output:S9e,pagination:"cursor",async:"sync",examples:[{name:"active-threads",input:{projectId:"11111111-1111-4111-8111-111111111111",status:"regular",limit:10},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),DN=E({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:C9e,output:v9e,pagination:"none",async:"sync"}),QN=E({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:k9e,output:x9e,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),LN=E({operationId:"threads.stop",description:"Stop a thread's in-flight run. Idempotent and best-effort: returns success even when the thread has no active run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/stop",tags:["Threads"]},input:P9e,output:R9e,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),NN=E({operationId:"threads.create",description:"Create a thread with an initial message and optionally wait for the agent response.",backend:"api",route:{method:"POST",path:"/threads",tags:["Threads"],successStatus:201},input:E9e,output:w9e,pagination:"none",async:"deferred",examples:[{name:"async-handoff",input:{projectId:"11111111-1111-4111-8111-111111111111",message:"Investigate elevated 500s in production.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),MN=E({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:T9e,output:B9e,pagination:"none",async:"sync",examples:[{name:"archive-thread",input:{threadId:"22222222-2222-4222-8222-222222222222",status:"archived"},output:{thread:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"archived",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),_pe=a.enum(["private","organization"]),O9e=a.object({threadId:a.string().uuid().describe("Thread ID of the source thread to fork."),messageId:a.string().uuid().describe("Message ID in the source thread to fork from. The new thread copies messages up to and including this message.")}),_9e=a.object({thread:dm.describe("The newly created forked thread.")}),D9e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),visibility:_pe.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),Q9e=a.object({thread:dm.describe("The updated thread."),visibility:_pe.describe("The thread's resulting visibility.")}),Dpe=a.object({shareId:a.string().uuid().describe("Unique identifier for the snapshot."),threadId:a.string().uuid().describe("Thread the snapshot was taken from."),url:a.string().describe("Public read-only URL for the snapshot."),createdAt:a.string().datetime()}),L9e=a.object({threadId:a.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),N9e=a.object({share:Dpe.describe("The created share link.")}),M9e=a.object({threadId:a.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:a.string().uuid().describe("Snapshot ID to revoke.")}),z9e=a.void(),j9e=a.object({threadId:a.string().uuid().describe("Thread ID to list public snapshots for.")}),U9e=a.object({shares:a.array(Dpe).describe("Active share links for the thread.")}),zN=E({operationId:"threads.fork",description:"Fork a thread from a specific message, creating a new thread that copies messages up to that point.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/fork",tags:["Threads"],successStatus:201},input:O9e,output:_9e,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:Fa,messageId:F9e},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:Qpe,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),jN=E({operationId:"threads.setVisibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:D9e,output:Q9e,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:Fa,visibility:"private"},output:{thread:{id:Fa,projectId:Qpe,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),UN=E({operationId:"threads.createShareLink",description:"Create a public read-only share link for a thread's current messages.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/share",tags:["Threads"],successStatus:201},input:L9e,output:N9e,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:Fa},output:{share:{shareId:Lpe,threadId:Fa,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),FN=E({operationId:"threads.listShareLinks",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:j9e,output:U9e,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:Fa},output:{shares:[{shareId:Lpe,threadId:Fa,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),$N=E({operationId:"threads.revokeShareLink",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:M9e,output:z9e,pagination:"none",async:"sync"}),Ajt={list:_N.contract,get:DN.contract,getStatus:QN.contract,stop:LN.contract,create:NN.contract,update:MN.contract,fork:zN.contract,setVisibility:jN.contract,createShareLink:UN.contract,listShareLinks:FN.contract,revokeShareLink:$N.contract}});var $9e,G9e,H9e,q9e,Npe,Mpe;var zpe=h(()=>{De();Ve();iS();GN();$9e=a.object({threadId:a.string().uuid().describe("Thread ID to list messages for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),G9e=a.object({messages:a.array(ON),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),H9e=a.object({threadId:a.string().uuid().describe("Thread ID to append the message to."),message:a.string().min(1,"Message cannot be empty").describe("Message body to append to the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{sS(e.message,e.automationId,t),aS(e.ambientServiceRun,e.automationId,t)}),q9e=um.describe("Deferred run result for appending a message to an existing thread."),Npe=E({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:$9e,output:G9e,pagination:"cursor",async:"sync",examples:[{name:"thread-messages",input:{threadId:"22222222-2222-4222-8222-222222222222",limit:2},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",role:"user",content:[{type:"message",message:"What changed in the intake pipeline?"}],source:"api",createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Mpe=E({operationId:"messages.append",description:"Append a user message to an existing thread and trigger a deferred run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/messages",successStatus:201,tags:["Messages"]},input:H9e,output:q9e,pagination:"none",async:"deferred",examples:[{name:"append-processing",input:{threadId:"22222222-2222-4222-8222-222222222222",message:"Follow up on the intake backlog.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]})});var ho,Upe,HN,Du,qN,cS,Cs,Fpe,jpe;var pm=h(()=>{De();ho={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",MICROSOFT_TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},Upe=[ho.IN_APP,ho.SLACK,ho.EMAIL,ho.SMS],HN=[ho.SLACK_CHANNEL,ho.MICROSOFT_TEAMS_CHANNEL,ho.INCIDENT_IO,ho.PAGERDUTY,ho.ROOTLY,ho.WEBHOOK],Du=Object.values(ho),qN=[...Du,"victorops"],cS=a.enum(Du),Cs=a.enum(HN),Fpe=[{channel:"in_app",name:"In-app",description:"Show notifications in your Sazabi notification feed.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"email",name:"Email",description:"Send notifications to your account email address.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"sms",name:"SMS",description:"Send notifications to your verified phone number.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/account?phone-number=add"},{channel:"slack",name:"Slack DMs",description:"Send personal notifications by Slack DM.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/connected-accounts/slack"},{channel:"slack_channel",name:"Slack",description:"Post this project's alerts to selected Slack channels.",scope:"project",destinationManagement:"slack_channels",projectIntegrationPath:"slack"},{channel:"teams_channel",name:"Microsoft Teams",description:"Post this project's alerts to selected Microsoft Teams channels.",scope:"project",destinationManagement:"teams_channels",projectIntegrationPath:"teams"},{channel:"incident_io",name:"incident.io",description:"Route this project's alerts to incident.io.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"incident-io"},{channel:"pagerduty",name:"PagerDuty",description:"Route this project's alerts to PagerDuty.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"pagerduty"},{channel:"rootly",name:"Rootly",description:"Route this project's alerts to Rootly.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"rootly"},{channel:"webhook",name:"Webhooks",description:"Send this project's alerts to configured HTTPS endpoints.",scope:"project",destinationManagement:"webhook_endpoints",projectSettingsPath:"webhooks"}],jpe=new Set(Fpe.map(({channel:e})=>e));if(jpe.size!==Du.length||Du.some((e)=>!jpe.has(e)))throw Error("Notification channel definitions must represent every channel")});var $pe,V9e=(e,t)=>e.value===t.value&&e.label===t.label&&e.scope===t.scope&&e.role===t.role&&e.defaultOff===t.defaultOff&&(e.defaultOffChannels??[]).join(",")===(t.defaultOffChannels??[]).join(",")&&e.email?.template===t.email?.template&&e.email?.ctaLabel===t.email?.ctaLabel&&(e.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),Dn=(e)=>{for(let t of Object.values(e)){let n=$pe.get(t.value);if(n&&!V9e(n,t))throw Error(`Notification type registered twice with conflicting definitions: ${t.value}`);if(t.role!==void 0&&t.scope!=="org")throw Error(`Notification type role restrictions require org scope: ${t.value}`);if(t.label.trim().length===0)throw Error(`Notification type needs a display label: ${t.value}`);if(t.email&&t.email.ctaLabel.trim().length===0)throw Error(`Notification email presentation needs a CTA label: ${t.value}`);if(t.defaultOff&&t.defaultOffChannels)throw Error(`Notification type declares both defaultOff and defaultOffChannels: ${t.value}`);$pe.set(t.value,t)}return e};var di=h(()=>{$pe=new Map});var Gpe;var Hpe=h(()=>{di();Gpe=Dn({AUTOMATION_FINISHED:{value:"automation_finished",label:"Automation completed",scope:"project",defaultOff:!0},AUTOMATION_RUN_FAILED:{value:"automation_run_failed",label:"Automation run failed",scope:"project"}})});var lS;var VN=h(()=>{di();lS=Dn({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage auto top-up"}},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View invoice"}},BILLING_INVOICE_PAYMENT_FAILED:{value:"billing_invoice_payment_failed",label:"Billing invoice payment failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED:{value:"billing_subscription_cancellation_scheduled",label:"Billing cancellation scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage subscription"}},BILLING_SUBSCRIPTION_CANCELED:{value:"billing_subscription_canceled",label:"Billing subscription canceled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_PAYMENT_METHOD_EXPIRING:{value:"billing_payment_method_expiring",label:"Billing payment method expiring",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_PAYMENT_METHOD_CHANGED:{value:"billing_payment_method_changed",label:"Billing payment method changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Review payment method"}},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}}})});var qpe;var Vpe=h(()=>{di();qpe=Dn({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var Kpe;var Ype=h(()=>{di();Kpe=Dn({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]}})});var Wpe;var Jpe=h(()=>{di();Wpe=Dn({PROJECT_CREATED:{value:"project_created",label:"Project created",scope:"org",defaultOff:!0},PROJECT_DELETED:{value:"project_deleted",label:"Project deleted",scope:"org",defaultOff:!0},MEMBER_INVITED:{value:"member_invited",label:"Member invited",scope:"org",defaultOff:!0},USER_REMOVED:{value:"user_removed",label:"Member removed",scope:"org",defaultOff:!0},MCP_CONNECTOR_ADDED:{value:"mcp_connector_added",label:"MCP connector added",scope:"org",defaultOff:!0},MCP_CONNECTOR_REMOVED:{value:"mcp_connector_removed",label:"MCP connector removed",scope:"org",defaultOff:!0},SECRET_KEY_CREATED:{value:"secret_key_created",label:"Secret key created",scope:"org",defaultOff:!0},SECRET_KEY_DELETED:{value:"secret_key_deleted",label:"Secret key deleted",scope:"org",defaultOff:!0}})});var Zpe;var Xpe=h(()=>{di();Zpe=Dn({SANDBOX_CREATED:{value:"sandbox_created",label:"Sandbox connected",scope:"project",defaultOff:!0},SANDBOX_DELETED:{value:"sandbox_deleted",label:"Sandbox disconnected",scope:"project",defaultOff:!0},LOG_SOURCE_CONNECTED:{value:"log_source_connected",label:"Log source connected",scope:"project",defaultOff:!0},LOG_SOURCE_DISCONNECTED:{value:"log_source_disconnected",label:"Log source disconnected",scope:"project"},GITHUB_CONNECTED:{value:"github_connected",label:"GitHub connected",scope:"project",defaultOff:!0},GITHUB_DISCONNECTED:{value:"github_disconnected",label:"GitHub disconnected",scope:"project"},CODE_REPO_CONNECTED:{value:"code_repo_connected",label:"Code repository connected",scope:"project",defaultOff:!0},CODE_REPO_DISCONNECTED:{value:"code_repo_disconnected",label:"Code repository disconnected",scope:"project"},PUBLIC_KEY_DEACTIVATED:{value:"public_key_deactivated",label:"Public key deactivated",scope:"project"}})});var ege;var tge=h(()=>{di();ege=Dn({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var KN,Pt,Y9e,YN=(e)=>{let t=Y9e.get(e)?.label;if(t)return t;let n=e.replace(/_/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e};var gm=h(()=>{Hpe();VN();VN();Vpe();Ype();Jpe();Xpe();tge();di();KN={...ege,...Wpe,...qpe,...Gpe,...Kpe,...Zpe,...lS},Pt=Object.fromEntries(Object.entries(KN).map(([e,t])=>[e,t.value])),Y9e=new Map(Object.values(KN).map((e)=>[e.value,e]))});var uS,oge,Zjt,Qr,Xjt;var $a=h(()=>{gm();pm();pm();uS=Object.values(Pt),oge=[Pt.BILLING_PLAN_UPGRADE_APPLIED,Pt.BILLING_PLAN_DOWNGRADE_SCHEDULED,Pt.BILLING_PLAN_DOWNGRADE_APPLIED,Pt.BILLING_CREDIT_BALANCE_LOW,Pt.BILLING_CREDIT_BALANCE_DEPLETED,Pt.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,Pt.BILLING_AUTO_TOP_UP_FAILED,Pt.BILLING_INVOICE_PAID,Pt.BILLING_NEGATIVE_BALANCE_COLLECTED,Pt.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED,Pt.BILLING_INVOICE_PAYMENT_FAILED,Pt.BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED,Pt.BILLING_SUBSCRIPTION_CANCELED,Pt.BILLING_PAYMENT_METHOD_EXPIRING,Pt.BILLING_PAYMENT_METHOD_CHANGED],Zjt=new Set(oge),Qr=[Pt.ISSUE_TRIGGERED,Pt.ISSUE_RESOLVED,Pt.ISSUE_IGNORED,Pt.AUTOMATION_RUN_FAILED],Xjt=new Set(Qr)});var mm,rge,ige=(e)=>typeof e==="string"&&(e in rge)?rge[e]:e,J9e;var sge=h(()=>{pm();De();$a();mm=a.enum(uS),rge={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},J9e=a.preprocess(ige,mm)});var Z9e;var age=h(()=>{gm();$a();Z9e=Qr.map((e)=>({notificationType:e,label:YN(e)}))});var cge=h(()=>{gm();$a()});var lge=h(()=>{pm();gm();$a();sge();age();cge()});var uge=()=>{};var dge=h(()=>{$a()});var pge=h(()=>{$a()});var WN=h(()=>{uge();dge();pge();lge()});var n6e,o6e,r6e,i6e,s6e,a6e,c6e,JN,hFt;var gge=h(()=>{WN();De();Ve();n6e=a.enum(["ready","missing","degraded","unavailable"]),o6e=a.object({id:a.string(),label:a.string(),status:a.enum(["active","inactive","degraded"]),statusLabel:a.string()}),r6e=a.object({channel:cS,name:a.string(),description:a.string(),scope:a.enum(["personal","project"]),enabled:a.boolean().nullable(),preferenceId:a.string().nullable(),prerequisite:a.object({status:n6e,statusLabel:a.string(),message:a.string()}),action:a.object({label:a.string(),href:a.string()}).nullable(),destinations:a.array(o6e),destinationManagement:a.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:a.boolean(),supportedNotificationTypes:a.array(mm)}),i6e=a.object({channel:Cs,enabled:a.boolean(),preferenceId:a.string().nullable()}),s6e=a.object({channel:Cs,notificationType:mm,enabled:a.boolean(),preferenceId:a.string()}),a6e=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),c6e=a.object({channelCards:a.array(r6e).length(10),channels:a.array(i6e),notificationTypePreferences:a.array(s6e),issueNotificationMinSeverity:a.enum(["low","medium","high","critical"])}),JN=E({operationId:"notificationChannels.getProject",summary:"List Project Notification Channels",description:"List a project's notification channels with preferences, prerequisites, connection state, configured destinations, and supported notification types.",backend:"api",route:{method:"GET",path:"/notification-channels",tags:["Notification channels"]},input:a6e,output:c6e,pagination:"none",async:"sync"}),hFt={getProject:JN.contract}});var mge,XN,hge,e0,IFt,SFt,t0,n0=(e,t)=>{if((e.componentIds?.length||e.componentId)&&"componentIds"in e.condition&&e.condition.componentIds?.length)t.addIssue({code:"custom",path:["condition","componentIds"],message:"Use componentIds instead of legacy condition.componentIds."});if(e.componentIds?.length&&e.componentId)t.addIssue({code:"custom",path:["componentId"],message:"Use componentIds instead of componentId."})},CFt,Age,ZN,o0,hm,fge,l6e,u6e,d6e,p6e,g6e,m6e,h6e,A6e,f6e,r0,i0,s0,a0,c0,vFt;var yge=h(()=>{WN();De();Ve();mge=a.enum(["low","medium","high","critical"]),XN=a.object({severities:a.array(mge).min(1).optional()}).strict(),hge=a.object({componentIds:a.array(a.string().uuid()).min(1).optional(),severities:a.array(mge).min(1).optional()}).strict(),e0=a.object({channel:Cs,destinationKey:a.string().min(1)}),IFt=a.object({destinations:a.array(e0).min(1),notificationTypes:a.array(a.enum(Qr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:XN}),SFt=a.object({destinations:a.array(e0).min(1),notificationTypes:a.array(a.enum(Qr)).min(1),condition:hge}),t0=a.object({destinations:a.array(e0).min(1),notificationTypes:a.array(a.enum(Qr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),componentId:a.string().uuid().optional().describe("Deprecated single-component compatibility input."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:a.union([XN,hge])}),CFt=t0.superRefine(n0),Age=a.object({id:a.string(),channel:Cs,destinationKey:a.string(),displayName:a.string()}),ZN=a.object({id:a.string().uuid(),label:a.string(),lifecycle:a.enum(["active","retired","merged"])}),o0=a.object({id:a.string().uuid(),projectId:a.string().uuid(),notificationTypes:a.array(a.enum(Qr)),destinations:a.array(Age),condition:XN,component:ZN.nullable(),componentId:a.string().uuid().nullable(),includeDescendants:a.boolean(),suspendedAt:a.string().datetime().nullable(),suspensionReason:a.string().nullable(),components:a.array(ZN),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),hm=a.object({projectId:a.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),fge=a.string().uuid().describe("Logical notification delivery rule ID."),l6e=hm,u6e=a.object({rules:a.array(o0)}),d6e=a.object({destinations:a.array(Age),notificationTypes:a.array(a.object({notificationType:a.enum(Qr),label:a.string(),conditions:a.array(a.enum(["component","severity"]))})),components:a.array(ZN)}),p6e=hm.extend(t0.shape).superRefine(n0),g6e=o0,m6e=hm.extend({...t0.shape,ruleId:fge}).superRefine(n0),h6e=o0,A6e=hm.extend({ruleId:fge}),f6e=a.object({removed:a.boolean()}),r0=E({operationId:"notificationDeliveryRules.list",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:l6e,output:u6e,pagination:"none",async:"sync"}),i0=E({operationId:"notificationDeliveryRules.options",description:"List available destinations, events, and conditions for project delivery rules.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules/options",tags:["Notification delivery rules"]},input:hm,output:d6e,pagination:"none",async:"sync"}),s0=E({operationId:"notificationDeliveryRules.create",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:p6e,output:g6e,pagination:"none",async:"sync"}),a0=E({operationId:"notificationDeliveryRules.update",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:m6e,output:h6e,pagination:"none",async:"sync"}),c0=E({operationId:"notificationDeliveryRules.delete",description:"Delete a positive delivery rule without deleting its reusable destinations.",backend:"api",route:{method:"DELETE",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:A6e,output:f6e,pagination:"none",async:"sync"}),vFt={list:r0.contract,options:i0.contract,create:s0.contract,update:a0.contract,delete:c0.contract}});var l0,y6e,b6e,I6e,S6e,C6e,v6e,u0,E6e,w6e,d0,k6e,x6e,p0,P6e,R6e,g0,T6e,B6e,m0,xFt;var bge=h(()=>{De();Ve();l0=a.enum(["verify-email","accept-invite","create-organization","billing","configure-project","connect-github-account","install-github-app","configure-code-search","install-slack-app","configure-slack-notifications","trigger-issue","confirm-issue","finish"]),y6e=a.enum(["needs-onboarding","blocked","ready"]),b6e=a.enum(["incomplete","complete","skipped"]),I6e=a.object({invitationId:a.string(),organizationId:a.string(),organizationName:a.string(),organizationSlug:a.string(),organizationImageUrl:a.string().nullable(),inviterName:a.string().nullable()}),S6e=a.object({gate:y6e,canonicalStep:l0.nullable(),organizationId:a.string().nullable(),projectId:a.string().nullable(),completionByStep:a.record(l0,b6e),githubSkipped:a.boolean(),githubAppSkipped:a.boolean(),slackSkipped:a.boolean(),sampleIssueId:a.string().nullable(),actorRole:a.enum(["admin","member"]).nullable(),requiredStep:a.union([l0,a.literal("select-organization")]).nullable(),isCompleted:a.boolean(),onboardingRecommendationsThreadId:a.string().nullable(),hasOrganizations:a.boolean(),hasPaidBillingSubscription:a.boolean(),billingStepEnabled:a.boolean(),pendingInvitations:a.array(I6e)}),C6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project whose onboarding state to bind (sample-issue attempt and project-scoped facts). Auto-filled from CLI and SDK context when omitted.")}),v6e=a.object({onboarding:S6e}),u0=E({operationId:"onboarding.getState",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:C6e,output:v6e,pagination:"none",async:"sync"}),E6e=a.object({integration:a.enum(["github","slack"]).describe("Integration onboarding step to skip."),organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),w6e=a.object({skipped:a.literal(!0)}),d0=E({operationId:"onboarding.skipIntegration",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:E6e,output:w6e,pagination:"none",async:"sync"}),k6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),x6e=a.object({skipped:a.literal(!0)}),p0=E({operationId:"onboarding.skipGithubAppInstallation",summary:"Skip GitHub App Installation",description:"Skip GitHub App installation during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-github-app",tags:["Onboarding"]},input:k6e,output:x6e,pagination:"none",async:"sync"}),P6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),R6e=a.object({skipped:a.literal(!0)}),g0=E({operationId:"onboarding.skipSampleIssue",summary:"Skip Test Issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:P6e,output:R6e,pagination:"none",async:"sync"}),T6e=a.object({projectId:a.string().uuid().describe("Project that completed onboarding.")}),B6e=a.object({completed:a.boolean()}),m0=E({operationId:"onboarding.finish",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:T6e,output:B6e,pagination:"none",async:"sync"}),xFt={getState:u0.contract,skipIntegration:d0.contract,skipGithubAppInstallation:p0.contract,skipSampleIssue:g0.contract,finish:m0.contract}});var dS,O6e,_6e,D6e,Q6e,L6e,N6e,M6e,z6e,j6e,U6e,h0,A0,f0,y0,OFt;var Ige=h(()=>{De();Ve();nS();dS=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),O6e=dS.extend({role:Ss.optional()}),_6e=a.object({}),D6e=a.object({organizations:a.array(O6e).describe("Organizations available to the current credential.")}),Q6e=a.object({organizationId:a.string().min(1).describe("Organization ID to fetch.")}),L6e=a.object({organization:dS}),N6e=a.object({organizationId:a.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:a.string().trim().min(1).max(100).describe("New organization name.")}),M6e=a.object({organization:dS.describe("Updated organization.")}),z6e=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),j6e=a.object({name:z6e.describe("Organization display name.")}),U6e=a.object({organization:dS}),h0=E({operationId:"organizations.create",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:j6e,output:U6e,pagination:"none",async:"sync"}),A0=E({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:_6e,output:D6e,pagination:"none",async:"sync"}),f0=E({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Q6e,output:L6e,pagination:"none",async:"sync"}),y0=E({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:N6e,output:M6e,pagination:"none",async:"sync",examples:[{name:"rename-organization",input:{organizationId:"organization-123",name:"Observed Platform"},output:{organization:{id:"organization-123",name:"Observed Platform",slug:"acme",logo:null}}}]}),OFt={list:A0.contract,get:f0.contract,create:h0.contract,update:y0.contract}});var Qu,Am,Sge,Cge,vge,Ege,wge,kge,xge,pS,gS,mS,Pge,Rge,hS,Tge,Bge,AS,F6e;var b0=h(()=>{De();Ve();Qu=a.enum(["us-east-1","us-east-2","us-west-1","us-west-2","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3"]),Am=a.object({id:a.string().uuid(),organizationId:a.string().min(1),name:a.string(),region:Qu}),Sge=a.object({organizationId:a.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),Cge=a.object({projects:a.array(Am).describe("Projects visible within the selected organization.")}),vge=a.object({projectId:a.string().uuid().describe("Project ID to fetch.")}),Ege=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),wge=a.object({organizationId:a.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),name:Ege.describe("Project name."),region:Qu.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),kge=a.object({project:Am}),xge=a.object({project:Am}),pS=E({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:Sge,output:Cge,pagination:"none",async:"sync"}),gS=E({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:vge,output:xge,pagination:"none",async:"sync"}),mS=E({operationId:"projects.create",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:wge,output:kge,pagination:"none",async:"sync"}),Pge=a.object({projectId:a.string().uuid().describe("Project ID to update."),name:Ege.optional().describe("New project name.")}),Rge=a.object({project:Am}),hS=E({operationId:"projects.update",description:"Update (rename) one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"PATCH",path:"/projects/{projectId}",tags:["Projects"]},input:Pge,output:Rge,pagination:"none",async:"sync"}),Tge=a.object({projectId:a.string().uuid().describe("Project ID to delete.")}),Bge=a.void(),AS=E({operationId:"projects.delete",description:"Delete one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"DELETE",path:"/projects/{projectId}",successStatus:204,tags:["Projects"]},input:Tge,output:Bge,pagination:"none",async:"sync"}),F6e={list:pS.contract,get:gS.contract,create:mS.contract,update:hS.contract,delete:AS.contract}});var Oge,$6e,G6e,H6e,q6e,V6e,I0,zFt;var _ge=h(()=>{De();Ve();Oge=a.enum(["open","merged","closed"]),$6e=a.enum(["review_required","approved","changes_requested"]),G6e=a.enum(["passing","failing","pending"]),H6e=a.object({id:a.string().uuid(),projectId:a.string().uuid(),repositoryFullName:a.string(),pullRequestId:a.string().describe("Provider-native pull request identifier (GitHub PR number or Bitbucket PR id), serialized as a string."),githubPullRequestId:a.number().int().describe("Deprecated: use pullRequestId. Numeric form of the provider-native pull request identifier; kept for backward compatibility."),title:a.string().nullable(),url:a.string().nullable(),status:Oge.nullable(),reviewState:$6e.nullable(),checksState:G6e.nullable(),requestedByUserId:a.string().nullable(),authorLogin:a.string().nullable().describe("Forge login that authored the pull request (often the Sazabi app identity)."),githubAuthorLogin:a.string().nullable().describe("Deprecated: use authorLogin. Kept for backward compatibility."),threadId:a.string().uuid().nullable(),runId:a.string().uuid().nullable(),createdAt:a.string().datetime(),mergedAt:a.string().datetime().nullable(),closedAt:a.string().datetime().nullable()}),q6e=a.object({projectId:a.string().uuid().optional().describe("Project to list pull requests for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of pull requests to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:Oge.optional().describe("Filter by pull request status (open, merged, or closed)."),repositoryFullName:a.string().trim().optional().describe("Filter by repository full name, for example owner/repo. Case-insensitive."),requestedByUserId:a.string().trim().optional().describe("Filter by the Sazabi user who requested the pull request. Pass 'me' to filter to the authenticated user.")}),V6e=a.object({pullRequests:a.array(H6e),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),I0=E({operationId:"pullRequests.list",description:"List pull requests that Sazabi opened, optionally filtered by status, repository, and requesting user.",backend:"api",route:{method:"GET",path:"/pull-requests",tags:["Pull Requests"]},input:q6e,output:V6e,pagination:"cursor",async:"sync"}),zFt={list:I0.contract}});var Dge,Qge,Lge,Nge,Mge,fm;var S0=h(()=>{De();Ve();Dge=a.enum(["log_source","mcp_connector","sandbox_cli","integration"]),Qge=a.enum(["connected","recommended"]),Lge=a.object({kind:Dge.describe("What the recommendation targets: a log source, MCP connector, sandbox CLI, or integration."),targetId:a.string().describe("Exact catalog id for the kind (log source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:Qge.describe("Resolved live against current connections: connected (already set up) or recommended (suggested, not yet connected)."),roiScore:a.number().int().min(0).max(100).describe("Intrinsic ROI score, 0–100 — a normalized blend of how valuable, how easy to connect, and how proven the item is. A pure function of the item; computed live on read, never stored."),priority:a.number().int().min(1).describe("1-based rank within this list, sorted by roiScore (best first). Items are already returned in priority order; the field lets consumers recover the rank without trusting array position.")}),Nge=a.object({projectId:a.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),Mge=a.object({recommendations:a.array(Lge).describe("The project's configuration recommendations, deduped by (kind, targetId), with status resolved live and each item's ROI score. Returned in priority order (highest roiScore first).")}),fm=E({operationId:"recommendations.list",description:"List a project's configuration recommendations (data sources, MCP connectors, sandbox CLIs, and integrations) with each item's live connection status.",backend:"api",route:{method:"GET",path:"/recommendations",tags:["Recommendations"]},input:Nge,output:Mge,pagination:"none",async:"sync"})});var zge,C0,jge,Uge,Fge,$ge,Gge,Hge,ym,bm,Im;var v0=h(()=>{De();Ve();zge=a.enum(["github","bitbucket"]),C0=a.object({id:a.string().uuid().describe("Repository row id — stable across access sources; use it as the path id for repos.remove."),accessSourceId:a.string().uuid().describe("Access source granting this view of the repository (GitHub App installation, personal connection, or integration). Pass to repos.add to link the repository through this source."),source:a.enum(["githubApp","personal","integration"]).describe("Kind of access source granting this view: an organization GitHub App installation, the caller's personal forge connection, or an organization integration."),sourceLabel:a.string().describe('Display label for the access source (e.g. "GitHub app", "Personal").'),provider:zge.describe("Forge hosting the repository."),owner:a.string().describe("Repository owner (user or organization)."),name:a.string().describe("Repository name without the owner."),fullName:a.string().describe("Full name in owner/name form."),defaultBranch:a.string().nullable().describe("Default branch, when the forge reports one."),isPrivate:a.boolean().describe("Whether the repository is private."),linked:a.boolean().describe("Whether the repository is already linked to the project.")}),jge=a.object({projectId:a.string().uuid().optional().describe("Project to list repositories for. Auto-filled from CLI and SDK context when omitted.")}),Uge=a.object({repos:a.array(C0).describe("Every repository available to the project's organization (from GitHub App installations, the caller's personal forge connections, and integrations), with `linked` marking the ones already linked to the project.")}),Fge=a.object({projectId:a.string().uuid().optional().describe("Project to link the repositories to. Auto-filled from CLI and SDK context when omitted."),accessSourceIds:a.array(a.string().uuid()).min(1).describe("Access source ids (from repos.list) to link. Select only one access source per repository.")}),$ge=a.object({repos:a.array(C0).describe("The now-linked repositories.")}),Gge=a.object({id:a.string().uuid().describe("Repository row id (from repos.list) to unlink."),projectId:a.string().uuid().optional().describe("Project to unlink the repository from. Auto-filled from CLI and SDK context when omitted.")}),Hge=a.void(),ym=E({operationId:"repos.list",description:"List the repositories available to a project — every repository reachable through the organization's GitHub App installations, the caller's personal forge connections, and integrations — with each one's linked status.",backend:"api",route:{method:"GET",path:"/repos",tags:["Repos"]},input:jge,output:Uge,pagination:"none",async:"sync"}),bm=E({operationId:"repos.add",description:"Link repositories to a project by access source id. Select only one access source per repository; re-linking an already-linked repository refreshes its selected access source.",backend:"api",route:{method:"POST",path:"/repos",tags:["Repos"]},input:Fge,output:$ge,pagination:"none",async:"sync"}),Im=E({operationId:"repos.remove",description:"Unlink a repository from a project by repository row id.",backend:"api",route:{method:"DELETE",path:"/repos/{id}",successStatus:204,tags:["Repos"]},input:Gge,output:Hge,pagination:"none",async:"sync"})});var qge,K6e,Vge,fS,Kge,Yge,Wge,Jge,Lu,E0,Zge,Xge,Nu,eme,tme,Mu,nme,ome,zu,Y6e;var w0=h(()=>{De();Ve();qge=a.object({type:a.string().describe("Preset type identifier."),label:a.string().describe("Human-readable display name."),executableNames:a.array(a.string()).describe("CLI binary names installed by this preset."),envVarKeys:a.array(a.string()).describe("Environment variables required for authentication."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),K6e=a.object({}),Vge=a.object({types:a.array(qge)}),fS=E({operationId:"sandboxPresets.listTypes",description:"List all supported sandbox CLI types with their environment variable requirements and setup skills.",backend:"api",route:{method:"GET",path:"/sandbox-presets/types",tags:["Sandbox Presets"]},input:K6e,output:Vge,pagination:"none",async:"sync"}),Kge=a.enum(["github_app","bitbucket_integration","personal_access_token","stored_credentials"]),Yge=a.object({presetType:a.string().describe("Preset type identifier."),credentialSource:Kge.describe("Authoritative credential source for the preset."),isSystemManaged:a.boolean().describe("Whether the connection follows an integration lifecycle."),fallbackConfigured:a.boolean().describe("Whether user-provided fallback credentials are stored for this preset."),envVarKeys:a.array(a.string()).describe("Stored environment variable names. Secret values are omitted.")}),Wge=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted.")}),Jge=a.object({connections:a.array(Yge)}),Lu=E({operationId:"sandboxPresets.listConnections",description:"List a project's stored and integration-backed sandbox CLI connections without returning secret values.",backend:"api",route:{method:"GET",path:"/sandbox-presets/connections",tags:["Sandbox Presets"]},input:Wge,output:Jge,pagination:"none",async:"sync"}),E0=a.object({key:a.string().min(1).max(256).regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable keys must match /^[A-Za-z_][A-Za-z0-9_]*$/.").describe("Environment variable name (e.g. KUBECONFIG_CONTENTS)."),value:a.string().max(10240).describe("Secret value. Encrypted at rest; never returned by any API response.")}),Zge=a.object({projectId:a.string().uuid().optional().describe("Project to configure. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier (e.g. kubectl, aws, github)."),environmentVariables:a.array(E0).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),Xge=a.object({projectId:a.string().uuid().describe("Project the preset was written to."),presetType:a.string().describe("Preset type that was upserted."),envVarKeys:a.array(a.string()).describe("Env var key names now stored for this preset. Values are never returned.")}),Nu=E({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI connection",description:"Set or replace a project's CLI connection credentials (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires write access to the target project.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:Zge,output:Xge,pagination:"none",async:"sync"}),eme=a.object({projectId:a.string().uuid().optional().describe("Project to update. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier.")}),tme=a.object({projectId:a.string().uuid().describe("Project the CLI connection belonged to."),presetType:a.string().describe("Preset type that was disconnected."),deleted:a.boolean().describe("Whether a stored CLI connection was deleted.")}),Mu=E({operationId:"sandboxPresets.deletePreset",summary:"Disconnect CLI",description:"Delete a project's stored CLI connection. Integration-managed access remains available until its owning integration is disconnected.",backend:"api",route:{method:"DELETE",path:"/sandbox-presets/config/{presetType}",tags:["Sandbox Presets"]},input:eme,output:tme,pagination:"none",async:"sync"}),nme=a.object({projectId:a.string().uuid().optional().describe("Project to test from. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier."),environmentVariables:a.array(E0).max(100).describe("Unsaved credentials to validate in a readonly sandbox.")}),ome=a.object({status:a.enum(["success","failed"]),message:a.string().nullable(),stdout:a.string().describe("Truncated command output with submitted credentials redacted."),stderr:a.string().describe("Truncated command errors with submitted credentials redacted.")}),zu=E({operationId:"sandboxPresets.testPreset",summary:"Test CLI connection",description:"Validate unsaved CLI credentials in a read-only ephemeral sandbox without persisting them.",backend:"api",route:{method:"POST",path:"/sandbox-presets/test",tags:["Sandbox Presets"]},input:nme,output:ome,pagination:"none",async:"sync"}),Y6e={deletePreset:Mu.contract,listConnections:Lu.contract,listTypes:fS.contract,testPreset:zu.contract,upsertPreset:Nu.contract}});var yS,rme=1048576,k0,ime,x0,W6e,J6e,Z6e,X6e,e5e,t5e,n5e,o5e,r5e,i5e,P0,R0,T0,B0,O0,ZFt;var sme=h(()=>{De();Ve();yS=a.string().min(1).max(64).regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/,"Name must start with a letter or digit and contain only letters, digits, underscores, and hyphens (max 64 characters).").describe("Script name. Must be unique within the project among non-deleted scripts."),k0=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=rme,{message:`Script content must be at most ${rme} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),ime=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),contentHash:a.string().describe("sha256 hex digest of the script content."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),x0=ime.extend({content:k0}),W6e=a.object({projectId:a.string().uuid().optional().describe("Project to list scripts for. Auto-filled from CLI and SDK context when omitted."),search:a.string().optional().describe("Case-insensitive partial match on script name."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of scripts to return per page.")}),J6e=a.object({scripts:a.array(ime),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),Z6e=a.object({name:yS.describe("Script name to fetch."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),X6e=a.object({script:x0}),e5e=a.object({projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:yS.describe("Script name. Must be unique within the project among non-deleted scripts."),content:k0,description:a.string().max(500).nullable().optional().describe("Optional human-readable description.")}),t5e=a.object({script:x0}),n5e=a.object({name:yS.describe("Script to update."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),content:k0.optional().describe("New script body. Omit to leave content unchanged."),description:a.string().max(500).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged.")}),o5e=a.object({script:x0}),r5e=a.object({name:yS.describe("Script to delete."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),i5e=a.void(),P0=E({operationId:"scripts.list",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:W6e,output:J6e,pagination:"cursor",async:"sync"}),R0=E({operationId:"scripts.get",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:Z6e,output:X6e,pagination:"none",async:"sync"}),T0=E({operationId:"scripts.create",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:e5e,output:t5e,pagination:"none",async:"sync"}),B0=E({operationId:"scripts.update",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:n5e,output:o5e,pagination:"none",async:"sync"}),O0=E({operationId:"scripts.delete",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:r5e,output:i5e,pagination:"none",async:"sync"}),ZFt={list:P0.contract,get:R0.contract,create:T0.contract,update:B0.contract,delete:O0.contract}});var _0,ame,cme,lme,ume,ju,Uu,s5e;var D0=h(()=>{De();Ve();_0=a.object({projectId:a.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:a.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:a.coerce.number().min(1).default(1).describe("One-based page number.")}),ame=_0.extend({status:a.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),cme=_0.extend({threadId:a.string().uuid().optional().describe("Optional thread restriction for message search."),role:a.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),lme=a.object({threads:a.array(a.object({id:a.string().uuid(),projectId:a.string().uuid().optional(),title:a.string(),status:a.enum(["regular","archived"]),labels:a.array(a.string()),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),ume=a.object({messages:a.array(a.object({id:a.string().uuid(),threadId:a.string().uuid(),threadTitle:a.string(),role:a.enum(["user","assistant"]),content:a.string(),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),ju=E({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:ame,output:lme,pagination:"page",async:"sync",examples:[{name:"search-open-incidents",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"payment timeout",status:"regular",limit:10,page:1},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"Payment timeout in us-west-2",status:"regular",labels:["payments","timeout"],createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["payment timeout"],score:123.45}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),Uu=E({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:cme,output:ume,pagination:"page",async:"sync",examples:[{name:"search-assistant-messages",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"rollback",role:"assistant",limit:10,page:1},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",threadId:"22222222-2222-4222-8222-222222222222",threadTitle:"Deployment rollback guidance",role:"assistant",content:"Rollback the ingestion deployment and confirm queue depth.",createdAt:"2026-01-02T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["Rollback the ingestion deployment"],score:98.76}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),s5e={threads:ju.contract,messages:Uu.contract}});var bS,dme,Q0,Sm,a5e,c5e,l5e,u5e,d5e,p5e,g5e,m5e,h5e,A5e,L0,N0,M0,z0,j0,f5e,y5e,U0,i$t;var pme=h(()=>{De();Ve();bS=a.string().uuid().describe("Signal definition ID."),dme=a.string().min(1).max(200).describe("Human-readable expression name."),Q0=a.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),Sm=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),expression:Q0,enabled:a.boolean(),compiledVersion:a.number().int(),linkedAutomationIds:a.array(a.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),a5e=a.object({projectId:a.string().uuid().optional().describe("Project to list signal definitions for. Auto-filled from CLI and SDK context when omitted.")}),c5e=a.object({signalDefinitions:a.array(Sm)}),l5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),u5e=a.object({signalDefinition:Sm}),d5e=a.object({projectId:a.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:dme,expression:Q0,enabled:a.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),p5e=a.object({signalDefinition:Sm}),g5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:dme.optional(),expression:Q0.optional(),enabled:a.boolean().optional().describe("Whether the expression is enabled.")}),m5e=a.object({signalDefinition:Sm}),h5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),A5e=a.object({signalDefinition:Sm}),L0=E({operationId:"signalDefinitions.list",description:"List signal definitions in a project.",backend:"api",route:{method:"GET",path:"/signal-definitions",tags:["Signal definitions"]},input:a5e,output:c5e,pagination:"none",async:"sync"}),N0=E({operationId:"signalDefinitions.get",description:"Get a single signal definition by ID.",backend:"api",route:{method:"GET",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:l5e,output:u5e,pagination:"none",async:"sync"}),M0=E({operationId:"signalDefinitions.create",description:"Create a CEL signal definition for a project.",backend:"api",route:{method:"POST",path:"/signal-definitions",successStatus:201,tags:["Signal definitions"]},input:d5e,output:p5e,pagination:"none",async:"sync"}),z0=E({operationId:"signalDefinitions.update",description:"Update a signal definition's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:g5e,output:m5e,pagination:"none",async:"sync"}),j0=E({operationId:"signalDefinitions.disable",description:"Disable a signal definition so it stops matching logs.",backend:"api",route:{method:"POST",path:"/signal-definitions/{signalDefinitionId}/disable",tags:["Signal definitions"]},input:h5e,output:A5e,pagination:"none",async:"sync"}),f5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),y5e=a.void(),U0=E({operationId:"signalDefinitions.delete",description:"Permanently delete a signal definition.",backend:"api",route:{method:"DELETE",path:"/signal-definitions/{signalDefinitionId}",successStatus:204,tags:["Signal definitions"]},input:f5e,output:y5e,pagination:"none",async:"sync"}),i$t={list:L0.contract,get:N0.contract,create:M0.contract,update:z0.contract,disable:j0.contract,delete:U0.contract}});var gme;var mme=h(()=>{gme=["onboarding","setup"]});var hme,Ame,fme,yme,Cm;var F0=h(()=>{mme();De();Ve();hme=a.enum(gme),Ame=a.object({id:a.string().describe("Unique task identifier (e.g. install_github_app)."),label:a.string().describe("Short human-readable task name."),description:a.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:a.string().describe("Step-by-step instructions for completing this task."),completed:a.boolean().describe("Whether the task has been completed."),completedAt:a.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:hme.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),fme=a.object({projectId:a.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),yme=a.object({tasks:a.array(Ame).describe("All onboarding and setup tasks with their current completion status.")}),Cm=E({operationId:"tasks.list",description:"List all onboarding and setup tasks for a project, including their current completion status and a description of what is required to complete each task.",backend:"api",route:{method:"GET",path:"/tasks",tags:["Tasks"]},input:fme,output:yme,pagination:"none",async:"sync"})});var b5e,I5e,Ga,S5e,C5e,v5e,E5e,w5e,k5e,x5e,P5e,R5e,T5e,B5e,O5e,_5e,D5e,$0,G0,H0,q0,V0,K0,Y0,m$t;var bme=h(()=>{De();Ve();b5e=a.object({id:a.string().uuid().describe("Team ID."),name:a.string().describe("Team name, unique among the org's active teams."),description:a.string().nullable().describe("Optional team description."),createdAt:a.string().datetime().describe("When the team was created."),memberCount:a.number().int().nonnegative().describe("Number of active members in the team.")}),I5e=a.object({userId:a.string().min(1).describe("User ID of the team member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),addedAt:a.string().datetime().describe("When the member was added to the team.")}),Ga=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),S5e=a.object({organizationId:Ga}),C5e=a.object({teams:a.array(b5e).describe("Active teams in the organization.")}),v5e=a.object({organizationId:Ga,name:a.string().trim().min(1).describe("Team name."),description:a.string().trim().min(1).optional().describe("Optional team description.")}),E5e=a.object({id:a.string().uuid().describe("ID of the created team.")}),w5e=a.object({organizationId:Ga,teamId:a.string().uuid().describe("Team to update."),name:a.string().trim().min(1).optional().describe("New team name."),description:a.string().trim().min(1).nullable().optional().describe("New team description; null clears it.")}),k5e=a.object({id:a.string().uuid().describe("ID of the updated team.")}),x5e=a.object({params:a.object({teamId:a.string().uuid().describe("Team to delete.")}),query:a.object({organizationId:Ga})}).transform(({params:e,query:t})=>({...t,...e})),P5e=a.object({success:a.literal(!0).describe("The team and its memberships were removed.")}),R5e=a.object({organizationId:Ga,teamId:a.string().uuid().describe("Team to add the member to."),userId:a.string().min(1).describe("User ID of an active organization member to add.")}),T5e=a.object({id:a.string().uuid().describe("ID of the team membership.")}),B5e=a.object({params:a.object({teamId:a.string().uuid().describe("Team to remove the member from."),userId:a.string().min(1).describe("User ID of the member to remove.")}),query:a.object({organizationId:Ga})}).transform(({params:e,query:t})=>({...t,...e})),O5e=a.object({success:a.literal(!0).describe("The membership was removed.")}),_5e=a.object({organizationId:Ga,teamId:a.string().uuid().describe("Team to list members for.")}),D5e=a.object({members:a.array(I5e).describe("Active members of the team.")}),$0=E({operationId:"teams.list",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:S5e,output:C5e,pagination:"none",async:"sync",examples:[{name:"organization-teams",input:{organizationId:"organization-123"},output:{teams:[{id:"5c0f9866-31ab-4237-94cc-a1d0ba2f6de2",name:"Payments",description:"Owns checkout and billing components.",createdAt:"2026-01-01T00:00:00.000Z",memberCount:4}]}}]}),G0=E({operationId:"teams.create",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:v5e,output:E5e,pagination:"none",async:"sync"}),H0=E({operationId:"teams.update",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:w5e,output:k5e,pagination:"none",async:"sync"}),q0=E({operationId:"teams.delete",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:x5e,output:P5e,pagination:"none",async:"sync"}),V0=E({operationId:"teams.addMember",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:R5e,output:T5e,pagination:"none",async:"sync"}),K0=E({operationId:"teams.removeMember",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:B5e,output:O5e,pagination:"none",async:"sync"}),Y0=E({operationId:"teams.listMembers",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:_5e,output:D5e,pagination:"none",async:"sync"}),m$t={list:$0.contract,create:G0.contract,update:H0.contract,delete:q0.contract,addMember:V0.contract,removeMember:K0.contract,listMembers:Y0.contract}});var Q5e,L5e,N5e,W0,M5e,z5e,J0,j5e,U5e,Z0,y$t;var Ime=h(()=>{De();Ve();Q5e=a.object({kind:a.enum(["user","workspace"]),name:a.string().optional(),email:a.string().optional()}),L5e=a.object({container:a.string().min(1).describe("The container to create the work item in: its id, short key (e.g. a Linear team key like ENG), or display name."),title:a.string().min(1),bodyMarkdown:a.string().optional(),state:a.string().optional(),itemType:a.string().optional(),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers."),clientRequestId:a.string().min(1).optional().describe("Optional caller-supplied idempotency key. When provided, retrying the same logical create with the same clientRequestId reuses the original result instead of creating a duplicate external work item.")}).strict(),N5e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),attribution:Q5e.optional(),reused:a.boolean()}),W0=E({operationId:"work-items.create",description:"Create a work item (e.g. a Linear issue) in a connected issue tracker, attributing the write to the requesting user.",backend:"api",route:{method:"POST",path:"/work-items",tags:["Work Items"],successStatus:201},input:L5e,output:N5e,pagination:"none",async:"sync"}),M5e=a.object({itemId:a.string().min(1).describe("The work item to comment on."),bodyMarkdown:a.string().min(1),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),z5e=a.object({identifier:a.string(),url:a.string()}),J0=E({operationId:"work-items.comment",description:"Add a comment to an existing work item.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/comment",tags:["Work Items"]},input:M5e,output:z5e,pagination:"none",async:"sync"}),j5e=a.object({itemId:a.string().min(1).describe("The work item to transition."),state:a.string().min(1).describe("The target workflow state."),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),U5e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),changed:a.boolean()}),Z0=E({operationId:"work-items.transition",description:"Move a work item to a target workflow state.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/transition",tags:["Work Items"]},input:j5e,output:U5e,pagination:"none",async:"sync"}),y$t={create:W0.contract,comment:J0.contract,transition:Z0.contract}});var X0;var Sme=h(()=>{z1();H1();iR();dR();m2();GR();VR();Vf();RY();AB();hN();nS();gpe();xN();zpe();gge();yge();bge();Ige();b0();_ge();S0();v0();iS();w0();sme();D0();pme();F0();bme();GN();Ime();X0={me:AN.contract,automations:{list:gR.contract,get:mR.contract,create:hR.contract,update:AR.contract,enable:fR.contract,disable:yR.contract,runs:{list:bR.contract,get:IR.contract,logs:SR.contract}},logs:{query:Kc.contract,schema:Yc.contract,volume:Wc.contract,patterns:Jc.contract,nativeQuery:Zc.contract},logSources:{listProviders:$f.contract,list:qc.contract,create:Vc.contract,get:Gf.contract,update:Hf.contract,delete:qf.contract},logStreams:{list:lB.contract,create:uB.contract,get:dB.contract,update:pB.contract,delete:gB.contract,reassign:mB.contract},connectedAccounts:{beginConnect:aR.contract,getConnectAttempt:cR.contract,list:lR.contract,disconnect:uR.contract},integrations:{listProviders:V1.contract,listConnections:K1.contract,getConnection:Y1.contract,createConnection:W1.contract,beginConnect:J1.contract,getConnectAttempt:Z1.contract,disconnectConnection:X1.contract,updateConnectionCredentials:e2.contract,getOrganizationExternalIdentityJitPolicy:o2.contract,updateOrganizationExternalIdentityJitPolicy:r2.contract,getConnectionExternalIdentityJitPolicy:i2.contract,updateConnectionExternalIdentityJitPolicy:s2.contract,getSlackConfiguration:c2.contract,updateSlackConfiguration:l2.contract,listSlackChannelProjectMappings:d2.contract,setSlackChannelProjectMapping:p2.contract,deleteSlackChannelProjectMapping:g2.contract},notificationChannels:{getProject:JN.contract},notificationDeliveryRules:{list:r0.contract,options:i0.contract,create:s0.contract,update:a0.contract,delete:c0.contract},mcpConnectors:{listProviders:tS.contract,list:fu.contract,get:yu.contract,details:bu.contract,search:Iu.contract,describe:Su.contract,call:Cu.contract,create:vu.contract,update:Eu.contract,disconnect:wu.contract,setReadOnly:ku.contract,beginOAuthInstall:xu.contract,getOAuthInstallAttempt:Pu.contract},sandboxPresets:{deletePreset:Mu.contract,listConnections:Lu.contract,listTypes:fS.contract,testPreset:zu.contract,upsertPreset:Nu.contract},scripts:{list:P0.contract,get:R0.contract,create:T0.contract,update:B0.contract,delete:O0.contract},signalDefinitions:{list:L0.contract,get:N0.contract,create:M0.contract,update:z0.contract,disable:j0.contract,delete:U0.contract},memory:{put:Ru.contract,get:Tu.contract,list:Bu.contract,search:Ou.contract,delete:_u.contract},onboarding:{getState:u0.contract,skipIntegration:d0.contract,skipGithubAppInstallation:p0.contract,skipSampleIssue:g0.contract,finish:m0.contract},organizations:{list:A0.contract,get:f0.contract,create:h0.contract,update:y0.contract},members:{list:fN.contract,updateRole:yN.contract,remove:bN.contract,invite:IN.contract,listInvitations:SN.contract,revokeInvitation:CN.contract},teams:{list:$0.contract,create:G0.contract,update:H0.contract,delete:q0.contract,addMember:V0.contract,removeMember:K0.contract,listMembers:Y0.contract},publicKeys:{list:jc.contract,get:Uc.contract,ensureLogForwarding:Fc.contract,update:$c.contract,deactivate:Gc.contract},secretKeys:{list:Df.contract,get:Qf.contract,create:Lf.contract,update:Nf.contract,delete:Mf.contract},projects:{list:pS.contract,get:gS.contract,create:mS.contract,update:hS.contract,delete:AS.contract},search:{threads:ju.contract,messages:Uu.contract},messages:{list:Npe.contract,append:Mpe.contract},threads:{list:_N.contract,get:DN.contract,getStatus:QN.contract,stop:LN.contract,create:NN.contract,update:MN.contract,fork:zN.contract,setVisibility:jN.contract,createShareLink:UN.contract,listShareLinks:FN.contract,revokeShareLink:$N.contract},runs:{list:PN.contract,listForThread:RN.contract,get:TN.contract,cancel:BN.contract},pullRequests:{list:I0.contract},issues:{count:vf.contract,create:zc.contract,list:Sf.contract,search:Cf.contract,get:Ef.contract,resolve:wf.contract,ignore:kf.contract,reopen:xf.contract,reassignAndReopen:Pf.contract,mute:Rf.contract,unmute:Tf.contract},workItems:{create:W0.contract,comment:J0.contract,transition:Z0.contract},billing:{getSummary:vR.contract,getUsage:ER.contract,listTransactions:wR.contract,getAutoTopUp:PR.contract,updateAutoTopUp:RR.contract,purchaseCredits:TR.contract,listPlans:BR.contract,previewPlanChange:OR.contract,previewSubscriptionCancellation:MR.contract,scheduleSubscriptionCancellation:zR.contract,resumeSubscriptionCancellation:jR.contract,changePlan:_R.contract,createCheckoutSession:DR.contract,getCheckoutSessionStatus:QR.contract,createPortalSession:LR.contract,getPaymentMethod:NR.contract},tasks:{list:Cm.contract},recommendations:{list:fm.contract},repos:{list:ym.contract,add:bm.contract,remove:Im.contract},components:{list:ZA.contract,get:XA.contract,register:Nc.contract,deregister:ef.contract,rename:tf.contract,assignTeam:nf.contract,retirementPreview:of.contract,retire:rf.contract,restorationPreview:sf.contract,restore:af.contract,mergePreview:gf.contract,merge:mf.contract,relationships:{list:cf.contract,preview:lf.contract,add:uf.contract,remove:df.contract},incidents:{list:hf.contract},timeline:Af.contract}}});var Ha=h(()=>{P$();iR();dR();Sme();GR();VR();Vf();AB();hN();xN();b0();S0();v0();w0();D0();F0()});var F5e="https://api.sazabi.com",$5e="x-sazabi-client-source",vme=(e)=>({streamRun:async(t)=>Cme({options:e,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal}),streamThread:async(t)=>Cme({options:e,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}),Cme=async(e)=>{let t=e.options.fetch??globalThis.fetch;if(!t)throw Error("Fetch transport is not available in this runtime.");let n=await e.options.credentialProvider.getToken(),r=G5e(e.options.apiBaseUrl,e.path,e.cursor);return q5e({url:r,token:n,clientSource:e.options.clientSource,initialCursor:e.cursor,signal:e.signal,fetch:t})},G5e=(e,t,n)=>{let r=H5e(e??F5e),o=new URL(`${r}${t}`);if(n)o.searchParams.set(GP,n);return o.toString()},H5e=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},q5e=async(e)=>{let t=[],n=[],r=!1,o=!1,i,s=e.initialCursor,c=new AbortController,l=(f)=>{if(r)return;r=!0,i=f;while(n.length>0)n.shift()?.({value:void 0,done:!0})},u=(f)=>{let S=n.shift();if(S){S({value:f,done:!1});return}t.push(f)},d=(f)=>{if(f.event===qP){let v=J5e(f.data);if(v!==void 0)s=v;return}if(f.data===VP){o=!0,c.abort(),l();return}let S=Z5e(f.data);if(S)u(S)},p=()=>{o=!0,c.abort(),l()};if(e.signal)if(e.signal.aborted)o=!0,c.abort();else e.signal.addEventListener("abort",p,{once:!0});let g={[Symbol.asyncIterator](){return g},get cursor(){return s},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(r){if(i)throw i;return{value:void 0,done:!0}}return new Promise((f)=>{n.push(f)}).then((f)=>{if(f.done&&i)throw i;return f})},return:async()=>(o=!0,c.abort(),l(),{value:void 0,done:!0}),throw:async(f)=>{throw o=!0,c.abort(),l(f instanceof Error?f:Error(String(f))),f},close:async()=>{o=!0,c.abort(),l()}};if(o)return l(),g;let m=await e.fetch(e.url,{method:HP,headers:V5e(e.token,e.clientSource),signal:c.signal});if(await K5e(m))l();else Y5e(m,d).then(()=>l()).catch((f)=>{if(eXe(f)||o||e.signal?.aborted){l();return}l(tXe(f))});return g},V5e=(e,t)=>({accept:"text/event-stream",authorization:`Bearer ${e}`,...t?{[$5e]:t}:{}}),K5e=async(e)=>{if(e.status===204)return!0;if(e.ok&&e.body)return!1;let t=await X5e(e);if(e.status===401)throw Error("Authentication failed. Check your credential.");if(e.status===403)throw Error(`Forbidden (403): ${t||"Credential may not have access to this resource"}`);if(e.status===404)throw Error(`Not found (404): ${t||"Run or thread not found"}`);if(e.status===400)throw Error(`Invalid stream cursor (400): ${t||"The provided cursor was rejected"}`);if(e.status>=400&&e.status<500&&e.status!==429)throw Error(`Client error (${e.status}): ${t}`);if(!e.body)throw Error("Agent stream response did not include a body.");throw Error(e.status===429?`Rate limited (429): ${t}`:`Server error (${e.status}): ${t}`)},Y5e=async(e,t)=>{let n=e.body?.getReader();if(!n)throw Error("Agent stream response did not include a body.");let r=new TextDecoder,o="",i=W5e(t);try{while(!0){let s=await n.read();if(s.done)break;o+=r.decode(s.value,{stream:!0});let c=o.split(/\r\n|\r|\n/);o=c.pop()??"";for(let l of c)i.line(l)}if(o+=r.decode(),o)for(let s of o.split(/\r\n|\r|\n/))i.line(s);i.flush()}finally{n.releaseLock()}},W5e=(e)=>{let t="message",n=[],r=()=>{t="message",n=[]},o=()=>{if(n.length===0){r();return}e({event:t,data:n.join(`
|
|
8747
|
+
`)}],evidenceHints:["force.com / my.salesforce.com URLs, SALESFORCE_* or SFDC_* environment variables, or sf/sfdx CLI usage","jsforce, simple-salesforce, or @salesforce packages","README/runbooks naming Salesforce as the CRM or system of record"],helpText:"Query Salesforce data and metadata, and run Apex invocable actions and Flows exposed by a hosted MCP server. Coming soon — a Salesforce admin registers an External Client App in your org and Sazabi provisions its credentials, so it isn't self-serve connectable yet."})});var mue;var hue=h(()=>{de();mue=U({id:"secureframe",label:"Secureframe",iconKey:"secureframe",defaultServerUrl:"https://mcp.secureframe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"secureframe",callbackPathSegment:"secureframe",authorizationUrl:"https://mcp.secureframe.com/oauth/authorize",tokenUrl:"https://mcp.secureframe.com/oauth/token",resourceUrl:"https://mcp.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp.secureframe.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp",label:"MCP Access",description:"Query and manage Secureframe compliance data, controls, tests, vendors, risks, and framework requirements."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.secureframe.com"},{label:"United Kingdom (UK)",serverUrl:"https://mcp-uk.secureframe.com",authorizationUrl:"https://mcp-uk.secureframe.com/oauth/authorize",tokenUrl:"https://mcp-uk.secureframe.com/oauth/token",resourceUrl:"https://mcp-uk.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp-uk.secureframe.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["secureframe.com URLs, SECUREFRAME_API_KEY / SECUREFRAME_API_SECRET environment variables","SOC 2, ISO 27001, HIPAA, PCI DSS, GDPR, or NIST compliance frameworks and controls","README/docs or compliance runbooks naming Secureframe for automated compliance and continuous monitoring"],helpText:"Query and manage Secureframe compliance data, controls, automated tests, vendors, risks, and framework requirements. Choose the US or UK region when connecting.",skill:"secureframe",setupSkill:"secureframe-setup"})});var Aue;var fue=h(()=>{de();Aue=U({id:"sentry",label:"Sentry",iconKey:"sentry",defaultServerUrl:"https://mcp.sentry.dev/mcp",serverUrlPathSuffixMaxSegments:2,transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"sentry",callbackPathSegment:"sentry",authorizationUrl:"https://mcp.sentry.dev/oauth/authorize",tokenUrl:"https://mcp.sentry.dev/oauth/token",useServerUrlAsResource:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.sentry.dev/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"org:read"},{value:"project:write"},{value:"team:write"},{value:"event:write"}],getUrlConfiguration:async()=>({docsUrl:"https://mcp.sentry.dev/",instructions:"Copy the hosted MCP server URL below. Optional: to scope this connection to one organization or project, copy a path-scoped URL from the Sentry MCP page (e.g. .../mcp/your-org).",defaultServerUrl:"https://mcp.sentry.dev/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["@sentry packages, sentry.properties, SENTRY_* environment variables, or sentry-cli usage","Sentry.init calls, release/deploy automation, or Sentry alert docs","README/docs naming Sentry as the error tracking provider"],helpText:"Browse Sentry organizations, teams, projects, and events."})});var yue;var bue=h(()=>{_t();de();yue=U({id:"signoz",label:"SigNoz",iconKey:"signoz",defaultServerUrl:"https://mcp.us.signoz.cloud/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["SigNoz config, SIGNOZ_* environment variables, or signoz.io links","OpenTelemetry Collector exporting to SigNoz, or a signoz docker-compose / self-hosted deployment","README/docs naming SigNoz for metrics, logs, traces, alerts, or dashboards"],helpText:"Query SigNoz metrics, logs, traces, alerts, and dashboards to investigate production issues.",setupGroups:[{id:"instance",title:"Find your SigNoz instance",description:"Point Sazabi at the SigNoz instance whose telemetry you want to query.",body:"For SigNoz Cloud, use the regional MCP endpoint for your account, such as `https://mcp.us.signoz.cloud/mcp` (replace the region as needed). For self-hosted SigNoz, use your instance's MCP endpoint and set the SigNoz base URL below so the server knows which instance to target.",fieldKeys:["signozUrl"]},{id:"api-key",title:"Create an API key",description:"Create or copy the SigNoz API key Sazabi will send to SigNoz's MCP endpoint.",body:"In SigNoz, go to **Settings > API Keys** and create or copy an API key. Alert, dashboard, and notification-channel tools require an admin-level key. Paste it below.",fieldKeys:["apiKey"]}],validateCredentials:Yae,normalizeHeaders:Kae})});var Iue;var Sue=h(()=>{de();Iue=U({id:"slack",label:"Slack",iconKey:"slack",defaultServerUrl:"https://mcp.slack.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"slack",callbackPathSegment:"slack",authorizationUrl:"https://slack.com/oauth/v2_user/authorize",tokenUrl:"https://slack.com/api/oauth.v2.user.access"},getAvailableScopes:async()=>[{value:"search:read.public"},{value:"search:read.private"},{value:"search:read.mpim"},{value:"search:read.im"},{value:"search:read.files"},{value:"search:read.users"},{value:"canvases:read"},{value:"users:read"},{value:"users:read.email"}],getUrlConfiguration:async()=>null,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Slack app manifests, bot/webhook URLs, SLACK_* environment variables, or slack.com links","Runbooks that route incidents, alerts, or deploy notices through Slack","Code or docs naming Slack channels for operational triage"],helpText:"Browse Slack messages, files, and threads. Coming soon — requires backend OAuth plumbing for user_scope and isn't self-serve connectable yet.",skill:"slack",setupSkill:"slack-setup"})});var Cue;var vue=h(()=>{de();Cue=U({id:"stripe",label:"Stripe MCP",iconKey:"stripe",defaultServerUrl:"https://mcp.stripe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"stripe",callbackPathSegment:"stripe",authorizationUrl:"https://access.stripe.com/mcp/oauth2/authorize",tokenUrl:"https://access.stripe.com/mcp/oauth2/token",resourceUrl:"https://mcp.stripe.com",dynamicClientRegistration:{registrationEndpoint:"https://access.stripe.com/mcp/oauth2/register",tokenEndpointAuthMethod:"none"},defaultAccessTokenTtlSeconds:21600},getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Access the Stripe MCP server tools for the connected account.",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Stripe dashboard URLs, `sk_`/`rk_`/`pk_` API keys, or Stripe object IDs (cus_, pi_, ch_)","STRIPE_* environment variables or code that imports the `stripe` SDK","README/runbooks naming Stripe for billing, payments, or subscriptions"],helpText:"Query and manage Stripe payments, customers, and billing."})});var Eue;var wue=h(()=>{de();Eue=U({id:"supabase",label:"Supabase",iconKey:"supabase",defaultServerUrl:"https://mcp.supabase.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"supabase",callbackPathSegment:"supabase",authorizationUrl:"https://api.supabase.com/v1/oauth/authorize",tokenUrl:"https://api.supabase.com/v1/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://api.supabase.com/platform/oauth/apps/register",tokenEndpointAuthMethod:"client_secret_post"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"analytics:read"},{value:"auth:read"},{value:"auth:write"},{value:"database:read"},{value:"database:write"},{value:"domains:read"},{value:"domains:write"},{value:"edge_functions:read"},{value:"edge_functions:write"},{value:"environment:read"},{value:"environment:write"},{value:"organizations:read"},{value:"projects:read"},{value:"projects:write"},{value:"rest:read"},{value:"rest:write"},{value:"secrets:read"},{value:"secrets:write"},{value:"storage:read"}],getUrlConfiguration:async()=>({docsUrl:"https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool",instructions:"Choose your project and options in the Supabase configuration panel, then copy the generated Server URL.",defaultServerUrl:"https://mcp.supabase.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["supabase/ directory, supabase/config.toml, or @supabase packages","SUPABASE_* or NEXT_PUBLIC_SUPABASE_* environment variables","README/docs naming Supabase for Postgres, Auth, Storage, or Edge Functions"],helpText:"Manage Supabase organizations, projects, databases, and run SQL.",skill:"supabase",setupSkill:"supabase-setup"})});var kue;var xue=h(()=>{de();kue=U({id:"superhuman",label:"Superhuman",iconKey:"superhuman",defaultServerUrl:"https://mcp.mail.superhuman.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"superhuman",callbackPathSegment:"superhuman",authorizationUrl:"https://mcp.auth.mail.superhuman.com/oauth2/authorize",tokenUrl:"https://mcp.auth.mail.superhuman.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.auth.mail.superhuman.com/oauth2/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"email",required:!0},{value:"offline_access",required:!0},{value:"openid",required:!0},{value:"profile",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Superhuman mail links, SUPERHUMAN_* environment variables, or support workflows naming Superhuman","Customer communication runbooks that depend on email search or drafting","Docs naming Superhuman Mail for sales, support, or founder-led customer comms"],helpText:"Search, draft, send, and triage emails in Superhuman Mail."})});var Pue;var Rue=h(()=>{_t();de();Pue=U({id:"the-context-company",label:"The Context Company",iconKey:"the-context-company",defaultServerUrl:"https://api.thecontext.company/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!1},evidenceHints:["The Context Company, context company, or context observability references","insight_search, get_agent_runs, or get_agent_sessions tool usage","THE_CONTEXT_COMPANY_API_KEY or api.thecontext.company in MCP configuration"],helpText:"Query agent insights, runs, and sessions through The Context Company's read-only hosted MCP server.",setupGroups:[{id:"api-key",title:"Create a read-only API key",description:"Create the API key The Context Company's hosted MCP server will use.",body:"Generate a read-only API key on The Context Company's [Access Data page](https://www.thecontextcompany.com/prod/mcp-and-api), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:jae,normalizeHeaders:zae,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var Tue;var Bue=h(()=>{de();Tue=U({id:"vercel",label:"Vercel",iconKey:"vercel",defaultServerUrl:"https://mcp.vercel.com",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"vercel",callbackPathSegment:"vercel",authorizationUrl:"https://vercel.com/oauth/authorize",tokenUrl:"https://vercel.com/api/login/oauth/token",resourceUrl:"https://mcp.vercel.com",dynamicClientRegistration:{registrationEndpoint:"https://vercel.com/api/login/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["vercel.com links, VERCEL_* environment variables, or a vercel.json in the repo","Deploy workflows or runbooks naming Vercel as the frontend/hosting provider","Vercel project/deployment IDs or preview URLs referenced in docs or CI"],helpText:"Manage Vercel projects, deployments, and access Vercel platform documentation. Coming soon — Vercel's hosted MCP only authorizes allowlisted clients and Sazabi is pending approval, so it isn't connectable yet."})});var Oue;var _ue=h(()=>{_t();de();Oue=U({id:"x",label:"X",iconKey:"x",defaultServerUrl:"https://api.x.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["search_news","get_news","get_trends_by_woeid","get_posts_by_ids","get_posts_counts_recent","search_posts_all","get_posts_by_id","get_posts_liking_users","get_posts_quoted_posts","get_posts_reposted_by","get_users_by_usernames","get_users_by_username","get_users_me","search_users","get_users_by_id","get_users_bookmarks","get_users_bookmark_folders","get_users_bookmarks_by_folder_id","get_users_mentions","get_users_timeline","get_users_posts"]},evidenceHints:["X (Twitter) API usage, X_BEARER_TOKEN, or TWITTER_* environment variables","twitter-api-v2, tweepy, or other X/Twitter API client packages","README/docs naming the X API, X Developer Platform, or tweet automation"],helpText:"Search X posts and access real-time X data using your app's app-only Bearer Token.",setupGroups:[{id:"developer-app",title:"Open the X Developer Portal",description:"Use an X developer project/app with access to the X API v2.",body:"Go to the [X Developer Portal](https://developer.x.com/en/portal/dashboard), open the project and app you want Sazabi to use, and confirm the app has access to the API tiers you need. The hosted MCP server lives at `https://api.x.com/mcp`."},{id:"bearer-token",title:"Copy the app's Bearer Token",description:"Copy the app-only Bearer Token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, find the app-only **Bearer Token** and copy it (regenerate it if you don't have it saved). This is the app-only token, not a user OAuth 2.0 access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:Uae,normalizeHeaders:Mae,skill:"x",setupSkill:"x-setup"})});var Que,lLt;var Lue=h(()=>{Cce();Ece();kce();Pce();Tce();eS();eS();_ce();Qce();Nce();zce();Uce();$ce();Hce();Vce();Yce();Jce();Xce();tle();ole();ile();ale();lle();dle();gle();hle();fle();ble();Sle();vle();wle();xle();Rle();Ble();_le();Qle();Nle();zle();Ule();$le();Hle();Vle();Yle();Jle();Xle();tue();oue();iue();aue();lue();due();gue();hue();fue();bue();Sue();vue();wue();xue();Rue();Bue();_ue();Que=[Eue,rle,sle,vce,Sce,wce,xce,Rce,Bce,Oce,Dce,Lce,Mce,jce,Fce,qce,Kce,Wce,Zce,Gce,ele,nle,cle,ule,ple,mle,Ale,yle,Ile,Cle,Ele,kle,Ple,Tle,Ole,Dle,Lle,Mle,jle,Fle,Gle,qle,Kle,Wle,Zle,eue,nue,sue,rue,cue,uue,pue,mue,Aue,yue,Iue,Cue,kue,Pue,Tue,Oue],lLt=new Map(Que.map((e)=>[e.id,e]))});var Nue=()=>{};var Mue=()=>{};var zue=()=>{};var jue=()=>{};var Uue=()=>{};var Fue=()=>{};var $ue=()=>{};var Gue=()=>{};var Hue=()=>{};var que=()=>{};var Vue=()=>{};var Kue=()=>{};var Yue=()=>{};var Wue=()=>{};var Jue=()=>{};var Zue=()=>{};var Xue=()=>{};var ede=()=>{};var tde=()=>{};var nde=()=>{};var ode=()=>{};var rde=()=>{};var ide=()=>{};var sde=()=>{};var ade=()=>{};var cde=()=>{};var lde=()=>{};var ude=()=>{};var dde=()=>{};var pde=()=>{};var gde=()=>{};var mde=()=>{};var hde=()=>{};var Ade=()=>{};var fde=()=>{};var yde=()=>{};var bde=()=>{};var Ide=()=>{};var Sde=()=>{};var Cde=()=>{};var vde=()=>{};var Ede=()=>{};var wde=()=>{};var kde=()=>{};var xde=h(()=>{Nue();Mue();zue();jue();Uue();Fue();$ue();Gue();Hue();que();Vue();Kue();Yue();Wue();Jue();Zue();Xue();ede();tde();nde();ode();rde();ide();sde();ade();cde();lde();ude();dde();pde();gde();mde();hde();Ade();fde();yde();bde();Ide();Sde();Cde();vde();Ede();wde();kde()});var Pde=h(()=>{eS()});var Rde=()=>{};var Tde=h(()=>{ZY();Jf();Tae();_t();hce();Ace();Lue();dN();xde();Pde();Rde()});var Bde,B3e,Ode,O3e,_de,pN,Dde,Qde,Is,Lde,Nde,Mde,fu,zde,jde,yu,Ude,Fde,bu,$de,_3e,Gde,tS,Hde,qde,Vde,Kde,Iu,Yde,Wde,Su,Jde,Zde,Cu,gN,mN,Xde,epe,vu,tpe,npe,Eu,ope,D3e,wu,rpe,ipe,ku,spe,ape,xu,cpe,lpe,Pu,Q3e;var hN=h(()=>{Tde();De();Ve();Bde=["configured","authorizing","connected","error"],B3e=a.enum(Bde),Ode=["preset","custom"],O3e=a.enum(Ode),_de=["streamable-http","sse"],pN=a.enum(_de),Dde=["none","headers","oauth","aws-sigv4"],Qde=a.enum(Dde),Is=a.object({connectionId:a.string().uuid().describe("Connection ID."),connectionKey:a.string().describe("Stable key used to reference this connector in tool calls."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),source:O3e.describe("Whether the connector is a built-in preset or a custom server."),installStatus:B3e.describe("Current connection lifecycle status."),authMode:Qde.describe("Authentication mode."),transport:pN.describe("Transport protocol."),serverUrl:a.string().describe("MCP server URL."),readOnly:a.boolean().describe("Whether the connector is restricted to read-only tools."),management:vB.describe("Lifecycle owner and supported connector mutations."),enabledToolCount:a.number().int().nonnegative().describe("Number of tools enabled and available for this connector."),connectedAt:a.string().datetime().nullable().describe("When the connector last became connected, if ever."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Lde=a.object({name:a.string().describe("Tool name as invoked."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),enabled:a.boolean().describe("Whether the tool is enabled and available given the connector config.")}),Nde=a.object({projectId:a.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:a.union([a.boolean(),a.stringbool()]).optional().describe("When true, only return connectors that are connected.")}),Mde=a.object({connectors:a.array(Is)}),fu=E({operationId:"mcpConnectors.list",description:"List configured MCP connectors within one project with provider, status, and enabled-tool count.",backend:"api",route:{method:"GET",path:"/mcp-connectors",tags:["MCP Connectors"]},input:Nde,output:Mde,pagination:"none",async:"sync"}),zde=a.object({connectionId:a.string().uuid().describe("Connection ID to fetch."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),jde=a.object({connector:Is}),yu=E({operationId:"mcpConnectors.get",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:zde,output:jde,pagination:"none",async:"sync"}),Ude=a.object({connectionId:a.string().uuid().describe("Connection ID to inspect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),Fde=a.object({connector:Is,tools:a.array(Lde)}),bu=E({operationId:"mcpConnectors.details",description:"Inspect one MCP connector's tool surface, including each tool's name, description, and read-only status.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}/details",tags:["MCP Connectors"]},input:Ude,output:Fde,pagination:"none",async:"sync"}),$de=a.object({providerId:a.string().describe('Provider identifier, e.g. "linear".'),label:a.string().describe("Human-readable provider name."),authMode:Qde.describe("Authentication mode."),availability:a.enum(Xc).describe("Whether the provider is enabled or coming soon."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),_3e=a.object({}),Gde=a.object({providers:a.array($de)}),tS=E({operationId:"mcpConnectors.listProviders",description:"List all supported MCP connector providers with their auth mode and setup skill.",backend:"api",route:{method:"GET",path:"/mcp-connectors/providers",tags:["MCP Connectors"]},input:_3e,output:Gde,pagination:"none",async:"sync"}),Hde=a.object({connectionKey:a.string().describe("Stable key used to call this connector."),displayName:a.string().describe("Human-readable connector name."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),toolCount:a.number().int().nonnegative().describe("Number of executable tools on this connector.")}),qde=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),description:a.string().describe("Tool description from the stored snapshot."),score:a.number().describe("BM25 rank score. Zero when enumerating a namespace."),inputSchema:a.record(a.string(),a.unknown()).optional().describe("JSON Schema for the tool's arguments, when requested.")}),Vde=a.object({projectId:a.string().uuid().optional().describe("Project to search connectors in. Auto-filled from SDK context when omitted."),query:a.string().optional().describe("Free-text query over tool names, titles, connector keys, and descriptions. Omit or empty to list connectors, or to enumerate one connector when namespace is set."),namespace:a.string().min(1).optional().describe("Restrict results to one connectionKey or providerId."),limit:a.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of connectors or tool hits to return."),offset:a.coerce.number().int().min(0).default(0).describe("Number of connectors or tool hits to skip."),includeInputSchema:a.union([a.boolean(),a.stringbool()]).optional().describe("When true, tool hits include inputSchema so a caller can execute without a describe round-trip.")}),Kde=a.object({kind:a.enum(["connectors","tools"]).describe("connectors when the query is empty and no namespace is set; tools otherwise."),total:a.number().int().nonnegative().describe("Total matches before limit and offset."),connectors:a.array(Hde).describe("Connector index. Empty when kind is tools."),tools:a.array(qde).describe("Ranked or enumerated tool hits. Empty when kind is connectors.")}),Iu=E({operationId:"mcpConnectors.search",description:"Search executable third-party MCP connector tools by free-text query. Empty query lists connectors; empty query plus namespace enumerates that connector. Hits omit input schemas unless includeInputSchema is true.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/search",tags:["MCP Connectors"]},input:Vde,output:Kde,pagination:"none",async:"sync"}),Yde=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked.")}),Wde=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description from the stored snapshot."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),inputSchema:a.record(a.string(),a.unknown()).describe("JSON Schema for the tool's arguments.")}),Su=E({operationId:"mcpConnectors.describe",description:"Load one executable third-party MCP connector tool, including its input schema.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/describe",tags:["MCP Connectors"]},input:Yde,output:Wde,pagination:"none",async:"sync"}),Jde=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked."),arguments:a.record(a.string(),a.unknown()).optional().describe("Arguments matching the tool's input schema.")}),Zde=a.discriminatedUnion("ok",[a.object({ok:a.literal(!0),connectionKey:a.string().describe("Connector that ran the tool."),toolName:a.string().describe("Tool name as invoked."),result:a.unknown().describe("Vendor tool result payload."),structuredContent:a.unknown().optional().describe("Structured content from the vendor when present."),content:a.array(a.record(a.string(),a.unknown())).describe("Raw MCP content parts from the vendor."),text:a.string().nullable().describe("Concatenated text content, if any.")}),a.object({ok:a.literal(!1),code:a.enum(["TOOL_NOT_ENABLED","READ_ONLY","MCP_ERROR"]).describe("Why the tool did not run."),message:a.string().describe("Caller-facing error message.")})]),Cu=E({operationId:"mcpConnectors.call",description:"Invoke one executable third-party MCP connector tool using that connection's stored credential.",backend:"api",route:{method:"POST",path:"/mcp-connectors/tools/call",tags:["MCP Connectors"]},input:Jde,output:Zde,pagination:"none",async:"sync"}),gN=a.object({id:a.string().min(1).describe("Stable ID for this header (must be unique within the connector)."),name:a.string().trim().min(1).describe("HTTP header name."),value:a.string().min(1).describe("HTTP header value (passed verbatim).")}),mN=a.object({accessKeyId:a.string().trim().min(1).describe("AWS access key ID."),secretAccessKey:a.string().min(1).describe("AWS secret access key."),sessionToken:a.string().min(1).optional().describe("Optional session token for temporary credentials."),region:a.string().trim().min(1).describe("AWS region.")}),Xde=a.object({projectId:a.string().uuid().optional().describe("Project to create the connector in. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().describe("MCP server URL (must be https)."),transport:pN.describe("Transport protocol."),headers:a.array(gN).optional().describe("HTTP headers to send with each request."),awsSigV4:mN.optional().describe("AWS SigV4 credentials for AWS MCP servers."),providerId:a.string().min(1).describe("Built-in preset provider ID (for example, linear or datadog)."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools. Defaults to false.")}),epe=a.object({connector:Is}),vu=E({operationId:"mcpConnectors.create",description:"Create a preset MCP connector with header-based or AWS SigV4 authentication. The server URL must match the selected provider's supported endpoints. Connects immediately and returns the connector with its discovered tool snapshot.",backend:"api",route:{method:"POST",path:"/mcp-connectors",tags:["MCP Connectors"],successStatus:201},input:Xde,output:epe,pagination:"none",async:"sync"}),tpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().optional().describe("New MCP server URL."),transport:pN.optional().describe("New transport protocol."),headers:a.array(gN).optional().describe("Complete replacement header set. Replaces all existing headers."),awsSigV4:mN.optional().describe("Replacement AWS SigV4 credentials. Mutually exclusive with headers.")}),npe=a.object({connector:Is}),Eu=E({operationId:"mcpConnectors.update",description:"Deprecated. Preset MCP connector updates are no longer supported via the public API; disconnect and reconnect instead.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:tpe,output:npe,pagination:"none",async:"sync"}),ope=a.object({connectionId:a.string().uuid().describe("Connection ID to disconnect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),D3e=a.void(),wu=E({operationId:"mcpConnectors.disconnect",description:"Disconnect and permanently remove an MCP connector.",backend:"api",route:{method:"DELETE",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"],successStatus:204},input:ope,output:D3e,pagination:"none",async:"sync"}),rpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),readOnly:a.boolean().describe("True to restrict to read-only tools; false to allow all enabled tools.")}),ipe=a.object({connector:Is}),ku=E({operationId:"mcpConnectors.setReadOnly",description:"Toggle the read-only restriction on an MCP connector.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}/read-only",tags:["MCP Connectors"]},input:rpe,output:ipe,pagination:"none",async:"sync"}),spe=a.object({projectId:a.string().uuid().optional().describe("Project to install into. Auto-filled from SDK context when omitted."),providerId:a.string().min(1).describe('Provider ID to install, e.g. "linear".'),requestedScopes:a.array(a.string()).optional().describe("Scopes to request. Defaults to the provider's recommended scope set."),serverUrl:a.string().url().optional().describe("Server URL for multi-region providers; defaults to the provider's primary server."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools after install. Defaults to false."),returnTo:a.string().optional().describe("Path to redirect the user to after OAuth completes.")}),ape=a.object({authorizationUrl:a.string().describe("Authorization URL to open in the user's browser."),connectionId:a.string().uuid().describe("Connection ID to poll for completion via getMcpOAuthInstallAttempt."),expiresAt:a.string().datetime().describe("When the OAuth authorization attempt expires.")}),xu=E({operationId:"mcpConnectors.beginOAuthInstall",description:"Begin an OAuth browser flow to install a preset MCP connector. Opens an authorization URL in the user's browser; poll getMcpOAuthInstallAttempt with the returned connectionId to check completion.",backend:"api",route:{method:"POST",path:"/mcp-connectors/oauth/begin",tags:["MCP Connectors"],successStatus:201},input:spe,output:ape,pagination:"none",async:"sync"}),cpe=a.object({connectionId:a.string().uuid().describe("Connection ID returned by beginMcpOAuthInstall."),projectId:a.string().uuid().optional().describe("Project the connection belongs to. Auto-filled from SDK context when omitted.")}),lpe=a.object({status:a.enum(["authorizing","connected","error"]).describe("Current install status."),connector:Is.optional().describe("Connector details once connected or in error state.")}),Pu=E({operationId:"mcpConnectors.getOAuthInstallAttempt",description:"Poll the status of an in-progress OAuth MCP connector install. Returns authorizing while the user completes the browser flow, connected on success, or error on failure.",backend:"api",route:{method:"GET",path:"/mcp-connectors/oauth/attempts/{connectionId}",tags:["MCP Connectors"]},input:cpe,output:lpe,pagination:"none",async:"sync"}),Q3e={list:fu.contract,get:yu.contract,details:bu.contract,listProviders:tS.contract,search:Iu.contract,describe:Su.contract,call:Cu.contract,create:vu.contract,update:Eu.contract,disconnect:wu.contract,setReadOnly:ku.contract,beginOAuthInstall:xu.contract,getOAuthInstallAttempt:Pu.contract}});var Ss,L3e,N3e,M3e,z3e,j3e,U3e,F3e,AN,Jzt;var nS=h(()=>{De();Ve();Ss=a.enum(["admin","member"]),L3e=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional(),role:Ss}),N3e=a.object({id:a.string().min(1),name:a.string().nullable(),email:a.string().email()}),M3e=a.object({credentialType:a.literal("user"),user:N3e,authorizedOrganizationId:a.string().min(1).nullable(),authorizedProjectId:a.string().min(1).nullable(),organizations:a.array(L3e).describe("Organizations the user belongs to, including membership role.")}),z3e=a.object({credentialType:a.literal("secret"),organization:a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),keyName:a.string()}),j3e=a.object({credentialType:a.literal("partner"),superorganization:a.object({id:a.string().uuid(),name:a.string()})}),U3e=a.object({}),F3e=a.discriminatedUnion("credentialType",[M3e,z3e,j3e]),AN=E({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:U3e,output:F3e,pagination:"none",async:"sync"}),Jzt=AN.contract});var upe,dpe,ppe,$3e,G3e,H3e,q3e,V3e,K3e,fN,yN,bN,Y3e,W3e,J3e,Z3e,X3e,e9e,IN,SN,CN,njt;var gpe=h(()=>{De();Ve();nS();upe=a.object({membershipId:a.string().min(1).describe("Organization membership record ID."),userId:a.string().min(1).describe("User ID for the organization member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),imageUrl:a.string().nullable().describe("Profile image URL for the member, when available."),role:Ss.describe("Organization role."),createdAt:a.string().datetime().describe("When the membership was created.")}),dpe=a.object({id:a.string().min(1).describe("Invitation ID."),email:a.string().email().describe("Invited email address."),role:Ss.describe("Role the invitee will receive when they accept."),status:a.string().min(1).describe('Invitation status (e.g. "pending").'),createdAt:a.string().datetime().describe("When the invitation was created."),expiresAt:a.string().datetime().describe("When the invitation expires.")}),ppe=a.string().min(1).describe("A user ID, or a URL-encoded email address, of the member."),$3e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),G3e=a.object({members:a.array(upe).describe("Members visible within the selected organization.")}),H3e=a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),member:ppe.describe("User ID, or URL-encoded email address, of the member to update."),role:Ss.describe("Role to assign.")}),q3e=a.object({member:upe.describe("Updated organization member.")}),V3e=a.object({params:a.object({member:ppe.describe("User ID, or URL-encoded email address, of the member to remove.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),K3e=a.object({removedUserId:a.string().min(1).describe("User ID removed from the organization.")}),fN=E({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:$3e,output:G3e,pagination:"none",async:"sync",examples:[{name:"organization-members",input:{organizationId:"organization-123"},output:{members:[{membershipId:"membership-123",userId:"user-123",name:"Alex Admin",email:"alex@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}]}}]}),yN=E({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{member}/role",tags:["Members"]},input:H3e,output:q3e,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",member:"user-456",role:"admin"},output:{member:{membershipId:"membership-456",userId:"user-456",name:"Mina Member",email:"mina@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}}}]}),bN=E({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{member}",tags:["Members"],inputStructure:"detailed"},input:V3e,output:K3e,pagination:"none",async:"sync"}),Y3e=a.object({organizationId:a.string().min(1).optional().describe("Organization to invite into. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),email:a.string().email().describe("Email address to invite."),role:Ss.optional().default("member").describe('Role to grant on acceptance. Defaults to "member".')}),W3e=a.object({invitation:dpe.describe("The created pending invitation.")}),J3e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list invitations for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),Z3e=a.object({invitations:a.array(dpe).describe("Pending invitations visible within the selected organization.")}),X3e=a.object({params:a.object({invitationId:a.string().min(1).describe("ID of the invitation to revoke.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the invitation. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),e9e=a.object({revokedInvitationId:a.string().min(1).describe("ID of the revoked invitation.")}),IN=E({operationId:"members.invite",description:"Invite a person to the organization by email.",backend:"api",route:{method:"POST",path:"/members/invitations",tags:["Members"],successStatus:201},input:Y3e,output:W3e,pagination:"none",async:"sync",examples:[{name:"invite-member",input:{organizationId:"organization-123",email:"newhire@example.com",role:"member"},output:{invitation:{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}}}]}),SN=E({operationId:"members.listInvitations",description:"List pending invitations for an organization.",backend:"api",route:{method:"GET",path:"/members/invitations",tags:["Members"]},input:J3e,output:Z3e,pagination:"none",async:"sync",examples:[{name:"organization-invitations",input:{organizationId:"organization-123"},output:{invitations:[{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}]}}]}),CN=E({operationId:"members.revokeInvitation",description:"Revoke a pending invitation.",backend:"api",route:{method:"DELETE",path:"/members/invitations/{invitationId}",tags:["Members"],inputStructure:"detailed"},input:X3e,output:e9e,pagination:"none",async:"sync"}),njt={list:fN.contract,updateRole:yN.contract,remove:bN.contract,invite:IN.contract,listInvitations:SN.contract,revokeInvitation:CN.contract}});var hpe,Ape,oS,fpe,rS,mpe=4194304,vN,EN,t9e=(e)=>{let t=e.split(",").map((r)=>r.trim()).filter(Boolean),n=a.array(oS).safeParse(t);if(!n.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return n.data},lm,wN,kN,ype,bpe,Ipe,Spe,Cpe,vpe,Epe,wpe,kpe,xpe,Ppe,Rpe,Ru,Tu,Bu,Ou,_u,n9e;var xN=h(()=>{De();Ve();hpe=["note","runbook"],Ape=["note","runbook","change"],oS=a.enum(Ape),fpe=a.enum(hpe),rS=a.string().min(1).max(512).refine((e)=>!e.startsWith("/"),{message:"Path must be relative without a leading slash."}).describe("Relative memory path, for example AGENTS.md or notes/architecture.md."),vN=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=mpe,{message:`Memory body must be at most ${mpe} bytes (4 MiB).`}).describe("Document body stored in project memory."),EN=a.string().regex(/^(\d+)(s|m|h|d)$/u,"Duration must use s, m, h, or d units, for example 7d or 30m.").describe("Relative time window, for example 7d or 30m."),lm=a.string().min(1).transform(t9e).describe("Comma-separated kinds, for example note,runbook."),wN=a.object({id:a.string().uuid(),projectId:a.string().uuid(),kind:oS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),contentHash:a.string(),attrs:a.record(a.string(),a.unknown()),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),kN=wN.extend({body:vN}),ype=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:rS.describe("Relative path for the curated document."),body:vN,kind:fpe.default("note").describe("Curated document kind. Only note and runbook may be written through the API."),title:a.string().max(500).optional().describe("Optional display title. Defaults to the path basename.")}),bpe=a.object({document:kN}),Ipe=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:rS.optional().describe("Relative curated path.")}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),Spe=a.object({document:kN}),Cpe=a.object({projectId:a.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:lm.optional(),since:EN.optional().describe("Only return documents updated within this window, for example 7d."),service:a.string().min(1).optional().describe("Filter to documents whose attrs.services contains this value."),pathPrefix:a.string().min(1).optional().describe("Filter to paths starting with this prefix."),managed:a.coerce.boolean().optional(),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of documents to return per page.")}),vpe=a.object({documents:a.array(wN),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),Epe=a.object({documentId:a.string().uuid(),kind:oS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),snippet:a.string(),score:a.number()}),wpe=a.object({calibrated:a.literal(!0),minScoreThreshold:a.number(),queryTerms:a.array(a.string()),message:a.string()}),kpe=a.object({projectId:a.string().uuid().optional().describe("Project to search memory for. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1).max(500).describe("Natural-language search query."),kind:lm.optional(),since:EN.optional(),service:a.string().min(1).optional(),pathPrefix:a.string().min(1).optional(),managed:a.coerce.boolean().optional(),limit:a.coerce.number().int().min(1).max(50).default(10).describe("Maximum ranked search hits to return.")}),xpe=a.object({hits:a.array(Epe),emptyVerdict:wpe.nullable()}),Ppe=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:rS.optional()}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),Rpe=a.void(),Ru=E({operationId:"memory.put",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:ype,output:bpe,pagination:"none",async:"sync"}),Tu=E({operationId:"memory.get",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:Ipe,output:Spe,pagination:"none",async:"sync"}),Bu=E({operationId:"memory.list",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:Cpe,output:vpe,pagination:"cursor",async:"sync"}),Ou=E({operationId:"memory.search",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:kpe,output:xpe,pagination:"none",async:"sync"}),_u=E({operationId:"memory.delete",description:"Soft-delete a curated project memory document by id or path.",backend:"api",route:{method:"DELETE",path:"/memory/document",successStatus:204,tags:["Memory"]},input:Ppe,output:Rpe,pagination:"none",async:"sync"}),n9e={put:Ru.contract,get:Tu.contract,list:Bu.contract,search:Ou.contract,delete:_u.contract}});var Tpe,Bpe,o9e,r9e,i9e,s9e,a9e,um,c9e,l9e,u9e,PN,RN,TN,BN,ljt;var iS=h(()=>{De();Ve();Tpe=a.enum(["processing","completed","aborted","error"]),Bpe=a.object({id:a.string().uuid(),threadId:a.string().uuid(),userMessageId:a.string().uuid().nullable(),assistantMessageId:a.string().uuid().nullable(),parentRunId:a.string().uuid().nullable(),workflowRunId:a.string().nullable(),status:Tpe,source:a.enum(["app","api","mcp","slack","teams","linear","github","agent","cli","web","sdk","bitbucket","system"]),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),completedAt:a.string().datetime().nullable()}),o9e=a.object({projectId:a.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),r9e=a.object({runs:a.array(Bpe),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),i9e=a.object({threadId:a.string().uuid().describe("Thread ID to list runs for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),s9e=a.object({runs:a.array(Bpe),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),a9e=a.object({runId:a.string().uuid().describe("Run ID returned by a deferred operation.")}),um=a.object({completed:a.boolean().describe("Whether the run has reached a terminal status."),threadId:a.string().uuid().describe("Thread ID associated with the run."),runId:a.string().uuid().describe("Run ID for subsequent polling."),messageId:a.string().uuid().optional().describe("ID of the user message that triggered this run."),status:Tpe.describe("Current run lifecycle status."),response:a.string().nullable().describe("Assistant response text when the run has completed.")}),c9e=um.describe("Current run state and, when complete, the assistant response."),l9e=a.object({runId:a.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),u9e=a.object({success:a.literal(!0).describe("Always true when the cancellation request was accepted.")}),PN=E({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:o9e,output:r9e,pagination:"cursor",async:"sync"}),RN=E({operationId:"runs.listForThread",summary:"List Runs for a Thread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:i9e,output:s9e,pagination:"cursor",async:"sync"}),TN=E({operationId:"runs.get",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:a9e,output:c9e,pagination:"none",async:"sync",examples:[{name:"processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),BN=E({operationId:"runs.cancel",description:"Request cancellation of an in-flight run. Idempotent and best-effort: returns success even when the run has already reached a terminal status.",backend:"api",route:{method:"POST",path:"/runs/{runId}/cancel",tags:["Runs"]},input:l9e,output:u9e,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),ljt={list:PN.contract,listForThread:RN.contract,get:TN.contract,cancel:BN.contract}});var sS=(e,t,n)=>{let r=t?20000:1e4;if(e.length>r)n.addIssue({code:"too_big",maximum:r,type:"string",inclusive:!0,message:`Message cannot exceed ${r} characters`,origin:"string",path:["message"]})},aS=(e,t,n)=>{if(e&&!t)n.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var Ope,dm,d9e,p9e,g9e,m9e,h9e,A9e,f9e,y9e,b9e,ON,I9e,S9e,C9e,v9e,E9e,w9e,k9e,x9e,P9e,R9e,T9e,B9e,_N,DN,QN,LN,NN,MN,_pe,O9e,_9e,D9e,Q9e,Dpe,L9e,N9e,M9e,z9e,j9e,U9e,Fa="22222222-2222-4222-8222-222222222222",Qpe="11111111-1111-4111-8111-111111111111",F9e="44444444-4444-4444-8444-444444444444",Lpe="55555555-5555-4555-8555-555555555555",zN,jN,UN,FN,$N,Ajt;var GN=h(()=>{De();Ve();iS();Ope=a.enum(["slack","teams","linear","github","app","mcp","agent","api","cli","web","sdk","bitbucket","system"]),dm=a.object({id:a.string().uuid(),projectId:a.string().uuid(),title:a.string().nullable(),status:a.enum(["regular","archived"]),source:Ope.nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),d9e=a.object({type:a.literal("message"),message:a.string()}),p9e=a.object({type:a.literal("reasoning"),reasoning:a.string(),status:a.enum(["in_progress","complete"]).optional()}),g9e=a.object({type:a.literal("tool_call"),name:a.string(),params:a.any().optional(),result:a.any().optional(),status:a.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:a.string().optional(),durationMs:a.number().nonnegative().optional()}),m9e=a.object({type:a.literal("artifact"),name:a.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card","mdx"]),data:a.any(),toolCallId:a.string().optional()}),h9e=a.object({type:a.literal("fork"),sourceThreadId:a.string(),sourceMessageId:a.string(),sourceThreadTitle:a.string().nullable()}),A9e=a.object({type:a.literal("summary"),summary:a.string()}),f9e=a.object({type:a.literal("slack_context"),channelId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({timestamp:a.string(),slackUserId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),files:a.array(a.object({name:a.string(),mimetype:a.string(),size:a.number().optional(),attachmentId:a.string().uuid().optional(),ingestionStatus:a.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),y9e=a.object({type:a.literal("teams_context"),conversationId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({activityId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),createdDateTime:a.string().optional()}))}),b9e=a.union([d9e,p9e,g9e,m9e,h9e,A9e,f9e,y9e]),ON=a.object({id:a.string().uuid(),role:a.enum(["user","assistant"]),content:a.array(b9e),source:Ope,createdAt:a.string().datetime()}),I9e=a.object({projectId:a.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:a.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),S9e=a.object({threads:a.array(dm).describe("The page of threads matching the query."),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),C9e=a.object({threadId:a.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),v9e=a.object({thread:dm.describe("The requested thread."),messages:a.array(ON).describe("Messages currently stored on the thread in chronological order.")}),E9e=a.object({projectId:a.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:a.string().min(1,"Message cannot be empty").describe("Initial user message that starts the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{sS(e.message,e.automationId,t),aS(e.ambientServiceRun,e.automationId,t)}),w9e=um.describe("Deferred run result for creating a thread."),k9e=a.object({threadId:a.string().uuid().describe("Thread ID whose current processing status should be returned.")}),x9e=a.object({status:a.enum(["idle","processing"]),lastRunStatus:a.enum(["error"]).nullable()}),P9e=a.object({threadId:a.string().uuid().describe("Thread ID whose active run should be stopped.")}),R9e=a.object({success:a.literal(!0).describe("Always true when the stop request was accepted.")}),T9e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),status:a.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),B9e=a.object({thread:dm.describe("The updated thread.")}),_N=E({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:I9e,output:S9e,pagination:"cursor",async:"sync",examples:[{name:"active-threads",input:{projectId:"11111111-1111-4111-8111-111111111111",status:"regular",limit:10},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),DN=E({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:C9e,output:v9e,pagination:"none",async:"sync"}),QN=E({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:k9e,output:x9e,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),LN=E({operationId:"threads.stop",description:"Stop a thread's in-flight run. Idempotent and best-effort: returns success even when the thread has no active run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/stop",tags:["Threads"]},input:P9e,output:R9e,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),NN=E({operationId:"threads.create",description:"Create a thread with an initial message and optionally wait for the agent response.",backend:"api",route:{method:"POST",path:"/threads",tags:["Threads"],successStatus:201},input:E9e,output:w9e,pagination:"none",async:"deferred",examples:[{name:"async-handoff",input:{projectId:"11111111-1111-4111-8111-111111111111",message:"Investigate elevated 500s in production.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),MN=E({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:T9e,output:B9e,pagination:"none",async:"sync",examples:[{name:"archive-thread",input:{threadId:"22222222-2222-4222-8222-222222222222",status:"archived"},output:{thread:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"archived",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),_pe=a.enum(["private","organization"]),O9e=a.object({threadId:a.string().uuid().describe("Thread ID of the source thread to fork."),messageId:a.string().uuid().describe("Message ID in the source thread to fork from. The new thread copies messages up to and including this message.")}),_9e=a.object({thread:dm.describe("The newly created forked thread.")}),D9e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),visibility:_pe.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),Q9e=a.object({thread:dm.describe("The updated thread."),visibility:_pe.describe("The thread's resulting visibility.")}),Dpe=a.object({shareId:a.string().uuid().describe("Unique identifier for the snapshot."),threadId:a.string().uuid().describe("Thread the snapshot was taken from."),url:a.string().describe("Public read-only URL for the snapshot."),createdAt:a.string().datetime()}),L9e=a.object({threadId:a.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),N9e=a.object({share:Dpe.describe("The created share link.")}),M9e=a.object({threadId:a.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:a.string().uuid().describe("Snapshot ID to revoke.")}),z9e=a.void(),j9e=a.object({threadId:a.string().uuid().describe("Thread ID to list public snapshots for.")}),U9e=a.object({shares:a.array(Dpe).describe("Active share links for the thread.")}),zN=E({operationId:"threads.fork",description:"Fork a thread from a specific message, creating a new thread that copies messages up to that point.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/fork",tags:["Threads"],successStatus:201},input:O9e,output:_9e,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:Fa,messageId:F9e},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:Qpe,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),jN=E({operationId:"threads.setVisibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:D9e,output:Q9e,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:Fa,visibility:"private"},output:{thread:{id:Fa,projectId:Qpe,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),UN=E({operationId:"threads.createShareLink",description:"Create a public read-only share link for a thread's current messages.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/share",tags:["Threads"],successStatus:201},input:L9e,output:N9e,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:Fa},output:{share:{shareId:Lpe,threadId:Fa,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),FN=E({operationId:"threads.listShareLinks",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:j9e,output:U9e,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:Fa},output:{shares:[{shareId:Lpe,threadId:Fa,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),$N=E({operationId:"threads.revokeShareLink",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:M9e,output:z9e,pagination:"none",async:"sync"}),Ajt={list:_N.contract,get:DN.contract,getStatus:QN.contract,stop:LN.contract,create:NN.contract,update:MN.contract,fork:zN.contract,setVisibility:jN.contract,createShareLink:UN.contract,listShareLinks:FN.contract,revokeShareLink:$N.contract}});var $9e,G9e,H9e,q9e,Npe,Mpe;var zpe=h(()=>{De();Ve();iS();GN();$9e=a.object({threadId:a.string().uuid().describe("Thread ID to list messages for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),G9e=a.object({messages:a.array(ON),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),H9e=a.object({threadId:a.string().uuid().describe("Thread ID to append the message to."),message:a.string().min(1,"Message cannot be empty").describe("Message body to append to the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{sS(e.message,e.automationId,t),aS(e.ambientServiceRun,e.automationId,t)}),q9e=um.describe("Deferred run result for appending a message to an existing thread."),Npe=E({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:$9e,output:G9e,pagination:"cursor",async:"sync",examples:[{name:"thread-messages",input:{threadId:"22222222-2222-4222-8222-222222222222",limit:2},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",role:"user",content:[{type:"message",message:"What changed in the intake pipeline?"}],source:"api",createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Mpe=E({operationId:"messages.append",description:"Append a user message to an existing thread and trigger a deferred run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/messages",successStatus:201,tags:["Messages"]},input:H9e,output:q9e,pagination:"none",async:"deferred",examples:[{name:"append-processing",input:{threadId:"22222222-2222-4222-8222-222222222222",message:"Follow up on the intake backlog.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]})});var ho,Upe,HN,Du,qN,cS,Cs,Fpe,jpe;var pm=h(()=>{De();ho={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",MICROSOFT_TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},Upe=[ho.IN_APP,ho.SLACK,ho.EMAIL,ho.SMS],HN=[ho.SLACK_CHANNEL,ho.MICROSOFT_TEAMS_CHANNEL,ho.INCIDENT_IO,ho.PAGERDUTY,ho.ROOTLY,ho.WEBHOOK],Du=Object.values(ho),qN=[...Du,"victorops"],cS=a.enum(Du),Cs=a.enum(HN),Fpe=[{channel:"in_app",name:"In-app",description:"Show notifications in your Sazabi notification feed.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"email",name:"Email",description:"Send notifications to your account email address.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"sms",name:"SMS",description:"Send notifications to your verified phone number.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/account?phone-number=add"},{channel:"slack",name:"Slack DMs",description:"Send personal notifications by Slack DM.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/connected-accounts/slack"},{channel:"slack_channel",name:"Slack",description:"Post this project's alerts to selected Slack channels.",scope:"project",destinationManagement:"slack_channels",projectIntegrationPath:"slack"},{channel:"teams_channel",name:"Microsoft Teams",description:"Post this project's alerts to selected Microsoft Teams channels.",scope:"project",destinationManagement:"teams_channels",projectIntegrationPath:"teams"},{channel:"incident_io",name:"incident.io",description:"Route this project's alerts to incident.io.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"incident-io"},{channel:"pagerduty",name:"PagerDuty",description:"Route this project's alerts to PagerDuty.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"pagerduty"},{channel:"rootly",name:"Rootly",description:"Route this project's alerts to Rootly.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"rootly"},{channel:"webhook",name:"Webhooks",description:"Send this project's alerts to configured HTTPS endpoints.",scope:"project",destinationManagement:"webhook_endpoints",projectSettingsPath:"webhooks"}],jpe=new Set(Fpe.map(({channel:e})=>e));if(jpe.size!==Du.length||Du.some((e)=>!jpe.has(e)))throw Error("Notification channel definitions must represent every channel")});var $pe,V9e=(e,t)=>e.value===t.value&&e.label===t.label&&e.scope===t.scope&&e.role===t.role&&e.defaultOff===t.defaultOff&&(e.defaultOffChannels??[]).join(",")===(t.defaultOffChannels??[]).join(",")&&e.email?.template===t.email?.template&&e.email?.ctaLabel===t.email?.ctaLabel&&(e.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),Dn=(e)=>{for(let t of Object.values(e)){let n=$pe.get(t.value);if(n&&!V9e(n,t))throw Error(`Notification type registered twice with conflicting definitions: ${t.value}`);if(t.role!==void 0&&t.scope!=="org")throw Error(`Notification type role restrictions require org scope: ${t.value}`);if(t.label.trim().length===0)throw Error(`Notification type needs a display label: ${t.value}`);if(t.email&&t.email.ctaLabel.trim().length===0)throw Error(`Notification email presentation needs a CTA label: ${t.value}`);if(t.defaultOff&&t.defaultOffChannels)throw Error(`Notification type declares both defaultOff and defaultOffChannels: ${t.value}`);$pe.set(t.value,t)}return e};var di=h(()=>{$pe=new Map});var Gpe;var Hpe=h(()=>{di();Gpe=Dn({AUTOMATION_FINISHED:{value:"automation_finished",label:"Automation completed",scope:"project",defaultOff:!0},AUTOMATION_RUN_FAILED:{value:"automation_run_failed",label:"Automation run failed",scope:"project"}})});var lS;var VN=h(()=>{di();lS=Dn({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage auto top-up"}},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View invoice"}},BILLING_INVOICE_PAYMENT_FAILED:{value:"billing_invoice_payment_failed",label:"Billing invoice payment failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED:{value:"billing_subscription_cancellation_scheduled",label:"Billing cancellation scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage subscription"}},BILLING_SUBSCRIPTION_CANCELED:{value:"billing_subscription_canceled",label:"Billing subscription canceled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_PAYMENT_METHOD_EXPIRING:{value:"billing_payment_method_expiring",label:"Billing payment method expiring",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_PAYMENT_METHOD_CHANGED:{value:"billing_payment_method_changed",label:"Billing payment method changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Review payment method"}},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}}})});var qpe;var Vpe=h(()=>{di();qpe=Dn({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var Kpe;var Ype=h(()=>{di();Kpe=Dn({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]}})});var Wpe;var Jpe=h(()=>{di();Wpe=Dn({PROJECT_CREATED:{value:"project_created",label:"Project created",scope:"org",defaultOff:!0},PROJECT_DELETED:{value:"project_deleted",label:"Project deleted",scope:"org",defaultOff:!0},MEMBER_INVITED:{value:"member_invited",label:"Member invited",scope:"org",defaultOff:!0},USER_REMOVED:{value:"user_removed",label:"Member removed",scope:"org",defaultOff:!0},MCP_CONNECTOR_ADDED:{value:"mcp_connector_added",label:"MCP connector added",scope:"org",defaultOff:!0},MCP_CONNECTOR_REMOVED:{value:"mcp_connector_removed",label:"MCP connector removed",scope:"org",defaultOff:!0},SECRET_KEY_CREATED:{value:"secret_key_created",label:"Secret key created",scope:"org",defaultOff:!0},SECRET_KEY_DELETED:{value:"secret_key_deleted",label:"Secret key deleted",scope:"org",defaultOff:!0}})});var Zpe;var Xpe=h(()=>{di();Zpe=Dn({SANDBOX_CREATED:{value:"sandbox_created",label:"Sandbox connected",scope:"project",defaultOff:!0},SANDBOX_DELETED:{value:"sandbox_deleted",label:"Sandbox disconnected",scope:"project",defaultOff:!0},LOG_SOURCE_CONNECTED:{value:"log_source_connected",label:"Log source connected",scope:"project",defaultOff:!0},LOG_SOURCE_DISCONNECTED:{value:"log_source_disconnected",label:"Log source disconnected",scope:"project"},GITHUB_CONNECTED:{value:"github_connected",label:"GitHub connected",scope:"project",defaultOff:!0},GITHUB_DISCONNECTED:{value:"github_disconnected",label:"GitHub disconnected",scope:"project"},CODE_REPO_CONNECTED:{value:"code_repo_connected",label:"Code repository connected",scope:"project",defaultOff:!0},CODE_REPO_DISCONNECTED:{value:"code_repo_disconnected",label:"Code repository disconnected",scope:"project"},PUBLIC_KEY_DEACTIVATED:{value:"public_key_deactivated",label:"Public key deactivated",scope:"project"}})});var ege;var tge=h(()=>{di();ege=Dn({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var KN,Pt,Y9e,YN=(e)=>{let t=Y9e.get(e)?.label;if(t)return t;let n=e.replace(/_/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e};var gm=h(()=>{Hpe();VN();VN();Vpe();Ype();Jpe();Xpe();tge();di();KN={...ege,...Wpe,...qpe,...Gpe,...Kpe,...Zpe,...lS},Pt=Object.fromEntries(Object.entries(KN).map(([e,t])=>[e,t.value])),Y9e=new Map(Object.values(KN).map((e)=>[e.value,e]))});var uS,oge,Zjt,Qr,Xjt;var $a=h(()=>{gm();pm();pm();uS=Object.values(Pt),oge=[Pt.BILLING_PLAN_UPGRADE_APPLIED,Pt.BILLING_PLAN_DOWNGRADE_SCHEDULED,Pt.BILLING_PLAN_DOWNGRADE_APPLIED,Pt.BILLING_CREDIT_BALANCE_LOW,Pt.BILLING_CREDIT_BALANCE_DEPLETED,Pt.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,Pt.BILLING_AUTO_TOP_UP_FAILED,Pt.BILLING_INVOICE_PAID,Pt.BILLING_NEGATIVE_BALANCE_COLLECTED,Pt.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED,Pt.BILLING_INVOICE_PAYMENT_FAILED,Pt.BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED,Pt.BILLING_SUBSCRIPTION_CANCELED,Pt.BILLING_PAYMENT_METHOD_EXPIRING,Pt.BILLING_PAYMENT_METHOD_CHANGED],Zjt=new Set(oge),Qr=[Pt.ISSUE_TRIGGERED,Pt.ISSUE_RESOLVED,Pt.ISSUE_IGNORED,Pt.AUTOMATION_RUN_FAILED],Xjt=new Set(Qr)});var mm,rge,ige=(e)=>typeof e==="string"&&(e in rge)?rge[e]:e,J9e;var sge=h(()=>{pm();De();$a();mm=a.enum(uS),rge={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},J9e=a.preprocess(ige,mm)});var Z9e;var age=h(()=>{gm();$a();Z9e=Qr.map((e)=>({notificationType:e,label:YN(e)}))});var cge=h(()=>{gm();$a()});var lge=h(()=>{pm();gm();$a();sge();age();cge()});var uge=()=>{};var dge=h(()=>{$a()});var pge=h(()=>{$a()});var WN=h(()=>{uge();dge();pge();lge()});var n6e,o6e,r6e,i6e,s6e,a6e,c6e,JN,hFt;var gge=h(()=>{WN();De();Ve();n6e=a.enum(["ready","missing","degraded","unavailable"]),o6e=a.object({id:a.string(),label:a.string(),status:a.enum(["active","inactive","degraded"]),statusLabel:a.string()}),r6e=a.object({channel:cS,name:a.string(),description:a.string(),scope:a.enum(["personal","project"]),enabled:a.boolean().nullable(),preferenceId:a.string().nullable(),prerequisite:a.object({status:n6e,statusLabel:a.string(),message:a.string()}),action:a.object({label:a.string(),href:a.string()}).nullable(),destinations:a.array(o6e),destinationManagement:a.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:a.boolean(),supportedNotificationTypes:a.array(mm)}),i6e=a.object({channel:Cs,enabled:a.boolean(),preferenceId:a.string().nullable()}),s6e=a.object({channel:Cs,notificationType:mm,enabled:a.boolean(),preferenceId:a.string()}),a6e=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),c6e=a.object({channelCards:a.array(r6e).length(10),channels:a.array(i6e),notificationTypePreferences:a.array(s6e),issueNotificationMinSeverity:a.enum(["low","medium","high","critical"])}),JN=E({operationId:"notificationChannels.getProject",summary:"List Project Notification Channels",description:"List a project's notification channels with preferences, prerequisites, connection state, configured destinations, and supported notification types.",backend:"api",route:{method:"GET",path:"/notification-channels",tags:["Notification channels"]},input:a6e,output:c6e,pagination:"none",async:"sync"}),hFt={getProject:JN.contract}});var mge,XN,hge,e0,IFt,SFt,t0,n0=(e,t)=>{if((e.componentIds?.length||e.componentId)&&"componentIds"in e.condition&&e.condition.componentIds?.length)t.addIssue({code:"custom",path:["condition","componentIds"],message:"Use componentIds instead of legacy condition.componentIds."});if(e.componentIds?.length&&e.componentId)t.addIssue({code:"custom",path:["componentId"],message:"Use componentIds instead of componentId."})},CFt,Age,ZN,o0,hm,fge,l6e,u6e,d6e,p6e,g6e,m6e,h6e,A6e,f6e,r0,i0,s0,a0,c0,vFt;var yge=h(()=>{WN();De();Ve();mge=a.enum(["low","medium","high","critical"]),XN=a.object({severities:a.array(mge).min(1).optional()}).strict(),hge=a.object({componentIds:a.array(a.string().uuid()).min(1).optional(),severities:a.array(mge).min(1).optional()}).strict(),e0=a.object({channel:Cs,destinationKey:a.string().min(1)}),IFt=a.object({destinations:a.array(e0).min(1),notificationTypes:a.array(a.enum(Qr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:XN}),SFt=a.object({destinations:a.array(e0).min(1),notificationTypes:a.array(a.enum(Qr)).min(1),condition:hge}),t0=a.object({destinations:a.array(e0).min(1),notificationTypes:a.array(a.enum(Qr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),componentId:a.string().uuid().optional().describe("Deprecated single-component compatibility input."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:a.union([XN,hge])}),CFt=t0.superRefine(n0),Age=a.object({id:a.string(),channel:Cs,destinationKey:a.string(),displayName:a.string()}),ZN=a.object({id:a.string().uuid(),label:a.string(),lifecycle:a.enum(["active","inactive","merged"])}),o0=a.object({id:a.string().uuid(),projectId:a.string().uuid(),notificationTypes:a.array(a.enum(Qr)),destinations:a.array(Age),condition:XN,component:ZN.nullable(),componentId:a.string().uuid().nullable(),includeDescendants:a.boolean(),suspendedAt:a.string().datetime().nullable(),suspensionReason:a.string().nullable(),components:a.array(ZN),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),hm=a.object({projectId:a.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),fge=a.string().uuid().describe("Logical notification delivery rule ID."),l6e=hm,u6e=a.object({rules:a.array(o0)}),d6e=a.object({destinations:a.array(Age),notificationTypes:a.array(a.object({notificationType:a.enum(Qr),label:a.string(),conditions:a.array(a.enum(["component","severity"]))})),components:a.array(ZN)}),p6e=hm.extend(t0.shape).superRefine(n0),g6e=o0,m6e=hm.extend({...t0.shape,ruleId:fge}).superRefine(n0),h6e=o0,A6e=hm.extend({ruleId:fge}),f6e=a.object({removed:a.boolean()}),r0=E({operationId:"notificationDeliveryRules.list",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:l6e,output:u6e,pagination:"none",async:"sync"}),i0=E({operationId:"notificationDeliveryRules.options",description:"List available destinations, events, and conditions for project delivery rules.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules/options",tags:["Notification delivery rules"]},input:hm,output:d6e,pagination:"none",async:"sync"}),s0=E({operationId:"notificationDeliveryRules.create",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:p6e,output:g6e,pagination:"none",async:"sync"}),a0=E({operationId:"notificationDeliveryRules.update",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:m6e,output:h6e,pagination:"none",async:"sync"}),c0=E({operationId:"notificationDeliveryRules.delete",description:"Delete a positive delivery rule without deleting its reusable destinations.",backend:"api",route:{method:"DELETE",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:A6e,output:f6e,pagination:"none",async:"sync"}),vFt={list:r0.contract,options:i0.contract,create:s0.contract,update:a0.contract,delete:c0.contract}});var l0,y6e,b6e,I6e,S6e,C6e,v6e,u0,E6e,w6e,d0,k6e,x6e,p0,P6e,R6e,g0,T6e,B6e,m0,xFt;var bge=h(()=>{De();Ve();l0=a.enum(["verify-email","accept-invite","create-organization","billing","configure-project","connect-github-account","install-github-app","configure-code-search","install-slack-app","configure-slack-notifications","trigger-issue","confirm-issue","finish"]),y6e=a.enum(["needs-onboarding","blocked","ready"]),b6e=a.enum(["incomplete","complete","skipped"]),I6e=a.object({invitationId:a.string(),organizationId:a.string(),organizationName:a.string(),organizationSlug:a.string(),organizationImageUrl:a.string().nullable(),inviterName:a.string().nullable()}),S6e=a.object({gate:y6e,canonicalStep:l0.nullable(),organizationId:a.string().nullable(),projectId:a.string().nullable(),completionByStep:a.record(l0,b6e),githubSkipped:a.boolean(),githubAppSkipped:a.boolean(),slackSkipped:a.boolean(),sampleIssueId:a.string().nullable(),actorRole:a.enum(["admin","member"]).nullable(),requiredStep:a.union([l0,a.literal("select-organization")]).nullable(),isCompleted:a.boolean(),onboardingRecommendationsThreadId:a.string().nullable(),hasOrganizations:a.boolean(),hasPaidBillingSubscription:a.boolean(),billingStepEnabled:a.boolean(),pendingInvitations:a.array(I6e)}),C6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project whose onboarding state to bind (sample-issue attempt and project-scoped facts). Auto-filled from CLI and SDK context when omitted.")}),v6e=a.object({onboarding:S6e}),u0=E({operationId:"onboarding.getState",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:C6e,output:v6e,pagination:"none",async:"sync"}),E6e=a.object({integration:a.enum(["github","slack"]).describe("Integration onboarding step to skip."),organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),w6e=a.object({skipped:a.literal(!0)}),d0=E({operationId:"onboarding.skipIntegration",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:E6e,output:w6e,pagination:"none",async:"sync"}),k6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),x6e=a.object({skipped:a.literal(!0)}),p0=E({operationId:"onboarding.skipGithubAppInstallation",summary:"Skip GitHub App Installation",description:"Skip GitHub App installation during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-github-app",tags:["Onboarding"]},input:k6e,output:x6e,pagination:"none",async:"sync"}),P6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),R6e=a.object({skipped:a.literal(!0)}),g0=E({operationId:"onboarding.skipSampleIssue",summary:"Skip Test Issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:P6e,output:R6e,pagination:"none",async:"sync"}),T6e=a.object({projectId:a.string().uuid().describe("Project that completed onboarding.")}),B6e=a.object({completed:a.boolean()}),m0=E({operationId:"onboarding.finish",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:T6e,output:B6e,pagination:"none",async:"sync"}),xFt={getState:u0.contract,skipIntegration:d0.contract,skipGithubAppInstallation:p0.contract,skipSampleIssue:g0.contract,finish:m0.contract}});var dS,O6e,_6e,D6e,Q6e,L6e,N6e,M6e,z6e,j6e,U6e,h0,A0,f0,y0,OFt;var Ige=h(()=>{De();Ve();nS();dS=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),O6e=dS.extend({role:Ss.optional()}),_6e=a.object({}),D6e=a.object({organizations:a.array(O6e).describe("Organizations available to the current credential.")}),Q6e=a.object({organizationId:a.string().min(1).describe("Organization ID to fetch.")}),L6e=a.object({organization:dS}),N6e=a.object({organizationId:a.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:a.string().trim().min(1).max(100).describe("New organization name.")}),M6e=a.object({organization:dS.describe("Updated organization.")}),z6e=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),j6e=a.object({name:z6e.describe("Organization display name.")}),U6e=a.object({organization:dS}),h0=E({operationId:"organizations.create",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:j6e,output:U6e,pagination:"none",async:"sync"}),A0=E({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:_6e,output:D6e,pagination:"none",async:"sync"}),f0=E({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Q6e,output:L6e,pagination:"none",async:"sync"}),y0=E({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:N6e,output:M6e,pagination:"none",async:"sync",examples:[{name:"rename-organization",input:{organizationId:"organization-123",name:"Observed Platform"},output:{organization:{id:"organization-123",name:"Observed Platform",slug:"acme",logo:null}}}]}),OFt={list:A0.contract,get:f0.contract,create:h0.contract,update:y0.contract}});var Qu,Am,Sge,Cge,vge,Ege,wge,kge,xge,pS,gS,mS,Pge,Rge,hS,Tge,Bge,AS,F6e;var b0=h(()=>{De();Ve();Qu=a.enum(["us-east-1","us-east-2","us-west-1","us-west-2","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3"]),Am=a.object({id:a.string().uuid(),organizationId:a.string().min(1),name:a.string(),region:Qu}),Sge=a.object({organizationId:a.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),Cge=a.object({projects:a.array(Am).describe("Projects visible within the selected organization.")}),vge=a.object({projectId:a.string().uuid().describe("Project ID to fetch.")}),Ege=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),wge=a.object({organizationId:a.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),name:Ege.describe("Project name."),region:Qu.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),kge=a.object({project:Am}),xge=a.object({project:Am}),pS=E({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:Sge,output:Cge,pagination:"none",async:"sync"}),gS=E({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:vge,output:xge,pagination:"none",async:"sync"}),mS=E({operationId:"projects.create",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:wge,output:kge,pagination:"none",async:"sync"}),Pge=a.object({projectId:a.string().uuid().describe("Project ID to update."),name:Ege.optional().describe("New project name.")}),Rge=a.object({project:Am}),hS=E({operationId:"projects.update",description:"Update (rename) one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"PATCH",path:"/projects/{projectId}",tags:["Projects"]},input:Pge,output:Rge,pagination:"none",async:"sync"}),Tge=a.object({projectId:a.string().uuid().describe("Project ID to delete.")}),Bge=a.void(),AS=E({operationId:"projects.delete",description:"Delete one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"DELETE",path:"/projects/{projectId}",successStatus:204,tags:["Projects"]},input:Tge,output:Bge,pagination:"none",async:"sync"}),F6e={list:pS.contract,get:gS.contract,create:mS.contract,update:hS.contract,delete:AS.contract}});var Oge,$6e,G6e,H6e,q6e,V6e,I0,zFt;var _ge=h(()=>{De();Ve();Oge=a.enum(["open","merged","closed"]),$6e=a.enum(["review_required","approved","changes_requested"]),G6e=a.enum(["passing","failing","pending"]),H6e=a.object({id:a.string().uuid(),projectId:a.string().uuid(),repositoryFullName:a.string(),pullRequestId:a.string().describe("Provider-native pull request identifier (GitHub PR number or Bitbucket PR id), serialized as a string."),githubPullRequestId:a.number().int().describe("Deprecated: use pullRequestId. Numeric form of the provider-native pull request identifier; kept for backward compatibility."),title:a.string().nullable(),url:a.string().nullable(),status:Oge.nullable(),reviewState:$6e.nullable(),checksState:G6e.nullable(),requestedByUserId:a.string().nullable(),authorLogin:a.string().nullable().describe("Forge login that authored the pull request (often the Sazabi app identity)."),githubAuthorLogin:a.string().nullable().describe("Deprecated: use authorLogin. Kept for backward compatibility."),threadId:a.string().uuid().nullable(),runId:a.string().uuid().nullable(),createdAt:a.string().datetime(),mergedAt:a.string().datetime().nullable(),closedAt:a.string().datetime().nullable()}),q6e=a.object({projectId:a.string().uuid().optional().describe("Project to list pull requests for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of pull requests to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:Oge.optional().describe("Filter by pull request status (open, merged, or closed)."),repositoryFullName:a.string().trim().optional().describe("Filter by repository full name, for example owner/repo. Case-insensitive."),requestedByUserId:a.string().trim().optional().describe("Filter by the Sazabi user who requested the pull request. Pass 'me' to filter to the authenticated user.")}),V6e=a.object({pullRequests:a.array(H6e),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),I0=E({operationId:"pullRequests.list",description:"List pull requests that Sazabi opened, optionally filtered by status, repository, and requesting user.",backend:"api",route:{method:"GET",path:"/pull-requests",tags:["Pull Requests"]},input:q6e,output:V6e,pagination:"cursor",async:"sync"}),zFt={list:I0.contract}});var Dge,Qge,Lge,Nge,Mge,fm;var S0=h(()=>{De();Ve();Dge=a.enum(["log_source","mcp_connector","sandbox_cli","integration"]),Qge=a.enum(["connected","recommended"]),Lge=a.object({kind:Dge.describe("What the recommendation targets: a log source, MCP connector, sandbox CLI, or integration."),targetId:a.string().describe("Exact catalog id for the kind (log source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:Qge.describe("Resolved live against current connections: connected (already set up) or recommended (suggested, not yet connected)."),roiScore:a.number().int().min(0).max(100).describe("Intrinsic ROI score, 0–100 — a normalized blend of how valuable, how easy to connect, and how proven the item is. A pure function of the item; computed live on read, never stored."),priority:a.number().int().min(1).describe("1-based rank within this list, sorted by roiScore (best first). Items are already returned in priority order; the field lets consumers recover the rank without trusting array position.")}),Nge=a.object({projectId:a.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),Mge=a.object({recommendations:a.array(Lge).describe("The project's configuration recommendations, deduped by (kind, targetId), with status resolved live and each item's ROI score. Returned in priority order (highest roiScore first).")}),fm=E({operationId:"recommendations.list",description:"List a project's configuration recommendations (data sources, MCP connectors, sandbox CLIs, and integrations) with each item's live connection status.",backend:"api",route:{method:"GET",path:"/recommendations",tags:["Recommendations"]},input:Nge,output:Mge,pagination:"none",async:"sync"})});var zge,C0,jge,Uge,Fge,$ge,Gge,Hge,ym,bm,Im;var v0=h(()=>{De();Ve();zge=a.enum(["github","bitbucket"]),C0=a.object({id:a.string().uuid().describe("Repository row id — stable across access sources; use it as the path id for repos.remove."),accessSourceId:a.string().uuid().describe("Access source granting this view of the repository (GitHub App installation, personal connection, or integration). Pass to repos.add to link the repository through this source."),source:a.enum(["githubApp","personal","integration"]).describe("Kind of access source granting this view: an organization GitHub App installation, the caller's personal forge connection, or an organization integration."),sourceLabel:a.string().describe('Display label for the access source (e.g. "GitHub app", "Personal").'),provider:zge.describe("Forge hosting the repository."),owner:a.string().describe("Repository owner (user or organization)."),name:a.string().describe("Repository name without the owner."),fullName:a.string().describe("Full name in owner/name form."),defaultBranch:a.string().nullable().describe("Default branch, when the forge reports one."),isPrivate:a.boolean().describe("Whether the repository is private."),linked:a.boolean().describe("Whether the repository is already linked to the project.")}),jge=a.object({projectId:a.string().uuid().optional().describe("Project to list repositories for. Auto-filled from CLI and SDK context when omitted.")}),Uge=a.object({repos:a.array(C0).describe("Every repository available to the project's organization (from GitHub App installations, the caller's personal forge connections, and integrations), with `linked` marking the ones already linked to the project.")}),Fge=a.object({projectId:a.string().uuid().optional().describe("Project to link the repositories to. Auto-filled from CLI and SDK context when omitted."),accessSourceIds:a.array(a.string().uuid()).min(1).describe("Access source ids (from repos.list) to link. Select only one access source per repository.")}),$ge=a.object({repos:a.array(C0).describe("The now-linked repositories.")}),Gge=a.object({id:a.string().uuid().describe("Repository row id (from repos.list) to unlink."),projectId:a.string().uuid().optional().describe("Project to unlink the repository from. Auto-filled from CLI and SDK context when omitted.")}),Hge=a.void(),ym=E({operationId:"repos.list",description:"List the repositories available to a project — every repository reachable through the organization's GitHub App installations, the caller's personal forge connections, and integrations — with each one's linked status.",backend:"api",route:{method:"GET",path:"/repos",tags:["Repos"]},input:jge,output:Uge,pagination:"none",async:"sync"}),bm=E({operationId:"repos.add",description:"Link repositories to a project by access source id. Select only one access source per repository; re-linking an already-linked repository refreshes its selected access source.",backend:"api",route:{method:"POST",path:"/repos",tags:["Repos"]},input:Fge,output:$ge,pagination:"none",async:"sync"}),Im=E({operationId:"repos.remove",description:"Unlink a repository from a project by repository row id.",backend:"api",route:{method:"DELETE",path:"/repos/{id}",successStatus:204,tags:["Repos"]},input:Gge,output:Hge,pagination:"none",async:"sync"})});var qge,K6e,Vge,fS,Kge,Yge,Wge,Jge,Lu,E0,Zge,Xge,Nu,eme,tme,Mu,nme,ome,zu,Y6e;var w0=h(()=>{De();Ve();qge=a.object({type:a.string().describe("Preset type identifier."),label:a.string().describe("Human-readable display name."),executableNames:a.array(a.string()).describe("CLI binary names installed by this preset."),envVarKeys:a.array(a.string()).describe("Environment variables required for authentication."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),K6e=a.object({}),Vge=a.object({types:a.array(qge)}),fS=E({operationId:"sandboxPresets.listTypes",description:"List all supported sandbox CLI types with their environment variable requirements and setup skills.",backend:"api",route:{method:"GET",path:"/sandbox-presets/types",tags:["Sandbox Presets"]},input:K6e,output:Vge,pagination:"none",async:"sync"}),Kge=a.enum(["github_app","bitbucket_integration","personal_access_token","stored_credentials"]),Yge=a.object({presetType:a.string().describe("Preset type identifier."),credentialSource:Kge.describe("Authoritative credential source for the preset."),isSystemManaged:a.boolean().describe("Whether the connection follows an integration lifecycle."),fallbackConfigured:a.boolean().describe("Whether user-provided fallback credentials are stored for this preset."),envVarKeys:a.array(a.string()).describe("Stored environment variable names. Secret values are omitted.")}),Wge=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted.")}),Jge=a.object({connections:a.array(Yge)}),Lu=E({operationId:"sandboxPresets.listConnections",description:"List a project's stored and integration-backed sandbox CLI connections without returning secret values.",backend:"api",route:{method:"GET",path:"/sandbox-presets/connections",tags:["Sandbox Presets"]},input:Wge,output:Jge,pagination:"none",async:"sync"}),E0=a.object({key:a.string().min(1).max(256).regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable keys must match /^[A-Za-z_][A-Za-z0-9_]*$/.").describe("Environment variable name (e.g. KUBECONFIG_CONTENTS)."),value:a.string().max(10240).describe("Secret value. Encrypted at rest; never returned by any API response.")}),Zge=a.object({projectId:a.string().uuid().optional().describe("Project to configure. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier (e.g. kubectl, aws, github)."),environmentVariables:a.array(E0).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),Xge=a.object({projectId:a.string().uuid().describe("Project the preset was written to."),presetType:a.string().describe("Preset type that was upserted."),envVarKeys:a.array(a.string()).describe("Env var key names now stored for this preset. Values are never returned.")}),Nu=E({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI connection",description:"Set or replace a project's CLI connection credentials (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires write access to the target project.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:Zge,output:Xge,pagination:"none",async:"sync"}),eme=a.object({projectId:a.string().uuid().optional().describe("Project to update. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier.")}),tme=a.object({projectId:a.string().uuid().describe("Project the CLI connection belonged to."),presetType:a.string().describe("Preset type that was disconnected."),deleted:a.boolean().describe("Whether a stored CLI connection was deleted.")}),Mu=E({operationId:"sandboxPresets.deletePreset",summary:"Disconnect CLI",description:"Delete a project's stored CLI connection. Integration-managed access remains available until its owning integration is disconnected.",backend:"api",route:{method:"DELETE",path:"/sandbox-presets/config/{presetType}",tags:["Sandbox Presets"]},input:eme,output:tme,pagination:"none",async:"sync"}),nme=a.object({projectId:a.string().uuid().optional().describe("Project to test from. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier."),environmentVariables:a.array(E0).max(100).describe("Unsaved credentials to validate in a readonly sandbox.")}),ome=a.object({status:a.enum(["success","failed"]),message:a.string().nullable(),stdout:a.string().describe("Truncated command output with submitted credentials redacted."),stderr:a.string().describe("Truncated command errors with submitted credentials redacted.")}),zu=E({operationId:"sandboxPresets.testPreset",summary:"Test CLI connection",description:"Validate unsaved CLI credentials in a read-only ephemeral sandbox without persisting them.",backend:"api",route:{method:"POST",path:"/sandbox-presets/test",tags:["Sandbox Presets"]},input:nme,output:ome,pagination:"none",async:"sync"}),Y6e={deletePreset:Mu.contract,listConnections:Lu.contract,listTypes:fS.contract,testPreset:zu.contract,upsertPreset:Nu.contract}});var yS,rme=1048576,k0,ime,x0,W6e,J6e,Z6e,X6e,e5e,t5e,n5e,o5e,r5e,i5e,P0,R0,T0,B0,O0,ZFt;var sme=h(()=>{De();Ve();yS=a.string().min(1).max(64).regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/,"Name must start with a letter or digit and contain only letters, digits, underscores, and hyphens (max 64 characters).").describe("Script name. Must be unique within the project among non-deleted scripts."),k0=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=rme,{message:`Script content must be at most ${rme} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),ime=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),contentHash:a.string().describe("sha256 hex digest of the script content."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),x0=ime.extend({content:k0}),W6e=a.object({projectId:a.string().uuid().optional().describe("Project to list scripts for. Auto-filled from CLI and SDK context when omitted."),search:a.string().optional().describe("Case-insensitive partial match on script name."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of scripts to return per page.")}),J6e=a.object({scripts:a.array(ime),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),Z6e=a.object({name:yS.describe("Script name to fetch."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),X6e=a.object({script:x0}),e5e=a.object({projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:yS.describe("Script name. Must be unique within the project among non-deleted scripts."),content:k0,description:a.string().max(500).nullable().optional().describe("Optional human-readable description.")}),t5e=a.object({script:x0}),n5e=a.object({name:yS.describe("Script to update."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),content:k0.optional().describe("New script body. Omit to leave content unchanged."),description:a.string().max(500).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged.")}),o5e=a.object({script:x0}),r5e=a.object({name:yS.describe("Script to delete."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),i5e=a.void(),P0=E({operationId:"scripts.list",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:W6e,output:J6e,pagination:"cursor",async:"sync"}),R0=E({operationId:"scripts.get",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:Z6e,output:X6e,pagination:"none",async:"sync"}),T0=E({operationId:"scripts.create",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:e5e,output:t5e,pagination:"none",async:"sync"}),B0=E({operationId:"scripts.update",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:n5e,output:o5e,pagination:"none",async:"sync"}),O0=E({operationId:"scripts.delete",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:r5e,output:i5e,pagination:"none",async:"sync"}),ZFt={list:P0.contract,get:R0.contract,create:T0.contract,update:B0.contract,delete:O0.contract}});var _0,ame,cme,lme,ume,ju,Uu,s5e;var D0=h(()=>{De();Ve();_0=a.object({projectId:a.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:a.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:a.coerce.number().min(1).default(1).describe("One-based page number.")}),ame=_0.extend({status:a.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),cme=_0.extend({threadId:a.string().uuid().optional().describe("Optional thread restriction for message search."),role:a.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),lme=a.object({threads:a.array(a.object({id:a.string().uuid(),projectId:a.string().uuid().optional(),title:a.string(),status:a.enum(["regular","archived"]),labels:a.array(a.string()),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),ume=a.object({messages:a.array(a.object({id:a.string().uuid(),threadId:a.string().uuid(),threadTitle:a.string(),role:a.enum(["user","assistant"]),content:a.string(),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),ju=E({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:ame,output:lme,pagination:"page",async:"sync",examples:[{name:"search-open-incidents",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"payment timeout",status:"regular",limit:10,page:1},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"Payment timeout in us-west-2",status:"regular",labels:["payments","timeout"],createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["payment timeout"],score:123.45}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),Uu=E({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:cme,output:ume,pagination:"page",async:"sync",examples:[{name:"search-assistant-messages",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"rollback",role:"assistant",limit:10,page:1},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",threadId:"22222222-2222-4222-8222-222222222222",threadTitle:"Deployment rollback guidance",role:"assistant",content:"Rollback the ingestion deployment and confirm queue depth.",createdAt:"2026-01-02T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["Rollback the ingestion deployment"],score:98.76}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),s5e={threads:ju.contract,messages:Uu.contract}});var bS,dme,Q0,Sm,a5e,c5e,l5e,u5e,d5e,p5e,g5e,m5e,h5e,A5e,L0,N0,M0,z0,j0,f5e,y5e,U0,i$t;var pme=h(()=>{De();Ve();bS=a.string().uuid().describe("Signal definition ID."),dme=a.string().min(1).max(200).describe("Human-readable expression name."),Q0=a.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),Sm=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),expression:Q0,enabled:a.boolean(),compiledVersion:a.number().int(),linkedAutomationIds:a.array(a.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),a5e=a.object({projectId:a.string().uuid().optional().describe("Project to list signal definitions for. Auto-filled from CLI and SDK context when omitted.")}),c5e=a.object({signalDefinitions:a.array(Sm)}),l5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),u5e=a.object({signalDefinition:Sm}),d5e=a.object({projectId:a.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:dme,expression:Q0,enabled:a.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),p5e=a.object({signalDefinition:Sm}),g5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:dme.optional(),expression:Q0.optional(),enabled:a.boolean().optional().describe("Whether the expression is enabled.")}),m5e=a.object({signalDefinition:Sm}),h5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),A5e=a.object({signalDefinition:Sm}),L0=E({operationId:"signalDefinitions.list",description:"List signal definitions in a project.",backend:"api",route:{method:"GET",path:"/signal-definitions",tags:["Signal definitions"]},input:a5e,output:c5e,pagination:"none",async:"sync"}),N0=E({operationId:"signalDefinitions.get",description:"Get a single signal definition by ID.",backend:"api",route:{method:"GET",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:l5e,output:u5e,pagination:"none",async:"sync"}),M0=E({operationId:"signalDefinitions.create",description:"Create a CEL signal definition for a project.",backend:"api",route:{method:"POST",path:"/signal-definitions",successStatus:201,tags:["Signal definitions"]},input:d5e,output:p5e,pagination:"none",async:"sync"}),z0=E({operationId:"signalDefinitions.update",description:"Update a signal definition's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:g5e,output:m5e,pagination:"none",async:"sync"}),j0=E({operationId:"signalDefinitions.disable",description:"Disable a signal definition so it stops matching logs.",backend:"api",route:{method:"POST",path:"/signal-definitions/{signalDefinitionId}/disable",tags:["Signal definitions"]},input:h5e,output:A5e,pagination:"none",async:"sync"}),f5e=a.object({signalDefinitionId:bS,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),y5e=a.void(),U0=E({operationId:"signalDefinitions.delete",description:"Permanently delete a signal definition.",backend:"api",route:{method:"DELETE",path:"/signal-definitions/{signalDefinitionId}",successStatus:204,tags:["Signal definitions"]},input:f5e,output:y5e,pagination:"none",async:"sync"}),i$t={list:L0.contract,get:N0.contract,create:M0.contract,update:z0.contract,disable:j0.contract,delete:U0.contract}});var gme;var mme=h(()=>{gme=["onboarding","setup"]});var hme,Ame,fme,yme,Cm;var F0=h(()=>{mme();De();Ve();hme=a.enum(gme),Ame=a.object({id:a.string().describe("Unique task identifier (e.g. install_github_app)."),label:a.string().describe("Short human-readable task name."),description:a.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:a.string().describe("Step-by-step instructions for completing this task."),completed:a.boolean().describe("Whether the task has been completed."),completedAt:a.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:hme.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),fme=a.object({projectId:a.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),yme=a.object({tasks:a.array(Ame).describe("All onboarding and setup tasks with their current completion status.")}),Cm=E({operationId:"tasks.list",description:"List all onboarding and setup tasks for a project, including their current completion status and a description of what is required to complete each task.",backend:"api",route:{method:"GET",path:"/tasks",tags:["Tasks"]},input:fme,output:yme,pagination:"none",async:"sync"})});var b5e,I5e,Ga,S5e,C5e,v5e,E5e,w5e,k5e,x5e,P5e,R5e,T5e,B5e,O5e,_5e,D5e,$0,G0,H0,q0,V0,K0,Y0,m$t;var bme=h(()=>{De();Ve();b5e=a.object({id:a.string().uuid().describe("Team ID."),name:a.string().describe("Team name, unique among the org's active teams."),description:a.string().nullable().describe("Optional team description."),createdAt:a.string().datetime().describe("When the team was created."),memberCount:a.number().int().nonnegative().describe("Number of active members in the team.")}),I5e=a.object({userId:a.string().min(1).describe("User ID of the team member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),addedAt:a.string().datetime().describe("When the member was added to the team.")}),Ga=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),S5e=a.object({organizationId:Ga}),C5e=a.object({teams:a.array(b5e).describe("Active teams in the organization.")}),v5e=a.object({organizationId:Ga,name:a.string().trim().min(1).describe("Team name."),description:a.string().trim().min(1).optional().describe("Optional team description.")}),E5e=a.object({id:a.string().uuid().describe("ID of the created team.")}),w5e=a.object({organizationId:Ga,teamId:a.string().uuid().describe("Team to update."),name:a.string().trim().min(1).optional().describe("New team name."),description:a.string().trim().min(1).nullable().optional().describe("New team description; null clears it.")}),k5e=a.object({id:a.string().uuid().describe("ID of the updated team.")}),x5e=a.object({params:a.object({teamId:a.string().uuid().describe("Team to delete.")}),query:a.object({organizationId:Ga})}).transform(({params:e,query:t})=>({...t,...e})),P5e=a.object({success:a.literal(!0).describe("The team and its memberships were removed.")}),R5e=a.object({organizationId:Ga,teamId:a.string().uuid().describe("Team to add the member to."),userId:a.string().min(1).describe("User ID of an active organization member to add.")}),T5e=a.object({id:a.string().uuid().describe("ID of the team membership.")}),B5e=a.object({params:a.object({teamId:a.string().uuid().describe("Team to remove the member from."),userId:a.string().min(1).describe("User ID of the member to remove.")}),query:a.object({organizationId:Ga})}).transform(({params:e,query:t})=>({...t,...e})),O5e=a.object({success:a.literal(!0).describe("The membership was removed.")}),_5e=a.object({organizationId:Ga,teamId:a.string().uuid().describe("Team to list members for.")}),D5e=a.object({members:a.array(I5e).describe("Active members of the team.")}),$0=E({operationId:"teams.list",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:S5e,output:C5e,pagination:"none",async:"sync",examples:[{name:"organization-teams",input:{organizationId:"organization-123"},output:{teams:[{id:"5c0f9866-31ab-4237-94cc-a1d0ba2f6de2",name:"Payments",description:"Owns checkout and billing components.",createdAt:"2026-01-01T00:00:00.000Z",memberCount:4}]}}]}),G0=E({operationId:"teams.create",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:v5e,output:E5e,pagination:"none",async:"sync"}),H0=E({operationId:"teams.update",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:w5e,output:k5e,pagination:"none",async:"sync"}),q0=E({operationId:"teams.delete",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:x5e,output:P5e,pagination:"none",async:"sync"}),V0=E({operationId:"teams.addMember",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:R5e,output:T5e,pagination:"none",async:"sync"}),K0=E({operationId:"teams.removeMember",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:B5e,output:O5e,pagination:"none",async:"sync"}),Y0=E({operationId:"teams.listMembers",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:_5e,output:D5e,pagination:"none",async:"sync"}),m$t={list:$0.contract,create:G0.contract,update:H0.contract,delete:q0.contract,addMember:V0.contract,removeMember:K0.contract,listMembers:Y0.contract}});var Q5e,L5e,N5e,W0,M5e,z5e,J0,j5e,U5e,Z0,y$t;var Ime=h(()=>{De();Ve();Q5e=a.object({kind:a.enum(["user","workspace"]),name:a.string().optional(),email:a.string().optional()}),L5e=a.object({container:a.string().min(1).describe("The container to create the work item in: its id, short key (e.g. a Linear team key like ENG), or display name."),title:a.string().min(1),bodyMarkdown:a.string().optional(),state:a.string().optional(),itemType:a.string().optional(),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers."),clientRequestId:a.string().min(1).optional().describe("Optional caller-supplied idempotency key. When provided, retrying the same logical create with the same clientRequestId reuses the original result instead of creating a duplicate external work item.")}).strict(),N5e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),attribution:Q5e.optional(),reused:a.boolean()}),W0=E({operationId:"work-items.create",description:"Create a work item (e.g. a Linear issue) in a connected issue tracker, attributing the write to the requesting user.",backend:"api",route:{method:"POST",path:"/work-items",tags:["Work Items"],successStatus:201},input:L5e,output:N5e,pagination:"none",async:"sync"}),M5e=a.object({itemId:a.string().min(1).describe("The work item to comment on."),bodyMarkdown:a.string().min(1),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),z5e=a.object({identifier:a.string(),url:a.string()}),J0=E({operationId:"work-items.comment",description:"Add a comment to an existing work item.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/comment",tags:["Work Items"]},input:M5e,output:z5e,pagination:"none",async:"sync"}),j5e=a.object({itemId:a.string().min(1).describe("The work item to transition."),state:a.string().min(1).describe("The target workflow state."),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),U5e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),changed:a.boolean()}),Z0=E({operationId:"work-items.transition",description:"Move a work item to a target workflow state.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/transition",tags:["Work Items"]},input:j5e,output:U5e,pagination:"none",async:"sync"}),y$t={create:W0.contract,comment:J0.contract,transition:Z0.contract}});var X0;var Sme=h(()=>{z1();H1();iR();dR();m2();GR();VR();Vf();RY();AB();hN();nS();gpe();xN();zpe();gge();yge();bge();Ige();b0();_ge();S0();v0();iS();w0();sme();D0();pme();F0();bme();GN();Ime();X0={me:AN.contract,automations:{list:gR.contract,get:mR.contract,create:hR.contract,update:AR.contract,enable:fR.contract,disable:yR.contract,runs:{list:bR.contract,get:IR.contract,logs:SR.contract}},logs:{query:Kc.contract,schema:Yc.contract,volume:Wc.contract,patterns:Jc.contract,nativeQuery:Zc.contract},logSources:{listProviders:$f.contract,list:qc.contract,create:Vc.contract,get:Gf.contract,update:Hf.contract,delete:qf.contract},logStreams:{list:lB.contract,create:uB.contract,get:dB.contract,update:pB.contract,delete:gB.contract,reassign:mB.contract},connectedAccounts:{beginConnect:aR.contract,getConnectAttempt:cR.contract,list:lR.contract,disconnect:uR.contract},integrations:{listProviders:V1.contract,listConnections:K1.contract,getConnection:Y1.contract,createConnection:W1.contract,beginConnect:J1.contract,getConnectAttempt:Z1.contract,disconnectConnection:X1.contract,updateConnectionCredentials:e2.contract,getOrganizationExternalIdentityJitPolicy:o2.contract,updateOrganizationExternalIdentityJitPolicy:r2.contract,getConnectionExternalIdentityJitPolicy:i2.contract,updateConnectionExternalIdentityJitPolicy:s2.contract,getSlackConfiguration:c2.contract,updateSlackConfiguration:l2.contract,listSlackChannelProjectMappings:d2.contract,setSlackChannelProjectMapping:p2.contract,deleteSlackChannelProjectMapping:g2.contract},notificationChannels:{getProject:JN.contract},notificationDeliveryRules:{list:r0.contract,options:i0.contract,create:s0.contract,update:a0.contract,delete:c0.contract},mcpConnectors:{listProviders:tS.contract,list:fu.contract,get:yu.contract,details:bu.contract,search:Iu.contract,describe:Su.contract,call:Cu.contract,create:vu.contract,update:Eu.contract,disconnect:wu.contract,setReadOnly:ku.contract,beginOAuthInstall:xu.contract,getOAuthInstallAttempt:Pu.contract},sandboxPresets:{deletePreset:Mu.contract,listConnections:Lu.contract,listTypes:fS.contract,testPreset:zu.contract,upsertPreset:Nu.contract},scripts:{list:P0.contract,get:R0.contract,create:T0.contract,update:B0.contract,delete:O0.contract},signalDefinitions:{list:L0.contract,get:N0.contract,create:M0.contract,update:z0.contract,disable:j0.contract,delete:U0.contract},memory:{put:Ru.contract,get:Tu.contract,list:Bu.contract,search:Ou.contract,delete:_u.contract},onboarding:{getState:u0.contract,skipIntegration:d0.contract,skipGithubAppInstallation:p0.contract,skipSampleIssue:g0.contract,finish:m0.contract},organizations:{list:A0.contract,get:f0.contract,create:h0.contract,update:y0.contract},members:{list:fN.contract,updateRole:yN.contract,remove:bN.contract,invite:IN.contract,listInvitations:SN.contract,revokeInvitation:CN.contract},teams:{list:$0.contract,create:G0.contract,update:H0.contract,delete:q0.contract,addMember:V0.contract,removeMember:K0.contract,listMembers:Y0.contract},publicKeys:{list:jc.contract,get:Uc.contract,ensureLogForwarding:Fc.contract,update:$c.contract,deactivate:Gc.contract},secretKeys:{list:Df.contract,get:Qf.contract,create:Lf.contract,update:Nf.contract,delete:Mf.contract},projects:{list:pS.contract,get:gS.contract,create:mS.contract,update:hS.contract,delete:AS.contract},search:{threads:ju.contract,messages:Uu.contract},messages:{list:Npe.contract,append:Mpe.contract},threads:{list:_N.contract,get:DN.contract,getStatus:QN.contract,stop:LN.contract,create:NN.contract,update:MN.contract,fork:zN.contract,setVisibility:jN.contract,createShareLink:UN.contract,listShareLinks:FN.contract,revokeShareLink:$N.contract},runs:{list:PN.contract,listForThread:RN.contract,get:TN.contract,cancel:BN.contract},pullRequests:{list:I0.contract},issues:{count:vf.contract,create:zc.contract,list:Sf.contract,search:Cf.contract,get:Ef.contract,resolve:wf.contract,ignore:kf.contract,reopen:xf.contract,reassignAndReopen:Pf.contract,mute:Rf.contract,unmute:Tf.contract},workItems:{create:W0.contract,comment:J0.contract,transition:Z0.contract},billing:{getSummary:vR.contract,getUsage:ER.contract,listTransactions:wR.contract,getAutoTopUp:PR.contract,updateAutoTopUp:RR.contract,purchaseCredits:TR.contract,listPlans:BR.contract,previewPlanChange:OR.contract,previewSubscriptionCancellation:MR.contract,scheduleSubscriptionCancellation:zR.contract,resumeSubscriptionCancellation:jR.contract,changePlan:_R.contract,createCheckoutSession:DR.contract,getCheckoutSessionStatus:QR.contract,createPortalSession:LR.contract,getPaymentMethod:NR.contract},tasks:{list:Cm.contract},recommendations:{list:fm.contract},repos:{list:ym.contract,add:bm.contract,remove:Im.contract},components:{list:ZA.contract,get:XA.contract,register:Nc.contract,deregister:ef.contract,rename:tf.contract,assignTeam:nf.contract,retirementPreview:of.contract,retire:rf.contract,restorationPreview:sf.contract,restore:af.contract,mergePreview:gf.contract,merge:mf.contract,relationships:{list:cf.contract,preview:lf.contract,add:uf.contract,remove:df.contract},incidents:{list:hf.contract},timeline:Af.contract}}});var Ha=h(()=>{P$();iR();dR();Sme();GR();VR();Vf();AB();hN();xN();b0();S0();v0();w0();D0();F0()});var F5e="https://api.sazabi.com",$5e="x-sazabi-client-source",vme=(e)=>({streamRun:async(t)=>Cme({options:e,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal}),streamThread:async(t)=>Cme({options:e,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}),Cme=async(e)=>{let t=e.options.fetch??globalThis.fetch;if(!t)throw Error("Fetch transport is not available in this runtime.");let n=await e.options.credentialProvider.getToken(),r=G5e(e.options.apiBaseUrl,e.path,e.cursor);return q5e({url:r,token:n,clientSource:e.options.clientSource,initialCursor:e.cursor,signal:e.signal,fetch:t})},G5e=(e,t,n)=>{let r=H5e(e??F5e),o=new URL(`${r}${t}`);if(n)o.searchParams.set(GP,n);return o.toString()},H5e=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},q5e=async(e)=>{let t=[],n=[],r=!1,o=!1,i,s=e.initialCursor,c=new AbortController,l=(f)=>{if(r)return;r=!0,i=f;while(n.length>0)n.shift()?.({value:void 0,done:!0})},u=(f)=>{let S=n.shift();if(S){S({value:f,done:!1});return}t.push(f)},d=(f)=>{if(f.event===qP){let v=J5e(f.data);if(v!==void 0)s=v;return}if(f.data===VP){o=!0,c.abort(),l();return}let S=Z5e(f.data);if(S)u(S)},p=()=>{o=!0,c.abort(),l()};if(e.signal)if(e.signal.aborted)o=!0,c.abort();else e.signal.addEventListener("abort",p,{once:!0});let g={[Symbol.asyncIterator](){return g},get cursor(){return s},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(r){if(i)throw i;return{value:void 0,done:!0}}return new Promise((f)=>{n.push(f)}).then((f)=>{if(f.done&&i)throw i;return f})},return:async()=>(o=!0,c.abort(),l(),{value:void 0,done:!0}),throw:async(f)=>{throw o=!0,c.abort(),l(f instanceof Error?f:Error(String(f))),f},close:async()=>{o=!0,c.abort(),l()}};if(o)return l(),g;let m=await e.fetch(e.url,{method:HP,headers:V5e(e.token,e.clientSource),signal:c.signal});if(await K5e(m))l();else Y5e(m,d).then(()=>l()).catch((f)=>{if(eXe(f)||o||e.signal?.aborted){l();return}l(tXe(f))});return g},V5e=(e,t)=>({accept:"text/event-stream",authorization:`Bearer ${e}`,...t?{[$5e]:t}:{}}),K5e=async(e)=>{if(e.status===204)return!0;if(e.ok&&e.body)return!1;let t=await X5e(e);if(e.status===401)throw Error("Authentication failed. Check your credential.");if(e.status===403)throw Error(`Forbidden (403): ${t||"Credential may not have access to this resource"}`);if(e.status===404)throw Error(`Not found (404): ${t||"Run or thread not found"}`);if(e.status===400)throw Error(`Invalid stream cursor (400): ${t||"The provided cursor was rejected"}`);if(e.status>=400&&e.status<500&&e.status!==429)throw Error(`Client error (${e.status}): ${t}`);if(!e.body)throw Error("Agent stream response did not include a body.");throw Error(e.status===429?`Rate limited (429): ${t}`:`Server error (${e.status}): ${t}`)},Y5e=async(e,t)=>{let n=e.body?.getReader();if(!n)throw Error("Agent stream response did not include a body.");let r=new TextDecoder,o="",i=W5e(t);try{while(!0){let s=await n.read();if(s.done)break;o+=r.decode(s.value,{stream:!0});let c=o.split(/\r\n|\r|\n/);o=c.pop()??"";for(let l of c)i.line(l)}if(o+=r.decode(),o)for(let s of o.split(/\r\n|\r|\n/))i.line(s);i.flush()}finally{n.releaseLock()}},W5e=(e)=>{let t="message",n=[],r=()=>{t="message",n=[]},o=()=>{if(n.length===0){r();return}e({event:t,data:n.join(`
|
|
8748
8748
|
`)}),r()};return{line:(i)=>{if(i===""){o();return}if(i.startsWith(":"))return;let s=i.indexOf(":"),c=s===-1?i:i.slice(0,s),l=s===-1?"":i.slice(s+1),u=l.startsWith(" ")?l.slice(1):l;if(c==="event"){t=u||"message";return}if(c==="data")n.push(u)},flush:o}},J5e=(e)=>{try{let t=$P.safeParse(JSON.parse(e));return t.success?t.data.streamNextOffset:void 0}catch{return}},Z5e=(e)=>{try{let t=FP.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}},X5e=async(e)=>{try{return await e.text()}catch{return""}},eXe=(e)=>e instanceof Error&&e.name==="AbortError",tXe=(e)=>e instanceof Error?e:Error(String(e));var Eme=h(()=>{Ha()});var eM,tM,nM,wme;var kme=h(()=>{De();eM=a.object({severities:a.array(a.string()).optional().describe("Limit results to the listed severities."),services:a.array(a.string()).optional().describe("Limit results to the listed service names."),environments:a.array(a.string()).optional().describe("Limit results to the listed deployment environments."),searchTerm:a.string().optional().describe("Case-insensitive substring match against the log body."),traceId:a.string().optional().describe("Limit results to one trace ID."),attributes:a.record(a.string(),a.string()).optional().describe("Limit results to logs whose attributes contain every listed key with an exactly equal value.")}),tM=a.object({service:a.string(),namespace:a.string(),environment:a.string(),host:a.string(),container:a.string(),pod:a.string()}),nM=a.object({id:a.string(),timestamp:a.string().datetime(),severity:a.string(),body:a.string(),service:a.string(),traceId:a.string(),spanId:a.string(),attributes:a.record(a.string(),a.string()),resource:tM}),wme=a.object({type:a.literal("logs"),timestamp:a.string().datetime(),data:a.array(nM)})});var nXe="https://{region}.intake.sazabi.com",oXe="https://{region}.tail.sazabi.com",Rme=500,rXe=5000,Tme="sazabi.public_key",iXe="x-sazabi-internal-log-forwarding-secret",sXe="x-sazabi-internal-log-forwarding-source",aXe=(e)=>e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e,Bme=(e)=>{let t=aXe(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},cXe,lXe,uXe,Ome=(e)=>{let t=new Map;return{tail:async(n)=>{let r=await CXe(e.credentialProvider,n.projectId,"logs.tail"),o=await vXe(e,t,r,n.region,"logs.tail"),i=gXe({projectId:r,region:o,filters:n.filters,apiBaseUrl:e.apiBaseUrl,tailBaseUrl:e.tailBaseUrl}),s=await e.credentialProvider.getToken(),c=e.fetch??globalThis.fetch;if(!c)throw Error("Fetch transport is not available in this runtime.");return wXe({token:s,url:i,signal:n.signal,fetch:c})},forward:async(n)=>{let r=await EXe(e,t,n.projectId??await e.credentialProvider.getProjectId?.(),n.region,"logs.forward"),o=fXe(r,e.intakeBaseUrl),i=e.fetch??globalThis.fetch,s=bXe(n.logs,n.publicKey),c=_Xe(s);return await OXe(i,o,s,SXe(n.sazabiInternalForwarding)),{forwardedCount:c,failedCount:0}}}},dXe="3010",pXe,gXe=(e)=>{let t=(e.tailBaseUrl??mXe({region:e.region,apiBaseUrl:e.apiBaseUrl})).replace("{region}",e.region),n=hXe(t);n.searchParams.set("projectId",e.projectId);let r=AXe(e.filters);if(r)n.searchParams.set("filters",r);return n.toString()},mXe=(e)=>{if(e.apiBaseUrl)try{let t=new URL(e.apiBaseUrl).hostname;if(t.endsWith(".sazabi.dev")){let n=t.includes(".staging.")?"staging.sazabi.dev":"development.sazabi.dev";return`https://${e.region}.tail.${n}`}}catch{}return oXe.replace("{region}",e.region)},hXe=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)throw Error(`Invalid tail base URL: ${e}`);if(Bme(t.hostname)){if(t.protocol="http:",!t.port||pXe.has(t.port))t.port=dXe;return t.pathname="/v1/tail",t.search="",t.hash="",t}if(t.protocol==="ws:"||t.protocol==="wss:")t.protocol=t.protocol==="wss:"?"https:":"http:";if(t.protocol!=="http:"&&t.protocol!=="https:")throw Error(`Invalid tail base URL protocol: ${t.protocol}. Expected http:, https:, ws:, or wss:.`);return t.pathname="/v1/tail",t.search="",t.hash="",t},AXe=(e)=>{if(!e)return;let t=Object.entries(e).filter(([,n])=>n!==void 0&&(!Array.isArray(n)||n.length>0)&&(typeof n!=="object"||Array.isArray(n)||n===null||Object.keys(n).length>0)&&n!=="");if(t.length===0)return;return JSON.stringify(Object.fromEntries(t))},fXe=(e,t)=>{let n=(t??nXe).replace("{region}",e),r=n.endsWith("/")?n.slice(0,-1):n,o=yXe(r);if(o)return o;let i=r.match(/^https:\/\/([a-z0-9-]+)\.intake\.([a-z0-9.]+)$/);return`${i?`https://otlp.${i[1]}.intake.${i[2]}`:r}/v1/logs`},yXe=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!Bme(t.hostname))return;return t.pathname="/adapters/otlp",t.toString()},bXe=(e,t)=>{let n=e.resourceLogs;if(!n||n.length===0)return{...e,resourceLogs:[{resource:{attributes:[_me(t)]},scopeLogs:[]}]};return{...e,resourceLogs:n.map((r)=>({...r,resource:{...r.resource,attributes:IXe(r.resource?.attributes,t)}}))}},IXe=(e,t)=>[...(e??[]).filter((r)=>r?.key!==Tme),_me(t)],_me=(e)=>({key:Tme,value:{stringValue:e}}),SXe=(e)=>{if(!e?.secret)return{};return{[iXe]:e.secret,...e.source?{[sXe]:e.source}:{}}},CXe=async(e,t,n)=>{let r=t??await e.getProjectId?.();if(r)return r;throw Lme(n,"Project ID is required",["projectId"])},vXe=async(e,t,n,r,o)=>r??await Dme(e,t,n),EXe=async(e,t,n,r,o)=>{if(r)return r;if(!n)throw Lme(o,"Project ID is required",["projectId"]);return Dme(e,t,n)},Dme=async(e,t,n)=>{let r=t.get(n);if(r)return r;let o=e.raw.projects.get({projectId:n}).then((i)=>i.project.region);t.set(n,o);try{return await o}catch(i){throw t.delete(n),i}},wXe=async(e)=>{let t=[],n=[],r=!1,o=!1,i,s=0,c,l,u=(S)=>{if(r)return;r=!0,i=S;while(n.length>0){let v=n.shift();if(v)v({value:void 0,done:!0})}},d=(S)=>{let v=n.shift();if(v){v({value:S,done:!1});return}t.push(S)},p=()=>{l?.abort()},g=(S)=>{if(S.event!=="log"){if(S.id)c=S.id;return}let v=TXe(S.data);for(let P of v)d(P);if(S.id)c=S.id},m=async(S)=>{let v=!1;while(!r&&!o){let P=new AbortController,O=()=>P.abort();l=P;let V=!1;e.signal?.addEventListener("abort",O,{once:!0});try{let M=await e.fetch(kXe(e.url,c),{method:"GET",headers:{accept:"text/event-stream",authorization:`Bearer ${e.token}`},signal:P.signal});await xXe(M),s=0,v=!0,S(),await PXe(M,g),V=!0}catch(M){if(Pme(M)||e.signal?.aborted)break;let le=xme(M);if(!v||BXe(le))throw le;V=!0}finally{if(e.signal?.removeEventListener("abort",O),l===P)l=void 0}if(r||o||e.signal?.aborted)break;if(!V)continue;s+=1,await Qme(Math.min(Rme*2**(s-1),rXe),e.signal)}};if(e.signal?.addEventListener("abort",()=>{o=!0,p(),u()},{once:!0}),e.signal?.aborted)o=!0,p(),u();await new Promise((S,v)=>{let P=!1;m(()=>{if(!P)P=!0,S()}).catch((V)=>{let M=xme(V);if(!P){P=!0,v(M);return}if(!Pme(V))u(M)})});let f={[Symbol.asyncIterator](){return f},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(r){if(i)throw i;return{value:void 0,done:!0}}return new Promise((S)=>{n.push(S)}).then((S)=>{if(S.done&&i)throw i;return S})},return:async()=>(o=!0,p(),u(),{value:void 0,done:!0}),throw:async(S)=>{throw o=!0,p(),u(S instanceof Error?S:Error(String(S))),S}};return f},kXe=(e,t)=>{if(!t)return e;let n=new URL(e);return n.searchParams.set("cursor",t),n.toString()},xXe=async(e)=>{if(e.ok&&e.body)return;let t=await e.text();if(e.status===401)throw Error("Authentication failed. Check your credential.");if(e.status===403){if(/not served by this region/i.test(t))throw Error(`Wrong region (403): ${t||"Project is not served by this region"}`);throw Error(`Forbidden (403): ${t||"Credential may not have access to this project"}`)}if(e.status>=400&&e.status<500&&e.status!==429)throw Error(`Client error (${e.status}): ${t}`);if(!e.body)throw Error("Tail stream response did not include a body.");throw Error(e.status===429?`Rate limited (429): ${t}`:`Server error (${e.status}): ${t}`)},PXe=async(e,t)=>{let n=e.body?.getReader();if(!n)throw Error("Tail stream response did not include a body.");let r=new TextDecoder,o="",i=RXe(t);try{while(!0){let s=await n.read();if(s.done)break;o+=r.decode(s.value,{stream:!0});let c=o.split(/\r\n|\r|\n/);o=c.pop()??"";for(let l of c)i.line(l)}if(o+=r.decode(),o){let s=o.split(/\r\n|\r|\n/);for(let c of s)i.line(c)}i.flush()}finally{n.releaseLock()}},RXe=(e)=>{let t="message",n,r=[],o=()=>{t="message",n=void 0,r=[]},i=()=>{if(r.length===0&&!n){o();return}e({event:t,data:r.join(`
|
|
8749
8749
|
`),...n?{id:n}:{}}),o()};return{line:(s)=>{if(s===""){i();return}if(s.startsWith(":"))return;let c=s.indexOf(":"),l=c===-1?s:s.slice(0,c),u=c===-1?"":s.slice(c+1),d=u.startsWith(" ")?u.slice(1):u;if(l==="event"){t=d||"message";return}if(l==="data"){r.push(d);return}if(l==="id"&&!d.includes("\x00"))n=d},flush:i}},TXe=(e)=>{try{let t=wme.safeParse(JSON.parse(e));if(!t.success)return[];return t.data.data}catch{return[]}},xme=(e)=>e instanceof Error?e:Error(String(e)),Pme=(e)=>e instanceof Error&&e.name==="AbortError",BXe=(e)=>e.message.startsWith("Authentication failed")||e.message.startsWith("Forbidden (")||e.message.startsWith("Wrong region (")||e.message.startsWith("Client error ("),OXe=async(e,t,n,r={},o=3,i=1e4)=>{let s;for(let c=0;c<=o;c+=1){let l=new AbortController,u=globalThis.setTimeout(()=>l.abort(),i);try{let d=await e(t,{method:"POST",headers:{"content-type":"application/json",...r},body:JSON.stringify(n),signal:l.signal});if(d.ok)return;let p=await d.text();if(d.status===401||d.status===403)throw Error("Authentication failed. Check your public key.");if(d.status>=400&&d.status<500&&d.status!==429)throw Error(`Client error (${d.status}): ${p}`);s=Error(d.status===429?`Rate limited (429): ${p}`:`Server error (${d.status}): ${p}`)}catch(d){let p=d instanceof Error?d.message:String(d);if(p.startsWith("Authentication failed")||p.startsWith("Client error ("))throw d instanceof Error?d:Error(p);s=d instanceof Error&&d.name==="AbortError"?Error("Request timed out"):d instanceof Error?d:Error(String(d))}finally{globalThis.clearTimeout(u)}if(c<o)await Qme(Rme*2**c)}throw Error(`Failed after ${o+1} attempts: ${s?.message??"Unknown error"}`)},_Xe=(e)=>e.resourceLogs?.reduce((t,n)=>t+(n.scopeLogs?.reduce((r,o)=>r+(o.logRecords?.length??0),0)??0),0)??0,Qme=async(e,t)=>{if(t?.aborted)return;await new Promise((n)=>{let r=globalThis.setTimeout(n,e);t?.addEventListener("abort",()=>{globalThis.clearTimeout(r),n()},{once:!0})})},Lme=(e,t,n)=>new Zt("BAD_REQUEST",{message:t,data:{operationId:e,missingContext:n}});var oM=h(()=>{ic();kme();De();cXe=a.object({projectId:a.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:eM.optional().describe("Optional filters applied by the tail SSE service.")}),lXe=a.object({publicKey:a.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:a.custom((e)=>typeof e==="object"&&e!==null).describe("OTLP logs export request payload to send to the intake service.")}),uXe=a.object({forwardedCount:a.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:a.number().int().nonnegative().describe("Number of log records rejected by the intake request.")}),pXe=new Set(["15006","3010"])});var rM="https://api.sazabi.com",zme="https://api.platform.sazabi.com",jme="sazabi-cli",DXe="urn:ietf:params:oauth:grant-type:device_code",Ume=(e)=>{let t=OC(new HC(X0,{url:QXe(e.apiBaseUrl??rM),headers:async()=>{let o=new Headers({authorization:`Bearer ${await e.credentialProvider.getToken()}`});if(e.clientSource)o.set("x-sazabi-client-source",e.clientSource);if(e.sandboxActorDescriptor)o.set("x-sazabi-sandbox-actor",e.sandboxActorDescriptor);return o},fetch:e.fetch,customErrorResponseBodyDecoder:(o,i)=>{let s=FXe(o);if(!s)return null;return new Zt(s.code,{message:s.message,status:i.status,data:{operationId:s.operationId,missingContext:s.missingContext,...s.reason!==void 0?{reason:s.reason}:{},...s.retryAfterSeconds!==void 0?{retryAfterSeconds:s.retryAfterSeconds}:{}}})}})),n=Ome({raw:t,credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??rM,intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl}),r=vme({credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??rM,clientSource:e.clientSource});return{raw:t,me:async()=>t.me({}),automations:{list:async(o={})=>t.automations.list(await oe(e.credentialProvider,o,"automations.list")),get:async(o)=>t.automations.get(await oe(e.credentialProvider,o,"automations.get")),create:async(o)=>t.automations.create(await oe(e.credentialProvider,o,"automations.create")),update:async(o)=>t.automations.update(await oe(e.credentialProvider,o,"automations.update")),enable:async(o)=>t.automations.enable(await oe(e.credentialProvider,o,"automations.enable")),disable:async(o)=>t.automations.disable(await oe(e.credentialProvider,o,"automations.disable")),runs:{list:async(o)=>t.automations.runs.list(await oe(e.credentialProvider,o,"automations.runs.list")),get:async(o)=>t.automations.runs.get(await oe(e.credentialProvider,o,"automations.runs.get")),logs:async(o)=>t.automations.runs.logs(await oe(e.credentialProvider,o,"automations.runs.logs"))}},logs:{...n,query:async(o={})=>t.logs.query(await oe(e.credentialProvider,o,Kc.operationId)),schema:async(o={})=>t.logs.schema(await oe(e.credentialProvider,o,Yc.operationId)),volume:async(o)=>t.logs.volume(await oe(e.credentialProvider,o,Wc.operationId)),patterns:async(o={})=>t.logs.patterns(await oe(e.credentialProvider,o,Jc.operationId)),nativeQuery:async(o)=>t.logs.nativeQuery(await oe(e.credentialProvider,o,Zc.operationId))},onboarding:{getState:async(o={})=>t.onboarding.getState(await Nme(e.credentialProvider,await NXe(e.credentialProvider,o))),skipSampleIssue:async(o)=>t.onboarding.skipSampleIssue(await Nme(e.credentialProvider,o??{})),finish:async(o)=>t.onboarding.finish(o)},organizations:{list:async()=>t.organizations.list({}),get:async(o)=>t.organizations.get(o),create:async(o)=>t.organizations.create(o),update:async(o)=>t.organizations.update(await ve(e.credentialProvider,o,"organizations.update"))},members:{list:async(o={})=>t.members.list(await ve(e.credentialProvider,o,"members.list")),updateRole:async(o)=>t.members.updateRole(await ve(e.credentialProvider,o,"members.updateRole")),remove:async(o)=>{let i=await ve(e.credentialProvider,o,"members.remove");return t.members.remove({params:{member:i.member},query:{organizationId:i.organizationId}})},invite:async(o)=>t.members.invite(await ve(e.credentialProvider,o,"members.invite")),listInvitations:async(o={})=>t.members.listInvitations(await ve(e.credentialProvider,o,"members.listInvitations")),revokeInvitation:async(o)=>{let i=await ve(e.credentialProvider,o,"members.revokeInvitation");return t.members.revokeInvitation({params:{invitationId:i.invitationId},query:{organizationId:i.organizationId}})}},teams:{list:async(o={})=>t.teams.list(await ve(e.credentialProvider,o,"teams.list")),create:async(o)=>t.teams.create(await ve(e.credentialProvider,o,"teams.create")),update:async(o)=>t.teams.update(await ve(e.credentialProvider,o,"teams.update")),delete:async(o)=>{let i=await ve(e.credentialProvider,o,"teams.delete");return t.teams.delete({params:{teamId:i.teamId},query:{organizationId:i.organizationId}})},addMember:async(o)=>t.teams.addMember(await ve(e.credentialProvider,o,"teams.addMember")),removeMember:async(o)=>{let i=await ve(e.credentialProvider,o,"teams.removeMember");return t.teams.removeMember({params:{teamId:i.teamId,userId:i.userId},query:{organizationId:i.organizationId}})},listMembers:async(o)=>t.teams.listMembers(await ve(e.credentialProvider,o,"teams.listMembers"))},publicKeys:{list:async(o={})=>t.publicKeys.list(await oe(e.credentialProvider,o,jc.operationId)),get:async(o)=>t.publicKeys.get(await oe(e.credentialProvider,o,Uc.operationId)),ensureLogForwarding:async(o={})=>t.publicKeys.ensureLogForwarding(await oe(e.credentialProvider,o,Fc.operationId)),update:async(o)=>t.publicKeys.update(await oe(e.credentialProvider,o,$c.operationId)),deactivate:async(o)=>{let i=await oe(e.credentialProvider,o,Gc.operationId);return t.publicKeys.deactivate({params:{keyId:i.keyId},query:{projectId:i.projectId}})}},secretKeys:{list:async(o={})=>t.secretKeys.list(await ve(e.credentialProvider,o,"secretKeys.list")),get:async(o)=>t.secretKeys.get(await ve(e.credentialProvider,o,"secretKeys.get")),create:async(o)=>t.secretKeys.create(await ve(e.credentialProvider,o,"secretKeys.create")),update:async(o)=>t.secretKeys.update(await ve(e.credentialProvider,o,"secretKeys.update")),delete:async(o)=>{let{organizationId:i}=await ve(e.credentialProvider,o,"secretKeys.delete");await t.secretKeys.delete({params:{keyId:o.keyId},query:{organizationId:i}})}},search:{threads:async(o)=>t.search.threads(await oe(e.credentialProvider,o,ju.operationId)),messages:async(o)=>t.search.messages(await oe(e.credentialProvider,o,Uu.operationId))},projects:{list:async(o={})=>t.projects.list(await LXe(e.credentialProvider,o)),get:async(o)=>t.projects.get(o),create:async(o)=>t.projects.create(await ve(e.credentialProvider,o,"projects.create"))},messages:{list:async(o)=>t.messages.list(o),append:async(o)=>Mme(t,await t.messages.append(UXe(o)))},threads:{list:async(o={})=>t.threads.list(await MXe(e.credentialProvider,o)),get:async(o)=>t.threads.get(o),getStatus:async(o)=>t.threads.getStatus(o),stop:async(o)=>t.threads.stop(o),create:async(o)=>Mme(t,await t.threads.create(await jXe(e.credentialProvider,o))),update:async(o)=>t.threads.update(o),fork:async(o)=>t.threads.fork(o),setVisibility:async(o)=>t.threads.setVisibility(o),createShareLink:async(o)=>t.threads.createShareLink(o),listShareLinks:async(o)=>t.threads.listShareLinks(o),revokeShareLink:async(o)=>t.threads.revokeShareLink(o),stream:async(o)=>r.streamThread(o)},runs:{list:async(o={})=>t.runs.list(await zXe(e.credentialProvider,o)),listForThread:async(o)=>t.runs.listForThread(o),get:async(o)=>t.runs.get(o),cancel:async(o)=>t.runs.cancel(o),stream:async(o)=>r.streamRun(o)},logSources:{listProviders:async()=>t.logSources.listProviders({}),list:async(o={})=>t.logSources.list(await oe(e.credentialProvider,o,qc.operationId)),get:async(o)=>t.logSources.get(o),create:async(o)=>t.logSources.create(await oe(e.credentialProvider,o,Vc.operationId)),update:async(o)=>t.logSources.update(o),delete:async(o)=>t.logSources.delete(o)},logStreams:{list:async(o)=>t.logStreams.list(o),get:async(o)=>t.logStreams.get(o),create:async(o)=>t.logStreams.create(o),update:async(o)=>t.logStreams.update(o),delete:async(o)=>t.logStreams.delete(o),reassign:async(o)=>t.logStreams.reassign(o)},connectedAccounts:{beginConnect:async(o)=>t.connectedAccounts.beginConnect(await ve(e.credentialProvider,o,"connectedAccounts.beginConnect")),getConnectAttempt:async(o)=>t.connectedAccounts.getConnectAttempt(await ve(e.credentialProvider,o,"connectedAccounts.getConnectAttempt")),list:async(o={})=>t.connectedAccounts.list(await ve(e.credentialProvider,o,"connectedAccounts.list")),disconnect:async(o)=>t.connectedAccounts.disconnect(await ve(e.credentialProvider,o,"connectedAccounts.disconnect"))},integrations:{listProviders:async(o={})=>t.integrations.listProviders(await ve(e.credentialProvider,o,"integrations.listProviders")),listConnections:async(o={})=>t.integrations.listConnections(await ve(e.credentialProvider,o,"integrations.listConnections")),getConnection:async(o)=>t.integrations.getConnection(await ve(e.credentialProvider,o,"integrations.getConnection")),createConnection:async(o)=>t.integrations.createConnection(await ve(e.credentialProvider,o,"integrations.createConnection")),beginConnect:async(o)=>t.integrations.beginConnect(await ve(e.credentialProvider,o,"integrations.beginConnect")),getConnectAttempt:async(o)=>t.integrations.getConnectAttempt(await ve(e.credentialProvider,o,"integrations.getConnectAttempt")),disconnectConnection:async(o)=>t.integrations.disconnectConnection(await ve(e.credentialProvider,o,"integrations.disconnectConnection")),updateConnectionCredentials:async(o)=>t.integrations.updateConnectionCredentials(await ve(e.credentialProvider,o,"integrations.updateConnectionCredentials"))},mcpConnectors:{list:async(o={})=>t.mcpConnectors.list(await oe(e.credentialProvider,o,fu.operationId)),get:async(o)=>t.mcpConnectors.get(await oe(e.credentialProvider,o,yu.operationId)),details:async(o)=>t.mcpConnectors.details(await oe(e.credentialProvider,o,bu.operationId)),listProviders:async()=>t.mcpConnectors.listProviders({}),search:async(o={})=>t.mcpConnectors.search(await oe(e.credentialProvider,o,Iu.operationId)),describe:async(o)=>t.mcpConnectors.describe(await oe(e.credentialProvider,o,Su.operationId)),call:async(o)=>t.mcpConnectors.call(await oe(e.credentialProvider,o,Cu.operationId)),create:async(o)=>t.mcpConnectors.create(await oe(e.credentialProvider,o,vu.operationId)),update:async(o)=>t.mcpConnectors.update(await oe(e.credentialProvider,o,Eu.operationId)),disconnect:async(o)=>{await t.mcpConnectors.disconnect(await oe(e.credentialProvider,o,wu.operationId))},setReadOnly:async(o)=>t.mcpConnectors.setReadOnly(await oe(e.credentialProvider,o,ku.operationId)),beginOAuthInstall:async(o)=>t.mcpConnectors.beginOAuthInstall(await oe(e.credentialProvider,o,xu.operationId)),getOAuthInstallAttempt:async(o)=>t.mcpConnectors.getOAuthInstallAttempt(await oe(e.credentialProvider,o,Pu.operationId))},sandboxPresets:{delete:async(o)=>t.sandboxPresets.deletePreset(await oe(e.credentialProvider,o,Mu.operationId)),listConnections:async(o={})=>t.sandboxPresets.listConnections(await oe(e.credentialProvider,o,Lu.operationId)),listTypes:async()=>t.sandboxPresets.listTypes({}),test:async(o)=>t.sandboxPresets.testPreset(await oe(e.credentialProvider,o,zu.operationId)),upsert:async(o)=>t.sandboxPresets.upsertPreset(await oe(e.credentialProvider,o,Nu.operationId))},memory:{list:async(o={})=>t.memory.list(await oe(e.credentialProvider,o,Bu.operationId)),get:async(o)=>t.memory.get(await oe(e.credentialProvider,o,Tu.operationId)),put:async(o)=>t.memory.put(await oe(e.credentialProvider,o,Ru.operationId)),search:async(o)=>t.memory.search(await oe(e.credentialProvider,o,Ou.operationId)),delete:async(o)=>t.memory.delete(await oe(e.credentialProvider,o,_u.operationId))},signalDefinitions:{list:async(o={})=>t.signalDefinitions.list(await oe(e.credentialProvider,o,"signalDefinitions.list")),get:async(o)=>t.signalDefinitions.get(await oe(e.credentialProvider,o,"signalDefinitions.get")),create:async(o)=>t.signalDefinitions.create(await oe(e.credentialProvider,o,"signalDefinitions.create")),update:async(o)=>t.signalDefinitions.update(await oe(e.credentialProvider,o,"signalDefinitions.update")),disable:async(o)=>t.signalDefinitions.disable(await oe(e.credentialProvider,o,"signalDefinitions.disable"))},scripts:{list:async(o={})=>t.scripts.list(await oe(e.credentialProvider,o,"scripts.list")),get:async(o)=>t.scripts.get(await oe(e.credentialProvider,o,"scripts.get")),create:async(o)=>t.scripts.create(await oe(e.credentialProvider,o,"scripts.create")),update:async(o)=>t.scripts.update(await oe(e.credentialProvider,o,"scripts.update")),delete:async(o)=>t.scripts.delete(await oe(e.credentialProvider,o,"scripts.delete"))},issues:{count:async(o={})=>t.issues.count(await oe(e.credentialProvider,o,"issues.count")),create:async(o)=>t.issues.create(await oe(e.credentialProvider,o,zc.operationId)),list:async(o={})=>t.issues.list(await oe(e.credentialProvider,o,"issues.list")),search:async(o={})=>t.issues.search(await oe(e.credentialProvider,o,"issues.search")),get:async(o)=>t.issues.get(o),resolve:async(o)=>t.issues.resolve(o),ignore:async(o)=>t.issues.ignore(o),reopen:async(o)=>t.issues.reopen(o),mute:async(o)=>t.issues.mute(o),unmute:async(o)=>t.issues.unmute(o)},workItems:{create:async(o)=>t.workItems.create(await ve(e.credentialProvider,o,"work-items.create")),comment:async(o)=>t.workItems.comment(await ve(e.credentialProvider,o,"work-items.comment")),transition:async(o)=>t.workItems.transition(await ve(e.credentialProvider,o,"work-items.transition"))},pullRequests:{list:async(o={})=>t.pullRequests.list(await oe(e.credentialProvider,o,"pullRequests.list"))},components:{list:async(o={})=>t.components.list(await oe(e.credentialProvider,o,"components.list")),get:async(o)=>t.components.get(o),register:async(o)=>t.components.register(await oe(e.credentialProvider,o,Nc.operationId)),deregister:async(o)=>t.components.deregister({componentId:o.componentId,...o.reason!==void 0?{reason:o.reason}:{}}),rename:async(o)=>t.components.rename(o),assignTeam:async(o)=>t.components.assignTeam(o),retirementPreview:async(o)=>t.components.retirementPreview(o),retire:async(o)=>t.components.retire(o),restorationPreview:async(o)=>t.components.restorationPreview(o),restore:async(o)=>t.components.restore(o),mergePreview:async(o)=>t.components.mergePreview(await oe(e.credentialProvider,o,"components.mergePreview")),merge:async(o)=>t.components.merge(await oe(e.credentialProvider,o,"components.merge")),relationships:{list:async(o={})=>t.components.relationships.list(await oe(e.credentialProvider,o,"components.relationships.list")),preview:async(o)=>t.components.relationships.preview(await oe(e.credentialProvider,o,"components.relationships.preview")),add:async(o)=>t.components.relationships.add(await oe(e.credentialProvider,o,"components.relationships.add")),remove:async(o)=>t.components.relationships.remove(await oe(e.credentialProvider,o,"components.relationships.remove"))},incidents:{list:async(o={})=>t.components.incidents.list(await oe(e.credentialProvider,o,"components.incidents.list"))},timeline:async(o)=>t.components.timeline(o)},billing:{getSummary:async(o={})=>t.billing.getSummary(await ve(e.credentialProvider,o,"billing.getSummary")),getUsage:async(o={})=>t.billing.getUsage(await ve(e.credentialProvider,o,"billing.getUsage")),listTransactions:async(o={})=>t.billing.listTransactions(await ve(e.credentialProvider,o,"billing.listTransactions")),previewSubscriptionCancellation:async(o={})=>t.billing.previewSubscriptionCancellation(await ve(e.credentialProvider,o,"billing.previewSubscriptionCancellation")),scheduleSubscriptionCancellation:async(o={})=>t.billing.scheduleSubscriptionCancellation(await ve(e.credentialProvider,o,"billing.scheduleSubscriptionCancellation")),resumeSubscriptionCancellation:async(o={})=>t.billing.resumeSubscriptionCancellation(await ve(e.credentialProvider,o,"billing.resumeSubscriptionCancellation")),getAutoTopUp:async(o={})=>t.billing.getAutoTopUp(await ve(e.credentialProvider,o,"billing.getAutoTopUp")),updateAutoTopUp:async(o)=>t.billing.updateAutoTopUp(await ve(e.credentialProvider,o,"billing.updateAutoTopUp")),purchaseCredits:async(o)=>t.billing.purchaseCredits(await ve(e.credentialProvider,o,"billing.purchaseCredits")),listPlans:async(o={})=>t.billing.listPlans(await ve(e.credentialProvider,o,"billing.listPlans")),previewPlanChange:async(o)=>t.billing.previewPlanChange(await ve(e.credentialProvider,o,"billing.previewPlanChange")),changePlan:async(o)=>t.billing.changePlan(await ve(e.credentialProvider,o,"billing.changePlan")),createCheckoutSession:async(o)=>t.billing.createCheckoutSession(await ve(e.credentialProvider,o,"billing.createCheckoutSession")),getCheckoutSessionStatus:async(o)=>t.billing.getCheckoutSessionStatus(await ve(e.credentialProvider,o,"billing.getCheckoutSessionStatus")),createPortalSession:async(o={})=>t.billing.createPortalSession(await ve(e.credentialProvider,o,"billing.createPortalSession")),getPaymentMethod:async(o={})=>t.billing.getPaymentMethod(await ve(e.credentialProvider,o,"billing.getPaymentMethod"))},tasks:{list:async(o={})=>t.tasks.list(await oe(e.credentialProvider,o,Cm.operationId))},recommendations:{list:async(o={})=>t.recommendations.list(await oe(e.credentialProvider,o,fm.operationId))},repos:{list:async(o={})=>t.repos.list(await oe(e.credentialProvider,o,ym.operationId)),add:async(o)=>t.repos.add(await oe(e.credentialProvider,o,bm.operationId)),remove:async(o)=>t.repos.remove(await oe(e.credentialProvider,o,Im.operationId))},notificationDeliveryRules:{list:async(o={})=>t.notificationDeliveryRules.list(await oe(e.credentialProvider,o,"notificationDeliveryRules.list")),options:async(o={})=>t.notificationDeliveryRules.options(await oe(e.credentialProvider,o,"notificationDeliveryRules.options")),create:async(o)=>t.notificationDeliveryRules.create(await oe(e.credentialProvider,o,"notificationDeliveryRules.create")),update:async(o)=>t.notificationDeliveryRules.update(await oe(e.credentialProvider,o,"notificationDeliveryRules.update")),delete:async(o)=>t.notificationDeliveryRules.delete(await oe(e.credentialProvider,o,"notificationDeliveryRules.delete"))},notificationChannels:{getProject:async(o={})=>t.notificationChannels.getProject(await oe(e.credentialProvider,o,"notificationChannels.getProject"))}}},sM=async(e={})=>{let t=await Gme(e.fetch)(Fme(e.apiBaseUrl??zme,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId??jme,...e.scope?{scope:e.scope}:{}})}),n=await t.json();if(!t.ok)throw $Xe(n,t.status);let r=n;return{deviceCode:Fu(r.device_code,"device_code"),userCode:Fu(r.user_code,"user_code"),verificationUri:Fu(r.verification_uri,"verification_uri"),verificationUriComplete:Fu(r.verification_uri_complete,"verification_uri_complete"),expiresIn:iM(r.expires_in,"expires_in"),interval:iM(r.interval,"interval")}},aM=async(e)=>{let t=await Gme(e.fetch)(Fme(e.apiBaseUrl??zme,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:DXe,device_code:e.deviceCode,client_id:e.clientId??jme})}),n=await t.json();if(t.ok){let o=n;return{status:"authorized",accessToken:Fu(o.access_token,"access_token"),tokenType:Fu(o.token_type,"token_type"),expiresIn:iM(o.expires_in,"expires_in"),scope:typeof o.scope==="string"?o.scope:""}}let r=$me(n);if(!r)throw Error(`Device authorization failed with status ${t.status}`);if(r.error==="authorization_pending")return{status:"pending"};if(r.error==="slow_down")return{status:"pending",interval:10};if(r.error==="access_denied")return{status:"denied",message:r.errorDescription};if(r.error==="expired_token"||r.error==="invalid_grant")return{status:"expired",message:r.errorDescription};throw Error(r.errorDescription)},QXe=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},Fme=(e,t)=>`${e.replace(/\/+$/,"")}/api/auth${t}`,LXe=async(e,t)=>ve(e,t,"projects.list"),Nme=async(e,t)=>{let n=t.organizationId??await e.getOrganizationId?.();return n?{...t,organizationId:n}:t},ve=async(e,t,n)=>{let r=t.organizationId??await e.getOrganizationId?.();if(!r)throw new Zt("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:n,missingContext:["organizationId"]},status:400});return{...t,organizationId:r}},NXe=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},oe=async(e,t,n)=>{let r=t.projectId??await e.getProjectId?.();if(!r)throw new Zt("BAD_REQUEST",{message:"Project ID is required",data:{operationId:n,missingContext:["projectId"]},status:400});return{...t,projectId:r}},MXe=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},zXe=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},jXe=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},UXe=(e)=>({threadId:e.threadId,message:e.message,wait:e.wait??!0,timeoutSeconds:e.timeoutSeconds??20,...e.automationId!==void 0?{automationId:e.automationId}:{}}),FXe=(e)=>{if(!e||typeof e!=="object")return null;let t=e;if(typeof t.code!=="string"||typeof t.message!=="string"||typeof t.operationId!=="string")return null;return{code:t.code,message:t.message,operationId:t.operationId,missingContext:Array.isArray(t.missingContext)?t.missingContext.filter((n)=>typeof n==="string"):[],...typeof t.reason==="string"?{reason:t.reason}:{},...typeof t.retryAfterSeconds==="number"?{retryAfterSeconds:t.retryAfterSeconds}:{}}},$me=(e)=>{if(!e||typeof e!=="object")return null;let t=e;if(typeof t.error!=="string"||typeof t.error_description!=="string")return null;return{error:t.error,errorDescription:t.error_description}},$Xe=(e,t)=>{let n=$me(e);return Error(n?.errorDescription??`Device authorization failed with status ${t}`)},Gme=(e)=>e??globalThis.fetch,Mme=(e,t)=>({result:t,poll:()=>e.runs.get({runId:t.runId}),waitForCompletion:async(n={})=>GXe(e,t,n)}),GXe=async(e,t,n)=>{if(t.completed)return t;let r=n.intervalMs??2000,o=Date.now(),i=t;while(!i.completed){if(n.timeoutMs!==void 0&&Date.now()-o>=n.timeoutMs)return i;await HXe(r),i=await e.runs.get({runId:i.runId})}return i},HXe=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},Fu=(e,t)=>{if(typeof e==="string")return e;throw Error(`Expected '${t}' to be a string.`)},iM=(e,t)=>{if(typeof e==="number")return e;throw Error(`Expected '${t}' to be a number.`)};var cM=h(()=>{ic();wj();Ha();Eme();oM();oM()});var Ct=(e)=>({success:!0,value:e}),ft=(e,t,n)=>({success:!1,error:e,...t!==void 0&&{statusCode:t},...n!==void 0&&{errorPayload:n}}),qXe=(e)=>{if(e===void 0)return"NETWORK_ERROR";if(e===401)return"UNAUTHORIZED";if(e===403)return"FORBIDDEN";if(e===404)return"NOT_FOUND";if(e===429)return"TOO_MANY_REQUESTS";if(e>=500)return"SERVER_ERROR";return"REQUEST_FAILED"},I=(e,t,n)=>{if(!e.success){let r=`${t}: ${e.error}`;if(n)return b(e.errorPayload??{code:qXe(e.statusCode),message:r,operationId:null});return y(r)}return e.value};var ce=h(()=>{re()});var VXe="https://api.sazabi.com",lM,KXe=30,YXe=(e)=>new Promise((t)=>setTimeout(t,e)),T=async(e)=>{for(let t=0;;t+=1)try{return Ct(await e())}catch(n){let r=WXe(n),o=JXe(n),i=r?.retryAfterSeconds;if(o===429&&t===0&&i!==void 0&&i<=KXe&&process.env.SAZABI_NO_RETRY!=="1"){process.stderr.write(`Rate limited; retrying in ~${i}s…
|
|
8750
8750
|
`),await YXe(i*1000);continue}let s=n instanceof Error?n.message:String(n);if(i!==void 0)s+=` Retry in ~${i}s.`;return ft(s,o,r)}},WXe=(e)=>{if(!e||typeof e!=="object")return;let t=e;if(typeof t.code!=="string"||typeof t.message!=="string"||!t.data||typeof t.data!=="object")return;let n=t.data;if(typeof n.operationId!=="string")return;return{code:t.code,message:t.message,operationId:n.operationId,...typeof n.reason==="string"?{reason:n.reason}:{},...typeof n.retryAfterSeconds==="number"?{retryAfterSeconds:n.retryAfterSeconds}:{},...Array.isArray(n.missingContext)?{missingContext:n.missingContext.filter((r)=>typeof r==="string")}:{}}},JXe=(e)=>{if(!e||typeof e!=="object")return;let t=e;return typeof t.status==="number"?t.status:void 0},pi=(e)=>{let t=Ume({apiBaseUrl:e.baseUrl??VXe,clientSource:"cli",sandboxActorDescriptor:e.sandboxActorDescriptor,credentialProvider:{getToken:()=>e.token,getOrganizationId:()=>e.organizationId,getProjectId:()=>e.projectId},intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl});return{me:()=>{let n=`${e.token}::${e.baseUrl??""}`,r=lM.get(n);if(r)return r;let o=T(()=>t.me()).then((i)=>{if(!i.success)lM.delete(n);return i});return lM.set(n,o),o},automations:{list:(n={})=>T(()=>t.automations.list(n)),get:(n)=>T(()=>t.automations.get({automationId:n})),create:(n)=>T(()=>t.automations.create(n)),update:(n)=>T(()=>t.automations.update(n)),enable:(n)=>T(()=>t.automations.enable({automationId:n})),disable:(n)=>T(()=>t.automations.disable({automationId:n})),runs:{list:(n,r={})=>T(()=>t.automations.runs.list({automationId:n,...r})),get:(n,r)=>T(()=>t.automations.runs.get({automationId:n,runId:r})),logs:(n,r)=>T(()=>t.automations.runs.logs({automationId:n,runId:r}))}},logs:{tail:(n)=>T(()=>t.logs.tail(n)),forward:(n)=>T(()=>t.logs.forward(n)),query:(n={})=>T(()=>t.logs.query(n)),schema:(n={})=>T(()=>t.logs.schema(n)),volume:(n)=>T(()=>t.logs.volume(n)),patterns:(n={})=>T(()=>t.logs.patterns(n)),nativeQuery:(n)=>T(()=>t.logs.nativeQuery(n))},organizations:{list:()=>T(()=>t.organizations.list()),get:(n)=>T(()=>t.organizations.get({organizationId:n})),create:(n)=>T(()=>t.organizations.create({name:n})),rename:(n,r)=>T(()=>t.organizations.update({organizationId:r,name:n}))},members:{list:(n={})=>T(()=>t.members.list(n)),updateRole:(n,r,o)=>T(()=>t.members.updateRole({organizationId:o,member:n,role:r})),remove:(n,r)=>T(()=>t.members.remove({organizationId:r,member:n})),invite:(n)=>T(()=>t.members.invite({organizationId:n.organizationId,email:n.email,role:n.role})),listInvitations:(n)=>T(()=>t.members.listInvitations({organizationId:n})),revokeInvitation:(n)=>T(()=>t.members.revokeInvitation({organizationId:n.organizationId,invitationId:n.invitationId}))},teams:{list:(n={})=>T(()=>t.teams.list(n)),create:(n,r,o)=>T(()=>t.teams.create({organizationId:o,name:n,...r!==void 0?{description:r}:{}})),update:(n,r,o)=>T(()=>t.teams.update({organizationId:o,teamId:n,...r.name!==void 0?{name:r.name}:{},...r.description!==void 0?{description:r.description}:{}})),delete:(n,r)=>T(()=>t.teams.delete({organizationId:r,teamId:n})),addMember:(n,r,o)=>T(()=>t.teams.addMember({organizationId:o,teamId:n,userId:r})),removeMember:(n,r,o)=>T(()=>t.teams.removeMember({organizationId:o,teamId:n,userId:r})),listMembers:(n,r)=>T(()=>t.teams.listMembers({organizationId:r,teamId:n}))},projects:{list:(n={})=>T(()=>t.projects.list(n)),get:(n)=>T(()=>t.projects.get({projectId:n})),create:(n)=>T(()=>t.projects.create(n))},threads:{list:(n={})=>T(()=>t.threads.list(n)),get:(n)=>T(()=>t.threads.get({threadId:n})),create:(n)=>T(()=>t.threads.create(n)),getStatus:(n)=>T(()=>t.threads.getStatus({threadId:n})),update:(n,r)=>T(()=>t.threads.update({threadId:n,status:r})),fork:(n,r)=>T(()=>t.threads.fork({threadId:n,messageId:r})),setVisibility:(n,r)=>T(()=>t.threads.setVisibility({threadId:n,visibility:r})),createShareLink:(n)=>T(()=>t.threads.createShareLink({threadId:n})),listShareLinks:(n)=>T(()=>t.threads.listShareLinks({threadId:n})),revokeShareLink:(n,r)=>T(()=>t.threads.revokeShareLink({threadId:n,shareId:r})),stop:(n)=>T(()=>t.threads.stop({threadId:n})),stream:(n)=>T(()=>t.threads.stream(n))},messages:{list:(n,r={})=>T(()=>t.messages.list({threadId:n,...r})),append:(n,r,o,i,s,c)=>T(()=>t.messages.append({threadId:n,message:r,wait:o,timeoutSeconds:i,...s!==void 0?{automationId:s}:{},...c?{ambientServiceRun:c}:{}}))},runs:{get:(n)=>T(()=>t.runs.get({runId:n})),cancel:(n)=>T(()=>t.runs.cancel({runId:n})),stream:(n)=>T(()=>t.runs.stream(n))},search:{threads:(n)=>T(()=>t.search.threads(n)),messages:(n)=>T(()=>t.search.messages(n))},publicKeys:{list:(n)=>T(()=>t.publicKeys.list(n)),get:(n,r)=>T(()=>t.publicKeys.get(r?{keyId:n,projectId:r}:{keyId:n})),ensureLogForwarding:(n)=>T(()=>t.publicKeys.ensureLogForwarding(n)),update:(n)=>T(()=>t.publicKeys.update(n)),deactivate:(n)=>T(()=>t.publicKeys.deactivate(n))},secretKeys:{list:(n)=>T(()=>t.secretKeys.list(n)),get:(n)=>T(()=>t.secretKeys.get({keyId:n})),create:(n)=>T(()=>t.secretKeys.create(n)),update:(n)=>T(()=>t.secretKeys.update(n)),delete:(n)=>T(()=>t.secretKeys.delete(n))},issues:{count:(n={})=>T(()=>t.issues.count(n)),create:(n)=>T(()=>t.issues.create(n)),list:(n={})=>T(()=>t.issues.list(n)),search:(n={})=>T(()=>t.issues.search(n)),get:(n)=>T(()=>t.issues.get({issueId:n})),resolve:(n)=>T(()=>t.issues.resolve({issueId:n})),ignore:(n)=>T(()=>t.issues.ignore({issueId:n})),reopen:(n)=>T(()=>t.issues.reopen({issueId:n})),mute:(n)=>T(()=>t.issues.mute({issueId:n})),unmute:(n)=>T(()=>t.issues.unmute({issueId:n}))},pullRequests:{list:(n={})=>T(()=>t.pullRequests.list(n))},workItems:{create:(n)=>T(()=>t.workItems.create(n)),comment:(n)=>T(()=>t.workItems.comment(n)),transition:(n)=>T(()=>t.workItems.transition(n))},components:{list:(n={})=>T(()=>t.components.list(n)),get:(n)=>T(()=>t.components.get({componentId:n})),register:(n)=>T(()=>t.components.register(n)),deregister:(n,r)=>T(()=>t.components.deregister({componentId:n,...r!==void 0?{reason:r}:{}})),rename:(n)=>T(()=>t.components.rename(n)),retirementPreview:(n)=>T(()=>t.components.retirementPreview(n)),retire:(n)=>T(()=>t.components.retire(n)),restorationPreview:(n)=>T(()=>t.components.restorationPreview(n)),restore:(n)=>T(()=>t.components.restore(n)),mergePreview:(n)=>T(()=>t.components.mergePreview(n)),merge:(n)=>T(()=>t.components.merge(n)),relationships:{list:(n={})=>T(()=>t.components.relationships.list(n)),preview:(n)=>T(()=>t.components.relationships.preview(n)),add:(n)=>T(()=>t.components.relationships.add(n)),remove:(n)=>T(()=>t.components.relationships.remove(n))},incidents:{list:(n={})=>T(()=>t.components.incidents.list(n))},timeline:(n)=>T(()=>t.components.timeline(n))},billing:{getSummary:(n={})=>T(()=>t.billing.getSummary(n)),getUsage:(n={})=>T(()=>t.billing.getUsage(n)),listTransactions:(n={})=>T(()=>t.billing.listTransactions(n)),previewSubscriptionCancellation:()=>T(()=>t.billing.previewSubscriptionCancellation()),scheduleSubscriptionCancellation:()=>T(()=>t.billing.scheduleSubscriptionCancellation()),resumeSubscriptionCancellation:()=>T(()=>t.billing.resumeSubscriptionCancellation()),getAutoTopUp:(n={})=>T(()=>t.billing.getAutoTopUp(n)),updateAutoTopUp:(n)=>T(()=>t.billing.updateAutoTopUp(n)),purchaseCredits:(n)=>T(()=>t.billing.purchaseCredits(n)),listPlans:(n={})=>T(()=>t.billing.listPlans(n)),previewPlanChange:(n)=>T(()=>t.billing.previewPlanChange(n)),changePlan:(n)=>T(()=>t.billing.changePlan(n)),createCheckoutSession:(n)=>T(()=>t.billing.createCheckoutSession(n)),getCheckoutSessionStatus:(n)=>T(()=>t.billing.getCheckoutSessionStatus(n)),createPortalSession:(n={})=>T(()=>t.billing.createPortalSession(n)),getPaymentMethod:(n={})=>T(()=>t.billing.getPaymentMethod(n))},tasks:{list:(n={})=>T(()=>t.tasks.list(n))},recommendations:{list:(n={})=>T(()=>t.recommendations.list(n))},repos:{list:(n={})=>T(()=>t.repos.list(n)),add:(n)=>T(()=>t.repos.add(n)),remove:(n)=>T(()=>t.repos.remove(n))},onboarding:{getState:(n={})=>T(()=>t.onboarding.getState(n)),skipSampleIssue:(n)=>T(()=>t.onboarding.skipSampleIssue(n)),finish:(n)=>T(()=>t.onboarding.finish(n))},notificationDeliveryRules:{list:()=>T(()=>t.notificationDeliveryRules.list()),options:()=>T(()=>t.notificationDeliveryRules.options()),create:(n)=>T(()=>t.notificationDeliveryRules.create(n)),update:(n)=>T(()=>t.notificationDeliveryRules.update(n)),delete:(n)=>T(()=>t.notificationDeliveryRules.delete({ruleId:n}))},notificationChannels:{getProject:()=>T(()=>t.notificationChannels.getProject())},logSources:{listProviders:()=>T(()=>t.logSources.listProviders()),list:(n)=>T(()=>t.logSources.list(n)),get:(n)=>T(()=>t.logSources.get({logSourceId:n})),create:(n)=>T(()=>t.logSources.create(n)),update:(n)=>T(()=>t.logSources.update(n)),delete:(n)=>T(()=>t.logSources.delete({logSourceId:n}))},logStreams:{list:(n)=>T(()=>t.logStreams.list({logSourceId:n})),get:(n)=>T(()=>t.logStreams.get({streamId:n})),create:(n)=>T(()=>t.logStreams.create(n)),update:(n)=>T(()=>t.logStreams.update(n)),delete:(n)=>T(()=>t.logStreams.delete({streamId:n})),reassign:(n)=>T(()=>t.logStreams.reassign(n))},integrations:{listProviders:()=>T(()=>t.integrations.listProviders()),listConnections:(n)=>T(()=>t.integrations.listConnections(n)),getConnection:(n)=>T(()=>t.integrations.getConnection({connectionId:n})),createConnection:(n)=>T(()=>t.integrations.createConnection(n)),beginConnect:(n)=>T(()=>t.integrations.beginConnect(n)),getConnectAttempt:(n)=>T(()=>t.integrations.getConnectAttempt({attemptId:n})),disconnectConnection:(n)=>T(()=>t.integrations.disconnectConnection({connectionId:n})),updateConnectionCredentials:(n)=>T(()=>t.integrations.updateConnectionCredentials(n))},connectedAccounts:{beginConnect:(n)=>T(()=>t.connectedAccounts.beginConnect(n)),getConnectAttempt:(n)=>T(()=>t.connectedAccounts.getConnectAttempt({attemptId:n})),list:()=>T(()=>t.connectedAccounts.list({})),disconnect:(n)=>T(()=>t.connectedAccounts.disconnect(n))},mcpConnectors:{list:(n)=>T(()=>t.mcpConnectors.list(n)),get:(n)=>T(()=>t.mcpConnectors.get(n)),details:(n)=>T(()=>t.mcpConnectors.details(n)),listProviders:()=>T(()=>t.mcpConnectors.listProviders()),beginOAuthInstall:(n)=>T(()=>t.mcpConnectors.beginOAuthInstall(n)),getOAuthInstallAttempt:(n)=>T(()=>t.mcpConnectors.getOAuthInstallAttempt(n)),disconnect:(n)=>T(()=>t.mcpConnectors.disconnect(n)),update:(n)=>T(()=>t.mcpConnectors.update(n))},sandboxPresets:{delete:(n)=>T(()=>t.sandboxPresets.delete(n)),listConnections:(n)=>T(()=>t.sandboxPresets.listConnections(n)),listTypes:()=>T(()=>t.sandboxPresets.listTypes()),test:(n)=>T(()=>t.sandboxPresets.test(n)),upsert:(n)=>T(()=>t.sandboxPresets.upsert(n))},memory:{list:(n={})=>T(()=>t.memory.list(n)),get:(n)=>T(()=>t.memory.get(n)),search:(n)=>T(()=>t.memory.search(n)),put:(n)=>T(()=>t.memory.put({kind:"note",...n})),delete:(n)=>T(()=>t.memory.delete(n))},signalDefinitions:{list:(n={})=>T(()=>t.signalDefinitions.list(n)),get:(n)=>T(()=>t.signalDefinitions.get({signalDefinitionId:n})),create:(n)=>T(()=>t.signalDefinitions.create(n)),update:(n,r={})=>T(()=>t.signalDefinitions.update({signalDefinitionId:n,...r})),disable:(n)=>T(()=>t.signalDefinitions.disable({signalDefinitionId:n}))},scripts:{list:(n={})=>T(()=>t.scripts.list(n)),get:(n)=>T(()=>t.scripts.get({name:n})),create:(n)=>T(()=>t.scripts.create(n)),update:(n,r={})=>T(()=>t.scripts.update({name:n,...r})),delete:(n)=>T(()=>t.scripts.delete({name:n}))}}};var vm=h(()=>{cM();ce();lM=new Map});var Hme;var qme=h(()=>{Hme={version:2,activeProfile:"default",profiles:{default:{}}}});import*as gi from"node:fs";import*as Vme from"node:os";import*as pM from"node:path";var Sn=(e)=>{if(e===void 0||e===null)return;if(typeof e==="string")return e.length>0?e:void 0;return},ZXe=(e)=>{if(typeof e!=="object"||e===null||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e)){if(!Array.isArray(r))continue;let o=r.filter((i)=>typeof i==="string"&&i.length>0);if(o.length>0)t[n]=o}return Object.keys(t).length>0?t:void 0},uM,$u,XXe=()=>{if(!gi.existsSync(uM))gi.mkdirSync(uM,{recursive:!0,mode:448})},dM,Kme=(e)=>{dM=e},Yme=(e)=>({token:Sn(e.token),activeOrganizationId:Sn(e.activeOrganizationId??e.organizationId),organizationName:Sn(e.organizationName),activeProjectId:Sn(e.activeProjectId??e.defaultProjectId),apiBaseUrl:Sn(e.apiBaseUrl),authBaseUrl:Sn(e.authBaseUrl),webBaseUrl:Sn(e.webBaseUrl),intakeBaseUrl:Sn(e.intakeBaseUrl),tailBaseUrl:Sn(e.tailBaseUrl),apiDomain:Sn(e.apiDomain),webDomain:Sn(e.webDomain),intakeDomain:Sn(e.intakeDomain),tailDomain:Sn(e.tailDomain),forwardPublicKey:Sn(e.forwardPublicKey),forwardPublicKeyProjectId:Sn(e.forwardPublicKeyProjectId),skippedOnboardingSteps:ZXe(e.skippedOnboardingSteps)}),e8e=(e)=>({version:2,activeProfile:"default",profiles:{default:Yme(e)}}),t8e=(e)=>{let t=Sn(e.activeProfile)??"default",n=typeof e.profiles==="object"&&e.profiles!==null?e.profiles:{},r={};for(let[o,i]of Object.entries(n)){if(typeof i!=="object"||i===null)continue;r[o]=Yme(i)}if(!r[t])r[t]={};return{version:2,activeProfile:t,profiles:r}},Ye=()=>{try{if(!gi.existsSync($u))return Ct(Hme);let e=gi.readFileSync($u,"utf-8"),t=JSON.parse(e),n=typeof t.version==="number"?t.version:void 0;if(n!==void 0&&n>2)return ft("Settings file requires a newer CLI version. Upgrade with 'npm install -g @sazabi/cli@latest'.");if(n===2)return Ct(t8e(t));let r=e8e(t),o=yt(r);if(!o.success)return o;return Ct(r)}catch(e){let t=e instanceof Error?e.message:String(e);return ft(t)}},yt=(e)=>{try{return XXe(),gi.writeFileSync($u,JSON.stringify(e,null,2),{encoding:"utf-8",mode:384}),Ct(void 0)}catch(t){let n=t instanceof Error?t.message:String(t);return ft(n)}},Mo=(e,t)=>{if(t)return t;if(dM)return dM;let n=process.env.SAZABI_PROFILE?.trim();if(n)return n;return e.activeProfile??"default"},Yt=(e,t)=>{let n=Mo(e,t),r=e.profiles[n];if(r)return Ct(r);if(n==="default")return Ct({});return ft(`Profile '${n}' does not exist. Run 'sazabi profiles create ${n}' first.`)},sr=()=>{let e=Ye();if(!e.success)return e;return Yt(e.value)},Wt=(e,t,n)=>{let r=Mo(e,n);if(!e.profiles[r])return ft(`Profile '${r}' does not exist. Run 'sazabi profiles create ${r}' first.`);return Ct({...e,profiles:{...e.profiles,[r]:{...e.profiles[r],...t}}})},Wme=(e,t)=>e?.skippedOnboardingSteps?.[t]??[],Jme=(e,t,n,r)=>{let o=Yt(e,r);if(!o.success)return o;let i={...o.value.skippedOnboardingSteps},s=i[t]??[];if(!s.includes(n))i[t]=[...s,n];return Wt(e,{skippedOnboardingSteps:i},r)},Zme=(e,t,n)=>{let r=Yt(e,n);if(!r.success)return r;let{[t]:o,...i}=r.value.skippedOnboardingSteps??{};return Wt(e,{skippedOnboardingSteps:Object.keys(i).length>0?i:void 0},n)},zo=(e)=>{if(!e?.forwardPublicKey&&!e?.forwardPublicKeyProjectId)return{};return{forwardPublicKey:void 0,forwardPublicKeyProjectId:void 0}};var Cn=h(()=>{qme();ce();uM=pM.join(Vme.homedir(),".sazabi"),$u=pM.join(uM,"settings.json")});var Lr=(e)=>{let{cliFlag:t,globalUrl:n,globalDomain:r,buildUrlFromDomain:o,defaultUrl:i}=e;if(t)return t;let s=process.env.SAZABI_API_URL?.trim();if(s)return s;if(n)return n;if(r)return o(r);return i},Q=(e)=>{let{tokenFlag:t,organizationIdFlag:n,projectIdFlag:r,jsonMode:o}=e,i=t?.trim(),s=process.env.SAZABI_TOKEN?.trim(),c=process.env.SAZABI_ORGANIZATION_ID?.trim(),l=process.env.SAZABI_PROJECT_ID?.trim(),u=I(sr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",o),d=u.token?.trim(),p=(i&&i.length>0?i:void 0)||(s&&s.length>0?s:void 0)||d,g=i&&i.length>0?"flag":s&&s.length>0?"environment":"settings";if(!p||p.length===0){if(o)return b("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return y("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let m,A;if(n)m=n,A="flag";else if(c&&c.length>0)m=c,A="environment";else if(u.activeOrganizationId)m=u.activeOrganizationId,A="settings";let f,S;if(r)f=r,S="flag";else if(l&&l.length>0)f=l,S="environment";else if(u.activeProjectId)f=u.activeProjectId,S="settings";return{token:p,type:"token",projectId:f,organizationId:m,tokenSource:g,organizationSource:A,projectSource:S}},Em=(e)=>{let t=I(sr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e?.jsonMode);return Lr({cliFlag:e?.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(n)=>`https://api.${n}`,defaultUrl:"https://api.sazabi.com"})},N=(e)=>{let t=e.apiBaseUrl??Em({apiBaseUrlFlag:e.apiBaseUrlFlag,jsonMode:e.jsonMode});return pi({token:e.token,baseUrl:t,organizationId:e.organizationId,projectId:e.projectId,sandboxActorDescriptor:process.env.SAZABI_SANDBOX_ACTOR})},Xme,gM,SS=async(e)=>{let t=I(sr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e.jsonMode),n=Lr({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(l)=>`https://api.${l}`,defaultUrl:"https://api.sazabi.com"}),r=`${e.token}@${n}@${e.projectId??""}`,o=Xme.get(r);if(o)return o;let i=gM.get(r);if(i)return i;if(!e.projectId){if(e.jsonMode)return b("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.");return y("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let s=e.projectId,c=(async()=>{let u=await pi({token:e.token,baseUrl:n,projectId:s}).projects.get(s),p=I(u,"Couldn't fetch project info (run 'sazabi projects list' to verify the project ID)",e.jsonMode).project;return Xme.set(r,p),p})();gM.set(r,c);try{return await c}finally{gM.delete(r)}},IS=(e)=>{let t=e.trim().toLowerCase(),n=/^[a-z][a-z0-9+.-]*:\/\//.test(t)?t:`https://${t}`,r=t;try{r=new URL(n).hostname.toLowerCase()}catch{r=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,"").replace(/[/?#].*$/,"").replace(/:\d+$/,"")}return`https://app.${r.replace(/^(?:app\.)+/,"")}`},n8e=(e)=>{try{let t=new URL(e),n=t.hostname.toLowerCase();if(!n.startsWith("api."))return null;return`${t.protocol}//app.${n.slice(4)}`}catch{return null}},Nr=(e)=>{let t=(r)=>r.replace(/\/+$/,"");if(e)return t(e);let n=I(sr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)");if(n.webBaseUrl)return t(n.webBaseUrl);if(n.webDomain)return IS(n.webDomain);if(n.apiDomain)return IS(n.apiDomain);if(n.apiBaseUrl){let r=n8e(n.apiBaseUrl);if(r)return r}return"https://app.sazabi.com"},Xn=(e,t)=>{if(e&&e.length>0)return e;let n="No project selected. Pass --project-id, set SAZABI_PROJECT_ID, or run 'sazabi projects use <project-id>'.";if(t)return b(n);return y(n)},vs=(e,t)=>`${Nr(t)}/projects/${e}`,zt=(e,t,n,r)=>{let o=`${Nr(n)}/projects/${e}/threads/${t}`;return r?`${o}?messageId=${encodeURIComponent(r)}`:o},ehe=(e,t,n,r)=>zt(e,t,n,r),the=(e,t,n)=>`${vs(e,n)}/issues/${t}`,nhe=(e,t,n)=>`${vs(e,n)}/automations/${t}`,ohe=(e,t)=>`${vs(e,t)}/status`,rhe=(e,t,n)=>`${vs(e,n)}/settings/log-source-providers/${t}`,ihe=(e,t,n)=>`${vs(e,n)}/settings/mcp-connectors/${t}`,CS=(e,t,n)=>`${vs(e,n)}/settings/sandbox/catalog/${t}`,she=(e,t)=>`https://otlp.${t}.intake.${e}`;var ye=h(()=>{re();vm();ce();Cn();Xme=new Map,gM=new Map});var XS,fbe=(e)=>{XS.set(e.name,e)},eC=(e)=>XS.get(e),Wm=()=>Array.from(XS.values()),ybe=(e)=>XS.has(e);var wz=h(()=>{XS=new Map});async function Tz(e){let t=await e.publicKeys.list({limit:20});if(!t.success)return[];return t.value.publicKeys.map((n)=>({value:n.id,description:n.name}))}async function Bz(e){let t=await e.secretKeys.list({limit:20});if(!t.success)return[];return t.value.secretKeys.map((n)=>({value:n.id,description:n.name}))}async function Zm(e){let t=await e.logSources.list();if(!t.success)return[];return t.value.logSources.map((n)=>({value:n.id,description:n.name??n.provider}))}async function Ibe(e){let t=await e.members.list();if(!t.success)return[];return t.value.members.map((n)=>({value:n.userId,description:n.name??n.email}))}var aat=3000,cat,Sbe=async(e,t,n)=>{try{let r=cat[e]?.[t];if(!r)return[];let o=sr();if(!o.success)return[];let i=o.value,s=process.env.SAZABI_TOKEN?.trim()||i.token?.trim();if(!s)return[];let c=Lr({globalUrl:i.apiBaseUrl,globalDomain:i.apiDomain,buildUrlFromDomain:(d)=>`https://api.${d}`,defaultUrl:"https://api.sazabi.com"}),l=pi({token:s,baseUrl:c,organizationId:i.activeOrganizationId,projectId:i.activeProjectId});return(await Promise.race([r(l),new Promise((d)=>setTimeout(()=>d([]),aat))])).filter((d)=>d.value.startsWith(n))}catch{return[]}};var Cbe=h(()=>{vm();ye();Cn();cat={threads:{get:async(e)=>{let t=await e.threads.list({limit:20});if(!t.success)return[];return t.value.threads.map((n)=>({value:n.id,description:n.title??void 0}))}},projects:{use:async(e)=>{let t=await e.projects.list();if(!t.success)return[];return t.value.projects.map((n)=>({value:n.id,description:n.name}))}},organizations:{use:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((n)=>({value:n.id,description:n.name}))},rename:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((n)=>({value:n.id,description:n.name}))}},"public-keys":{get:Tz,update:Tz,deactivate:Tz},"secret-keys":{get:Bz,update:Bz,delete:Bz},"log-sources":{get:Zm,enable:Zm,disable:Zm,delete:Zm,remove:Zm},members:{"update-role":Ibe,remove:Ibe}}});var Ebe={};cr(Ebe,{getCompletions:()=>pat,parseCompletionContext:()=>dat});var lat,uat,dat=(e)=>{let t=e.length>0?e:[""],n=t.length-1,r=t[n]??"";return{words:t,currentIndex:n,partial:r}},pat=async(e)=>{let{words:t,currentIndex:n,partial:r}=e,o=t[n-1];if(o==="--profile")return Aat(r);let i=hat(t),s=Math.max(0,i.length-(t.length-n));if(s===0)return gat(r);let c=i[0]??"",l=eC(c);if(!l)return[];if(s===1&&l.subcommands){if(r.startsWith("-"))return vbe(l.options,i);return mat(l,r)}let u=l.subcommands?i[1]:void 0,p=(u?l.subcommands?.[u]:void 0)?.options??l.options;if(r.startsWith("-"))return vbe(p,i);if(o?.startsWith("--")){let g=o.slice(2);if(p?.[g]?.type==="string"){let A=`${c}:${u??""}`,f=uat[A]?.[g]??lat[g];if(f)return f.filter((S)=>S.startsWith(r)).map((S)=>({value:S}));return[]}}return Sbe(c,u??"",r)},gat=(e)=>{let n=Wm().filter((o)=>o.name.startsWith(e)).map((o)=>({value:o.name,description:o.description})),r=[{value:"--help",description:"Show help"},{value:"--version",description:"Show version"},{value:"--profile",description:"Use a named profile"}];for(let o of r)if(o.value.startsWith(e))n.push(o);return n},mat=(e,t)=>{if(!e.subcommands)return[];return Object.values(e.subcommands).filter((n)=>n.name.startsWith(t)).map((n)=>({value:n.name,description:n.description}))},vbe=(e,t)=>{let n=t[t.length-1]??"",r=new Set(t.filter((i)=>i.startsWith("--")).map((i)=>i.replace(/=.*/,""))),o=[];if(!r.has("--help")&&"--help".startsWith(n))o.push({value:"--help",description:"Show help"});if(!r.has("--profile")&&"--profile".startsWith(n))o.push({value:"--profile",description:"Use a named profile"});if(!e)return o;for(let[i,s]of Object.entries(e)){let c=`--${i}`;if(r.has(c))continue;if(!c.startsWith(n))continue;o.push({value:c,description:s.description})}return o},hat=(e)=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r==="--profile"&&n+1<e.length)n++;else if(r.startsWith("--profile="));else t.push(r)}return t},Aat=(e)=>{try{let t=Ye();if(!t.success)return[];return Object.keys(t.value.profiles).filter((n)=>n.startsWith(e)).map((n)=>({value:n,description:n===t.value.activeProfile?"active":void 0}))}catch{return[]}};var wbe=h(()=>{wz();Cn();Cbe();lat={status:["regular","archived"],format:["json","text"]},uat={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});re();re();re();import{parseArgs as Hz}from"node:util";var w=(e,t,n={})=>{let r=Object.hasOwn(t,"json")&&e.includes("--json"),o=(d,p)=>{if(r)b({code:d,message:p,operationId:null});throw y(p),Error("Unreachable")},i=(()=>{try{return Hz({args:e,options:t,allowPositionals:Boolean(n.allowPositionals),strict:!1,tokens:!0})}catch(d){let p=new Set(Object.keys(t)),g=new Set(Object.values(t).map((A)=>A.short).filter((A)=>Boolean(A)));try{let A=Hz({args:e,options:t,allowPositionals:!0,strict:!1,tokens:!0}),f=[...new Set((A.tokens??[]).flatMap((S)=>S.kind==="option"?[S]:[]).filter((S)=>!p.has(S.name)&&!(S.name.length===1&&g.has(S.name))).map((S)=>S.name.length>1?`--${S.name}`:`-${S.name}`))];if(f.length>0)return o("UNEXPECTED_ARGUMENT",`Unknown option${f.length>1?"s":""}: ${f.join(", ")}. Run the command with -h for usage.`)}catch{}let m=d instanceof Error?d.message:"Invalid arguments.";return o("INVALID_ARGUMENT",`${m.endsWith(".")?m:`${m}.`} Run the command with -h for usage.`)}})(),s=Object.hasOwn(t,"json")&&i.values.json===!0,c=new Set(Object.keys(t)),l=new Set(Object.entries(t).map(([,d])=>d.short).filter((d)=>Boolean(d))),u=[];if(Array.isArray(i.tokens))for(let d of i.tokens){if(d.kind!=="option")continue;let p=d.name,g=p.length>1;if(!(c.has(p)||!g&&l.has(p))){let A=g?`--${p}`:`-${p}`;if(!u.includes(A))u.push(A)}}for(let d of Object.keys(i.values))if(!c.has(d)){let p=d.length>1?`--${d}`:`-${d}`;if(!u.includes(p))u.push(p)}if(u.length>0){let d=`Unknown option${u.length>1?"s":""}: ${u.join(", ")}. Run the command with -h for usage.`;if(s)b({code:"UNEXPECTED_ARGUMENT",message:d,operationId:null});y(d)}for(let[d,p]of Object.entries(t))if(p.type==="string"&&i.values[d]===!0){let g=d.length===1?`-${d}`:`--${d}`,m=`Option ${g} requires a value. Use '${g} <value>'.`;o("INVALID_ARGUMENT",m)}for(let[d,p]of Object.entries(t)){let g=i.values[d];if(p.type==="string"&&typeof g==="string"){if(g.length===0){let A=d.length===1?`-${d}`:`--${d}`;o("INVALID_ARGUMENT",`Option ${A} requires a non-empty value.`)}if(g.startsWith("--")||g.length===2&&g[0]==="-"&&/[a-zA-Z]/.test(g.charAt(1))){let f=`Option ${d.length===1?`-${d}`:`--${d}`} received "${g}" as its value. Did you forget to provide a value?`;o("INVALID_ARGUMENT",f)}}}if(!n.allowPositionals&&i.positionals.length>0)o("UNEXPECTED_ARGUMENT",`Unexpected argument${i.positionals.length>1?"s":""}: ${i.positionals.join(", ")}. Run the command with -h for usage.`);return{values:i.values,positionals:i.positionals}};var ih=(e,t)=>{if(e?.json?.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class qz{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t,n){this.name=e,this.description=t,this.handler=n}withOptions(e){return this.options=e,this}withSubcommands(e){return this.subcommands=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Subcommand "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson&&this.handler)ih(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[e,t]of Object.entries(this.subcommands))if(!t.subcommands)ih(t.options,`Subcommand "${this.name} ${e}"`)}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}class Vz{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t){this.name=e,this.description=t}withHandler(e){return this.handler=e,this}withSubcommands(e){return this.subcommands=e,this}withOptions(e){return this.options=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Command "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson){if(this.handler)ih(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[e,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;ih(t.options,`Subcommand "${this.name} ${e}"`)}}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}var se=(e,t)=>new Vz(e,t),C=(e,t,n)=>new qz(e,t,n);re();var gn=(e,t,n,r,o)=>{let i=Number.parseInt(e,10);if(Number.isNaN(i)||i<t||i>n){let s=`${r} must be between ${t} and ${n}.`;if(o)return b(s);return y(s)}return i},no=(e,t,n,r)=>{if(!t.includes(e)){let o=t.map((s)=>`"${s}"`).join(" or "),i=`${n} must be ${o}.`;if(r)return b(i);return y(i)}return e};re();ye();ce();var hM=(e)=>{let t=[];for(let n of e){let r=0;for(let o of n.content){if(o.type!=="artifact")continue;t.push({id:`${n.id}:${r}`,messageId:n.id,name:o.name,toolCallId:o.toolCallId??null,createdAt:n.createdAt,data:o.data}),r+=1}}return t},che=(e)=>{let t=e.lastIndexOf(":");if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1);if(!/^\d+$/.test(r))return null;return{messageId:n,index:Number.parseInt(r,10)}},lhe=(e,t)=>hM(e).find((n)=>n.id===t),mM=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),ahe=(e)=>{let t=e===null||e===void 0?"":typeof e==="object"?JSON.stringify(e):String(e);if(/[",\n\r]/.test(t))return`"${t.replace(/"/g,'""')}"`;return t},o8e=(e)=>{if(Array.isArray(e)&&e.every(mM))return e;if(mM(e))for(let t of["rows","data","items","points"]){let n=e[t];if(Array.isArray(n)&&n.every(mM))return n}return null},uhe=(e)=>{let t=o8e(e);if(!t||t.length===0)return null;let n=[];for(let o of t)for(let i of Object.keys(o))if(!n.includes(i))n.push(i);if(n.length===0)return null;let r=[n.map(ahe).join(",")];for(let o of t)r.push(n.map((i)=>ahe(o[i])).join(","));return r.join(`
|
|
@@ -8799,7 +8799,7 @@ _sazabi() {
|
|
|
8799
8799
|
complete -F _sazabi sazabi
|
|
8800
8800
|
`.trim();var j7e=async(e)=>{let{values:t}=w(e,{json:{type:"boolean"}}),n=oAe();if(t.json){j({shell:"zsh",script:n});return}console.log(n)},U7e=async(e)=>{let{values:t}=w(e,{json:{type:"boolean"}}),n=rAe();if(t.json){j({shell:"bash",script:n});return}console.log(n)},iAe=se("completions","Shell completion scripts").withSubcommands({zsh:C("zsh","Output zsh completion script",j7e).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions zsh)" # Add to .zshrc']).build(),bash:C("bash","Output bash completion script",U7e).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions bash)" # Add to .bashrc']).build()}).withExamples(['eval "$(sazabi completions zsh)" # Enable zsh completions','eval "$(sazabi completions bash)" # Enable bash completions']).build();re();ye();ce();re();ye();import*as yi from"node:fs";import*as eo from"node:path";var F7e=["services","apps","packages"],$7e=["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"],sAe=(e)=>{try{let t=JSON.parse(yi.readFileSync(e,"utf8"));return typeof t==="object"&&t!==null&&!Array.isArray(t)?t:void 0}catch{return}},kM=(e)=>{let n=sAe(eo.join(e,"package.json"))?.name;return typeof n==="string"&&n.trim().length>0?n.trim():void 0},G7e=(e)=>{try{return yi.statSync(e).isDirectory()}catch{return!1}},PS=(e)=>{try{return yi.statSync(e).isFile()}catch{return!1}},aAe=(e)=>{try{return yi.readdirSync(e,{withFileTypes:!0}).filter((t)=>t.isDirectory()&&!t.name.startsWith(".")).map((t)=>t.name).sort()}catch{return[]}},H7e=(e,t)=>{let n=t.trim().replace(/\/+$/,"");if(n.length===0||n.startsWith("!"))return[];if(n.endsWith("/*")){let r=n.slice(0,-2);if(r.includes("*"))return[];return aAe(eo.join(e,r)).map((o)=>eo.join(r,o))}if(n.includes("*"))return[];return G7e(eo.join(e,n))?[n]:[]},q7e=(e)=>{let t=e?.workspaces;if(Array.isArray(t))return t.filter((n)=>typeof n==="string");if(typeof t==="object"&&t!==null){let n=t.packages;if(Array.isArray(n))return n.filter((r)=>typeof r==="string")}return[]},V7e=(e)=>{let t=eo.join(e,"pnpm-workspace.yaml");if(!PS(t))return[];let n;try{n=yi.readFileSync(t,"utf8")}catch{return[]}let r=[],o=!1;for(let i of n.split(`
|
|
8801
8801
|
`)){if(/^packages\s*:/.test(i)){o=!0;continue}if(o){let s=i.match(/^\s+-\s+["']?([^"'#\n]+?)["']?\s*$/);if(s?.[1]){r.push(s[1]);continue}if(/^\S/.test(i))o=!1}}return r},K7e=(e,t)=>{let n=[];for(let r of t)for(let o of H7e(e,r)){let i=kM(eo.join(e,o));if(!i)continue;n.push({name:i,description:"workspace package",dir:o})}return n},Y7e=(e)=>{let t=[];for(let n of F7e)for(let r of aAe(eo.join(e,n))){let o=eo.join(n,r),i=eo.join(e,o);if(!(PS(eo.join(i,"package.json"))||PS(eo.join(i,"Dockerfile"))))continue;t.push({name:kM(i)??r,description:"service directory",dir:o})}return t},W7e=(e)=>{let t=$7e.map((s)=>eo.join(e,s)).find(PS);if(!t)return[];let n;try{n=yi.readFileSync(t,"utf8")}catch{return[]}let r=[],o=!1,i;for(let s of n.split(`
|
|
8802
|
-
`)){if(/^services\s*:\s*(#.*)?$/.test(s)){o=!0,i=void 0;continue}if(!o)continue;if(/^\S/.test(s)){o=!1;continue}let c=s.match(/^(\s+)([A-Za-z0-9_.-]+)\s*:\s*(#.*)?$/);if(!c)continue;let l=c[1].length;if(i??=l,l!==i)continue;r.push({name:c[2],description:"docker compose service",dir:"."})}return r},xM=(e)=>{let t=sAe(eo.join(e,"package.json")),n=[...q7e(t),...V7e(e)],r=[...K7e(e,n),...Y7e(e),...W7e(e)],o=n.length===0?kM(e):void 0;if(o)r.push({name:o,description:"root package",dir:"."});let i=new Set;return r.filter((s)=>{if(i.has(s.name))return!1;return i.add(s.name),!0})};ce();var J7e={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}}},Z7e={schema:J7e,columns:["id","name","origin","lifecycle"],header:"Registered components",emptyMessage:"No components registered."},PM=async(e)=>{let{client:t,json:n}=e,r=e.rootDir??process.cwd(),o=xM(r);if(o.length===0)return $r("No component candidates detected. Register one with 'sazabi components register --name <name>'."),[];let i=await xm({message:"Select the components to register",choices:o.map((c)=>({label:c.name,value:c,hint:`${c.description}, ${c.dir}`,preselected:!0}))});if(i.length===0)return H("Nothing selected. No components registered."),[];let s=[];for(let c of i){let l=I(await t.components.register({name:c.name,description:c.description}),`Failed to register component ${c.name}`,n);z(`Component ${l.component.name} registered.`),s.push({id:l.component.id,name:l.component.name,origin:l.component.origin,lifecycle:l.component.lifecycle})}return K(Z7e,s,{json:n}),s},X7e=async(e)=>{let{values:t}=w(e,{...L,dir:{type:"string"}}),n=t.json,r=t.dir??process.cwd();if(n||!fi()){j({candidates:xM(r)});return}let o=Q({jsonMode:n}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t["api-base-url"],jsonMode:n});await PM({client:i,rootDir:r,json:n})},cAe=C("scan","Detect component candidates in the working tree (propose-only)",X7e).withOptions({...D,dir:{type:"string",description:"Directory to scan (default: current directory)"}}).withExamples(["sazabi components scan # Detect candidates and confirm which to register","sazabi components scan --json # Print candidates only, register nothing"]).build();var uAe={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},description:{label:"Description",type:{kind:"nullable-string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}},observationState:{label:"Observation",type:{kind:"string"}},registryRevision:{label:"Revision",type:{kind:"number"}},canonicalComponentId:{label:"Canonical component",type:{kind:"id"}},mergedIntoComponentId:{label:"Merged into",type:{kind:"nullable-string"}},firstSeenAt:{label:"Created at",type:{kind:"date"}},lastSeenAt:{label:"Last seen",type:{kind:"date"}},deletedAt:{label:"Deleted at",type:{kind:"nullable-date"}},retiredAt:{label:"Retired at",type:{kind:"nullable-date"}},retirementReason:{label:"Retirement reason",type:{kind:"nullable-string"}},legacyStateUnknown:{label:"Legacy inactive",type:{kind:"boolean"}}},eet={schema:uAe,columns:["id","name","lifecycle","observationState","currentStatus"],jsonFields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","retiredAt","retirementReason","legacyStateUnknown"],emptyMessage:"No components found. Register one with 'sazabi components register --name <name>'."},TM={layout:"field-list",schema:uAe,fields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","retiredAt","retirementReason","legacyStateUnknown"],title:"Component"},tet={status:{label:"Status",type:{kind:"string"}},componentId:{label:"Component ID",type:{kind:"id"}},sourceType:{label:"Source type",type:{kind:"string"}},withdrawn:{label:"Withdrawn",type:{kind:"boolean"}}},net={layout:"field-list",schema:tet,fields:["status","componentId","sourceType","withdrawn"],title:"Component observation"},oet=(e)=>{let t=e,n=Object.values(t.counts).reduce((r,o)=>r+o,0);return`${t.canonicalComponentName} (${t.canonicalComponentId}); ${t.affectedComponentIds.length} component(s), ${n} dependent(s); no changes applied`},ret={status:{label:"Status",type:{kind:"string"}},preview:{label:"Retirement preview",type:{kind:"custom",render:oet,serialize:(e)=>e}}},iet={layout:"field-list",schema:ret,fields:["status","preview"],title:"Retirement confirmation required"},Rm=(e,t,n)=>{if(e===void 0)return;try{let r=JSON.parse(e);if(!r||typeof r!=="object"||Array.isArray(r))throw Error("must be a JSON object");return r}catch(r){let o=`${t} must be valid JSON: ${r instanceof Error?r.message:String(r)}`;if(n)return b(o);return y(o)}},RM=(e)=>e?e.split(",").map((t)=>t.trim()).filter(Boolean):[],BM={kind:"custom",render:(e)=>JSON.stringify(e,null,2),serialize:(e)=>e},set={preview:{label:"Preview",type:BM}},aet={layout:"field-list",schema:set,fields:["preview"],title:"Component operation preview"},cet={result:{label:"Result",type:BM}},uet={layout:"field-list",schema:cet,fields:["result"],title:"Component operation result"},BS=(e,t)=>G(aet,e,{json:t}),OS=(e,t)=>G(uet,e,{json:t}),det=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.components.list({limit:e.limit,cursor:e.cursor,includeDeleted:e.includeDeleted}),"Couldn't list components (check the active project and try again)",e.json);K(eet,r.components,{json:e.json,nextCursor:r.nextCursor})},pet=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.components.get(e),"Couldn't get component (run 'sazabi components list' to see component IDs)",t.json);G(TM,o.component,{json:t.json})},get=async(e)=>{let t=e.name?.trim(),n=e.description?.trim(),r=e.origin?.trim();if(!t){if(e.json)return b("Name is required.");return y("Name is required.")}if(e.description!==void 0&&!n){if(e.json)return b("Description cannot be empty.");return y("Description cannot be empty.")}if(r!==void 0&&r!=="code_detected"&&r!=="log_observed"){if(e.json)return b("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).");return y("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).")}let o=Q({tokenFlag:e.token,jsonMode:e.json}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),s=I(await i.components.register({name:t,...n?{description:n}:{},...r?{origin:r}:{}}),"Failed to register component",e.json);G(TM,s.component,{json:e.json})},met=async(e,t)=>{let n=t.reason?.trim();if(t.reason!==void 0&&!n){if(t.json)return b("Reason cannot be empty.");return y("Reason cannot be empty.")}let r=Q({tokenFlag:t.token,jsonMode:t.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:r.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=I(await o.components.deregister(e,n),"Failed to deregister component",t.json);if(i.status==="observation_withdrawn"){G(net,i,{json:t.json});return}G(iet,i,{json:t.json})},qu=(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json});return N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json})},het=async(e,t)=>{let n=t.name?.trim(),r=t.reason?.trim();if(!n){if(t.json)return b("Name is required.");return y("Name is required.")}if(!t.requestId){if(t.json)return b("Request ID is required.");return y("Request ID is required.")}if(!r){if(t.json)return b("Reason is required.");return y("Reason is required.")}let o=qu(t),i=I(await o.components.rename({componentId:e,name:n,requestId:t.requestId,reason:r}),"Failed to rename component",t.json);G(TM,i.component,{json:t.json})},Aet=async(e,t)=>{let n=qu(t),r=Rm(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let s=I(await n.components.retirementPreview({componentId:e}),"Failed to preview component retirement",t.json);BS(s,t.json);return}let o=t.reason?.trim();if(!t.requestId||!o){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let i=I(await n.components.retire({componentId:e,requestId:t.requestId,reason:o,componentRevisions:r,confirmCanonicalGroup:t.confirmCanonicalGroup??!1}),"Failed to retire component; refresh the preview if it changed",t.json);OS(i,t.json)},fet=async(e,t)=>{let n=qu(t),r=Rm(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let s=I(await n.components.restorationPreview({componentId:e,...t.retirementOperationId?{retirementOperationId:t.retirementOperationId}:{}}),"Failed to preview component restoration",t.json);BS(s,t.json);return}let o=t.reason?.trim();if(!t.requestId||!t.retirementOperationId||!o){if(t.json)return b("Commit requires --request-id, --retirement-operation-id, and --reason with --confirm-preview-revision.");return y("Commit requires --request-id, --retirement-operation-id, and --reason with --confirm-preview-revision.")}let i=I(await n.components.restore({componentId:e,retirementOperationId:t.retirementOperationId,requestId:t.requestId,reason:o,componentRevisions:r,selections:{notificationRuleIds:RM(t.notificationRuleIds),automationBindingIds:RM(t.automationBindingIds),recommendationScopeIds:[],relationshipIds:RM(t.relationshipIds)}}),"Failed to restore component; refresh the preview if it changed",t.json);OS(i,t.json)},yet=async(e)=>{if(!e.sourceComponentId||!e.targetComponentId){if(e.json)return b("Source and target component IDs are required.");return y("Source and target component IDs are required.")}let t=qu(e),n={sourceComponentId:e.sourceComponentId,targetComponentId:e.targetComponentId},r=Rm(e.confirmPreviewRevision,"Confirm preview revision",e.json);if(!r){let c=I(await t.components.mergePreview(n),"Failed to preview component consolidation",e.json);BS(c,e.json);return}let o=e.reason?.trim(),i=Rm(e.policyDispositions,"Policy dispositions",e.json);if(!e.requestId||!o||!i){if(e.json)return b("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.");return y("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.")}let s=I(await t.components.merge({...n,requestId:e.requestId,reason:o,componentRevisions:r,policyDispositions:i,confirmPolicyImpact:e.confirmPolicyImpact??!1}),"Failed to consolidate component; refresh the preview if it changed",e.json);OS(s,e.json)},bet=async(e)=>{let t=qu(e),n=I(await t.components.relationships.list({includeHistorical:e.includeHistorical}),"Failed to list component relationships",e.json);G({layout:"field-list",schema:{relationships:{label:"Relationships",type:BM}},fields:["relationships"],title:"Component relationships"},n,{json:e.json})},Iet=async(e,t)=>{if(!t.sourceComponentId||!t.targetComponentId||t.relationshipType!=="part_of"&&t.relationshipType!=="depends_on"){if(t.json)return b("Source, target, and relationship type (part_of or depends_on) are required.");return y("Source, target, and relationship type (part_of or depends_on) are required.")}let n=qu(t),r={action:e,sourceComponentId:t.sourceComponentId,targetComponentId:t.targetComponentId,relationshipType:t.relationshipType},o=Rm(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!o){let l=I(await n.components.relationships.preview(r),"Failed to preview component relationship",t.json);BS(l,t.json);return}let i=t.reason?.trim();if(!t.requestId||!i){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let s={sourceComponentId:r.sourceComponentId,targetComponentId:r.targetComponentId,relationshipType:r.relationshipType,requestId:t.requestId,reason:i,componentRevisions:o,confirmPolicyImpact:t.confirmPolicyImpact??!1},c=I(e==="add"?await n.components.relationships.add(s):await n.components.relationships.remove(s),`Failed to ${e} component relationship; refresh the preview if it changed`,t.json);OS(c,t.json)},RS={...L,"confirm-preview-revision":{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},TS={...D,"confirm-preview-revision":{type:"string",description:"Exact componentRevisions JSON from the preview; omit to preview only"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key required for commit"},reason:{type:"string",description:"Audit reason required for commit"}},lAe=(e)=>C(e,`${e==="add"?"Add":"End"} a component relationship`,async(t)=>{let{values:n}=w(t,{...RS,source:{type:"string"},target:{type:"string"},type:{type:"string"},"confirm-policy-impact":{type:"boolean"}});await Iet(e,{token:n.token,json:n.json,apiBaseUrl:n["api-base-url"],sourceComponentId:n.source,targetComponentId:n.target,relationshipType:n.type,confirmPreviewRevision:n["confirm-preview-revision"],requestId:n["request-id"],reason:n.reason,confirmPolicyImpact:n["confirm-policy-impact"]})}).withOptions({...TS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},type:{type:"string",description:"Relationship type: part_of or depends_on"},"confirm-policy-impact":{type:"boolean",description:"Confirm the policy-scope delta shown by the preview"}}).withExamples([`sazabi components relationships ${e} --source <component-id> --target <component-id> --type part_of # Preview a parent-child topology change`]).build(),Cet=se("relationships","Inspect and edit component topology").withSubcommands({list:C("list","List component relationships",async(e)=>{let{values:t}=w(e,{...L,"include-historical":{type:"boolean"}});await bet({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],includeHistorical:t["include-historical"]})}).withOptions({...D,"include-historical":{type:"boolean",description:"Include historically ended relationships"}}).build(),add:lAe("add"),remove:lAe("remove")}).build(),dAe=se("components","Manage status page components").withSubcommands({list:C("list","List components in the active project",async(e)=>{let{values:t}=w(e,{...L,limit:{type:"string"},cursor:{type:"string"},"include-deleted":{type:"boolean"}});await det({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],limit:t.limit?Number(t.limit):void 0,cursor:t.cursor,includeDeleted:t["include-deleted"]})}).withOptions({...D,limit:{type:"string",description:"Maximum number of components to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},"include-deleted":{type:"boolean",description:"Include deregistered components"}}).withExamples(["sazabi components list # List all components","sazabi components list --include-deleted # Include deregistered components"]).build(),get:C("get","Get one component by ID",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await pet(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<component-id>").withOptions(D).withExamples(["sazabi components get <component-id> # Get one component"]).build(),scan:cAe,register:C("register","Register or refresh a component",async(e)=>{let{values:t}=w(e,{...L,name:{type:"string"},description:{type:"string"},origin:{type:"string"}});await get({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,origin:t.origin})}).withOptions({...D,name:{type:"string",description:"Component name to register"},description:{type:"string",description:"Optional component description"},origin:{type:"string",description:"Machine provenance: 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry, the default)"}}).withExamples(['sazabi components register --name "API Gateway" # Register a component','sazabi components register --name "Checkout" --description "Checkout API and workflow" # Register with description','sazabi components register --name "intake-consumer" --origin code_detected # Register a component inferred from repository analysis']).build(),deregister:C("deregister","Deregister a component",async(e)=>{let{values:t,positionals:n}=w(e,{...L,reason:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await met(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],reason:t.reason})}).withPositionalArgs("<component-id>").withOptions({...D,reason:{type:"string",description:"Optional deregistration reason"}}).withExamples(["sazabi components deregister <component-id> # Deregister a component",'sazabi components deregister <component-id> --reason "service retired" # Deregister with reason']).build(),rename:C("rename","Rename an active component",async(e)=>{let{values:t,positionals:n}=w(e,{...L,name:{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await het(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,requestId:t["request-id"],reason:t.reason})}).withPositionalArgs("<component-id>").withOptions({...D,name:{type:"string",description:"New component name"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key"},reason:{type:"string",description:"Audit reason for the rename"}}).build(),retire:C("retire","Preview or confirm component retirement",async(e)=>{let{values:t,positionals:n}=w(e,{...RS,"confirm-canonical-group":{type:"boolean"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await Aet(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,confirmCanonicalGroup:t["confirm-canonical-group"]})}).withPositionalArgs("<component-id>").withOptions({...TS,"confirm-canonical-group":{type:"boolean",description:"Confirm the complete canonical group"}}).build(),restore:C("restore","Preview or confirm component restoration",async(e)=>{let{values:t,positionals:n}=w(e,{...RS,"retirement-operation-id":{type:"string"},"notification-rule-ids":{type:"string"},"automation-binding-ids":{type:"string"},"relationship-ids":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await fet(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,retirementOperationId:t["retirement-operation-id"],notificationRuleIds:t["notification-rule-ids"],automationBindingIds:t["automation-binding-ids"],relationshipIds:t["relationship-ids"]})}).withPositionalArgs("<component-id>").withOptions({...TS,"retirement-operation-id":{type:"string",description:"Retirement operation ID returned by the preview"},"notification-rule-ids":{type:"string",description:"Comma-separated eligible notification rule IDs"},"automation-binding-ids":{type:"string",description:"Comma-separated eligible automation binding IDs"},"relationship-ids":{type:"string",description:"Comma-separated eligible relationship IDs"}}).build(),merge:C("merge","Preview or confirm present-day component consolidation",async(e)=>{let{values:t}=w(e,{...RS,source:{type:"string"},target:{type:"string"},"policy-dispositions":{type:"string"},"confirm-policy-impact":{type:"boolean"}});await yet({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],sourceComponentId:t.source,targetComponentId:t.target,confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,policyDispositions:t["policy-dispositions"],confirmPolicyImpact:t["confirm-policy-impact"]})}).withOptions({...TS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},"policy-dispositions":{type:"string",description:"Exact non-equivalent policy disposition JSON"},"confirm-policy-impact":{type:"boolean",description:"Confirm every previewed policy-scope change"}}).withExamples(["sazabi components merge --source <component-id> --target <component-id> # Preview only"]).build(),relationships:Cet}).withExamples(["sazabi components list # List all components","sazabi components get <component-id> # Get one component",'sazabi components register --name "API Gateway" # Register a component',"sazabi components deregister <component-id> # Deregister a component"]).build();re();Ha();ye();ce();var mAe={provider:{label:"Provider",type:{kind:"string"}},externalName:{label:"Name",type:{kind:"nullable-string"}},externalLogin:{label:"Login",type:{kind:"nullable-string"}},connectedAt:{label:"Connected",type:{kind:"nullable-date"}},authMode:{label:"Auth mode",type:{kind:"nullable-string"}},needsReconnect:{label:"Needs reconnect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}}},vet={schema:mAe,columns:["provider","externalName","externalLogin","connectedAt","needsReconnect"],header:"Connected accounts",emptyMessage:"No connected accounts found."},Eet={layout:"field-list",schema:mAe,fields:["provider","externalName","externalLogin","connectedAt","authMode","needsReconnect"],title:"Connected account"},wet={provider:{label:"Provider",type:{kind:"string"}}},ket={schema:wet,columns:["provider"],header:"Connected account providers",emptyMessage:"No providers found."},Tm=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},xet=3000,Pet={vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser was not signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},pAe=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Available: github, google, microsoft, linear, bitbucket, slack")}let{client:i}=Tm(t),s=I(await i.connectedAccounts.beginConnect({provider:r}),`Couldn't start the ${r} connect flow`,o);if(!o)be(`Connect ${r}`),H("Complete the authorization in a browser where you're signed in to the Sazabi dashboard as the same user."),H(`Opening ${Z.info(s.url)}`);if(Ai(s.url),!o)H("Waiting for the browser flow to complete...");let c=new Date(s.expiresAt).getTime()+15000;while(Date.now()<c){await Mr(xet);let u=I(await i.connectedAccounts.getConnectAttempt(s.attemptId),"Couldn't poll the connect attempt (try again)",o);if(u.status==="pending")continue;if(u.status==="completed"){if(!o)z(`Connected ${r}.`);if(o)j({status:"completed",provider:r});return}if(u.status==="failed"){let d=u.errorCode??"unknown",p=Pet[d],g=p?`Connect did not complete (${d}). ${p}`:`Connect failed (${d}). Run the command again.`;if(o)return b(g);return y(g)}break}let l="The browser flow didn't complete in time. Run the command again.";if(o)return b(l);return y(l)},Ret=async(e)=>{let{values:t}=w(e,L),{client:n,json:r}=Tm(t),{accounts:o}=I(await n.connectedAccounts.list(),"Couldn't list connected accounts (try again)",r);K(vet,o,{json:r})},Tet=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Tm(t);if(I(await i.connectedAccounts.disconnect({provider:r}),"Couldn't disconnect the connected account",o),o){j({success:!0});return}z(`Disconnected ${r}.`)},gAe=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Tm(t),{accounts:s}=I(await i.connectedAccounts.list(),"Couldn't list connected accounts (try again)",o),c=s.find((l)=>l.provider===r);if(!c){let l=`No connected account found for provider '${r}'.`;if(o)return b(l);return y(l)}G(Eet,c,{json:o})},Bet=async(e)=>{let{values:t}=w(e,L),{json:n}=Tm(t),r=ff.map((o)=>({provider:o}));K(ket,r,{json:n})},hAe=se("connected-accounts","Manage personal connected accounts (GitHub, Google, Microsoft, Linear, Bitbucket, Slack)").withSubcommands({connect:C("connect","Connect a personal account via a browser OAuth flow",pAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts connect github # Connect GitHub","sazabi connected-accounts connect google # Connect Google","sazabi connected-accounts connect slack # Connect Slack"]).build(),list:C("list","List connected accounts for the organization",Ret).withOptions(D).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts list --json # Machine-readable output"]).build(),get:C("get","Get one connected account by provider",gAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts get github # Show GitHub connected account","sazabi connected-accounts get slack --json # Machine-readable output"]).build(),details:C("details","Show details for one connected account",gAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts details github # Show GitHub connected account detail"]).build(),providers:C("providers","List supported connected account providers",Bet).withOptions(D).withExamples(["sazabi connected-accounts providers # List all providers","sazabi connected-accounts providers --json # Machine-readable output"]).build(),disconnect:C("disconnect","Disconnect a personal connected account",Tet).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts disconnect github # Disconnect GitHub"]).build(),"update-credentials":C("update-credentials","Reconnect a provider to refresh its OAuth token",pAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts update-credentials github # Re-run the GitHub OAuth flow","sazabi connected-accounts update-credentials slack # Refresh Slack token"]).build()}).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts get github # Show GitHub account","sazabi connected-accounts providers # List available providers","sazabi connected-accounts connect github # Connect GitHub via browser","sazabi connected-accounts disconnect github # Disconnect GitHub","sazabi connected-accounts update-credentials github # Refresh GitHub token"]).build();re();ye();ce();var Oet={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},authType:{label:"Auth",type:{kind:"string"}},capabilities:{label:"Capabilities",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"",serialize:(e)=>e??[]}},connectionCount:{label:"Connections",type:{kind:"number"}},browserConnectSupported:{label:"Browser connect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}},credentialFields:{label:"Credential fields",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.map((t)=>t.name).join(", "):"",serialize:(e)=>e??null}}},_et={schema:Oet,columns:["id","name","authType","capabilities","connectionCount"],jsonFields:["id","name","authType","capabilities","connectionCount","browserConnectSupported","credentialFields"],header:"Integration providers",emptyMessage:"No integration providers found."},yAe={id:{label:"ID",type:{kind:"string"}},provider:{label:"Provider",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},status:{label:"Status",type:{kind:"string"}},healthStatus:{label:"Health",type:{kind:"string"}},metadata:{label:"Metadata",type:{kind:"custom",render:(e)=>e==null?"":JSON.stringify(e),serialize:(e)=>e??null}},healthMessage:{label:"Health detail",type:{kind:"nullable-string"}},healthCheckedAt:{label:"Health checked",type:{kind:"nullable-date"}},healthConsecutiveFailures:{label:"Health failures",type:{kind:"number"}},connectedBy:{label:"Connected by",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},Det={schema:yAe,columns:["id","provider","displayName","status","healthStatus"],header:"Integration connections",emptyMessage:"No integration connections found."},OM={layout:"field-list",schema:yAe,fields:["id","provider","displayName","status","metadata","healthStatus","healthMessage","healthCheckedAt","healthConsecutiveFailures","connectedBy","createdAt","updatedAt"],title:"Integration connection"},Vu=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},Qet=async(e)=>{let{values:t}=w(e,L),{client:n,json:r}=Vu(t),{providers:o}=I(await n.integrations.listProviders(),"Couldn't list integration providers (try again)",r),i=[...o].sort((s,c)=>s.name.localeCompare(c.name));K(_et,i,{json:r})},Let=async(e)=>{let{values:t}=w(e,{...L,provider:{type:"string"}}),{client:n,json:r}=Vu(t),{connections:o}=I(await n.integrations.listConnections({provider:t.provider}),"Couldn't list integration connections (check your organization access and try again)",r);K(Det,o,{json:r})},AAe=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Connection ID is required.");return y("Connection ID is required.")}let{client:o,json:i}=Vu(t),{connection:s}=I(await o.integrations.getConnection(r),"Couldn't get integration connection (run 'sazabi integrations list' to see connection IDs)",i);G(OM,s,{json:i})},Net=3000,fAe={installation_requested:"The install needs approval from a GitHub organization admin. The connection will appear once they approve — no need to rerun connect.",vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser wasn't signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},Met=(e)=>e.map((t)=>` ${t.name}${t.required?"":" (optional)"} — ${t.label}`).join(`
|
|
8802
|
+
`)){if(/^services\s*:\s*(#.*)?$/.test(s)){o=!0,i=void 0;continue}if(!o)continue;if(/^\S/.test(s)){o=!1;continue}let c=s.match(/^(\s+)([A-Za-z0-9_.-]+)\s*:\s*(#.*)?$/);if(!c)continue;let l=c[1].length;if(i??=l,l!==i)continue;r.push({name:c[2],description:"docker compose service",dir:"."})}return r},xM=(e)=>{let t=sAe(eo.join(e,"package.json")),n=[...q7e(t),...V7e(e)],r=[...K7e(e,n),...Y7e(e),...W7e(e)],o=n.length===0?kM(e):void 0;if(o)r.push({name:o,description:"root package",dir:"."});let i=new Set;return r.filter((s)=>{if(i.has(s.name))return!1;return i.add(s.name),!0})};ce();var J7e={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}}},Z7e={schema:J7e,columns:["id","name","origin","lifecycle"],header:"Registered components",emptyMessage:"No components registered."},PM=async(e)=>{let{client:t,json:n}=e,r=e.rootDir??process.cwd(),o=xM(r);if(o.length===0)return $r("No component candidates detected. Register one with 'sazabi components register --name <name>'."),[];let i=await xm({message:"Select the components to register",choices:o.map((c)=>({label:c.name,value:c,hint:`${c.description}, ${c.dir}`,preselected:!0}))});if(i.length===0)return H("Nothing selected. No components registered."),[];let s=[];for(let c of i){let l=I(await t.components.register({name:c.name,description:c.description}),`Failed to register component ${c.name}`,n);z(`Component ${l.component.name} registered.`),s.push({id:l.component.id,name:l.component.name,origin:l.component.origin,lifecycle:l.component.lifecycle})}return K(Z7e,s,{json:n}),s},X7e=async(e)=>{let{values:t}=w(e,{...L,dir:{type:"string"}}),n=t.json,r=t.dir??process.cwd();if(n||!fi()){j({candidates:xM(r)});return}let o=Q({jsonMode:n}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t["api-base-url"],jsonMode:n});await PM({client:i,rootDir:r,json:n})},cAe=C("scan","Detect component candidates in the working tree (propose-only)",X7e).withOptions({...D,dir:{type:"string",description:"Directory to scan (default: current directory)"}}).withExamples(["sazabi components scan # Detect candidates and confirm which to register","sazabi components scan --json # Print candidates only, register nothing"]).build();var uAe={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},description:{label:"Description",type:{kind:"nullable-string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}},observationState:{label:"Observation",type:{kind:"string"}},registryRevision:{label:"Revision",type:{kind:"number"}},canonicalComponentId:{label:"Canonical component",type:{kind:"id"}},mergedIntoComponentId:{label:"Merged into",type:{kind:"nullable-string"}},firstSeenAt:{label:"Created at",type:{kind:"date"}},lastSeenAt:{label:"Last seen",type:{kind:"date"}},deletedAt:{label:"Deleted at",type:{kind:"nullable-date"}},inactiveAt:{label:"Inactive at",type:{kind:"nullable-date"}},inactiveReason:{label:"Inactive reason",type:{kind:"nullable-string"}},legacyStateUnknown:{label:"Legacy inactive",type:{kind:"boolean"}}},eet={schema:uAe,columns:["id","name","lifecycle","observationState","currentStatus"],jsonFields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","inactiveAt","inactiveReason","legacyStateUnknown"],emptyMessage:"No components found. Register one with 'sazabi components register --name <name>'."},TM={layout:"field-list",schema:uAe,fields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","inactiveAt","inactiveReason","legacyStateUnknown"],title:"Component"},tet={status:{label:"Status",type:{kind:"string"}},componentId:{label:"Component ID",type:{kind:"id"}},sourceType:{label:"Source type",type:{kind:"string"}},withdrawn:{label:"Withdrawn",type:{kind:"boolean"}}},net={layout:"field-list",schema:tet,fields:["status","componentId","sourceType","withdrawn"],title:"Component observation"},oet=(e)=>{let t=e,n=Object.values(t.counts).reduce((r,o)=>r+o,0);return`${t.canonicalComponentName} (${t.canonicalComponentId}); ${t.affectedComponentIds.length} component(s), ${n} dependent(s); no changes applied`},ret={status:{label:"Status",type:{kind:"string"}},preview:{label:"Retirement preview",type:{kind:"custom",render:oet,serialize:(e)=>e}}},iet={layout:"field-list",schema:ret,fields:["status","preview"],title:"Retirement confirmation required"},Rm=(e,t,n)=>{if(e===void 0)return;try{let r=JSON.parse(e);if(!r||typeof r!=="object"||Array.isArray(r))throw Error("must be a JSON object");return r}catch(r){let o=`${t} must be valid JSON: ${r instanceof Error?r.message:String(r)}`;if(n)return b(o);return y(o)}},RM=(e)=>e?e.split(",").map((t)=>t.trim()).filter(Boolean):[],BM={kind:"custom",render:(e)=>JSON.stringify(e,null,2),serialize:(e)=>e},set={preview:{label:"Preview",type:BM}},aet={layout:"field-list",schema:set,fields:["preview"],title:"Component operation preview"},cet={result:{label:"Result",type:BM}},uet={layout:"field-list",schema:cet,fields:["result"],title:"Component operation result"},BS=(e,t)=>G(aet,e,{json:t}),OS=(e,t)=>G(uet,e,{json:t}),det=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.components.list({limit:e.limit,cursor:e.cursor,includeDeleted:e.includeDeleted}),"Couldn't list components (check the active project and try again)",e.json);K(eet,r.components,{json:e.json,nextCursor:r.nextCursor})},pet=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.components.get(e),"Couldn't get component (run 'sazabi components list' to see component IDs)",t.json);G(TM,o.component,{json:t.json})},get=async(e)=>{let t=e.name?.trim(),n=e.description?.trim(),r=e.origin?.trim();if(!t){if(e.json)return b("Name is required.");return y("Name is required.")}if(e.description!==void 0&&!n){if(e.json)return b("Description cannot be empty.");return y("Description cannot be empty.")}if(r!==void 0&&r!=="code_detected"&&r!=="log_observed"){if(e.json)return b("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).");return y("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).")}let o=Q({tokenFlag:e.token,jsonMode:e.json}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),s=I(await i.components.register({name:t,...n?{description:n}:{},...r?{origin:r}:{}}),"Failed to register component",e.json);G(TM,s.component,{json:e.json})},met=async(e,t)=>{let n=t.reason?.trim();if(t.reason!==void 0&&!n){if(t.json)return b("Reason cannot be empty.");return y("Reason cannot be empty.")}let r=Q({tokenFlag:t.token,jsonMode:t.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:r.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=I(await o.components.deregister(e,n),"Failed to deregister component",t.json);if(i.status==="observation_withdrawn"){G(net,i,{json:t.json});return}G(iet,i,{json:t.json})},qu=(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json});return N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json})},het=async(e,t)=>{let n=t.name?.trim(),r=t.reason?.trim();if(!n){if(t.json)return b("Name is required.");return y("Name is required.")}if(!t.requestId){if(t.json)return b("Request ID is required.");return y("Request ID is required.")}if(!r){if(t.json)return b("Reason is required.");return y("Reason is required.")}let o=qu(t),i=I(await o.components.rename({componentId:e,name:n,requestId:t.requestId,reason:r}),"Failed to rename component",t.json);G(TM,i.component,{json:t.json})},Aet=async(e,t)=>{let n=qu(t),r=Rm(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let s=I(await n.components.retirementPreview({componentId:e}),"Failed to preview component retirement",t.json);BS(s,t.json);return}let o=t.reason?.trim();if(!t.requestId||!o){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let i=I(await n.components.retire({componentId:e,requestId:t.requestId,reason:o,componentRevisions:r,confirmCanonicalGroup:t.confirmCanonicalGroup??!1}),"Failed to retire component; refresh the preview if it changed",t.json);OS(i,t.json)},fet=async(e,t)=>{let n=qu(t),r=Rm(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let s=I(await n.components.restorationPreview({componentId:e,...t.retirementOperationId?{retirementOperationId:t.retirementOperationId}:{}}),"Failed to preview component restoration",t.json);BS(s,t.json);return}let o=t.reason?.trim();if(!t.requestId||!t.retirementOperationId||!o){if(t.json)return b("Commit requires --request-id, --retirement-operation-id, and --reason with --confirm-preview-revision.");return y("Commit requires --request-id, --retirement-operation-id, and --reason with --confirm-preview-revision.")}let i=I(await n.components.restore({componentId:e,retirementOperationId:t.retirementOperationId,requestId:t.requestId,reason:o,componentRevisions:r,selections:{notificationRuleIds:RM(t.notificationRuleIds),automationBindingIds:RM(t.automationBindingIds),recommendationScopeIds:[],relationshipIds:RM(t.relationshipIds)}}),"Failed to restore component; refresh the preview if it changed",t.json);OS(i,t.json)},yet=async(e)=>{if(!e.sourceComponentId||!e.targetComponentId){if(e.json)return b("Source and target component IDs are required.");return y("Source and target component IDs are required.")}let t=qu(e),n={sourceComponentId:e.sourceComponentId,targetComponentId:e.targetComponentId},r=Rm(e.confirmPreviewRevision,"Confirm preview revision",e.json);if(!r){let c=I(await t.components.mergePreview(n),"Failed to preview component consolidation",e.json);BS(c,e.json);return}let o=e.reason?.trim(),i=Rm(e.policyDispositions,"Policy dispositions",e.json);if(!e.requestId||!o||!i){if(e.json)return b("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.");return y("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.")}let s=I(await t.components.merge({...n,requestId:e.requestId,reason:o,componentRevisions:r,policyDispositions:i,confirmPolicyImpact:e.confirmPolicyImpact??!1}),"Failed to consolidate component; refresh the preview if it changed",e.json);OS(s,e.json)},bet=async(e)=>{let t=qu(e),n=I(await t.components.relationships.list({includeHistorical:e.includeHistorical}),"Failed to list component relationships",e.json);G({layout:"field-list",schema:{relationships:{label:"Relationships",type:BM}},fields:["relationships"],title:"Component relationships"},n,{json:e.json})},Iet=async(e,t)=>{if(!t.sourceComponentId||!t.targetComponentId||t.relationshipType!=="part_of"&&t.relationshipType!=="depends_on"){if(t.json)return b("Source, target, and relationship type (part_of or depends_on) are required.");return y("Source, target, and relationship type (part_of or depends_on) are required.")}let n=qu(t),r={action:e,sourceComponentId:t.sourceComponentId,targetComponentId:t.targetComponentId,relationshipType:t.relationshipType},o=Rm(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!o){let l=I(await n.components.relationships.preview(r),"Failed to preview component relationship",t.json);BS(l,t.json);return}let i=t.reason?.trim();if(!t.requestId||!i){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let s={sourceComponentId:r.sourceComponentId,targetComponentId:r.targetComponentId,relationshipType:r.relationshipType,requestId:t.requestId,reason:i,componentRevisions:o,confirmPolicyImpact:t.confirmPolicyImpact??!1},c=I(e==="add"?await n.components.relationships.add(s):await n.components.relationships.remove(s),`Failed to ${e} component relationship; refresh the preview if it changed`,t.json);OS(c,t.json)},RS={...L,"confirm-preview-revision":{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},TS={...D,"confirm-preview-revision":{type:"string",description:"Exact componentRevisions JSON from the preview; omit to preview only"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key required for commit"},reason:{type:"string",description:"Audit reason required for commit"}},lAe=(e)=>C(e,`${e==="add"?"Add":"End"} a component relationship`,async(t)=>{let{values:n}=w(t,{...RS,source:{type:"string"},target:{type:"string"},type:{type:"string"},"confirm-policy-impact":{type:"boolean"}});await Iet(e,{token:n.token,json:n.json,apiBaseUrl:n["api-base-url"],sourceComponentId:n.source,targetComponentId:n.target,relationshipType:n.type,confirmPreviewRevision:n["confirm-preview-revision"],requestId:n["request-id"],reason:n.reason,confirmPolicyImpact:n["confirm-policy-impact"]})}).withOptions({...TS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},type:{type:"string",description:"Relationship type: part_of or depends_on"},"confirm-policy-impact":{type:"boolean",description:"Confirm the policy-scope delta shown by the preview"}}).withExamples([`sazabi components relationships ${e} --source <component-id> --target <component-id> --type part_of # Preview a parent-child topology change`]).build(),Cet=se("relationships","Inspect and edit component topology").withSubcommands({list:C("list","List component relationships",async(e)=>{let{values:t}=w(e,{...L,"include-historical":{type:"boolean"}});await bet({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],includeHistorical:t["include-historical"]})}).withOptions({...D,"include-historical":{type:"boolean",description:"Include historically ended relationships"}}).build(),add:lAe("add"),remove:lAe("remove")}).build(),dAe=se("components","Manage status page components").withSubcommands({list:C("list","List components in the active project",async(e)=>{let{values:t}=w(e,{...L,limit:{type:"string"},cursor:{type:"string"},"include-deleted":{type:"boolean"}});await det({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],limit:t.limit?Number(t.limit):void 0,cursor:t.cursor,includeDeleted:t["include-deleted"]})}).withOptions({...D,limit:{type:"string",description:"Maximum number of components to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},"include-deleted":{type:"boolean",description:"Include deregistered components"}}).withExamples(["sazabi components list # List all components","sazabi components list --include-deleted # Include deregistered components"]).build(),get:C("get","Get one component by ID",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await pet(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<component-id>").withOptions(D).withExamples(["sazabi components get <component-id> # Get one component"]).build(),scan:cAe,register:C("register","Register or refresh a component",async(e)=>{let{values:t}=w(e,{...L,name:{type:"string"},description:{type:"string"},origin:{type:"string"}});await get({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,origin:t.origin})}).withOptions({...D,name:{type:"string",description:"Component name to register"},description:{type:"string",description:"Optional component description"},origin:{type:"string",description:"Machine provenance: 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry, the default)"}}).withExamples(['sazabi components register --name "API Gateway" # Register a component','sazabi components register --name "Checkout" --description "Checkout API and workflow" # Register with description','sazabi components register --name "intake-consumer" --origin code_detected # Register a component inferred from repository analysis']).build(),deregister:C("deregister","Deregister a component",async(e)=>{let{values:t,positionals:n}=w(e,{...L,reason:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await met(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],reason:t.reason})}).withPositionalArgs("<component-id>").withOptions({...D,reason:{type:"string",description:"Optional deregistration reason"}}).withExamples(["sazabi components deregister <component-id> # Deregister a component",'sazabi components deregister <component-id> --reason "service retired" # Deregister with reason']).build(),rename:C("rename","Rename an active component",async(e)=>{let{values:t,positionals:n}=w(e,{...L,name:{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await het(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,requestId:t["request-id"],reason:t.reason})}).withPositionalArgs("<component-id>").withOptions({...D,name:{type:"string",description:"New component name"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key"},reason:{type:"string",description:"Audit reason for the rename"}}).build(),retire:C("retire","Preview or confirm component retirement",async(e)=>{let{values:t,positionals:n}=w(e,{...RS,"confirm-canonical-group":{type:"boolean"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await Aet(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,confirmCanonicalGroup:t["confirm-canonical-group"]})}).withPositionalArgs("<component-id>").withOptions({...TS,"confirm-canonical-group":{type:"boolean",description:"Confirm the complete canonical group"}}).build(),restore:C("restore","Preview or confirm component restoration",async(e)=>{let{values:t,positionals:n}=w(e,{...RS,"retirement-operation-id":{type:"string"},"notification-rule-ids":{type:"string"},"automation-binding-ids":{type:"string"},"relationship-ids":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await fet(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,retirementOperationId:t["retirement-operation-id"],notificationRuleIds:t["notification-rule-ids"],automationBindingIds:t["automation-binding-ids"],relationshipIds:t["relationship-ids"]})}).withPositionalArgs("<component-id>").withOptions({...TS,"retirement-operation-id":{type:"string",description:"Retirement operation ID returned by the preview"},"notification-rule-ids":{type:"string",description:"Comma-separated eligible notification rule IDs"},"automation-binding-ids":{type:"string",description:"Comma-separated eligible automation binding IDs"},"relationship-ids":{type:"string",description:"Comma-separated eligible relationship IDs"}}).build(),merge:C("merge","Preview or confirm present-day component consolidation",async(e)=>{let{values:t}=w(e,{...RS,source:{type:"string"},target:{type:"string"},"policy-dispositions":{type:"string"},"confirm-policy-impact":{type:"boolean"}});await yet({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],sourceComponentId:t.source,targetComponentId:t.target,confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,policyDispositions:t["policy-dispositions"],confirmPolicyImpact:t["confirm-policy-impact"]})}).withOptions({...TS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},"policy-dispositions":{type:"string",description:"Exact non-equivalent policy disposition JSON"},"confirm-policy-impact":{type:"boolean",description:"Confirm every previewed policy-scope change"}}).withExamples(["sazabi components merge --source <component-id> --target <component-id> # Preview only"]).build(),relationships:Cet}).withExamples(["sazabi components list # List all components","sazabi components get <component-id> # Get one component",'sazabi components register --name "API Gateway" # Register a component',"sazabi components deregister <component-id> # Deregister a component"]).build();re();Ha();ye();ce();var mAe={provider:{label:"Provider",type:{kind:"string"}},externalName:{label:"Name",type:{kind:"nullable-string"}},externalLogin:{label:"Login",type:{kind:"nullable-string"}},connectedAt:{label:"Connected",type:{kind:"nullable-date"}},authMode:{label:"Auth mode",type:{kind:"nullable-string"}},needsReconnect:{label:"Needs reconnect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}}},vet={schema:mAe,columns:["provider","externalName","externalLogin","connectedAt","needsReconnect"],header:"Connected accounts",emptyMessage:"No connected accounts found."},Eet={layout:"field-list",schema:mAe,fields:["provider","externalName","externalLogin","connectedAt","authMode","needsReconnect"],title:"Connected account"},wet={provider:{label:"Provider",type:{kind:"string"}}},ket={schema:wet,columns:["provider"],header:"Connected account providers",emptyMessage:"No providers found."},Tm=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},xet=3000,Pet={vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser was not signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},pAe=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Available: github, google, microsoft, linear, bitbucket, slack")}let{client:i}=Tm(t),s=I(await i.connectedAccounts.beginConnect({provider:r}),`Couldn't start the ${r} connect flow`,o);if(!o)be(`Connect ${r}`),H("Complete the authorization in a browser where you're signed in to the Sazabi dashboard as the same user."),H(`Opening ${Z.info(s.url)}`);if(Ai(s.url),!o)H("Waiting for the browser flow to complete...");let c=new Date(s.expiresAt).getTime()+15000;while(Date.now()<c){await Mr(xet);let u=I(await i.connectedAccounts.getConnectAttempt(s.attemptId),"Couldn't poll the connect attempt (try again)",o);if(u.status==="pending")continue;if(u.status==="completed"){if(!o)z(`Connected ${r}.`);if(o)j({status:"completed",provider:r});return}if(u.status==="failed"){let d=u.errorCode??"unknown",p=Pet[d],g=p?`Connect did not complete (${d}). ${p}`:`Connect failed (${d}). Run the command again.`;if(o)return b(g);return y(g)}break}let l="The browser flow didn't complete in time. Run the command again.";if(o)return b(l);return y(l)},Ret=async(e)=>{let{values:t}=w(e,L),{client:n,json:r}=Tm(t),{accounts:o}=I(await n.connectedAccounts.list(),"Couldn't list connected accounts (try again)",r);K(vet,o,{json:r})},Tet=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Tm(t);if(I(await i.connectedAccounts.disconnect({provider:r}),"Couldn't disconnect the connected account",o),o){j({success:!0});return}z(`Disconnected ${r}.`)},gAe=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Tm(t),{accounts:s}=I(await i.connectedAccounts.list(),"Couldn't list connected accounts (try again)",o),c=s.find((l)=>l.provider===r);if(!c){let l=`No connected account found for provider '${r}'.`;if(o)return b(l);return y(l)}G(Eet,c,{json:o})},Bet=async(e)=>{let{values:t}=w(e,L),{json:n}=Tm(t),r=ff.map((o)=>({provider:o}));K(ket,r,{json:n})},hAe=se("connected-accounts","Manage personal connected accounts (GitHub, Google, Microsoft, Linear, Bitbucket, Slack)").withSubcommands({connect:C("connect","Connect a personal account via a browser OAuth flow",pAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts connect github # Connect GitHub","sazabi connected-accounts connect google # Connect Google","sazabi connected-accounts connect slack # Connect Slack"]).build(),list:C("list","List connected accounts for the organization",Ret).withOptions(D).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts list --json # Machine-readable output"]).build(),get:C("get","Get one connected account by provider",gAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts get github # Show GitHub connected account","sazabi connected-accounts get slack --json # Machine-readable output"]).build(),details:C("details","Show details for one connected account",gAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts details github # Show GitHub connected account detail"]).build(),providers:C("providers","List supported connected account providers",Bet).withOptions(D).withExamples(["sazabi connected-accounts providers # List all providers","sazabi connected-accounts providers --json # Machine-readable output"]).build(),disconnect:C("disconnect","Disconnect a personal connected account",Tet).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts disconnect github # Disconnect GitHub"]).build(),"update-credentials":C("update-credentials","Reconnect a provider to refresh its OAuth token",pAe).withPositionalArgs("<provider>").withOptions(D).withExamples(["sazabi connected-accounts update-credentials github # Re-run the GitHub OAuth flow","sazabi connected-accounts update-credentials slack # Refresh Slack token"]).build()}).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts get github # Show GitHub account","sazabi connected-accounts providers # List available providers","sazabi connected-accounts connect github # Connect GitHub via browser","sazabi connected-accounts disconnect github # Disconnect GitHub","sazabi connected-accounts update-credentials github # Refresh GitHub token"]).build();re();ye();ce();var Oet={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},authType:{label:"Auth",type:{kind:"string"}},capabilities:{label:"Capabilities",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"",serialize:(e)=>e??[]}},connectionCount:{label:"Connections",type:{kind:"number"}},browserConnectSupported:{label:"Browser connect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}},credentialFields:{label:"Credential fields",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.map((t)=>t.name).join(", "):"",serialize:(e)=>e??null}}},_et={schema:Oet,columns:["id","name","authType","capabilities","connectionCount"],jsonFields:["id","name","authType","capabilities","connectionCount","browserConnectSupported","credentialFields"],header:"Integration providers",emptyMessage:"No integration providers found."},yAe={id:{label:"ID",type:{kind:"string"}},provider:{label:"Provider",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},status:{label:"Status",type:{kind:"string"}},healthStatus:{label:"Health",type:{kind:"string"}},metadata:{label:"Metadata",type:{kind:"custom",render:(e)=>e==null?"":JSON.stringify(e),serialize:(e)=>e??null}},healthMessage:{label:"Health detail",type:{kind:"nullable-string"}},healthCheckedAt:{label:"Health checked",type:{kind:"nullable-date"}},healthConsecutiveFailures:{label:"Health failures",type:{kind:"number"}},connectedBy:{label:"Connected by",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},Det={schema:yAe,columns:["id","provider","displayName","status","healthStatus"],header:"Integration connections",emptyMessage:"No integration connections found."},OM={layout:"field-list",schema:yAe,fields:["id","provider","displayName","status","metadata","healthStatus","healthMessage","healthCheckedAt","healthConsecutiveFailures","connectedBy","createdAt","updatedAt"],title:"Integration connection"},Vu=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},Qet=async(e)=>{let{values:t}=w(e,L),{client:n,json:r}=Vu(t),{providers:o}=I(await n.integrations.listProviders(),"Couldn't list integration providers (try again)",r),i=[...o].sort((s,c)=>s.name.localeCompare(c.name));K(_et,i,{json:r})},Let=async(e)=>{let{values:t}=w(e,{...L,provider:{type:"string"}}),{client:n,json:r}=Vu(t),{connections:o}=I(await n.integrations.listConnections({provider:t.provider}),"Couldn't list integration connections (check your organization access and try again)",r);K(Det,o,{json:r})},AAe=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Connection ID is required.");return y("Connection ID is required.")}let{client:o,json:i}=Vu(t),{connection:s}=I(await o.integrations.getConnection(r),"Couldn't get integration connection (run 'sazabi integrations list' to see connection IDs)",i);G(OM,s,{json:i})},Net=3000,fAe={installation_requested:"The install needs approval from a GitHub organization admin. The connection will appear once they approve — no need to rerun connect.",vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser wasn't signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},Met=(e)=>e.map((t)=>` ${t.name}${t.required?"":" (optional)"} — ${t.label}`).join(`
|
|
8803
8803
|
`),bAe=(e,t,n,r)=>{let o=n.length?`
|
|
8804
8804
|
${t} credential fields:
|
|
8805
8805
|
${Met(n)}`:"";if(!e){let i=`--credentials is required for ${t} (JSON object).${o}`;if(r)b(i);else y(i);return}try{let i=JSON.parse(e);if(typeof i!=="object"||i===null||Array.isArray(i))throw Error("not an object");return i}catch{let i=`--credentials must be a JSON object, e.g. '{"apiToken":"..."}'.${o}`;if(r)b(i);else y(i);return}},Bm=async(e)=>{let{client:t,provider:n,displayName:r,credentialsFlag:o,projectId:i,json:s}=e,{providers:c}=I(await t.integrations.listProviders(),"Couldn't load the integration provider catalog (try again)",s),l=c.find((g)=>g.id===n);if(!l){let g=c.map((A)=>A.id).join(", "),m=`Unknown integration provider "${n}". Available: ${g}`;if(s)return b(m);return y(m)}if(l.authType==="api_key"){let g=bAe(o,l.name,l.credentialFields??[],s);if(!g)return null;let{connection:m}=I(await t.integrations.createConnection({provider:n,displayName:r,credentials:g}),`Couldn't connect ${l.name} (check the credentials and try again)`,s);if(!s)z(`Connected ${l.name}.`);return m}if(!l.browserConnectSupported){let g=`${l.name} can't be connected from the CLI yet. Connect it from the dashboard integration settings.`;if(s)return b(g);return y(g)}if(o){let g=`${l.name} connects through a browser flow — --credentials does not apply.`;if(s)return b(g);return y(g)}let u=I(await t.integrations.beginConnect({provider:n,displayName:r,projectId:i}),`Couldn't start the ${l.name} connect flow`,s);if(!s)be(`Connect ${l.name}`),H("Complete the authorization in a browser where you're signed in to the Sazabi dashboard as the same user."),H(`Opening ${Z.info(u.url)}`);if(Ai(u.url),!s)H("Waiting for the browser flow to complete...");let d=new Date(u.expiresAt).getTime()+15000;while(Date.now()<d){await Mr(Net);let g=I(await t.integrations.getConnectAttempt(u.attemptId),"Couldn't poll the connect attempt (try again)",s);if(g.status==="pending")continue;if(g.status==="completed"&&g.connection){if(!s)z(`Connected ${l.name}.`);return g.connection}if(g.status==="failed"){let m=g.errorCode??"unknown",A=fAe[m],f=A?`Connect did not complete (${m}). ${A}`:`Connect failed (${m}). Run the command again.`;if(s)return b(f);return y(f)}if(g.status==="not_connected"){let m=g.errorCode??void 0,f=(m?fAe[m]:void 0)??"Not connected yet — the flow finished but the connection isn't live (it may be awaiting approval). It'll appear once approved.";if(s)return j({status:"not_connected",...m?{reason:m}:{},message:f}),null;return H(f),null}break}let p="The browser flow didn't complete in time. Run the command again.";if(s)return b(p);return y(p)},zet=async(e)=>{let{values:t,positionals:n}=w(e,{...L,credentials:{type:"string"},"display-name":{type:"string"},project:{type:"string"}},{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi integrations providers' to see options.")}let{client:i}=Vu(t),s=await Bm({client:i,provider:r,displayName:t["display-name"],credentialsFlag:t.credentials,projectId:t.project,json:o});if(!s)return;G(OM,s,{json:o})},jet=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Connection ID is required.");return y("Connection ID is required. Run 'sazabi integrations list' to see connection IDs.")}let{client:i}=Vu(t);if(I(await i.integrations.disconnectConnection(r),"Couldn't disconnect the integration connection",o),o){j({success:!0});return}z("Integration connection disconnected.")},Uet=async(e)=>{let{values:t,positionals:n}=w(e,{...L,credentials:{type:"string"}},{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Connection ID is required.");return y("Connection ID is required. Run 'sazabi integrations list' to see connection IDs.")}let i=bAe(t.credentials,"this connection",[],o);if(!i)return;let{client:s}=Vu(t),{connection:c}=I(await s.integrations.updateConnectionCredentials({connectionId:r,credentials:i}),"Couldn't update the connection credentials (check the values and try again)",o);if(!o)z("Connection credentials updated.");G(OM,c,{json:o})},IAe=se("integrations","Connect and inspect integrations").withSubcommands({providers:C("providers","List supported integration providers",Qet).withOptions(D).withExamples(["sazabi integrations providers # List providers and connection counts","sazabi integrations providers --json # Machine-readable output"]).build(),connect:C("connect","Connect an integration (API-key credentials or a browser flow)",zet).withPositionalArgs("<provider>").withOptions({...D,credentials:{type:"string",description:'Vendor credentials as JSON for api_key providers, e.g. \'{"apiToken":"..."}\' (see credentialFields in `integrations providers --json`)'},"display-name":{type:"string",description:"Optional display name for the connection"},project:{type:"string",description:"Project the completed connection defaults its routing to (browser flows)"}}).withExamples([`sazabi integrations connect pagerduty --credentials '{"apiToken":"..."}' # API-key connect`,"sazabi integrations connect jira # Browser OAuth connect","sazabi integrations connect github # GitHub App install"]).build(),disconnect:C("disconnect","Disconnect an integration connection",jet).withPositionalArgs("<connection-id>").withOptions(D).withExamples(["sazabi integrations disconnect <connection-id> # Soft-delete the connection"]).build(),"update-credentials":C("update-credentials","Replace an api_key connection's credentials (reconnect path)",Uet).withPositionalArgs("<connection-id>").withOptions({...D,credentials:{type:"string",description:"Replacement vendor credentials as JSON"}}).withExamples([`sazabi integrations update-credentials <connection-id> --credentials '{"apiToken":"..."}' # Replace stored credentials`]).build(),list:C("list","List integration connections for the organization",Let).withOptions({...D,provider:{type:"string",description:"Filter by provider (e.g. slack, github, pagerduty)"}}).withExamples(["sazabi integrations list # All connections","sazabi integrations list --provider slack # Filter by provider"]).build(),get:C("get","Get one integration connection by ID",AAe).withPositionalArgs("<connection-id>").withOptions(D).withExamples(["sazabi integrations get <connection-id> # Connection detail"]).build(),details:C("details","Show details for one integration connection",AAe).withPositionalArgs("<connection-id>").withOptions(D).withExamples(["sazabi integrations details <connection-id> # Connection detail"]).build()}).withExamples(["sazabi integrations providers # List providers","sazabi integrations connect pagerduty --credentials '{...}' # Connect an integration","sazabi integrations list # List connections","sazabi integrations get <connection-id> # Connection detail"]).build();re();Ha();import{readFile as Fet}from"node:fs/promises";ye();ce();var _M={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},url:{label:"URL",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},severity:{label:"Severity",type:{kind:"severity"}},componentId:{label:"Component",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}},resolvedAt:{label:"Resolved",type:{kind:"nullable-date"}},mutedAt:{label:"Muted",type:{kind:"nullable-date"}},muteHitCount:{label:"Mute hits",type:{kind:"number"}},lastActivityAt:{label:"Last activity",type:{kind:"nullable-date"}},lastDeliveredAt:{label:"Last delivered",type:{kind:"nullable-date"}},description:{label:"Description",type:{kind:"nullable-string"}},delivery:{label:"Delivery",type:{kind:"custom",render:(e)=>e==null?"(none)":JSON.stringify(e,null,2),serialize:(e)=>e??null}}},$et={..._M,duplicateIssueId:{label:"Reused issue",type:{kind:"nullable-string"}}},CAe=["id","projectId","url","name","status","severity","componentId","createdAt","resolvedAt","mutedAt","muteHitCount","lastActivityAt","lastDeliveredAt","description"],vAe={schema:_M,columns:["id","name","status","severity","createdAt","mutedAt","url"],jsonFields:CAe,header:"Issues",emptyMessage:"No issues found."},Get={...vAe,jsonFields:[...CAe,"delivery"]},bi={layout:"sections",schema:_M,primary:{title:"Issue",fields:["id","url","name","status","severity","createdAt","resolvedAt","mutedAt","muteHitCount","lastActivityAt","lastDeliveredAt","componentId"]},secondary:[{title:"Description",field:"description"}]},zr=(e)=>({...e,url:the(e.projectId,e.id)}),Het={...bi,schema:$et,secondary:[{title:"Reused existing issue",field:"duplicateIssueId"},...bi.secondary??[]]},qet={layout:"field-list",title:"Issue counts",schema:{total:{label:"Total",type:{kind:"number"}},byStatus:{label:"By status",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}},bySeverity:{label:"By severity",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}},filters:{label:"Filters",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e},get:(e)=>e.filters}},fields:["total","byStatus","bySeverity","filters"]},Vet=bf.partial(),Ket={contentMdx:"contentMdx cannot be empty. Provide the issue body via --content-mdx or the contentMdx field in --from-json.",componentId:"componentId is required. Run `sazabi components list --json`, pick the matching component, and pass --component <id> (or componentId in --from-json)."},Yet=3000,Wet=90000,SAe=async(e)=>{let t=Date.now()+Wet;while(Date.now()<t){await Mr(Yet);let n=await e.onboarding.getState();if(!n.success)return!1;if(n.value.onboarding.completionByStep["trigger-issue"]==="complete")return!0}return!1},DM=async(e)=>{let{client:t,json:n}=e,r=I(await t.issues.create({sample:!0}),"Failed to create test issue",n);if(n){let i=await SAe(t);return{issue:r.issue,delivered:i}}G(bi,zr(r.issue),{json:n}),H("Waiting for the alert to reach your alert channels...");let o=await SAe(t);if(o)z("Delivered to your alert channels.");else H("Delivery pending. Check progress with 'sazabi onboarding progress'.");return{issue:r.issue,delivered:o}},Jet=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),{issue:r,delivered:o}=await DM({client:n,json:e.json});if(e.json){j({issue:zr(r),delivered:o});return}if(o)H(`Resolve it to complete the loop: sazabi issues resolve ${r.id}`)},Zet=async(e)=>{if(e.sample){let s=[["--name",e.name!==void 0],["--content-mdx",e.contentMdx!==void 0],["--severity",e.severity!==void 0],["--component",e.componentId!==void 0],["--from-json",e.fromJson!==void 0]].filter(([,c])=>c).map(([c])=>c);if(s.length>0){let c=`--sample uses the curated sample payload and cannot combine with ${s.join(", ")}. Remove those flags and try again.`;if(e.json)return b(c);return y(c)}return Jet(e)}let t=await ctt(e);if(!t.ok){if(e.json)return b(t.message);return y(t.message)}let n=Q({tokenFlag:e.token,jsonMode:e.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),o=I(await r.issues.create(t.input),"Failed to create issue",e.json);G(Het,{...o.issue,duplicateIssueId:o.duplicateIssueId??null},{json:e.json})},Xet=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.issues.list({status:e.status,severity:e.severity,componentId:e.componentId,limit:e.limit,cursor:e.cursor}),"Couldn't list issues (check the active project and try again)",e.json);K(vAe,r.issues.map(zr),{json:e.json,nextCursor:r.nextCursor})},ett=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.issues.search({name:e.name,status:e.status,severity:e.severity,componentId:e.componentId,limit:e.limit,cursor:e.cursor,includeDeliveryMetadata:e.includeDeliveryMetadata}),"Couldn't search issues (check the active project and try again)",e.json);K(Get,r.issues.map(zr),{json:e.json,nextCursor:r.nextCursor})},ttt=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.issues.count({name:e.name,status:e.status,severity:e.severity,componentId:e.componentId}),"Couldn't count issues (check the active project and try again)",e.json);G(qet,r,{json:e.json})},ntt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.get(e),"Couldn't get issue (run 'sazabi issues list' to see issue IDs)",t.json);G(bi,zr(o.issue),{json:t.json})},ott=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.resolve(e),"Failed to resolve issue",t.json);G(bi,zr(o.issue),{json:t.json})},rtt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.reopen(e),"Failed to reopen issue",t.json);G(bi,zr(o.issue),{json:t.json})},itt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.ignore(e),"Failed to ignore issue",t.json);G(bi,zr(o.issue),{json:t.json})},stt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.mute(e),"Failed to mute issue",t.json);G(bi,zr(o.issue),{json:t.json})},att=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.unmute(e),"Failed to unmute issue",t.json);G(bi,zr(o.issue),{json:t.json})},ctt=async(e)=>{let t=e.fromJson?await ltt(e.fromJson):{ok:!0,input:{}};if(!t.ok)return t;let n={...t.input,...e.name!==void 0?{name:e.name}:{},...e.contentMdx!==void 0?{contentMdx:e.contentMdx}:{},...e.severity!==void 0?{severity:e.severity}:{},...e.componentId!==void 0?{componentId:e.componentId}:{}},r=If.safeParse(n);if(!r.success)return{ok:!1,message:EAe(r.error)};return{ok:!0,input:r.data}},ltt=async(e)=>{let t;try{t=e==="-"?await utt():await Fet(e,"utf8")}catch(o){return{ok:!1,message:`Couldn't read issue input (check that the --from-json path exists and is readable): ${o instanceof Error?o.message:String(o)}`}}let n;try{n=JSON.parse(t)}catch(o){return{ok:!1,message:`Couldn't parse issue input JSON (fix the JSON syntax and try again): ${o instanceof Error?o.message:String(o)}`}}let r=Vet.safeParse(n);if(!r.success)return{ok:!1,message:EAe(r.error)};return{ok:!0,input:r.data}},utt=async()=>{let e=[];process.stdin.setEncoding("utf8");for await(let t of process.stdin)e.push(String(t));return e.join("")},EAe=(e)=>{let t=e.issues[0];if(!t)return"Invalid issue input.";let n=t.path[0];if(n&&(t.code==="invalid_type"||t.message===`${String(n)} is required`))return Ket[n]??t.message;return t.message},wAe=se("issues","Manage issues").withSubcommands({create:C("create","Create an issue, reusing an existing open issue when one matches",async(e)=>{let{values:t}=w(e,{...L,name:{type:"string"},"content-mdx":{type:"string"},severity:{type:"string"},component:{type:"string"},"from-json":{type:"string"},sample:{type:"boolean"}});await Zet({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,contentMdx:t["content-mdx"],severity:t.severity,componentId:t.component,fromJson:t["from-json"],sample:t.sample})}).withOptions({...D,name:{type:"string",description:"Stable issue name for indexing and mute matching"},"content-mdx":{type:"string",description:"Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence)"},severity:{type:"string",description:"Issue severity: low, medium, high, or critical (default: medium)"},component:{type:"string",description:"Required component ID. List with `sazabi components list` first; register one if none fits"},"from-json":{type:"string",description:"Read issue fields from a JSON file, or '-' for stdin"},sample:{type:"boolean",description:"Create the onboarding test issue with the curated payload and watch its alert delivery (no content flags)"}}).withExamples(['sazabi issues create --content-mdx "Checkout is returning 500s due to pool exhaustion." --component "$COMPONENT_ID" # Create an issue from MDX content',"sazabi issues create --from-json issue.json # Create an issue from a JSON file with contentMdx","cat issue.json | sazabi issues create --from-json - --json # Create an issue from stdin","sazabi issues create --sample # Create the onboarding test issue and watch alert delivery"]).build(),list:C("list","List issues in the active project",async(e)=>{let{values:t}=w(e,{...L,status:{type:"string"},severity:{type:"string"},component:{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),n=["open","resolved","ignored"];if(t.status&&!n.includes(t.status)){let i=`Invalid --status "${t.status}". Must be one of: ${n.join(", ")}.`;if(t.json)return b(i);return y(i)}let r=["low","medium","high","critical"];if(t.severity&&!r.includes(t.severity)){let i=`Invalid --severity "${t.severity}". Must be one of: ${r.join(", ")}.`;if(t.json)return b(i);return y(i)}let o=t.limit?Number(t.limit):void 0;if(o!==void 0&&(Number.isNaN(o)||o<1||o>100)){if(t.json)return b("Invalid --limit. Must be an integer between 1 and 100.");return y("Invalid --limit. Must be an integer between 1 and 100.")}await Xet({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],status:t.status,severity:t.severity,componentId:t.component,limit:o,cursor:t.cursor})}).withOptions({...D,status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},component:{type:"string",description:"Filter by component ID"},limit:{type:"string",description:"Maximum number of issues to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi issues list # List all issues","sazabi issues list --status open # List open issues only","sazabi issues list --component <component-id> # List issues for a component"]).build(),search:C("search","Search issues by name and filters",async(e)=>{let{values:t,positionals:n}=w(e,{...L,name:{type:"string"},status:{type:"string"},severity:{type:"string"},component:{type:"string"},limit:{type:"string"},cursor:{type:"string"},"include-delivery-metadata":{type:"boolean"}},{allowPositionals:!0}),r=["open","resolved","ignored"];if(t.status&&!r.includes(t.status)){let c=`Invalid --status "${t.status}". Must be one of: ${r.join(", ")}.`;if(t.json)return b(c);return y(c)}let o=["low","medium","high","critical"];if(t.severity&&!o.includes(t.severity)){let c=`Invalid --severity "${t.severity}". Must be one of: ${o.join(", ")}.`;if(t.json)return b(c);return y(c)}let i=t.limit?Number(t.limit):void 0;if(i!==void 0&&(Number.isNaN(i)||i<1||i>100)){if(t.json)return b("Invalid --limit. Must be an integer between 1 and 100.");return y("Invalid --limit. Must be an integer between 1 and 100.")}let s=n.join(" ").trim();await ett({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name??(s||void 0),status:t.status,severity:t.severity,componentId:t.component,limit:i,cursor:t.cursor,includeDeliveryMetadata:t["include-delivery-metadata"]})}).withPositionalArgs("[name]").withOptions({...D,name:{type:"string",description:"Case-insensitive partial issue name match"},status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},component:{type:"string",description:"Filter by component ID"},limit:{type:"string",description:"Maximum number of issues to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},"include-delivery-metadata":{type:"boolean",description:"Include delivery metadata in JSON output"}}).withExamples(['sazabi issues search "checkout" --status open # Search open issues by name',"sazabi issues search --severity critical --json # Machine-readable search"]).build(),count:C("count","Count issues by status and severity",async(e)=>{let{values:t,positionals:n}=w(e,{...L,name:{type:"string"},status:{type:"string"},severity:{type:"string"},component:{type:"string"}},{allowPositionals:!0}),r=["open","resolved","ignored"];if(t.status&&!r.includes(t.status)){let s=`Invalid --status "${t.status}". Must be one of: ${r.join(", ")}.`;if(t.json)return b(s);return y(s)}let o=["low","medium","high","critical"];if(t.severity&&!o.includes(t.severity)){let s=`Invalid --severity "${t.severity}". Must be one of: ${o.join(", ")}.`;if(t.json)return b(s);return y(s)}let i=n.join(" ").trim();await ttt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name??(i||void 0),status:t.status,severity:t.severity,componentId:t.component})}).withPositionalArgs("[name]").withOptions({...D,name:{type:"string",description:"Case-insensitive partial issue name match"},status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},component:{type:"string",description:"Filter by component ID"}}).withExamples(["sazabi issues count --status open # Count open issues",'sazabi issues count "checkout" --json # Count matching issues']).build(),get:C("get","Get one issue by ID",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await ntt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(D).withExamples(["sazabi issues get <issue-id> # Get one issue"]).build(),resolve:C("resolve","Resolve an open issue",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await ott(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(D).withExamples(["sazabi issues resolve <issue-id> # Resolve an issue"]).build(),ignore:C("ignore","Ignore an issue",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await itt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(D).withExamples(["sazabi issues ignore <issue-id> # Ignore an issue"]).build(),reopen:C("reopen","Reopen a resolved or ignored issue",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await rtt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(D).withExamples(["sazabi issues reopen <issue-id> # Reopen a resolved or ignored issue"]).build(),mute:C("mute","Mute an issue",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await stt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(D).withExamples(["sazabi issues mute <issue-id> # Mute an issue"]).build(),unmute:C("unmute","Unmute an issue",async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await att(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(D).withExamples(["sazabi issues unmute <issue-id> # Unmute an issue"]).build()}).withExamples(["sazabi issues create --from-json issue.json # Create an issue","sazabi issues list # List all issues","sazabi issues search checkout # Search issues","sazabi issues count --status open # Count issues","sazabi issues get <issue-id> # Get one issue","sazabi issues resolve <issue-id> # Resolve an issue","sazabi issues ignore <issue-id> # Ignore an issue","sazabi issues mute <issue-id> # Mute an issue","sazabi issues unmute <issue-id> # Unmute an issue"]).build();re();ye();ce();var dtt=async(e,t)=>{let n=Q({tokenFlag:t.token,projectIdFlag:e==="public"?t.projectId:void 0,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(e==="public"){let i=I(await r.publicKeys.list({projectId:n.projectId,limit:t.limit,cursor:t.cursor}),"Couldn't list public keys (check the active project and try again)",t.json);K(kAe(e),i.publicKeys.map((s)=>ws(e,s)),{json:t.json,nextCursor:i.nextCursor});return}let o=I(await r.secretKeys.list({limit:t.limit,cursor:t.cursor}),"Couldn't list secret keys (check your organization access and try again)",t.json);K(kAe(e),o.secretKeys.map((i)=>ws(e,i)),{json:t.json,nextCursor:o.nextCursor})},ptt=async(e,t,n)=>{let r=Q({tokenFlag:n.token,projectIdFlag:e==="public"?n.projectId:void 0,jsonMode:n.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:e==="public"?r.projectId:void 0,apiBaseUrlFlag:n.apiBaseUrl,jsonMode:n.json});if(e==="public"){let s=I(await o.publicKeys.get(t,r.projectId),"Couldn't get public key (run 'sazabi public-keys list' to see key IDs)",n.json);G(Ku(e),ws(e,s.publicKey),{json:n.json});return}let i=I(await o.secretKeys.get(t),"Couldn't get secret key (run 'sazabi secret-keys list' to see key IDs)",n.json);G(Ku(e),ws(e,i.secretKey),{json:n.json})},gtt=async(e,t)=>{let r=Q({tokenFlag:t.token,projectIdFlag:void 0,jsonMode:t.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:void 0,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i={name:e,...t.expiresAt?{expiresAt:t.expiresAt}:{}},s=I(await o.secretKeys.create(i),"Failed to create secret key",t.json);if(t.json){j(s);return}z(`Secret key ${s.secretKey.name} created.`),ke({Value:s.secretKey.value}),G(Ku("secret"),{...ws("secret",s.secretKey)})},mtt=async(e,t,n)=>{if(n.name===void 0&&n.expiresAt===void 0&&!n.clearExpiresAt){if(n.json)return b("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.");return y("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.")}if(n.expiresAt&&n.clearExpiresAt){if(n.json)return b("Use either --expires-at or --clear-expires-at, not both.");return y("Use either --expires-at or --clear-expires-at, not both.")}let r=Q({tokenFlag:n.token,projectIdFlag:e==="public"?n.projectId:void 0,jsonMode:n.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:e==="public"?r.projectId:void 0,apiBaseUrlFlag:n.apiBaseUrl,jsonMode:n.json}),i=n.clearExpiresAt?null:n.expiresAt!==void 0?n.expiresAt:void 0;if(e==="public"){let l={projectId:r.projectId,keyId:t,...n.name!==void 0?{name:n.name}:{},...i!==void 0?{expiresAt:i}:{}},u=I(await o.publicKeys.update(l),"Failed to update public key",n.json);G(Ku(e),ws(e,u.publicKey),{json:n.json});return}let s={keyId:t,...n.name!==void 0?{name:n.name}:{},...i!==void 0?{expiresAt:i}:{}},c=I(await o.secretKeys.update(s),"Failed to update secret key",n.json);G(Ku(e),ws(e,c.secretKey),{json:n.json})},htt=async(e,t)=>{let n=Q({tokenFlag:t.token,projectIdFlag:t.projectId,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.publicKeys.deactivate({projectId:n.projectId,keyId:e}),"Failed to deactivate public key",t.json);if(!t.json)z(`Public key ${e} deactivated.`);G(Ku("public"),ws("public",o.publicKey),{json:t.json})},Att=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(I(await r.secretKeys.delete({keyId:e}),"Failed to delete secret key",t.json),t.json){j({deleted:!0,keyId:e});return}z(`Secret key ${e} deleted.`)},xAe=(e)=>{let t=ftt(e),n=QM(e),r=e==="secret",o=r?"the organization":"the active project",i={token:{type:"string"},"project-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},l=r?{token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}:{token:{type:"string",description:"Override token"},"project-id":{type:"string",description:"Override project selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}};return se(t,`Manage ${e} keys`).withSubcommands({list:C("list",`List ${e} keys in ${o}`,async(u)=>{let{values:d,positionals:p}=w(u,{...i,limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0});if(p.length>0){let g=p.join(", ");if(d.json)return b(`Unexpected arguments: ${g}.`);return y(`Unexpected arguments: ${g}.`)}await dtt(e,{token:d.token,projectId:d["project-id"],limit:d.limit?Number(d.limit):void 0,cursor:d.cursor,json:d.json,apiBaseUrl:d["api-base-url"]})}).withOptions({...l,limit:{type:"string",description:"Maximum number of keys to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples([`sazabi ${t} list # List ${e} keys in ${o}`]).build(),get:C("get",`Get one ${e} key by ID`,async(u)=>{let{values:d,positionals:p}=w(u,i,{allowPositionals:!0}),g=p[0];if(!g){let m=`${n} key ID is required.`;if(d.json)return b(m);return y(m)}await ptt(e,g,{token:d.token,projectId:d["project-id"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(l).withExamples([`sazabi ${t} get <key-id> # Get one ${e} key`]).build(),...r?{create:C("create",`Create one ${e} key in ${o}`,async(u)=>{let{values:d,positionals:p}=w(u,{...i,"expires-at":{type:"string"}},{allowPositionals:!0}),g=p.join(" ");if(!g){let m=`${n} key name is required.`;if(d.json)return b(m);return y(m)}await gtt(g,{token:d.token,projectId:d["project-id"],expiresAt:d["expires-at"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<name>").withOptions({...l,"expires-at":{type:"string",description:"Optional ISO timestamp when the key should expire"}}).withExamples([`sazabi ${t} create "CI agent" # Create one ${e} key`]).build()}:{},update:C("update",`Update one ${e} key in ${o}`,async(u)=>{let{values:d,positionals:p}=w(u,{...i,name:{type:"string"},"expires-at":{type:"string"},"clear-expires-at":{type:"boolean"}},{allowPositionals:!0}),g=p[0];if(!g){let m=`${n} key ID is required.`;if(d.json)return b(m);return y(m)}await mtt(e,g,{token:d.token,projectId:d["project-id"],name:d.name,expiresAt:d["expires-at"],clearExpiresAt:d["clear-expires-at"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions({...l,name:{type:"string",description:`New ${e} key name`},"expires-at":{type:"string",description:"New ISO timestamp when the key should expire"},"clear-expires-at":{type:"boolean",description:"Clear any configured expiration"}}).withExamples([`sazabi ${t} update <key-id> --name "Renamed key" # Update one ${e} key`]).build(),...e==="public"?{deactivate:C("deactivate",`Deactivate one public key in ${o}`,async(u)=>{let{values:d,positionals:p}=w(u,i,{allowPositionals:!0}),g=p[0];if(!g){if(d.json)return b("Public key ID is required.");return y("Public key ID is required.")}await htt(g,{token:d.token,projectId:d["project-id"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(l).withExamples([`sazabi ${t} deactivate <key-id> # Deactivate one public key`]).build()}:{delete:C("delete",`Delete one secret key from ${o}`,async(u)=>{let{values:d,positionals:p}=w(u,i,{allowPositionals:!0}),g=p[0];if(!g){if(d.json)return b("Secret key ID is required.");return y("Secret key ID is required.")}await Att(g,{token:d.token,json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(l).withExamples([`sazabi ${t} delete <key-id> # Delete one secret key`]).build()}}).withExamples([`sazabi ${t} list # List ${e} keys in ${o}`,...r?[`sazabi ${t} create "CI agent" # Create one ${e} key`]:[]]).build()},PAe={keyType:{label:"Type",type:{kind:"string"}},id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},expiresAt:{label:"Expires",type:{kind:"nullable-date"}},lastUsedAt:{label:"Last used",type:{kind:"nullable-date"}},createdAt:{label:"Created",type:{kind:"date"}}},kAe=(e)=>({schema:PAe,columns:e==="public"?["id","name","status","expiresAt","lastUsedAt","createdAt"]:["id","name","expiresAt","lastUsedAt","createdAt"],header:`${QM(e)} keys`,emptyMessage:`No ${e} keys found.`}),Ku=(e)=>({layout:"field-list",schema:PAe,fields:e==="public"?["keyType","id","projectId","name","status","expiresAt","lastUsedAt","createdAt"]:["keyType","id","name","expiresAt","lastUsedAt","createdAt"]}),ftt=(e)=>e==="public"?"public-keys":"secret-keys",QM=(e)=>e==="public"?"Public":"Secret",ws=(e,t)=>{let n=e==="public"&&"deactivatedAt"in t&&t.deactivatedAt!==null;return{...t,keyType:`${QM(e)} key`,status:n?"Deactivated":"Active"}},RAe=xAe("public"),TAe=xAe("secret");re();ye();ce();re();ye();ce();var OAe={id:{label:"ID",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},logSourceId:{label:"Log source",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},enabled:{label:"Enabled",type:{kind:"boolean"}},errorMessage:{label:"Error",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}}},LM={schema:OAe,columns:["id","displayName","status","enabled","errorMessage","createdAt"],header:"Log streams",emptyMessage:"No log streams found for this log source."},ytt={layout:"field-list",schema:OAe,fields:["id","logSourceId","displayName","status","enabled","errorMessage","createdAt"],title:"Log stream"},_S=(e)=>{for(let t of e){let n={};if(t.kind==="url"&&t.url)n[t.label??"Endpoint"]=t.url;else if(t.kind==="hostPort"&&t.host){if(n[t.label??"Host"]=t.port!==void 0?`${t.host}:${t.port}`:t.host,t.extraCredential)n[t.extraCredential.label]=t.extraCredential.value}if(Object.keys(n).length>0){if(ke(n),t.description)H(t.description)}}},to=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t,projectId:n.projectId}},DS=(e,t)=>{let n=e[0];if(!n){if(t)b("Log stream ID is required.");else y("Log stream ID is required. Run 'sazabi log-streams list --log-source-id <id>' to see log stream IDs.");return null}return n},btt=async(e)=>{let{values:t}=w(e,{...L,"log-source-id":{type:"string"}});if(!t["log-source-id"]){if(t.json)return b("--log-source-id is required.");return y("--log-source-id is required. Run 'sazabi log-sources list' to see log source IDs.")}let{client:n,json:r}=to(t),{streams:o}=I(await n.logStreams.list(t["log-source-id"]),"Couldn't list log streams (run 'sazabi log-sources list' to see log source IDs)",r);K(LM,o,{json:r})},Itt=async(e)=>{let{values:t}=w(e,{...L,"log-source-id":{type:"string"},config:{type:"string"}});if(!t["log-source-id"]){if(t.json)return b("--log-source-id is required.");return y("--log-source-id is required.")}let n={};if(t.config)try{n=JSON.parse(t.config)}catch{if(t.json)return b("--config must be valid JSON.");return y("--config must be valid JSON.")}let{client:r,json:o}=to(t),i=I(await r.logStreams.create({logSourceId:t["log-source-id"],config:n}),"Failed to create log stream",o);if(o){j(i);return}z("Log stream created. Provisioning started."),ke({"Log stream ID":i.streamId})},Stt=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=DS(n,t.json);if(!r)return;let{client:o,json:i}=to(t),{stream:s}=I(await o.logStreams.get(r),"Couldn't get log stream (run 'sazabi log-streams list --log-source-id <id>' to see log stream IDs)",i);if(i){j({stream:s});return}if(G(ytt,s,{json:i}),s.endpointCards&&s.endpointCards.length>0)H("Point your sender at:"),_S(s.endpointCards)},BAe=async(e,t)=>{let{values:n,positionals:r}=w(e,L,{allowPositionals:!0}),o=DS(r,n.json);if(!o)return;let{client:i,json:s}=to(n),c=I(await i.logStreams.update({streamId:o,enabled:t}),t?"Failed to enable log stream":"Failed to disable log stream",s);if(s){j(c);return}z(t?"Log stream enabled. It resumes ingesting.":"Log stream disabled. It stops ingesting until re-enabled.")},Ctt=async(e)=>{let{values:t,positionals:n}=w(e,{...L,"to-log-source-id":{type:"string"}},{allowPositionals:!0}),r=DS(n,t.json);if(!r)return;let o=t["to-log-source-id"];if(!o){if(t.json)return b("--to-log-source-id is required.");return y("--to-log-source-id is required. Run 'sazabi log-sources list' to see log source IDs.")}let{client:i,json:s}=to(t),{stream:c}=I(await i.logStreams.get(r),"Couldn't get log stream (run 'sazabi log-streams list --log-source-id <id>' to see log stream IDs)",s),{logSource:l}=I(await i.logSources.get(c.logSourceId),"Couldn't get the log stream's current log source",s),{logSource:u}=I(await i.logSources.get(o),"Couldn't get the target log source (run 'sazabi log-sources list' to see log source IDs)",s),d=I(await i.logStreams.reassign({streamId:r,targetLogSourceId:o}),"Failed to reassign log stream",s);if(s){j(d);return}if(z("Log stream reassigned."),ke({"Log stream ID":d.stream.id,From:`${l.name} (${l.provider})`,To:`${u.name} (${u.provider})`}),l.provider!==u.provider)H(`The log stream keeps its intake key, but future data is now processed as ${u.provider} format — make sure the sender emits that format. Already-ingested data is unaffected.`)},vtt=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=DS(n,t.json);if(!r)return;let{client:o,json:i}=to(t),s=I(await o.logStreams.delete(r),"Failed to delete log stream",i);if(i){j(s);return}z("Log stream deleted.")},_Ae=se("log-streams","Manage log streams").withSubcommands({list:C("list","List log streams for a log source",btt).withOptions({...D,"log-source-id":{type:"string",description:"Log source ID (required)"}}).withExamples(["sazabi log-streams list --log-source-id <id> # List log streams"]).build(),get:C("get","Get one log stream (check provisioning status)",Stt).withPositionalArgs("<stream-id>").withOptions(D).withExamples(["sazabi log-streams get <id> # Check log stream status"]).build(),create:C("create","Create a log stream under a managed log source",Itt).withOptions({...D,"log-source-id":{type:"string",description:"Log source ID (required)"},config:{type:"string",description:"JSON stream config"}}).withExamples([`sazabi log-streams create --log-source-id <id> --config '{"foo":"bar"}' # Create log stream`]).build(),enable:C("enable","Resume ingestion for a log stream",(e)=>BAe(e,!0)).withPositionalArgs("<stream-id>").withOptions(D).withExamples(["sazabi log-streams enable <id> # Resume ingestion"]).build(),disable:C("disable","Pause ingestion for a log stream",(e)=>BAe(e,!1)).withPositionalArgs("<stream-id>").withOptions(D).withExamples(["sazabi log-streams disable <id> # Pause ingestion"]).build(),reassign:C("reassign","Move a log stream to a different connectionless log source",Ctt).withPositionalArgs("<stream-id>").withOptions({...D,"to-log-source-id":{type:"string",description:"Target log source ID (required)"}}).withExamples(["sazabi log-streams reassign <id> --to-log-source-id <id> # Move a log stream"]).build(),delete:C("delete","Delete a log stream",vtt).withPositionalArgs("<stream-id>").withOptions(D).withExamples(["sazabi log-streams delete <id> # Delete a log stream"]).build()}).withExamples(["sazabi log-streams list --log-source-id <id> # List log streams","sazabi log-streams get <id> # Log stream detail and endpoint","sazabi log-streams reassign <id> --to-log-source-id <id> # Move a log stream","sazabi log-streams delete <id> # Delete a log stream"]).build();var Ett={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},modes:{label:"Modes",type:{kind:"string"}}},wtt={schema:Ett,columns:["id","name","modes"],header:"Log source providers",emptyMessage:"No log source providers found."},NAe={id:{label:"ID",type:{kind:"string"}},provider:{label:"Provider",type:{kind:"string"}},mode:{label:"Mode",type:{kind:"string"}},name:{label:"Name",type:{kind:"nullable-string"}},streamCount:{label:"Streams",type:{kind:"number"}},url:{label:"URL",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}}},ktt={schema:NAe,columns:["id","provider","mode","name","streamCount","createdAt"],header:"Log sources",emptyMessage:"No log sources found."},xtt={layout:"field-list",schema:NAe,fields:["id","provider","mode","name","streamCount","url","createdAt"],title:"Log source"},Ptt=(e,t)=>({...e,url:t?rhe(t,e.provider):void 0}),NM=(e,t)=>{let n=e[0];if(!n){if(t)b("Log source ID is required.");else y("Log source ID is required. Run 'sazabi log-sources list' to see log source IDs.");return null}return n},Rtt=async(e)=>{let{values:t}=w(e,L),{client:n,json:r}=to(t),{providers:o}=I(await n.logSources.listProviders(),"Couldn't list log source providers (try again)",r),i=[...o].sort((s,c)=>s.name.localeCompare(c.name)).map((s)=>({id:s.id,name:s.name,modes:s.modes.join(", ")}));K(wtt,i,{json:r})},Ttt=async(e)=>{let{values:t}=w(e,{...L,provider:{type:"string"},"project-id":{type:"string"}}),{client:n,json:r}=to(t),{logSources:o}=I(await n.logSources.list({projectId:t["project-id"],provider:t.provider}),"Couldn't list log sources (check the active project and try again)",r);K(ktt,o,{json:r})},Om=async(e)=>I(await e.client.logSources.create({provider:e.provider,metadata:e.metadata,mode:e.mode,projectId:e.projectId}),"Failed to create log source",e.json),Btt=async(e)=>{let{values:t,positionals:n}=w(e,{...L,metadata:{type:"string"},mode:{type:"string"},"project-id":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Log source provider is required.");return y("Log source provider is required. Use 'sazabi log-sources providers' to see available providers.")}if(t.mode&&t.mode!=="managed"&&t.mode!=="connectionless"){if(t.json)return b("--mode must be 'managed' or 'connectionless'.");return y("--mode must be 'managed' or 'connectionless'.")}let o;if(t.metadata)try{o=JSON.parse(t.metadata)}catch{if(t.json)return b("--metadata must be valid JSON.");return y("--metadata must be valid JSON.")}let{client:i,json:s}=to(t),c=await Om({client:i,provider:r,metadata:o,mode:t.mode,projectId:t["project-id"],json:s});if(s){j(c);return}if(z("Log source created."),ke({"Log source ID":c.logSource.id,...c.logSource.name?{Name:c.logSource.name}:{},Provider:c.logSource.provider,Mode:c.logSource.mode,...c.streamId?{"Log stream ID":c.streamId}:{},...c.publicKey?{"Public key":c.publicKey}:{}}),c.endpointCards&&c.endpointCards.length>0)H("Point your sender at:"),_S(c.endpointCards);if(c.publicKey)Vt("Store the public key securely — it is only shown once.")},Ott=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=NM(n,t.json);if(!r)return;let{client:o,json:i,projectId:s}=to(t),{logSource:c}=I(await o.logSources.get(r),"Couldn't get log source (run 'sazabi log-sources list' to see log source IDs)",i);if(i){j({logSource:c});return}if(G(xtt,Ptt({id:c.id,provider:c.provider,mode:c.mode,name:c.name,streamCount:c.streamCount,createdAt:c.createdAt},s),{json:i}),c.streams.length>0){K(LM,c.streams,{json:i});for(let l of c.streams)if(l.endpointCards&&l.endpointCards.length>0)H(`Endpoint for log stream "${l.displayName??l.id}":`),_S(l.endpointCards)}},DAe=async(e,t)=>{let{values:n,positionals:r}=w(e,L,{allowPositionals:!0}),o=NM(r,n.json);if(!o)return;let{client:i,json:s}=to(n),c=I(await i.logSources.update({logSourceId:o,enabled:t}),t?"Failed to enable log source":"Failed to disable log source",s);if(s){j(c);return}z(t?"Log source enabled. Its log streams resume ingesting.":"Log source disabled. Its log streams stop ingesting until re-enabled.")},_tt=async(e)=>{let{values:t,positionals:n}=w(e,L,{allowPositionals:!0}),r=NM(n,t.json);if(!r)return;let{client:o,json:i}=to(t),s=I(await o.logSources.delete(r),"Failed to delete log source",i);if(i){j(s);return}if(s.teardownError){Vt(`Log source deleted, but remote cleanup failed (remove the remote resources manually): ${s.teardownError}`);return}z("Log source deleted.")},Dtt=async(e)=>{let{values:t}=w(e,{...L,provider:{type:"string"}});if(!t.provider){if(t.json)return b("--provider is required.");return y("--provider is required. Use 'sazabi log-sources providers' to see providers with skills.")}let{client:n,json:r}=to(t),{providers:o}=I(await n.logSources.listProviders(),"Couldn't list log source providers (try again)",r),i=o.find((s)=>s.id===t.provider);if(!i){let s=`Unknown log source provider: '${t.provider}'. Use 'sazabi log-sources providers' to see available providers.`;if(r)return b(s);return y(s)}if(!i.setupSkill){if(r)return b(`No setup skill available for ${t.provider}.`);return y(`No setup skill available for ${t.provider}. This log source provider does not have an agent-ready skill yet.`)}if(r){j({provider:t.provider,setupSkill:i.setupSkill});return}H(i.setupSkill)},QAe=C("list","List log sources",Ttt).withOptions({...D,provider:{type:"string",description:"Filter by log source provider"},"project-id":{type:"string",description:"Project ID"}}).withExamples(["sazabi log-sources list # List all log sources","sazabi log-sources list --provider vercel # Filter by provider"]).build(),LAe=C("delete","Delete a log source",_tt).withPositionalArgs("<log-source-id>").withOptions(D).withExamples(["sazabi log-sources delete <id> # Delete a log source and deactivate its keys"]).build(),MAe=se("log-sources","Manage log sources").withSubcommands({providers:C("providers","List supported log source providers",Rtt).withOptions(D).withExamples(["sazabi log-sources providers # List all providers","sazabi log-sources providers --json # Output as JSON"]).build(),list:QAe,ls:QAe,create:C("create","Create a log source",Btt).withPositionalArgs("<provider>").withOptions({...D,metadata:{type:"string",description:"JSON credentials for managed setup"},mode:{type:"string",description:"Setup mode: managed or connectionless (inferred from --metadata when omitted)"},"project-id":{type:"string",description:"Project ID"}}).withExamples(["sazabi log-sources create otel # Connectionless: mints a keyed endpoint",`sazabi log-sources create fly_io --metadata '{"apiToken":"..."}' # Managed: connects with credentials`]).build(),get:C("get","Get one log source",Ott).withPositionalArgs("<log-source-id>").withOptions(D).withExamples(["sazabi log-sources get <id> # Log source details, log streams, and endpoints"]).build(),enable:C("enable","Resume ingestion for a log source's log streams",(e)=>DAe(e,!0)).withPositionalArgs("<log-source-id>").withOptions(D).withExamples(["sazabi log-sources enable <id> # Resume ingestion"]).build(),disable:C("disable","Pause ingestion for a log source's log streams",(e)=>DAe(e,!1)).withPositionalArgs("<log-source-id>").withOptions(D).withExamples(["sazabi log-sources disable <id> # Pause ingestion"]).build(),delete:LAe,remove:LAe,skill:C("skill","Show setup skill for a log source provider",Dtt).withOptions({...D,provider:{type:"string",description:"Log source provider (required)"}}).withExamples(["sazabi log-sources skill --provider gcp # Show GCP setup skill","sazabi log-sources skill --provider fly_io # Show Fly.io setup skill"]).build()}).withExamples(["sazabi log-sources providers # List available providers","sazabi log-sources list # List log sources","sazabi log-sources create otel # Connectionless: mints a keyed endpoint",`sazabi log-sources create fly_io --metadata '{"apiToken":"..."}' # Managed: connects with credentials`,"sazabi log-sources skill --provider gcp # Show agent setup skill"]).build();re();re();Ha();vm();ye();import*as jr from"node:fs";import*as QS from"node:readline";var _m=(e)=>new Promise((t)=>setTimeout(t,e));var Qtt=(e)=>`${e.getTime()*1e6}`,Ltt=(e)=>Object.entries(e).map(([t,n])=>({key:t,value:{stringValue:n}})),Ntt=[{pattern:/\b(?:fatal|critical|crit)\b/i,severityNumber:21,severityText:"FATAL"},{pattern:/\b(?:error|err)\b/i,severityNumber:17,severityText:"ERROR"},{pattern:/\b(?:warn|warning)\b/i,severityNumber:13,severityText:"WARN"},{pattern:/\bdebug\b/i,severityNumber:5,severityText:"DEBUG"},{pattern:/\btrace\b/i,severityNumber:1,severityText:"TRACE"}],Mtt={severityNumber:9,severityText:"INFO"},ztt=(e)=>{let t=null;for(let{pattern:n,severityNumber:r,severityText:o}of Ntt){let i=n.exec(e);if(i&&(t===null||i.index<t.index))t={index:i.index,severityNumber:r,severityText:o}}return t?{severityNumber:t.severityNumber,severityText:t.severityText}:Mtt},zAe=(e,t,n={})=>{let o=Qtt(new Date),i=n.serviceName??"sazabi-cli",s=Ltt(n.attributes??{}),c=e.filter((l)=>l.trim().length>0).map((l)=>({timeUnixNano:o,observedTimeUnixNano:o,...ztt(l),body:{stringValue:l},attributes:s}));return{resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:i}},{key:"sazabi.public_key",value:{stringValue:t}}]},scopeLogs:[{scope:{name:"sazabi-cli-forward",version:"1.0.0"},logRecords:c}]}]}};function jtt(e,t,n){return e===1?t:n??`${t}s`}function yo(e,t,n){return`${e} ${jtt(e,t,n)}`}ce();Cn();var Utt="15003",Ftt="SAZABI_INTERNAL_LOG_FORWARDING_SECRET",$tt="SAZABI_INTERNAL_LOG_FORWARDING_SOURCE",Gtt="sazabi.source",Htt="sazabi.internal.source",qtt=(e)=>e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e,Vtt=(e)=>{let t=qtt(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},Ktt=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!Vtt(t.hostname))return;return t.protocol="http:",t.port=Utt,t.pathname="",t.search="",t.hash="",t.toString()},MM=async(e,t)=>{if(!t)H("Ensuring public key exists...");let n=await e.publicKeys.ensureLogForwarding({});if(!n.success){if(!t)Uo(`Failed to ensure public key: ${n.error}. Pass --public-key <value> or check your project access and try again.`);return null}if(!t)z(`Using public key: ${n.value.publicKey.name}`);return{value:n.value.publicKey.value,projectId:n.value.publicKey.projectId,createdAt:n.value.publicKey.createdAt}},Ytt=({explicitPublicKey:e,cachedPublicKey:t,cachedPublicKeyProjectId:n,activeProjectId:r})=>{let o=e?.trim();if(o)return o;let i=t?.trim();if(!i)return;return n?.trim()===r?i:void 0},Wtt=(e)=>{if(!e||e.length===0)return{success:!0,value:{}};let t={};for(let n of e){let r=n.indexOf("=");if(r<=0)return{success:!1,error:`Invalid attribute "${n}". Use key=value.`};let o=n.slice(0,r).trim();if(!o)return{success:!1,error:`Invalid attribute "${n}". Attribute key is required.`};t[o]=n.slice(r+1)}return{success:!0,value:t}},Jtt=(e)=>{let t=process.env[Ftt]?.trim();if(!t)return;let n=process.env[$tt]?.trim()||e[Htt]?.trim()||e[Gtt]?.trim()||void 0;return{secret:t,...n?{source:n}:{}}},zM=(e,t,n,r,o,i,s,c,l,u,d)=>async()=>{if(e.length===0)return;let p=zAe(e,r,c),g=tnt(p);if(e.length=0,g===0)return;if(!u)H(`Forwarding ${yo(g,"log")}...`);let m=await n.logs.forward({publicKey:r,logs:p,region:i,...s?{projectId:s}:{},...l?{sazabiInternalForwarding:l}:{}});while(!m.success&&int(m)&&snt(o)){if(!u)H("Public key is still propagating to intake (usually under a minute); retrying...");await _m(rnt),m=await n.logs.forward({publicKey:r,logs:p,region:i,...s?{projectId:s}:{},...l?{sazabiInternalForwarding:l}:{}})}if(!m.success){if(nnt(m)){I(m,"Failed to forward logs",u);return}if(t.totalFailed+=g,u)process.stderr.write(`Failed to forward logs: ${m.error}
|